@jiaozhiye/qm-design-react 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("prop-types"),n=require("dayjs");require("dayjs/locale/zh-cn");var l=require("dayjs/plugin/localeData"),a=require("dayjs/plugin/advancedFormat"),r=require("dayjs/plugin/customParseFormat"),i=require("dayjs/plugin/quarterOfYear"),o=require("dayjs/plugin/weekOfYear"),s=require("dayjs/plugin/weekday"),u=require("antd"),d=require("dayjs/plugin/weekYear"),c=require("antd/es/calendar/generateCalendar");require("antd/es/calendar/style");var f=require("antd/es/date-picker/generatePicker");require("antd/es/date-picker/style/index");var p=require("antd/es/locale/zh_CN"),h=require("antd/es/locale/en_GB"),m=require("omit.js"),g=require("lodash-es"),v=require("classnames"),b=require("@ant-design/icons"),y=require("react-draggable"),x=require("react-countup"),E=require("resize-observer-polyfill"),C=require("axios"),S=require("add-dom-event-listener"),w=require("scroll-into-view-if-needed"),T=require("memoize-one"),N=require("cropperjs"),I=require("big.js"),O=require("copy-to-clipboard"),R=require("@rc-component/portal"),k=require("@rc-component/trigger"),P=require("html2canvas"),A=require("react-sortablejs"),L=require("localforage"),H=require("exceljs"),_=require("react-dom"),F=require("china-area-data");function D(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function $(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var M=$(e),j=D(e),q=D(t),V=$(t),K=D(n),z=D(l),B=D(a),W=D(r),U=D(i),G=D(o),Y=D(s),X=D(d),Q=D(c),Z=D(f),J=D(p),ee=D(h),te=D(m),ne=D(v),le=D(y),ae=D(x),re=D(E),ie=D(C),oe=D(S),se=D(w),ue=D(T),de=D(N),ce=D(I),fe=D(O),pe=D(R),he=D(k),me=D(P),ge=D(L),ve=D(H),be=D(_),ye=D(F);const xe=e.createContext({locale:"zh-cn",size:"middle"});var Ee={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},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:"点击上传"},uploadCropper:{dragableText:"拖放或点击",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 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},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:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};let Ce=Ee;function Se(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const we=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[l,a]=t;let r;const i=l.split(".");let o=Ce;for(let e=0,t=i.length;e<t;e++){if(r=o[i[e]],e===t-1)return Se(r,a);if(!r)return"";o=r}return""},Te=e=>{Ce=e||Ce,Ce.name&&K.default.locale(Ce.name)};class Ne extends Error{constructor(e){super(e),this.name="QmDesignError"}}function Ie(e,t){throw new Ne(`[${e}] ${t}`)}function Oe(e,t){console.warn(new Ne(`[${e}] ${t}`))}const Re=e=>"number"==typeof e||void 0===e||(["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc")),ke=e=>["","small","middle","large"].includes(e);K.default.extend(z.default),K.default.extend(B.default),K.default.extend(W.default),K.default.extend(U.default),K.default.extend(G.default),K.default.extend(Y.default);var Pe={},Ae=[];function Le(e,t){if(!e&&void 0!==console){var n=Ae.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function He(e,t){!function(e,t,n){t||Pe[n]||(e(!1,n),Pe[n]=!0)}(Le,e,t)}K.default.extend(W.default),K.default.extend(B.default),K.default.extend(Y.default),K.default.extend(z.default),K.default.extend(G.default),K.default.extend(X.default),K.default.extend((function(e,t){var n=t.prototype,l=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return l.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]},De=function(){He(!1,"Not match any format. Please help to fire a issue about this.")},$e={getNow:function(){return K.default()},getFixedDate:function(e){return K.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 K.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 K.default().locale(Fe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return K.default().locale(Fe(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(Fe(e)).format(n)},parse:function(e,t,n){for(var l=Fe(e),a=0;a<n.length;a+=1){var r=n[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],u=K.default(o,"YYYY").startOf("year").locale(l),d=0;d<=52;d+=1){var c=u.add(d,"week");if(c.format("Wo")===s)return c}return De(),null}var f=K.default(i,r).locale(l);if(f.isValid())return f}return t&&De(),null}}};const Me=Q.default($e),je=Z.default($e);function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},qe.apply(this,arguments)}const Ve=M.forwardRef(((e,t)=>M.createElement(je,qe({},e,{picker:"time",mode:void 0,ref:t}))));Ve.displayName="TimePicker";const Ke=M.forwardRef(((e,t)=>M.createElement(je.RangePicker,qe({},e,{picker:"time",mode:void 0,ref:t}))));Ke.displayName="RangePicker",Ve.RangePicker=Ke;var ze={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},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"},uploadCropper:{dragableText:"Drop or click",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"},mergeCell:{cancel:"reset",confirm:"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",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?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}};const Be={[ze.name]:{qm:ze,antd:ee.default},[Ee.name]:{qm:Ee,antd:J.default}};class We extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},Te(Object.assign({},Be,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:n,size:l}=t.value,{locale:a,size:r,global:i}=e;return a!==n&&Te(Object.assign({},Be,i.langPackage)[a].qm),a!==n||r!==l?{value:Object.assign({},t.value,{locale:a,size:r})}:null}render(){const{global:e}=this.props,{value:t}=this.state,n=Object.assign({},Be,e.langPackage);return j.default.createElement(xe.Provider,{value:t},j.default.createElement(u.ConfigProvider,{locale:n[t.locale].antd,componentSize:t.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}function Ue(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(l=Object.getOwnPropertySymbols(e);a<l.length;a++)t.indexOf(l[a])<0&&Object.prototype.propertyIsEnumerable.call(e,l[a])&&(n[l[a]]=e[l[a]])}return n}function Ge(e,t,n,l){var a,r=arguments.length,i=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,n):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,l);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i}function Ye(e,t,n,l){return new(n||(n=Promise))((function(a,r){function i(e){try{s(l.next(e))}catch(e){r(e)}}function o(e){try{s(l.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}s((l=l.apply(e,t||[])).next())}))}We.propTypes={locale:q.default.string,size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},theme:q.default.string,global:q.default.object},We.defaultProps={locale:"zh-cn",size:"middle",global:{}};var Xe="undefined"==typeof window;const Qe=e=>j.default.isValidElement(e),Ze=e=>Qe(e)&&e.type===j.default.Fragment,Je=()=>{},et=()=>!0,tt=e=>Ye(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),nt=e=>{Promise.resolve().then(e)},lt=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),at=e=>!!(!e&&0!==e||g.isArray(e)&&!e.length||g.isPlainObject(e)&&!Object.keys(e).length);const rt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(g.isPlainObject(e)||g.isArray(e)){const n=Array.isArray(e),l=n?[]:{};if(t.get(e))return e;t.set(e,l);const a=n?void 0:Object.keys(e);return function(e,t){let n=-1;const l=e.length;for(;++n<l;)t(e[n],n)}(a||e,((n,r)=>{a&&(r=n),l[r]=rt(e[r],t)})),l}return e},it=e=>g.isNumber(e)?`${e}px`:e.toString();class ot extends e.Component{constructor(){super(...arguments),this.state={isLoading:!1},this.clickHandle=e=>Ye(this,void 0,void 0,(function*(){var t,n;this.setState({isLoading:!0});try{yield null===(n=(t=this.props).click)||void 0===n?void 0:n.call(t,e)}catch(e){Oe("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:t,authConfig:n,click:l,confirm:a}=this.props,{isLoading:r}=this.state,i=e||this.context.size||"",o=g.isFunction(l)?{onClick:this.clickHandle}:null,s=Object.assign(Object.assign(Object.assign({},te.default(this.props,["authConfig","click","confirm"])),{size:i,loading:r||t||!1}),o);if(n){const{visible:e=1,disabled:t}=n||{};if(!e)return null;t&&(s.disabled=!0)}return a?j.default.createElement(u.Popconfirm,{title:a.title||we("qm.button.confirmTitle"),disabled:s.disabled,onConfirm:e=>{var t,n;null===(t=a.onConfirm)||void 0===t||t.call(a),null===(n=s.onClick)||void 0===n||n.call(s,e)},onCancel:e=>{var t;null===(t=a.onCancel)||void 0===t||t.call(a,e)}},j.default.createElement(u.Button,qe({},s,{onClick:Je}),this.props.children)):j.default.createElement(u.Button,s,this.props.children)}}var st;ot.propTypes={click:q.default.func,confirm:q.default.shape({title:q.default.node,onConfirm:q.default.func,onCancel:q.default.func})},ot.contextType=xe,function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(st||(st={}));class ut extends e.Component{render(){const{size:e}=this.props,t=e||this.context.size||"",n=g.isNumber(e)?e:st[e||t||"default"],l=Object.assign(Object.assign({},this.props),{size:n});return j.default.createElement(u.Space,l,this.props.children)}}ut.contextType=xe;const dt=e=>`qm-${e}`;class ct extends e.Component{constructor(){super(...arguments),this.clickHandle=()=>{const{collapse:e,onCollapseChange:t=Je}=this.props;t(!e)}}render(){const{size:e,label:t,extra:n,collapse:l,bordered:a,disabled:r,id:i,className:o,style:s}=this.props,d=e||this.context.size||"",c=dt("divider"),f={[c]:!0,[`${c}-borderless`]:!a,[`${c}--lg`]:"large"===d,[`${c}--sm`]:"small"===d};return j.default.createElement("div",{id:i,className:ne.default(f,o),style:s},j.default.createElement("span",{className:ne.default(`${c}__title`)},t),j.default.createElement("div",{className:ne.default(`${c}__extra`)},n),void 0!==l&&j.default.createElement(u.Button,{type:"link",className:ne.default(`${c}__collapse`),disabled:r,onClick:this.clickHandle},we(l?"qm.divider.collect":"qm.divider.spread"),l?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)))}}ct.contextType=xe,ct.propTypes={label:q.default.string,size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},extra:q.default.oneOfType([q.default.element,q.default.string]),collapse:q.default.bool,bordered:q.default.bool},ct.defaultProps={bordered:!0};const ft=()=>({height:0,opacity:0}),pt=(e,t)=>"height"===t.propertyName,ht={motionName:"rc-collapse-motion",onEnterStart:ft,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:ft,onEnterEnd:pt,onLeaveEnd:pt,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function mt(e){return mt="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},mt(e)}function gt(e){var t=function(e,t){if("object"!==mt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var l=n.call(e,t||"default");if("object"!==mt(l))return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mt(t)?t:String(t)}function vt(e,t,n){return(t=gt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l}function Et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l,a,r,i,o=[],s=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(l=r.call(n)).done)&&(o.push(l.value),o.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(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 Ct(e){return function(e){return e instanceof HTMLElement||e instanceof SVGElement}(e)?e:e instanceof j.default.Component?be.default.findDOMNode(e):null}var St,wt={exports:{}},Tt={};function Nt(e,t){"function"==typeof e?e(t):"object"===mt(e)&&e&&"current"in e&&(e.current=t)}function It(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var l=t.filter((function(e){return e}));return l.length<=1?l[0]:function(e){t.forEach((function(t){Nt(t,e)}))}}function Ot(e){var t,n,l=wt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof l||null!==(t=l.prototype)&&void 0!==t&&t.render)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render)}function Rt(e,t){if(null==e)return{};var n,l,a=function(e,t){if(null==e)return{};var n,l,a={},r=Object.keys(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}wt.exports=(St||(St=1,function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var m=e.type;switch(m){case s:case u:case l:case r:case a:case c:return m;default:var g=m&&m.$$typeof;switch(g){case o:case d:case h:case p:case i:return g;default:return f}}case n:return f}}}var x=s,E=u,C=o,S=i,w=t,T=d,N=l,I=h,O=p,R=n,k=r,P=a,A=c,L=!1;function H(e){return y(e)===u}Tt.AsyncMode=x,Tt.ConcurrentMode=E,Tt.ContextConsumer=C,Tt.ContextProvider=S,Tt.Element=w,Tt.ForwardRef=T,Tt.Fragment=N,Tt.Lazy=I,Tt.Memo=O,Tt.Portal=R,Tt.Profiler=k,Tt.StrictMode=P,Tt.Suspense=A,Tt.isAsyncMode=function(e){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(e)||y(e)===s},Tt.isConcurrentMode=H,Tt.isContextConsumer=function(e){return y(e)===o},Tt.isContextProvider=function(e){return y(e)===i},Tt.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Tt.isForwardRef=function(e){return y(e)===d},Tt.isFragment=function(e){return y(e)===l},Tt.isLazy=function(e){return y(e)===h},Tt.isMemo=function(e){return y(e)===p},Tt.isPortal=function(e){return y(e)===n},Tt.isProfiler=function(e){return y(e)===r},Tt.isStrictMode=function(e){return y(e)===a},Tt.isSuspense=function(e){return y(e)===c},Tt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===a||e===c||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===o||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},Tt.typeOf=y}()),Tt);var kt=M.createContext({});function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function At(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,gt(l.key),l)}}function Lt(e,t,n){return t&&At(e.prototype,t),n&&At(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ht(e,t)}function _t(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&&Ht(e,t)}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Dt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,l=Ft(e);if(t){var a=Ft(this).constructor;n=Reflect.construct(l,arguments,a)}else n=l.apply(this,arguments);return function(e,t){if(t&&("object"===mt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dt(e)}(this,n)}}var Mt=function(e){_t(n,M.Component);var t=$t(n);function n(){return Pt(this,n),t.apply(this,arguments)}return Lt(n,[{key:"render",value:function(){return this.props.children}}]),n}();function jt(e){var t=M.useRef(!1),n=Et(M.useState(e),2),l=n[0],a=n[1];return M.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[l,function(e,n){n&&t.current||a(e)}]}var qt="none",Vt="appear",Kt="enter",zt="leave",Bt="none",Wt="prepare",Ut="start",Gt="active",Yt="end",Xt="prepared";function Qt(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Zt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Jt,en,tn,nn=(Jt=Qt(),en="undefined"!=typeof window?window:{},tn={animationend:Zt("Animation","AnimationEnd"),transitionend:Zt("Transition","TransitionEnd")},Jt&&("AnimationEvent"in en||delete tn.animationend.animation,"TransitionEvent"in en||delete tn.transitionend.transition),tn),ln={};if(Qt()){var an=document.createElement("div");ln=an.style}var rn={};function on(e){if(rn[e])return rn[e];var t=nn[e];if(t)for(var n=Object.keys(t),l=n.length,a=0;a<l;a+=1){var r=n[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in ln)return rn[e]=t[r],rn[e]}return""}var sn=on("animationend"),un=on("transitionend"),dn=!(!sn||!un),cn=sn||"animationend",fn=un||"transitionend";function pn(e,t){return e?"object"===mt(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var hn=function(t){var n=e.useRef(),l=e.useRef(t);l.current=t;var a=M.useCallback((function(e){l.current(e)}),[]);function r(e){e&&(e.removeEventListener(fn,a),e.removeEventListener(cn,a))}return M.useEffect((function(){return function(){r(n.current)}}),[]),[function(e){n.current&&n.current!==e&&r(n.current),e&&e!==n.current&&(e.addEventListener(fn,a),e.addEventListener(cn,a),n.current=e)},r]},mn=Qt()?e.useLayoutEffect:e.useEffect,gn=function(e){return+setTimeout(e,16)},vn=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(gn=function(e){return window.requestAnimationFrame(e)},vn=function(e){return window.cancelAnimationFrame(e)});var bn=0,yn=new Map;function xn(e){yn.delete(e)}var En=function(e){var t=bn+=1;return function n(l){if(0===l)xn(t),e();else{var a=gn((function(){n(l-1)}));yn.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};En.cancel=function(e){var t=yn.get(e);return xn(t),vn(t)};var Cn=[Wt,Ut,Gt,Yt],Sn=[Wt,Xt],wn=!1,Tn=!0;function Nn(e){return e===Gt||e===Yt}var In=function(e,t,n){var l=Et(jt(Bt),2),a=l[0],r=l[1],i=function(){var e=M.useRef(null);function t(){En.cancel(e.current)}return M.useEffect((function(){return function(){t()}}),[]),[function n(l){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=En((function(){a<=1?l({isCanceled:function(){return r!==e.current}}):n(l,a-1)}));e.current=r},t]}(),o=Et(i,2),s=o[0],u=o[1];var d=t?Sn:Cn;return mn((function(){if(a!==Bt&&a!==Yt){var e=d.indexOf(a),t=d[e+1],l=n(a);l===wn?r(t,!0):t&&s((function(e){function n(){e.isCanceled()||r(t,!0)}!0===l?n():Promise.resolve(l).then(n)}))}}),[e,a]),M.useEffect((function(){return function(){u()}}),[]),[function(){r(Wt,!0)},a]};var On=function(t){var n=t;"object"===mt(t)&&(n=t.transitionSupport);var l=M.forwardRef((function(t,l){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,u=t.children,d=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!n||!1===t)}(t,M.useContext(kt).motion),h=e.useRef(),m=e.useRef();var g=function(t,n,l,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,u=a.motionLeave,d=void 0===u||u,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,h=a.onEnterPrepare,m=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,b=a.onLeaveStart,y=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,S=a.onEnterEnd,w=a.onLeaveEnd,T=a.onVisibleChanged,N=Et(jt(),2),I=N[0],O=N[1],R=Et(jt(qt),2),k=R[0],P=R[1],A=Et(jt(null),2),L=A[0],H=A[1],_=e.useRef(!1),F=e.useRef(null);function D(){return l()}var $=e.useRef(!1);function j(){P(qt,!0),H(null,!0)}function q(e){var t=D();if(!e||e.deadline||e.target===t){var n,l=$.current;k===Vt&&l?n=null==C?void 0:C(t,e):k===Kt&&l?n=null==S?void 0:S(t,e):k===zt&&l&&(n=null==w?void 0:w(t,e)),k!==qt&&l&&!1!==n&&j()}}var V=Et(hn(q),1)[0],K=function(e){var t,n,l;switch(e){case Vt:return vt(t={},Wt,p),vt(t,Ut,g),vt(t,Gt,y),t;case Kt:return vt(n={},Wt,h),vt(n,Ut,v),vt(n,Gt,x),n;case zt:return vt(l={},Wt,m),vt(l,Ut,b),vt(l,Gt,E),l;default:return{}}},z=M.useMemo((function(){return K(k)}),[k]),B=Et(In(k,!t,(function(e){if(e===Wt){var t=z[Wt];return t?t(D()):wn}var n;return U in z&&H((null===(n=z[U])||void 0===n?void 0:n.call(z,D(),null))||null),U===Gt&&(V(D()),c>0&&(clearTimeout(F.current),F.current=setTimeout((function(){q({deadline:!0})}),c))),U===Xt&&j(),Tn})),2),W=B[0],U=B[1],G=Nn(U);$.current=G,mn((function(){O(n);var e,l=_.current;_.current=!0,!l&&n&&s&&(e=Vt),l&&n&&i&&(e=Kt),(l&&!n&&d||!l&&f&&!n&&d)&&(e=zt);var a=K(e);e&&(t||a[Wt])?(P(e),W()):P(qt)}),[n]),e.useEffect((function(){(k===Vt&&!s||k===Kt&&!i||k===zt&&!d)&&P(qt)}),[s,i,d]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(F.current)}}),[]);var Y=M.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===qt&&((Y.current||I)&&(null==T||T(I)),Y.current=!0)}),[I,k]);var X=L;return z[Wt]&&U===Ut&&(X=yt({transition:"none"},X)),[k,U,X,null!=I?I:n]}(p,r,(function(){try{return h.current instanceof HTMLElement?h.current:Ct(m.current)}catch(e){return null}}),t),v=Et(g,4),b=v[0],y=v[1],x=v[2],E=v[3],C=M.useRef(E);E&&(C.current=!0);var S,w=M.useCallback((function(e){h.current=e,Nt(l,e)}),[l]),T=yt(yt({},f),{},{visible:r});if(u)if(b===qt)S=E?u(yt({},T),w):!o&&C.current&&c?u(yt(yt({},T),{},{className:c}),w):s||!o&&!c?u(yt(yt({},T),{},{style:{display:"none"}}),w):null;else{var N,I;y===Wt?I="prepare":Nn(y)?I="active":y===Ut&&(I="start");var O=pn(d,"".concat(b,"-").concat(I));S=u(yt(yt({},T),{},{className:ne.default(pn(d,b),(N={},vt(N,O,O&&I),vt(N,d,"string"==typeof d),N)),style:x}),w)}else S=null;M.isValidElement(S)&&Ot(S)&&(S.ref||(S=M.cloneElement(S,{ref:w})));return M.createElement(Mt,{ref:m},S)}));return l.displayName="CSSMotion",l}(dn);function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},Rn.apply(this,arguments)}var kn="add",Pn="keep",An="remove",Ln="removed";function Hn(e){var t;return yt(yt({},t=e&&"object"===mt(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function _n(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Hn)}var Fn=["component","children","onVisibleChanged","onAllRemoved"],Dn=["status"],$n=["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]:On,n=function(e){_t(l,M.Component);var n=$t(l);function l(){var e;Pt(this,l);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return vt(Dt(e=n.call.apply(n,[this].concat(a))),"state",{keyEntities:[]}),vt(Dt(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:yt(yt({},e),{},{status:Ln})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==Ln})).length})),e}return Lt(l,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,l=this.props,a=l.component,r=l.children,i=l.onVisibleChanged,o=l.onAllRemoved,s=Rt(l,Fn),u=a||M.Fragment,d={};return $n.forEach((function(e){d[e]=s[e],delete s[e]})),delete s.keys,M.createElement(u,s,n.map((function(n){var l=n.status,a=Rt(n,Dn),s=l===kn||l===Pn;return M.createElement(t,Rn({},d,{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 n=e.keys,l=t.keyEntities,a=_n(n),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],l=0,a=t.length,r=_n(e),i=_n(t);r.forEach((function(e){for(var t=!1,r=l;r<a;r+=1){var o=i[r];if(o.key===e.key){l<r&&(n=n.concat(i.slice(l,r).map((function(e){return yt(yt({},e),{},{status:kn})}))),l=r),n.push(yt(yt({},o),{},{status:Pn})),l+=1,t=!0;break}}t||n.push(yt(yt({},e),{},{status:An}))})),l<a&&(n=n.concat(i.slice(l).map((function(e){return yt(yt({},e),{},{status:kn})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,l=t.status;return n!==e||l!==An}))).forEach((function(t){t.key===e&&(t.status=Pn)}))})),n}(l,a);return{keyEntities:r.filter((function(e){var t=l.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==Ln||e.status!==An}))}}}]),l}();vt(n,"defaultProps",{component:"div"})}(dn);const Mn=j.default.forwardRef(((e,t)=>{const{forceRender:n,className:l,style:a,boxStyle:r,isActive:i}=e,[o,s]=j.default.useState(i||n);if(j.default.useEffect((()=>{(n||i)&&s(!0)}),[n,i]),!o)return null;const u=dt("collapse");return j.default.createElement("div",{ref:t,className:ne.default(`${u}-content`,{[`${u}-content-active`]:i,[`${u}-content-inactive`]:!i},l),style:a},j.default.createElement("div",{className:`${u}-content-box`,style:r},e.children))}));Mn.displayName="PanelContent";const jn=e=>{const{defaultActive:t,label:n,extra:l,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:u,destroyOnClose:d=!1,onChange:c}=e,[f,p]=j.default.useState(!!t),h=dt("collapse"),m=ne.default({[`${h}`]:!0,[`${h}-active`]:f,[`${h}-disabled`]:s},a);return j.default.createElement("div",{className:m,style:r},j.default.createElement(ct,{label:n,extra:l,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),j.default.createElement(On,qe({visible:f},ht,{leavedClassName:`${h}-content-hidden`,forceRender:u,removeOnLeave:d}),((t,n)=>{let{className:l,style:a}=t;return j.default.createElement(Mn,{ref:n,prefixCls:h,className:l,style:a,boxStyle:i,isActive:f,forceRender:u},e.children)})))};jn.displayName="QmCollapse";const qn=j.default.createContext(void 0);function Vn(e,t){((e,t)=>{const n=M.useRef(!0);M.useEffect((()=>e(n.current)),t),M.useEffect((()=>(n.current=!1,()=>{n.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Kn=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},zn=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},Bn=e=>e.stopPropagation(),Wn=e=>e.preventDefault(),Un=(e,t)=>{if(Xe||!e||!t)return null;"float"===(t=lt(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const l=window.getComputedStyle(e);return l?l[t]:""}catch(n){return e.style[t]}},Gn=(e,t,n)=>{!Xe&&e&&t&&(g.isPlainObject(t)?Object.keys(t).forEach((n=>{Gn(e,n,t[n])})):(t=lt(t),e.style[t]=n))},Yn=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Xn=(e,t)=>Math.abs(Yn(e)-Yn(t)),Qn=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Zn=(e,t)=>{var n;let l=e;for(;l;){if(null===(n=l.classList)||void 0===n?void 0:n.contains(t))return l;l=l.parentNode}return null},Jn=(e,t)=>{if(Xe||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},el=e=>{const{minValues:t,onDragChange:n,onDragging:l}=e,{splitRef:a,direction:r}=j.default.useContext(qn),[i,o]=j.default.useState(),[s,u]=j.default.useState(0),d="vertical"===r?"y":"x",c=()=>{const{w:e,h:n}={w:a.current.offsetWidth,h:a.current.offsetHeight};return[t[0],("vertical"===r?n:e)-t[1]]},f={[`${dt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return j.default.createElement(le.default,{bounds:i,axis:d,position:{x:0,y:0},positionOffset:{[d]:-1*s},onStart:()=>{n(!0),(()=>{const e=a.current.children[0];if(!e)return;const t=c(),n=e.offsetWidth,l=e.offsetHeight;o({left:t[0]-n,right:t[1]-n,top:t[0]-l,bottom:t[1]-l})})()},onDrag:(e,t)=>{u(t[d]),l(t[d])},onStop:()=>n(!1)},j.default.createElement("div",{className:ne.default(f),title:we("qm.split.resize")}))};el.displayName="ResizeBar";const tl=j.default.forwardRef(((e,t)=>{const{offset:n,className:l,style:a}=e,{direction:r,dragging:i}=j.default.useContext(qn),o="vertical"===r?"height":"width",s={[dt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[l]:!!l},u=void 0!==n?{[o]:it(n)}:{flex:1,[o]:0};return j.default.createElement("div",{ref:t,className:ne.default(s),style:Object.assign(Object.assign({},u),a)},e.children)}));tl.displayName="QmSplitPane";const nl=e=>{const{direction:t="horizontal",defaultValue:n="50%",uniqueKey:l,className:a,style:r,onDragStart:i,onDrag:o=Je,onDragEnd:s}=e,{global:u}=j.default.useContext(xe),d=j.default.useRef(null),c=j.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),h=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},m=j.default.useMemo((()=>l?`split_${l}`:""),[l]),[g,v]=j.default.useState(!1),[b,y]=j.default.useState(f(n)),x=j.default.useRef(0);Vn((()=>{g?(x.current="vertical"===t?c.current.offsetHeight:c.current.offsetWidth,null==i||i(p(b))):(null==s||s(p(b)),localStorage.setItem(m,b),S(m,b))}),[g]),j.default.useEffect((()=>{E()}),[]);const E=()=>{if(!m)return;const e=localStorage.getItem(m);e?y(f(e)):C(m).then((e=>{localStorage.setItem(m,f(e||n)),E()})).catch((()=>{}))},C=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),S=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==u?void 0:u.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),w=j.default.useMemo((()=>({splitRef:d,direction:t,dragging:g})),[t,g]),T=[];j.default.Children.map(e.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&T.push(e)}));const[N,I]=T,O=j.default.useMemo((()=>[h(N),h(I)]),[N,I]),R={[dt("split")]:!0,vertical:"vertical"===t};return j.default.createElement(qn.Provider,{value:w},j.default.createElement("div",{ref:d,className:ne.default(R,a),style:r},j.default.createElement(tl,qe({},N.props,{ref:c,offset:b})),j.default.createElement(el,{minValues:O,onDragChange:e=>v(e),onDragging:e=>{const t=x.current+e;y(`${t}px`),o(t)}}),j.default.createElement(tl,I.props)))};nl.Pane=tl,nl.displayName="QmSplit";class ll extends e.Component{render(){const{size:e,className:t,style:n}=this.props,l=e||this.context.size||"",a=dt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===l,[`${a}--sm`]:"small"===l};return j.default.createElement(ae.default,qe({},this.props,{className:ne.default(r,t),style:n}),this.props.children)}}ll.defaultProps={duration:2},ll.contextType=xe;class al extends e.Component{render(){const{size:e,className:t}=this.props,n=e||this.context.size||"",l=dt("empty"),a=Object.assign(Object.assign({},this.props),{image:u.Empty.PRESENTED_IMAGE_SIMPLE}),r={[l]:!0,[`${l}--lg`]:"large"===n,[`${l}--sm`]:"small"===n};return j.default.createElement(u.Empty,qe({},a,{className:ne.default(r,t)}))}}al.contextType=xe,al.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class rl extends e.Component{render(){const{fullHeight:e,className:t,style:n={}}=this.props,l={[`${dt("spin")}-full-height`]:e},a=Object.assign(Object.assign({wrapperClassName:ne.default(l,t)},te.default(this.props,["fullHeight"])),{style:Object.assign(Object.assign({},n),{maxHeight:"none"})});return j.default.createElement(u.Spin,a,this.props.children)}}rl.defaultProps={tip:"Loading...",fullHeight:!1};const il=j.default.createContext(void 0),ol=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},sl=function(e,t){!Xe&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new re.default(ol),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},ul=function(e,t){var n;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(n=e.__ro__)||void 0===n||n.disconnect())};function dl(e){const[t,n]=M.useState({width:0,height:0});return M.useEffect((()=>{const t=e.current,l=e=>{const{width:t,height:l}=e.contentRect;n({width:t,height:l})};return t&&sl(t,l),()=>{t&&ul(t,l)}}),[e]),t}function cl(e,t){var n=this;const l=M.useRef(null);return M.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]),function(){for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(n,r)),t)}}const fl=6,pl={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"}},hl=e=>{const{thumb:t,always:n,barSize:l=fl,direction:a="vertical",onDrag:r=Je}=e,{dragging:i,scrollbarElement:o,wrapElement:s}=j.default.useContext(il),u=pl[a],d=j.default.useRef(t),c=j.default.useRef(null),f=j.default.useRef(null),p=j.default.useRef({}),h=j.default.useRef(!1),m=j.default.useRef(!1),g=j.default.useRef(Xe?null:document.onselectstart),[v,b]=j.default.useState(!1);j.default.useEffect((()=>{d.current=t}),[t]),j.default.useEffect((()=>{const e=o.current;return Kn(e,"mousemove",C),Kn(e,"mouseleave",S),()=>{E(),zn(document,"mouseup",x),zn(e,"mousemove",C),zn(e,"mouseleave",S)}}),[]);const y=e=>{if(!c.current||!f.current)return;if(!h.current)return;const t=p.current[u.axis];if(!t)return;const n=100*(-1*(c.current.getBoundingClientRect()[u.direction]-e[u.client])-(f.current[u.offset]-t))/c.current[u.offset];s.current[u.scroll]=n*s.current[u.scrollSize]/100,r(!0)},x=()=>{h.current=!1,p.current={[u.axis]:0},zn(document,"mousemove",y),zn(document,"mouseup",x),E(),m.current&&b(!1),r(!1)},E=()=>{document.onselectstart!==g.current&&(document.onselectstart=g.current)},C=()=>{m.current=!1,b(!!d.current.size)},S=()=>{m.current=!0,b(h.current)},w=dt("scrollbar"),T={[`${w}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},N={[u.reverse]:l},I={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return j.default.createElement(mc,{name:"fade",in:n||i||v,timeout:300},j.default.createElement("div",{ref:c,className:ne.default(T),style:N},j.default.createElement("div",{ref:f,className:`${w}__thumb`,style:I,onMouseDown:e=>{e.stopPropagation(),Kn(document,"mousemove",y),Kn(document,"mouseup",x),h.current=!0,g.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(p.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},ml=20,gl=j.default.forwardRef(((e,t)=>{const{wrapClassName:n,wrapStyle:l,barWidth:a,always:r,native:i,minSize:o=ml,onScroll:s}=e,u=j.default.useRef(null),d=j.default.useRef(null),c=j.default.useRef(null),[f,p]=j.default.useState({size:0,offset:0,ratio:1}),[h,m]=j.default.useState({size:0,offset:0,ratio:1}),[v,b]=j.default.useState(!1),y=dl(u),x=dl(c);Vn((()=>{!i&&E()}),[x.width,x.height,y.width,y.height]);const E=cl((()=>{if(!d.current)return;const e=d.current.offsetHeight-4,t=d.current.offsetWidth-4,n=Math.pow(e,2)/d.current.scrollHeight,l=Math.pow(t,2)/d.current.scrollWidth,a=Math.max(n,o),r=Math.max(l,o),i=n/(e-n)/(a/(e-a)),s=l/(t-l)/(r/(t-r)),u=a+4<e?a:0,c=r+4<t?r:0,g=100*d.current.scrollTop/e*i,v=100*d.current.scrollLeft/t*s;p(Object.assign({},f,{size:c,ratio:s,offset:v})),m(Object.assign({},h,{size:u,ratio:i,offset:g}))}),5),C=e=>{b(e)},S=e=>{g.isNumber(e)?d.current.scrollTop=e:Oe("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},w=e=>{g.isNumber(e)?d.current.scrollLeft=e:Oe("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};j.default.useImperativeHandle(t,(()=>{var e,t;return{container:u.current,scrollTop:(null===(e=d.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=d.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:S,SET_SCROLL_LEFT:w}}));const T=j.default.useMemo((()=>({dragging:v,scrollbarElement:u,wrapElement:d})),[v]),N=dt("scrollbar"),I={[`${N}__wrap`]:!0,[`${N}__wrap--hidden`]:!i};return j.default.createElement("div",{ref:u,className:ne.default(N,e.className),style:e.style},j.default.createElement("div",{ref:d,className:ne.default(I,n),style:l,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!i&&(()=>{if(!d.current)return;const e=d.current.offsetHeight-4,t=d.current.offsetWidth-4,n=100*d.current.scrollTop/e*h.ratio,l=100*d.current.scrollLeft/t*f.ratio;p(Object.assign({},f,{offset:l})),m(Object.assign({},h,{offset:n}))})(),null==s||s({scrollTop:t,scrollLeft:n})}},j.default.createElement("div",{ref:c,className:`${N}__view`},e.children)),!i&&j.default.createElement(il.Provider,{value:T},j.default.createElement(hl,{direction:"horizontal",thumb:f,barSize:a,always:r,onDrag:C}),j.default.createElement(hl,{direction:"vertical",thumb:h,barSize:a,always:r,onDrag:C})))}));gl.displayName="QmScrollbar";const vl=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let l=document.createElement("a");l.href=n,l.download=decodeURI(t),l.click(),l=null}};class bl extends e.Component{constructor(){super(...arguments),this.state={loading:!1},this.downloadHandle=()=>Ye(this,void 0,void 0,(function*(){var e,t,n,l;this.setState({loading:!0});try{const{action:n,beforeDownload:l=et}=this.props,a=g.isString(n)?n:yield this.getActionUrl();if(!a)return Oe("Download","参数 `action` 有误!");if(!l(a))return;yield this.downloadFile(a),yield tt(100),null===(t=(e=this.props).onSuccess)||void 0===t||t.call(e),u.message.success(we("qm.download.success"))}catch(e){null===(l=(n=this.props).onError)||void 0===l||l.call(n,e),u.message.error(we("qm.download.error"))}this.setState({loading:!1})}))}getActionUrl(){return Ye(this,void 0,void 0,(function*(){const e=this.props.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}))}downloadFile(e){return Ye(this,void 0,void 0,(function*(){const{fileName:t,headers:n,params:l,withCredentials:a}=this.props,r=yield ie.default({url:e,params:l,headers:n,withCredentials:a,responseType:"blob",timeout:0}),i=r.data,o=r.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));vl(i,s)}))}render(){const{size:e}=this.props,{loading:t}=this.state,n=e||this.context.size||"",l=te.default(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return j.default.createElement(u.Button,qe({},l,{size:n,loading:t,onClick:this.downloadHandle}),this.props.children)}}bl.propTypes={action:q.default.oneOfType([q.default.string,q.default.shape({api:q.default.func.isRequired,params:q.default.object})]),size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},fileName:q.default.string,headers:q.default.object,withCredentials:q.default.bool,params:q.default.object,beforeDownload:q.default.func,onSuccess:q.default.func,onError:q.default.func},bl.defaultProps={icon:j.default.createElement(b.DownloadOutlined,null),children:we("qm.download.text"),withCredentials:!1},bl.contextType=xe;class yl extends e.Component{renderLabel(){const{activeKey:e,labels:t,onTabClick:n}=this.props;return t.map(((t,l)=>{const a={item:!0,actived:l===e};return j.default.createElement("div",{key:l,className:ne.default(a),onClick:e=>n(l,e)},j.default.createElement("span",null,t))}))}render(){return j.default.createElement(j.default.Fragment,null,this.renderLabel())}}class xl extends e.Component{render(){const{label:e,showDivider:t,className:n,style:l}=this.props,a={[dt("anchor-item")]:!0};return j.default.createElement("div",{className:ne.default(a,n),style:l},t&&j.default.createElement(ct,{label:e,style:{marginBottom:10}}),this.props.children)}}xl.displayName="QmAnchorItem";class El extends e.Component{get __is_conf(){var e;return!!(null===(e=this.props.labelList)||void 0===e?void 0:e.length)}constructor(t){super(t),this.currentState="ready",this.scrollRef=e.createRef(),this.onScrollHandle=e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})},this.onTabClickHandle=e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),se.default(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))},this.SCROLL_TO_ITEM=e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)},this.state={activeKey:t.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=oe.default(this.scrollRef.current,"scroll",g.throttle(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=Xn(this.getTargetElement(e),this.scrollRef.current))}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>Xn(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),n=this.createDistances();let l=-1;for(let e=0;e<n.length;e++){const a=n[e],r=n[e+1]||1e4;t>=a-1&&t<r&&(l=e)}return l}getTargetElement(e){const{labelList:t=[]}=this.props;return this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e]}render(){const{activeKey:e}=this.state,{size:t,labelWidth:n,tabPosition:l,labelList:a=[],onTabClick:r,className:i,style:o}=this.props,s=t||this.context.size||"",u=dt("anchor"),d={[u]:!0,[`${u}-left`]:"left"===l,[`${u}-top`]:"top"===l,[`${u}--lg`]:"large"===s,[`${u}--sm`]:"small"===s},c=[];j.default.Children.map(this.props.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&c.push(e)}));const f=this.__is_conf?a.map((e=>e.label)):c.map((e=>e.props.label)),p=this.__is_conf?a.map((e=>e.id)):c.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=f.length,j.default.createElement("div",{className:ne.default(d,i),style:o},j.default.createElement("div",{className:ne.default("anchor-nav"),style:{width:n?it(n):""}},j.default.createElement(yl,{activeKey:e,labels:f,onTabClick:(e,t)=>{this.onTabClickHandle(e),null==r||r({label:f[e],id:p[e]},t)}})),j.default.createElement("div",{ref:this.scrollRef,className:ne.default("anchor-container")},this.__is_conf?this.props.children:c))}}El.Item=xl,El.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelWidth:(e,t,n)=>{if(!Re(e[t]))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelList:q.default.arrayOf(q.default.shape({id:q.default.string,label:q.default.string}))},El.defaultProps={tabPosition:"left"},El.contextType=xe;class Cl extends e.Component{render(){return j.default.createElement(u.Tabs.TabPane,this.props,this.props.children)}}Cl.displayName="QmTabPane";class Sl extends e.Component{render(){const{items:e,size:t,tabPosition:n,tabBarGutter:l,className:a,authConfig:r}=this.props,i=t||this.context.size||"",o=dt("tabs"),s={[o]:!0,[`${o}--lg`]:"large"===i,[`${o}--sm`]:"small"===i},d=Object.assign(Object.assign({},te.default(this.props,["items","authConfig"])),{size:i,tabBarGutter:null!=l?l:["top","bottom"].includes(n)?30:0}),c=[];j.default.Children.map(this.props.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmTabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&c.push(e)}));const f=e?[...e]:c.map((e=>{let{key:t,props:n}=e;return{key:t,label:n.tab,disabled:n.disabled,closable:n.closable,forceRender:n.forceRender,children:n.children}}));if(r){const{fieldList:e=[]}=r||{};for(let t=0;t<f.length;t++){const n=f[t],l=e.find((e=>e.dataIndex===n.key)),{visible:a=1,disabled:r}=l||{};a?r&&(n.disabled=!0):(f.splice(t,1),t--)}}return j.default.createElement(u.Tabs,qe({},d,{items:f,className:ne.default(s,a)}))}}Sl.TabPane=Cl,Sl.contextType=xe,Sl.defaultProps={tabPosition:"top"};class wl extends e.Component{constructor(){super(...arguments),this.titleRef=j.default.createRef(),this.$drawer=null,this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1},this.afterVisibleChange=e=>{var t,n;const{loading:l}=this.props;e?(this.opened=!0,g.isUndefined(l)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(n=(t=this.props).onClosed)||void 0===n||n.call(t),this.setState({fullscreen:!1}))},this.toggleHandle=()=>{this.$drawer=Zn(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){var n;const{visible:l,open:a,loading:r,destroyOnClose:i}=this.props,o=null!=a?a:l,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:u}=this.state;o&&o!==s&&(!i&&this.opened||g.isUndefined(r)&&this.setState({spinning:!0})),this.$drawer&&u!==t.fullscreen&&Gn(this.$drawer,u?{width:"100%"}:{width:it(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:t,showHeader:n,showFullScreen:l}=this.props;return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{ref:this.titleRef,className:ne.default("text")},n&&t),l&&j.default.createElement("button",{type:"button",className:ne.default("full-screen"),onClick:this.toggleHandle},j.default.createElement(e?b.FullscreenExitOutlined:b.FullscreenOutlined)))}render(){var e;const{spinning:t,sloading:n}=this.state,{visible:l,open:a,size:r,className:i,loading:o,showHeader:s,maskClosable:d,onClose:c}=this.props,f=this.context.global,p=r||this.context.size||"",h=dt("drawer"),m={[h]:!0,"no-header":!s,[`${h}--lg`]:"large"===p,[`${h}--sm`]:"small"===p};return j.default.createElement(u.Drawer,qe({},te.default(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(e=null!=d?d:null==f?void 0:f.maskClosable)&&void 0!==e&&e,className:ne.default(m,i),title:this.renderTitle(),footer:null,onClose:c,afterOpenChange:this.afterVisibleChange}),this.props.children,(o||n||t)&&j.default.createElement(rl,{spinning:!0,className:ne.default("spinning")}))}}wl.contextType=xe,wl.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Drawer","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:q.default.bool},wl.defaultProps={width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null};const Tl="10vh";var Nl;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Nl||(Nl={}));class Il extends e.Component{constructor(){super(...arguments),this.$event=null,this.draggleRef=j.default.createRef(),this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0},this.addMouseDownEvent=()=>{this.$event||(this.$event=oe.default(document.body,"mousedown",Bn))},this.removeMouseDownEvent=()=>{var e;this.$event&&(null===(e=this.$event)||void 0===e||e.remove(),this.$event=null)},this.onStart=(e,t)=>{const{clientWidth:n,clientHeight:l}=window.document.documentElement,a=this.draggleRef.current.getBoundingClientRect();a&&this.setState({bounds:{left:-a.left+t.x,right:n-(a.right-t.x)-1,top:-a.top+t.y,bottom:l-(a.bottom-t.y)-1}})},this.toggleHandle=e=>{const t=Zn(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body"),{width:l,height:a,showHeader:r}=this.props,{fullscreen:i}=this.state;i?(Gn(t,{width:it(l||"60%"),height:"auto",top:Tl}),Gn(n,{height:a?it(a):this.defaultHeight,maxHeight:"auto"===a?this.defaultHeight:""})):(Gn(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Gn(n,{height:`calc(100vh - ${Nl[r?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.afterVisibleChange=()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${Tl} - ${Tl} - ${Nl[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){var n;const{visible:l,open:a,loading:r,stopMouseDownEvent:i,destroyOnClose:o}=this.props,s=null!=a?a:l,u=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:d}=this.state;if(s&&s!==u){if(!o&&this.opened||g.isUndefined(r)&&this.setState({spinning:!0}),i&&this.addMouseDownEvent(),!o&&this.opened)return;setTimeout((()=>{this.opened=!0,g.isUndefined(r)&&this.setState({spinning:!1})}),400)}s||this.removeMouseDownEvent(),d!==t.fullscreen&&(d?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:t}=this.state,{title:n,showHeader:l,showFullScreen:a}=this.props;return j.default.createElement("div",{onMouseOver:()=>{t&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},j.default.createElement("span",{className:ne.default("text")},l&&n),a&&j.default.createElement("button",{type:"button",className:ne.default("full-screen"),onClick:this.toggleHandle},j.default.createElement(e?b.FullscreenExitOutlined:b.FullscreenOutlined)))}render(){var e;const{spinning:t,sloading:n,fullscreen:l,disabled:a,bounds:r,position:i}=this.state,{visible:o,open:s,height:d,className:c,loading:f,draggable:p,showHeader:h,maskClosable:m,bodyStyle:g,onClose:v}=this.props,b=this.context.global,y=dt("modal"),x={height:d?it(d):this.defaultHeight,maxHeight:"auto"===d?this.defaultHeight:"",overflow:"auto"},E={[y]:!0,"no-header":!h,[`${y}--lg`]:"large"===this.$size,[`${y}--sm`]:"small"===this.$size};return j.default.createElement(u.Modal,qe({},te.default(this.props,["visible","loading","showFullScreen","maskClosable","stopMouseDownEvent","onClose","onClosed"]),{open:null!=s?s:o,maskClosable:null!==(e=null!=m?m:null==b?void 0:b.maskClosable)&&void 0!==e&&e,className:ne.default(E,c),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},x,g),onCancel:v,afterClose:this.afterVisibleChange,modalRender:e=>j.default.createElement(le.default,{disabled:!p||a||l,bounds:r,position:i,onStart:(e,t)=>this.onStart(e,t)},j.default.createElement("div",{ref:this.draggleRef},e))}),this.props.children,(f||n||t)&&j.default.createElement(rl,{spinning:!0,className:ne.default("spinning")}))}}Il.contextType=xe,Il.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Modal","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:q.default.bool},Il.defaultProps={width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Tl}};const Ol=e.createContext(void 0),Rl=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var kl={operations:function(e){const t=e.split(" "),n=[];let l=0;n[l]=[];for(let e=0;e<t.length;e++)Rl.includes(t[e])?(n[l]=n[l].join(" "),l++,n[l]=[]):n[l].push(t[e]);return n[l]=n[l].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,l=(e=Array.isArray(e)?e:[e]).length;n<l;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<l-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const Pl=["==","<",">","<=",">=","!=","like","likes","in","nin"];var Al=function(e){let t=0;const n=e.length;for(let l=0;l<n;l++){const n=e.charAt(l);"("===n&&t++,")"===n&&t--}return 0===t},Ll=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const l=n.split(" ").filter((e=>""!==e));for(let e=0;e<l.length;e++)Pl.includes(l[e])&&("this"!=l[e-1]?l[e-1]=t+"."+l[e-1]:l[e-1]=t),Pl.includes(l[e])&&(l.splice(e-1,3,`__query__(${l[e-1]}, '${l[e]}', ${l[e+1]})`),e-=2);return e=l.join(" ")};const Hl=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,_l=["string","number","boolean","symbol"],Fl=e=>_l.includes(typeof e),Dl=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),$l=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(Hl,"\\$1"),"i");window.__query__=function(){return((e,t,n)=>{e=null!=e?e:"";let l=!0;switch(t){case"like":l=null!==e.toString().match($l(n));break;case"likes":l=n.split(/,|,/).some((t=>null!==e.toString().match($l(t))));break;case"in":Fl(n)&&(n=[n]),Array.isArray(n)&&(l=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":Fl(n)&&(n=[n]),Array.isArray(n)&&(l=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":l=(Dl(e)?e.slice(0,10):e)!=n;break;case"<":l=(Dl(e)?e.slice(0,10):e)<n;break;case"<=":l=(Dl(e)?e.slice(0,10):e)<=n;break;case">":l=(Dl(e)?e.slice(0,10):e)>n;break;case">=":l=(Dl(e)?e.slice(0,10):e)>=n;break;default:l=(Dl(e)?e.slice(0,10):e)==n}return l})(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const Ml=kl.stringify,jl=kl.array_format,ql=Al,Vl=(e,t,n)=>{let l=[];t=kl.replace_symbols(t);try{if(n){const n=new Function("record",`return ${Ll(t,"record")};`);l=xa(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${Ll(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)n(e,t)&&l.push(e[t])}}catch(t){Oe("Table","组件 `initialFilter` 参数有误!"),l=e}return l},Kl=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Kl(e.children)):t.push(e)})),t},zl=e=>e.filter((e=>(e.children&&(e.children=zl(e.children)),!e.hidden&&!e.noAuth))),Bl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Bl(e.children))})),t},Wl=(e,t)=>e.map((e=>(e.children&&(e.children=Wl(e.children,t)),null==t||t(e),e))),Ul=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=Ul(n.children,t);if(e)return e}}return null},Gl=e=>{const t=e.children;return t?t[0].children?Gl(t[0]):t[0]:e},Yl=e=>{const t=e.children;return t?t[t.length-1].children?Yl(t[t.length-1]):t[t.length-1]:e},Xl=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ql=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=Ql(n.children,t);if(e)return e}}return null},Zl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Zl(e.children))})),t},Jl=e=>{let t=1;const n=(e,l)=>{var a;if(l&&(e.level=l.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((l=>{e.fixed?l.fixed=e.fixed:delete l.fixed,n(l,e),t+=l.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,n(e,null)}));const l=[];for(let e=0;e<t;e++)l.push([]);return Bl(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,l[e.level-1].push(e)})),l},ea=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const l=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,l&&l!==document.documentElement&&l!==document.body&&(n.top-=l.scrollTop,n.left-=l.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return ea(e.offsetParent,t,n)}return n},ta=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,na=(e,t)=>g.transform(e,((e,n,l)=>{g.isEqual(n,t[l])||(e[l]=g.isPlainObject(n)&&g.isPlainObject(t[l])?na(n,t[l]):n)})),la=(e,t)=>{var n;return null!==(n=g.get(e,t))&&void 0!==n?n:""},aa=(e,t,n,l)=>{l>=0&&null!=n&&(n=Number(n).toFixed(l)),g.set(e,t,null!=n?n:"")},ra=(e,t)=>{if(!t.includes("|"))return la(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(la(e,t))})),n.every((e=>!e))?"":n.join(" | ")},ia=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),oa=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let l=n?t[0].slice(1):t[0],a="";for(;l.length>3;)a=`,${l.slice(-3)}${a}`,l=l.slice(0,l.length-3);return l&&(a=l+a),`${n}${a}${t[1]?`.${t[1]}`:""}`},sa=(e,t)=>{const n=e.toString();if(!ia(n)||0===t)return e;const l=Number.parseFloat(n).toString(),a=l.indexOf(".");if(-1===a)return l+"."+"0".repeat(t);const r=Math.max(0,t-(l.length-a-1));return l+"0".repeat(r)},ua=(e,t)=>e?K.default(e,t):null,da=(e,t)=>e?K.default(e).format(t):"",ca=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},fa=e=>{const t=[];if(j.default.isValidElement(e)){const{children:n}=e.props;j.default.Children.forEach(n,(e=>{t.push(...fa(e))}))}else t.push(e);return t},pa=e=>fa(e).join(""),ha=e=>e.filter((e=>!e._group)),ma=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="";if(Array.isArray(e)){let l=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)?jl(r.condition):Ml(r.condition,"^");n+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,l=r.logic.length}n=n.slice(0,-1*l-2)}else{const l=5;for(const l in e){const[a,r]=l.includes("|")?l.split("|"):[l,""],i=e[l];for(const e in i){n+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?jl(i[e]):Ml(i[e],"^")} and `}}n=n.slice(0,-1*l)}return n.replace(/\s+/g," ").trim()},ga=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>{const l=JSON.stringify((t=>{const n=[];return e.forEach((e=>n.push(la(t,e)))),n})(n));t[l]=t[l]||[],t[l].push(n)})),Object.keys(t).map((e=>t[e]))},va=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const l=va(e[n].children,t);if(l)return[e[n],l].flat()}}},ba=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const l=ba(e[n].children,t);if(l)return[e[n].rowKey,l].flat()}}},ya=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=ya(n.children,t);if(e)return e}if(t(n))return n}return null},xa=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&xa(e.children,t),t(e)||e.children&&e.children.length))),Ea=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Ca=80,Sa="1",wa="0",Ta=400,Na=["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"],Ia={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 Oa,Ra,ka;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Oa||(Oa={})),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"}(Ra||(Ra={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ka||(ka={}));const Pa={items:q.default.arrayOf(q.default.shape({type:q.default.string.isRequired,fieldName:q.default.string.isRequired})),initialValues:q.default.object,initialExtras:q.default.object,layout:q.default.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:q.default.number,customClass:q.default.string,compactMode:q.default.bool,labelWidth:q.default.oneOfType([q.default.number,q.default.string]),labelAlign:q.default.oneOf(["left","right"]),labelWrap:q.default.bool,formType:q.default.oneOf(["default","search","onlyShow"]),disabled:q.default.bool,uniqueKey:q.default.string,defaultRows:q.default.number,defaultExpand:q.default.bool,searchButtonCols:q.default.number,scrollToFirstError:q.default.bool,authConfig:q.default.object,isAutoFocus:q.default.bool,isCollapse:q.default.bool,isFieldsDefine:q.default.bool,isSearchBtn:q.default.bool,isSubmitBtn:q.default.bool,fieldsChange:q.default.func,onValuesChange:q.default.func,onFieldsChange:q.default.func,onFinish:q.default.func,onFinishFailed:q.default.func,onReset:q.default.func,onCollapse:q.default.func},Aa={layout:"horizontal",labelWidth:Ca,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Je,onFieldsChange:Je,onFinish:Je,onFinishFailed:Je,onReset:Je,onCollapse:Je,onFormItemsChange:Je},La=(e,t)=>{if(!e)return null;if(t===Ra.week){const t=e.match(/^(\d{4})-(\d+)/);return t?K.default().year(Number(t[1])).week(Number(t[2])):null}if(t===Ra.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?K.default().year(Number(t[1])).quarter(Number(t[2])):null}return K.default(e,t)},Ha=(e,t)=>e?K.default(e).format(t):"",_a=e=>""===e||null==e,Fa=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const l=t.split("|");let a="";for(let t=0,r=l.length;t<r;t++){a+=(null!==(n=e[l[t].trim()])&&void 0!==n?n:"")+(t===r-1?"":" | ")}return a},Da=(e,t,n)=>{for(const l in n)if(Object.keys(t).includes(l)&&t[l]!==n[l])if(t[l].includes("|")){const a=t[l].split("|"),r=n[l].split("|");a.forEach(((t,n)=>e[t]=e[r[n]]))}else e[t[l]]=e[n[l]]},$a=(e,t,n)=>{for(const l in n)if(Object.keys(t).includes(l)&&t[l]!==n[l])if(t[l].includes("|")){const a=t[l].split("|"),r=n[l].split("|");a.forEach(((t,n)=>e[t]=e[r[n]]))}else e[t[l]]=e[n[l]]},Ma=(e,t,n)=>e.map((e=>{const l={value:e[t],text:e[n]};return e.disabled&&(l.disabled=!0),e.isLeaf&&(l.isLeaf=!0),!g.isUndefined(e.selectable)&&(l.selectable=e.selectable),Array.isArray(e.children)&&(l.children=Ma(e.children,t,n)),l})),ja=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=ja(n.children,t);if(e)return e}}return null},qa=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const l=[];return e.forEach((e=>{e.value==t.split(",")[n]&&l.push(e),Array.isArray(e.children)&&l.push(...qa(e.children,t,n+1))})),l},Va=e=>Qe(e)||"string"==typeof e,Ka=e=>Qe(e)?fa(e).join(""):null!=e?e:"",za=(e,t,n,l)=>{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={[l?"textKey":t]:e.displayName[0],[l?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[l?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Ba={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 Wa="阿",Ua="鿿",Ga=1,Ya=2,Xa=3;let Qa,Za=null;function Ja(e){return e||null===Za?("object"==typeof Intl&&Intl.Collator?(Qa=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Za=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Za=!1,Za):Za}function er(e){const t=Ba.UNIHANS,n=Ba.PINYINS,l=Ba.EXCEPTIONS,a={source:e};if(e in l)return a.type=Ya,a.target=l[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Ga,a.target=e,a;if(r=Qa.compare(e,Wa),r<0)return a.type=Xa,a.target=e,a;if(0===r)a.type=Ya,i=0;else{if(r=Qa.compare(e,Ua),r>0)return a.type=Xa,a.target=e,a;0===r&&(a.type=Ya,i=t.length-1)}if(a.type=Ya,i<0){let n=0,l=t.length-1;for(;n<=l;){i=~~((n+l)/2);const a=t[i];if(r=Qa.compare(e,a),0===r)break;r>0?n=i+1:l=i-1}}return r<0&&i--,a.target=n[i],a.target||(a.type=Xa,a.target=a.source),a}function tr(e){return"string"==typeof e&&Ja()?e.split("").map((e=>er(e))):e}var nr={isSupported:Ja,parse:tr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ba)})))},genToken:er,convertToPinyin:(e,t,n)=>tr(e).map((e=>t&&e.type===Ya?e.target.toLowerCase():e.target)).join(n||"")};var lr={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)}};nr.isSupported()&&lr.shouldPatch(nr.genToken)&&nr.patchDict(lr);const ar=e=>{const{value:t,bordered:n}=e;return j.default.createElement(u.Input,{value:t,title:t,bordered:n,readOnly:!0})};ar.displayName="FormItemView";const{Option:rr}=u.Select,ir=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{fieldName:s,options:d={},style:c={},placeholder:f=we("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=e.option,{itemList:v=[],filterable:b=!0,listHeight:y=Ta,collapseTags:x,maxTagTextLength:E,openPyt:C=!0}=d,S=at(v)?l:v,w=e=>{var t;return a?S.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):(null===(t=S.find((t=>t.value===e)))||void 0===t?void 0:t.text)||""};return t.isOnlyShow?j.default.createElement(ar,{value:w(n),bordered:p}):j.default.createElement(u.Select,qe({value:n,mode:a?"multiple":void 0,popupClassName:`form-popper__${s}`,placeholder:f,style:c,loading:r,bordered:p,allowClear:h,disabled:g,showSearch:b,listHeight:y,maxTagCount:x?"responsive":void 0,maxTagTextLength:E},a?{title:w(n)}:null,{filterOption:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,w(e),S)})(e)}}),S.map((e=>j.default.createElement(rr,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class or 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:g=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(m)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(ir,{option:this.props.option,items:t,loading:n,multiple:this.props.multiple,onValuesChange:(t,n,l)=>{g(t,n,l),e.setViewValue(i,n)}}))),p&&j.default.createElement(u.Col,null,e.renderFormItemButton(i,p)),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}or.contextType=Ol;const sr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=wa,trueValue:p=Sa}=i,h=e=>we(e===p?"am.form.trueText":"am.form.falseText");return j.default.createElement(u.Checkbox,{checked:n===p,style:o,disabled:d||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==l||l(e),a(e,h(e))})(t?p:f)}},c?r:null)};class ur extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option,{labelToCheckbox:h}=i;return j.default.createElement(u.Form.Item,{label:h?" ":e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(sr,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ur.contextType=Ol;class dr extends e.Component{constructor(){super(...arguments),this.linkRef=j.default.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>Ye(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.saveFormFieldsConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const n=this.context.global,l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),this.resetFieldsHandle=e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||rt(e);return Object.assign(t,{hidden:e.hidden})}));this.changeHandle(t),this.setLocalFields(t)}}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));if(e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{var t;e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):(null===(t=this.context.global)||void 0===t?void 0:t.getComponentConfigApi)&&this.setLocalFields(this.props.items)})).catch((()=>{})),!e)return;return g.xor(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:n}=t,l=e.find((e=>e.fieldName===n));return l?(g.isUndefined(l.hidden)||(t.hidden=l.hidden),t):t})):e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return g.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));g.isEqual(t,n)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveFormFieldsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t([...e])}popupRender(){const{items:e}=this.props;return j.default.createElement(Ol.Consumer,null,(t=>{const n=t.$$form;return j.default.createElement("div",{className:ne.default("ant-dropdown-menu","fields-list")},j.default.createElement("div",{className:"reset"},j.default.createElement(ot,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(n.getOriginItems())},we("qm.table.columnFilter.reset"))),j.default.createElement(A.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const l=t.map((e=>e.fieldName)),a=e.map((e=>e.fieldName));if(g.isEqual(l,a))return;n.setExpandHandle(!0);const r=Ea(t);this.changeHandle(r),this.setLocalFields(r)}},e.map((t=>{var l;return j.default.createElement("li",{key:t.fieldName,className:"item",style:t.noAuth?{display:"none"}:void 0},j.default.createElement(u.Checkbox,{disabled:(null===(l=t.rules)||void 0===l?void 0:l.findIndex((e=>e.required)))>-1,checked:!t.hidden,onChange:n=>{const{checked:l}=n.target;t.hidden=!l,this.changeHandle(e),this.setLocalFields(e)}}),j.default.createElement(b.HolderOutlined,{className:"handle",title:we("qm.form.draggable")}),j.default.createElement("span",{className:"title"},n.getFormItemLabel(t.label)))}))))}))}render(){const{visible:e}=this.state,t=dt("form-fields-filter");return j.default.createElement(Ol.Consumer,null,(n=>{const{$size:l}=n.$$form,a={[t]:!0,[`${t}--lg`]:"large"===l,[`${t}--sm`]:"small"===l};return j.default.createElement(u.Dropdown,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:ne.default(a),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},j.default.createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},j.default.createElement(b.UnorderedListOutlined,null)))}))}}dr.contextType=xe;const cr=j.default.forwardRef(((e,t)=>{const{$$form:n}=j.default.useContext(Ol),{value:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},placeholder:s=we("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p,onBlur:h=Je,onEnter:m=Je}=e.option,{prefix:v,suffix:b,password:y,maxLength:x,pattern:E,toUpper:C,toTrim:S,autoFocus:w,autoComplete:T,secretType:N}=i,I=N&&(f||p),O=j.default.useRef(),R=e=>{null==a||a(e),r(e)},k=y?u.Input.Password:u.Input,P=I?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return 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}(l,N):l;return n.isOnlyShow?j.default.createElement(ar,{value:(e=>e&&y?new Array(e.length).fill("*").join(""):e)(P),bordered:d}):j.default.createElement(k,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:P,autoComplete:y?"new-password":T,autoFocus:w,placeholder:s,style:o,title:y?"":P,prefix:v,suffix:b,maxLength:x,bordered:d,allowClear:c,readOnly:f,disabled:p,onBlur:t=>{var n;let l=null!==(n=t.target.value)&&void 0!==n?n:"";if(S){const e=l.trim();l!==e&&(l=e,R(l))}(t=>{const{onBlur:n}=e;null==n||n(t)})(l),h(l)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:l}=e.target;m(l),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=O.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;g.isRegExp(E)&&(t=E.test(t)?t:null!=l?l:""),C&&(t=t.toUpperCase()),R(t)}})}));cr.displayName="VInput";class fr 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:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(cr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(a,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}fr.contextType=Ol;const pr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n=[],onChange:l,onValuesChange:a}=e,{options:r={},placeholder:i=we("qm.form.rangeInputNumberPlaceholder"),bordered:o=!0,allowClear:s,readOnly:d,disabled:c}=e.option,{prefix:f,suffix:p,maxLength:h}=r,m=e=>{const t=e.every((e=>!e))?[]:e;null==l||l(t),a(t,g(t))},g=e=>e.join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:g(n),bordered:o}):j.default.createElement(u.Input.Group,null,j.default.createElement(u.Input,{value:n[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:i[0],prefix:f,suffix:p,maxLength:h,allowClear:s,bordered:o,readOnly:d,disabled:c,onChange:e=>{const{value:t}=e.target;m([t,n[1]])}}),j.default.createElement(u.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:o,disabled:c,readOnly:!0}),j.default.createElement(u.Input,{value:n[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:i[1],prefix:f,suffix:p,maxLength:h,bordered:o,allowClear:s,readOnly:d,disabled:c,onChange:e=>{const{value:t}=e.target;m([n[0],t])}}))};class hr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:d,rules:c=[],onChange:f=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(o),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(i)},required:e.getFormItemRequired(c)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(pr,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;f(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(a,t)}}))),s&&j.default.createElement(u.Col,{flex:it(s.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}hr.contextType=Ol;const mr=j.default.forwardRef(((e,t)=>{const{$$form:n}=j.default.useContext(Ol),{value:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},placeholder:s=we("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:c,disabled:f,onBlur:p=Je,onEnter:h=Je}=e.option,{step:m=1,min:v,max:b,precision:y,autoFocus:x,stringMode:E,textAlign:C="left",controls:S=!0,formatter:w,parser:T}=i,N=j.default.useRef(),I=j.default.useRef(l),O=e=>{const t=_a(e)?"":g.isNumber(e)?e.toFixed(y):new ce.default(e).toFixed(y);return"function"==typeof w?w(t):t},R={[C]:!0,controls:S};return n.isOnlyShow?j.default.createElement(ar,{value:O(l),bordered:d}):j.default.createElement(u.InputNumber,{ref:e=>{N.current=e,"function"==typeof t&&t(e)},value:l,className:ne.default(R),placeholder:s,style:Object.assign({width:"100%"},o),step:m,min:v,max:b,controls:S,precision:y,autoFocus:x,stringMode:E,formatter:w,parser:T,bordered:d,readOnly:c,disabled:f,onBlur:()=>{nt((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(I.current),p(I.current)}))},onKeyUp:e=>{var t;13===e.keyCode&&(h(l),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=N.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{I.current=e,null==a||a(e),r(e,O(e))})(t)}})}));mr.displayName="VInputNumber";class gr 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:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(mr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(a,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}gr.contextType=Ol;const vr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n=[],onChange:l,onValuesChange:a}=e,{options:r={},placeholder:i=we("qm.form.rangeInputNumberPlaceholder"),bordered:o=!0,allowClear:s,readOnly:d,disabled:c}=e.option,{step:f=1,min:p=0,max:h,textAlign:m="left",controls:g=!0,precision:v,formatter:b,parser:y}=r,x=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),E(e)},E=e=>{const t=e.every((e=>null===e))?[]:[...e];null==l||l(t),a(t,C(t))},C=e=>_a(e)?"":e.map((e=>_a(e)?"":Number(e).toFixed(v))),S={[m]:!0,controls:g};return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:o}):j.default.createElement(u.Input.Group,null,j.default.createElement(u.InputNumber,{value:n[0],className:ne.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:i[0],step:f,min:p,max:h,controls:g,precision:v,formatter:b,parser:y,bordered:o,readOnly:d,disabled:c,onChange:e=>{E([e,n[1]])},onBlur:()=>{x(n)}}),j.default.createElement(u.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:o,disabled:c,readOnly:!0}),j.default.createElement(u.InputNumber,{value:n[1],className:ne.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:i[1],step:f,min:p,max:h,controls:g,precision:v,formatter:b,parser:y,bordered:o,readOnly:d,disabled:c,onChange:e=>{E([n[0],e])},onBlur:()=>{x(n)}}))};class br extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:d,rules:c=[],onChange:f=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(o),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(i)},required:e.getFormItemRequired(c)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(vr,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;f(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(a,t)}}))),s&&j.default.createElement(u.Col,{flex:it(s.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}var yr;br.contextType=Ol,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(yr||(yr={}));const{Search:xr}=u.Input;class Er extends e.Component{constructor(e){var t;super(e),t=this,this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,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:n,echoRequest:l}=this.searchHelper;if(t||Oe("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||Oe("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&Oe("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.searchHelper,l=""!==e?e:void 0,a=("function"==typeof n?n():n)||[],r={[t]:l};return(Array.isArray(a)?a:[a]).forEach((e=>{if(g.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](l):l;else r[e]=l})),r},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:l=et,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=g.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),a(this.createFilters(e))),{currentPage:1,pageSize:500});if(!l(s))return i();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=g.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(n)}else i()}catch(e){i(e)}finally{nt((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const l in this.alias){const a=Fa(e,this.alias[l]);void 0!==a&&(t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a))}for(const n in this.extras){const l=Fa(e,this.extras[n]);void 0!==l&&t.SET_FIELDS_EXTRA({[n]:l})}},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return Ye(t,void 0,void 0,(function*(){const{fieldName:t}=this.props.option,l=e.filter((e=>{var l;return null===(l=Fa(e,this.alias[t]))||void 0===l?void 0:l.toString().toLowerCase().includes(n.toLowerCase())}));if(1===l.length)return this.closeSearchHelper(l[0]);this.openSearchHelper(n)}))},this.openSearchHelper=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:l}=this.searchHelper,a=(null!=l?l:et)(n.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:n}=this.props.option;this._record=e;for(const l in this.alias)l!==n&&t.SET_FIELDS_VALUE({[l]:Fa(e,this.alias[l])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])});const l=Fa(e,this.alias[n]);this.triggerChange(l),this.searchHelperChangeHandle(l);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 n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:t}=this.context,{visible:n,loading:l}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:u={},placeholder:d=we("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:m,suffix:g,maxLength:v}=o,b={visible:n,title:we("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()}},y=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?j.default.createElement(ar,{value:a,bordered:c}):j.default.createElement(j.default.Fragment,null,j.default.createElement(xr,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:l,placeholder:d,style:u,prefix:m,suffix:g,maxLength:v,bordered:c,allowClear:f,readOnly:p,disabled:h,onBlur:e=>{var t;const{value:l}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(l),this._is_change&&!n&&(l?a?(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e,l))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(l):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!n&&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):nt((()=>this.clearSearchHelperValue())))}}),j.default.createElement(Il,b,j.default.createElement(vd,y)))}}Er.contextType=Ol;class Cr extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[]}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Er,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Cr.contextType=Ol;const Sr=t=>{class n extends e.Component{constructor(){var e;super(...arguments),e=this,this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,l;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(a))||(null===(l=this.$el)||void 0===l?void 0:l.contains(r)),s=this.$el===a,u=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=u.some((e=>null==e?void 0:e.contains(a)))||u.includes(r);let c;c=!(i||o||s||d),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}}componentDidMount(){this.event1=oe.default(document,"mousedown",this.mousedownHandler),this.event2=oe.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:n}=this.state;return j.default.createElement(t,qe({ref:e},this.props,{clickOutside:n,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${t.displayName||t.name})`,j.default.forwardRef(((e,t)=>j.default.createElement(n,qe({},e,{forwardedRef:t}))))};function wr(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Tr(e,t,n,l){var a=be.default.unstable_batchedUpdates?function(e){be.default.unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,a,l),{remove:function(){e.removeEventListener&&e.removeEventListener(t,a,l)}}}var Nr=e.forwardRef((function(t,n){var l=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(n,(function(){return{}}));var s=e.useRef(!1);return!s.current&&Qt()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==l||l(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e,t;null===(e=o.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(o.current)}}),[]),o.current?be.default.createPortal(r,o.current):null}));function Ir(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Or;function Rr(e){var t=e.prefixCls,n=e.motion,l=e.animation,a=e.transitionName;return n||(l?{motionName:"".concat(t,"-").concat(l)}:a?{motionName:a}:null)}function kr(e){var t=e.prefixCls,n=e.visible,l=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=yt({motionAppear:!0},Rr({motion:r,prefixCls:t,transitionName:o,animation:i}))),M.createElement(On,Rn({},s,{visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return M.createElement("div",{style:{zIndex:l},className:ne.default("".concat(t,"-mask"),n)})}))}function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pr(Object(n),!0).forEach((function(t){Hr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lr(e){return Lr="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},Lr(e)}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _r={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Fr(){if(void 0!==Or)return Or;Or="";var e=document.createElement("p").style;for(var t in _r)t+"Transform"in e&&(Or=t);return Or}function Dr(){return Fr()?"".concat(Fr(),"TransitionProperty"):"transitionProperty"}function $r(){return Fr()?"".concat(Fr(),"Transform"):"transform"}function Mr(e,t){var n=Dr();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function jr(e,t){var n=$r();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var qr,Vr=/matrix\((.*)\)/,Kr=/matrix3d\((.*)\)/;function zr(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Br(e,t,n){var l=n;if("object"!==Lr(t))return void 0!==l?("number"==typeof l&&(l="".concat(l,"px")),void(e.style[t]=l)):qr(e,t);for(var a in t)t.hasOwnProperty(a)&&Br(e,a,t[a])}function Wr(e,t){var n=e["page".concat(t?"Y":"X","Offset")],l="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var a=e.document;"number"!=typeof(n=a.documentElement[l])&&(n=a.body[l])}return n}function Ur(e){return Wr(e)}function Gr(e){return Wr(e,!0)}function Yr(e){var t=function(e){var t,n,l,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),l=Math.floor(t.top),{left:n-=i.clientLeft||r.clientLeft||0,top:l-=i.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,l=n.defaultView||n.parentWindow;return t.left+=Ur(l),t.top+=Gr(l),t}function Xr(e){return null!=e&&e==e.window}function Qr(e){return Xr(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Zr=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Jr=/^(top|right|bottom|left)$/,ei="currentStyle",ti="runtimeStyle",ni="left";function li(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function ai(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function ri(e,t,n){"static"===Br(e,"position")&&(e.style.position="relative");var l=-999,a=-999,r=li("left",n),i=li("top",n),o=ai(r),s=ai(i);"left"!==r&&(l=999),"top"!==i&&(a=999);var u,d="",c=Yr(e);("left"in t||"top"in t)&&(d=(u=e).style.transitionProperty||u.style[Dr()]||"",Mr(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(l,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),zr(e);var f=Yr(e),p={};for(var h in t)if(t.hasOwnProperty(h)){var m=li(h,n),g="left"===h?l:a,v=c[h]-f[h];p[m]=m===h?g+v:g-v}Br(e,p),zr(e),("left"in t||"top"in t)&&Mr(e,d);var b={};for(var y in t)if(t.hasOwnProperty(y)){var x=li(y,n),E=t[y]-c[y];b[x]=y===x?p[x]+E:p[x]-E}Br(e,b)}function ii(e,t){var n=Yr(e),l=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue($r());if(n&&"none"!==n){var l=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(l[12]||l[4],0),y:parseFloat(l[13]||l[5],0)}}return{x:0,y:0}}(e),a={x:l.x,y:l.y};"left"in t&&(a.x=l.x+t.left-n.left),"top"in t&&(a.y=l.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),l=n.getPropertyValue("transform")||n.getPropertyValue($r());if(l&&"none"!==l){var a,r=l.match(Vr);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,jr(e,"matrix(".concat(a.join(","),")"))):((a=l.match(Kr)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,jr(e,"matrix3d(".concat(a.join(","),")")))}else jr(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function oi(e,t){for(var n=0;n<e.length;n++)t(e[n])}function si(e){return"border-box"===qr(e,"boxSizing")}"undefined"!=typeof window&&(qr=window.getComputedStyle?function(e,t,n){var l=n,a="",r=Qr(e);return(l=l||r.defaultView.getComputedStyle(e,null))&&(a=l.getPropertyValue(t)||l[t]),a}:function(e,t){var n=e[ei]&&e[ei][t];if(Zr.test(n)&&!Jr.test(t)){var l=e.style,a=l[ni],r=e[ti][ni];e[ti][ni]=e[ei][ni],l[ni]="fontSize"===t?"1em":n||0,n=l.pixelLeft+"px",l[ni]=a,e[ti][ni]=r}return""===n?"auto":n});var ui=["margin","border","padding"],di=-1,ci=2,fi=1;function pi(e,t,n){var l,a,r,i=0;for(a=0;a<t.length;a++)if(l=t[a])for(r=0;r<n.length;r++){var o=void 0;o="border"===l?"".concat(l).concat(n[r],"Width"):l+n[r],i+=parseFloat(qr(e,o))||0}return i}var hi={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 mi(e,t,n){var l=n;if(Xr(e))return"width"===t?hi.viewportWidth(e):hi.viewportHeight(e);if(9===e.nodeType)return"width"===t?hi.docWidth(e):hi.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=si(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=qr(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===l&&(l=i?fi:di);var s=void 0!==r||i,u=r||o;return l===di?s?u-pi(e,["border","padding"],a):o:s?l===fi?u:u+(l===ci?-pi(e,["border"],a):pi(e,["margin"],a)):o+pi(e,ui.slice(l),a)}oi(["Width","Height"],(function(e){hi["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],hi["viewport".concat(e)](n))},hi["viewport".concat(e)]=function(t){var n="client".concat(e),l=t.document,a=l.body,r=l.documentElement[n];return"CSS1Compat"===l.compatMode&&r||a&&a[n]||r}}));var gi={position:"absolute",visibility:"hidden",display:"block"};function vi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var l,a=t[0];return 0!==a.offsetWidth?l=mi.apply(void 0,t):function(e,t,n){var l,a={},r=e.style;for(l in t)t.hasOwnProperty(l)&&(a[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=a[l])}(a,gi,(function(){l=mi.apply(void 0,t)})),l}function bi(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}oi(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);hi["outer".concat(t)]=function(t,n){return t&&vi(t,e,n?0:fi)};var n="width"===e?["Left","Right"]:["Top","Bottom"];hi[e]=function(t,l){var a=l;return void 0!==a?t?(si(t)&&(a+=pi(t,["padding","border"],n)),Br(t,e,a)):void 0:t&&vi(t,e,di)}}));var yi={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Qr,offset:function(e,t,n){if(void 0===t)return Yr(e);!function(e,t,n){if(n.ignoreShake){var l=Yr(e),a=l.left.toFixed(0),r=l.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}n.useCssRight||n.useCssBottom?ri(e,t,n):n.useCssTransform&&$r()in document.body.style?ii(e,t):ri(e,t,n)}(e,t,n||{})},isWindow:Xr,each:oi,css:Br,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:bi,getWindowScrollLeft:function(e){return Ur(e)},getWindowScrollTop:function(e){return Gr(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)yi.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};bi(yi,hi);var xi=yi.getParent;function Ei(e){if(yi.isWindow(e)||9===e.nodeType)return null;var t,n=yi.getDocument(e).body,l=yi.css(e,"position");if(!("fixed"===l||"absolute"===l))return"html"===e.nodeName.toLowerCase()?null:xi(e);for(t=xi(e);t&&t!==n&&9!==t.nodeType;t=xi(t))if("static"!==(l=yi.css(t,"position")))return t;return null}var Ci=yi.getParent;function Si(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},l=Ei(e),a=yi.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;l;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===l.clientWidth||l===i||l===o||"visible"===yi.css(l,"overflow")){if(l===i||l===o)break}else{var s=yi.offset(l);s.left+=l.clientLeft,s.top+=l.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+l.clientWidth),n.bottom=Math.min(n.bottom,s.top+l.clientHeight),n.left=Math.max(n.left,s.left)}l=Ei(l)}var u=null;yi.isWindow(e)||9===e.nodeType||(u=e.style.position,"absolute"===yi.css(e,"position")&&(e.style.position="fixed"));var d=yi.getWindowScrollLeft(r),c=yi.getWindowScrollTop(r),f=yi.viewportWidth(r),p=yi.viewportHeight(r),h=o.scrollWidth,m=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(h=r.innerWidth),"hidden"===g.overflowY&&(m=r.innerHeight),e.style&&(e.style.position=u),t||function(e){if(yi.isWindow(e)||9===e.nodeType)return!1;var t=yi.getDocument(e),n=t.body,l=null;for(l=Ci(e);l&&l!==n&&l!==t;l=Ci(l))if("fixed"===yi.css(l,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,c),n.right=Math.min(n.right,d+f),n.bottom=Math.min(n.bottom,c+p);else{var v=Math.max(h,d+f);n.right=Math.min(n.right,v);var b=Math.max(m,c+p);n.bottom=Math.min(n.bottom,b)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function wi(e){var t,n,l;if(yi.isWindow(e)||9===e.nodeType){var a=yi.getWindow(e);t={left:yi.getWindowScrollLeft(a),top:yi.getWindowScrollTop(a)},n=yi.viewportWidth(a),l=yi.viewportHeight(a)}else t=yi.offset(e),n=yi.outerWidth(e),l=yi.outerHeight(e);return t.width=n,t.height=l,t}function Ti(e,t){var n=t.charAt(0),l=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===n?o+=r/2:"b"===n&&(o+=r),"c"===l?i+=a/2:"r"===l&&(i+=a),{left:i,top:o}}function Ni(e,t,n,l,a){var r=Ti(t,n[1]),i=Ti(e,n[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+l[0]-a[0]),top:Math.round(e.top-o[1]+l[1]-a[1])}}function Ii(e,t,n){return e.left<n.left||e.left+t.width>n.right}function Oi(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Ri(e,t,n){var l=[];return yi.each(e,(function(e){l.push(e.replace(t,(function(e){return n[e]})))})),l}function ki(e,t){return e[t]=-e[t],e}function Pi(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Ai(e,t){e[0]=Pi(e[0],t.width),e[1]=Pi(e[1],t.height)}function Li(e,t,n,l){var a=n.points,r=n.offset||[0,0],i=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;r=[].concat(r),i=[].concat(i);var u={},d=0,c=Si(s,!(!(o=o||{})||!o.alwaysByViewport)),f=wi(s);Ai(r,f),Ai(i,t);var p=Ni(f,t,a,r,i),h=yi.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&l){if(o.adjustX&&Ii(p,f,c)){var m=Ri(a,/[lr]/gi,{l:"r",r:"l"}),g=ki(r,0),v=ki(i,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(Ni(f,t,m,g,v),f,c)||(d=1,a=m,r=g,i=v)}if(o.adjustY&&Oi(p,f,c)){var b=Ri(a,/[tb]/gi,{t:"b",b:"t"}),y=ki(r,1),x=ki(i,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(Ni(f,t,b,y,x),f,c)||(d=1,a=b,r=y,i=x)}d&&(p=Ni(f,t,a,r,i),yi.mix(h,p));var E=Ii(p,f,c),C=Oi(p,f,c);if(E||C){var S=a;E&&(S=Ri(a,/[lr]/gi,{l:"r",r:"l"})),C&&(S=Ri(a,/[tb]/gi,{t:"b",b:"t"})),a=S,r=n.offset||[0,0],i=n.targetOffset||[0,0]}u.adjustX=o.adjustX&&E,u.adjustY=o.adjustY&&C,(u.adjustX||u.adjustY)&&(h=function(e,t,n,l){var a=yi.clone(e),r={width:t.width,height:t.height};return l.adjustX&&a.left<n.left&&(a.left=n.left),l.resizeWidth&&a.left>=n.left&&a.left+r.width>n.right&&(r.width-=a.left+r.width-n.right),l.adjustX&&a.left+r.width>n.right&&(a.left=Math.max(n.right-r.width,n.left)),l.adjustY&&a.top<n.top&&(a.top=n.top),l.resizeHeight&&a.top>=n.top&&a.top+r.height>n.bottom&&(r.height-=a.top+r.height-n.bottom),l.adjustY&&a.top+r.height>n.bottom&&(a.top=Math.max(n.bottom-r.height,n.top)),yi.mix(a,r)}(p,f,c,u))}return h.width!==f.width&&yi.css(s,"width",yi.width(s)+h.width-f.width),h.height!==f.height&&yi.css(s,"height",yi.height(s)+h.height-f.height),yi.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:u}}function Hi(e,t,n){var l=n.target||t,a=wi(l),r=!function(e,t){var n=Si(e,t),l=wi(e);return!n||l.left+l.width<=n.left||l.top+l.height<=n.top||l.left>=n.right||l.top>=n.bottom}(l,n.overflow&&n.overflow.alwaysByViewport);return Li(e,a,n,r)}Hi.__getOffsetParent=Ei,Hi.__getVisibleRectForElement=Si;var _i={},Fi=[];function Di(e,t){if(!e&&void 0!==console){var n=Fi.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function $i(e,t){if(!e&&void 0!==console){var n=Fi.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function Mi(e,t,n){t||_i[n]||(e(!1,n),_i[n]=!0)}function ji(e,t){Mi(Di,e,t)}ji.preMessage=function(e){Fi.push(e)},ji.resetWarned=function(){_i={}},ji.noteOnce=function(e,t){Mi($i,e,t)};var qi=Qt()?M.useLayoutEffect:M.useEffect;function Vi(e,t){var n=null,l=null;var a=new re.default((function(e){var a=Et(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),u=Math.floor(o);n===s&&l===u||Promise.resolve().then((function(){t({width:s,height:u})})),n=s,l=u}}));return e&&a.observe(e),function(){a.disconnect()}}function Ki(e){return"function"!=typeof e?null:e()}function zi(e){return"object"===mt(e)&&e?e:null}var Bi=function(e,t){var n=e.children,l=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,u=void 0===s?0:s,d=j.default.useRef({}),c=j.default.useRef(),f=j.default.Children.only(n),p=j.default.useRef({});p.current.disabled=l,p.current.target=a,p.current.align=r,p.current.onAlign=i;var h=function(e,t){var n=j.default.useRef(!1),l=j.default.useRef(null);function a(){window.clearTimeout(l.current)}return[function r(i){if(a(),n.current&&!0!==i)l.current=window.setTimeout((function(){n.current=!1,r()}),t);else{if(!1===e(i))return;n.current=!0,l.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,n=e.target,l=e.align,a=e.onAlign,r=c.current;if(!t&&n&&r){var i,o=Ki(n),s=zi(n);d.current.element=o,d.current.point=s,d.current.align=l;var u=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,l=t.height;if(n||l)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Hi(r,o,l):s&&(i=function(e,t,n){var l,a,r=yi.getDocument(e),i=r.defaultView||r.parentWindow,o=yi.getWindowScrollLeft(i),s=yi.getWindowScrollTop(i),u=yi.viewportWidth(i),d=yi.viewportHeight(i),c={left:l="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=l>=0&&l<=o+u&&a>=0&&a<=s+d,p=[n.points[0],"cc"];return Li(e,c,Ar(Ar({},n),{},{points:p}),f)}(r,s,l)),function(e,t){e!==document.activeElement&&wr(t,e)&&"function"==typeof e.focus&&e.focus()}(u,r),a&&i&&a(r,i),!0}return!1}),u),m=Et(h,2),g=m[0],v=m[1],b=Et(j.default.useState(),2),y=b[0],x=b[1],E=Et(j.default.useState(),2),C=E[0],S=E[1];return qi((function(){x(Ki(a)),S(zi(a))})),j.default.useEffect((function(){var e,t;d.current.element===y&&((e=d.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=l.has(t);if(ji(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(n&&r>1)return!1;l.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"===mt(t)&&"object"===mt(a)){var u=Object.keys(t);return u.length===Object.keys(a).length&&u.every((function(n){return e(t[n],a[n],o)}))}return!1}(e,t)}(d.current.align,r)||g()})),j.default.useEffect((function(){return Vi(c.current,g)}),[c.current]),j.default.useEffect((function(){return Vi(y,g)}),[y]),j.default.useEffect((function(){l?v():g()}),[l]),j.default.useEffect((function(){if(o)return Tr(window,"resize",g).remove}),[o]),j.default.useEffect((function(){return function(){v()}}),[]),j.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),j.default.isValidElement(f)&&(f=j.default.cloneElement(f,{ref:It(f.ref,c)})),f},Wi=j.default.forwardRef(Bi);function Ui(){Ui=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,l=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new T(a||[]);return l(i,"_invoke",{value:E(e,n,o)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function f(){}function p(){}function h(){}var m={};s(m,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(N([])));v&&v!==t&&n.call(v,r)&&(m=v);var b=h.prototype=f.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(l,r,i,o){var s=d(e[l],e,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==mt(c)&&n.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){u.value=e,i(u)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;l(this,"_invoke",{value:function(e,n){function l(){return new t((function(t,l){a(e,n,t,l)}))}return r=r?r.then(l,l):l()}})}function E(e,t,n){var l="suspendedStart";return function(a,r){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===a)throw r;return I()}for(n.method=a,n.arg=r;;){var i=n.delegate;if(i){var o=C(i,n);if(o){if(o===c)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===l)throw l="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);l="executing";var s=d(e,t,n);if("normal"===s.type){if(l=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(l="completed",n.method="throw",n.arg=s.arg)}}}function C(e,t){var n=t.method,l=e.iterator[n];if(void 0===l)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),c;var a=d(l,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 S(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 w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function N(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 l=-1,a=function t(){for(;++l<e.length;)if(n.call(e,l))return t.value=e[l],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=h,l(b,"constructor",{value:h,configurable:!0}),l(h,"constructor",{value:p,configurable:!0}),p.displayName=s(h,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,h):(e.__proto__=h,s(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},y(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,l,a,r){void 0===r&&(r=Promise);var i=new x(u(t,n,l,a),r);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},y(b),s(b,o,"Generator"),s(b,r,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var l in t)n.push(l);return n.reverse(),function e(){for(;n.length;){var l=n.pop();if(l in t)return e.value=l,e.done=!1,e}return e.done=!0,e}},e.values=N,T.prototype={constructor:T,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(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function l(n,l){return i.type="throw",i.arg=e,t.next=n,l&&(t.method="next",t.arg=void 0),!!l}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return l("end");if(r.tryLoc<=this.prev){var o=n.call(r,"catchLoc"),s=n.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return l(r.catchLoc,!0);if(this.prev<r.finallyLoc)return l(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return l(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return l(r.finallyLoc)}}}},abrupt:function(e,t){for(var l=this.tryEntries.length-1;l>=0;--l){var a=this.tryEntries[l];if(a.tryLoc<=this.prev&&n.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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var l=n.completion;if("throw"===l.type){var a=l.arg;w(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function Gi(e,t,n,l,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(l,a)}function Yi(e){return function(){var t=this,n=arguments;return new Promise((function(l,a){var r=e.apply(t,n);function i(e){Gi(r,l,a,i,o,"next",e)}function o(e){Gi(r,l,a,i,o,"throw",e)}i(void 0)}))}}Wi.displayName="Align";var Xi=["measure","alignPre","align",null,"motion"],Qi=M.forwardRef((function(t,n){var l=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,u=t.stretch,d=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,h=t.getRootDomNode,m=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,b=t.onMouseLeave,y=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),S=e.useRef(),w=Et(e.useState(),2),T=w[0],N=w[1],I=function(e){var t=Et(M.useState({width:0,height:0}),2),n=t[0],l=t[1];return[M.useMemo((function(){var t={};if(e){var l=n.width,a=n.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&l?t.width=l:-1!==e.indexOf("minWidth")&&l&&(t.minWidth=l)}return t}),[e,n]),function(e){var t=e.offsetWidth,n=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(n-i)<1&&(t=r,n=i),l({width:t,height:n})}]}(u),O=Et(I,2),R=O[0],k=O[1];var P=function(t,n){var l=Et(jt(null),2),a=l[0],r=l[1],i=e.useRef();function o(e){r(e,!0)}function s(){En.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&n(),a&&(i.current=En(Yi(Ui().mark((function e(){var t,n;return Ui().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Xi.indexOf(a),(n=Xi[t+1])&&-1!==t&&o(n);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=En((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(l,(function(){u&&k(h())})),A=Et(P,2),L=A[0],H=A[1],_=Et(e.useState(0),2),F=_[0],D=_[1],$=e.useRef();function j(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function q(e,t){var n=m(t);T!==n&&N(n),D((function(e){return e+1})),"align"===L&&(null==g||g(e,t))}qi((function(){"alignPre"===L&&D(0)}),[L]),qi((function(){"align"===L&&(F<3?j():H((function(){var e;null===(e=$.current)||void 0===e||e.call($)})))}),[F]);var V=yt({},Rr(t));function K(){return new Promise((function(e){$.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=V[e];V[e]=function(e,n){return H(),null==t?void 0:t(e,n)}})),M.useEffect((function(){V.motionName||"motion"!==L||H()}),[V.motionName,L]),M.useImperativeHandle(n,(function(){return{forceAlign:j,getElement:function(){return S.current}}}));var z=yt(yt({},R),{},{zIndex:s,opacity:"motion"!==L&&"stable"!==L&&l?0:void 0,pointerEvents:l||"stable"===L?void 0:"none"},i),B=!0;null==f||!f.points||"align"!==L&&"stable"!==L||(B=!1);var W=o;return M.Children.count(o)>1&&(W=M.createElement("div",{className:"".concat(a,"-content")},o)),M.createElement(On,Rn({visible:l,ref:S,leavedClassName:"".concat(a,"-hidden")},V,{onAppearPrepare:K,onEnterPrepare:K,removeOnLeave:d,forceRender:c}),(function(e,t){var n=e.className,l=e.style,i=ne.default(a,r,T,n);return M.createElement(Wi,{target:p||h,key:"popup",ref:C,monitorWindowResize:!0,disabled:B,align:f,onAlign:q},M.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:b,onMouseDownCapture:y,onTouchStartCapture:x,onClick:E,style:yt(yt({},l),z)},W))}))}));Qi.displayName="PopupInner";var Zi=M.forwardRef((function(e,t){var n=e.prefixCls,l=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,u=i.popupMotion,d=void 0===u?{}:u,c=i.popupRender,f=e.onClick,p=M.useRef();M.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var h=yt({zIndex:a},s),m=r;return M.Children.count(r)>1&&(m=M.createElement("div",{className:"".concat(n,"-content")},r)),c&&(m=c(m)),M.createElement(On,Rn({visible:l,ref:p,removeOnLeave:!0},d),(function(e,t){var l=e.className,a=e.style,r=ne.default(n,o,l);return M.createElement("div",{ref:t,className:r,onClick:f,style:yt(yt({},a),h)},m)}))}));Zi.displayName="MobilePopupInner";var Ji=["visible","mobile"],eo=M.forwardRef((function(t,n){var l=t.visible,a=t.mobile,r=Rt(t,Ji),i=Et(e.useState(l),2),o=i[0],s=i[1],u=Et(e.useState(!1),2),d=u[0],c=u[1],f=yt(yt({},r),{},{visible:o});e.useEffect((function(){s(l),l&&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))}())}),[l,a]);var p=d?M.createElement(Zi,Rn({},f,{mobile:a,ref:n})):M.createElement(Qi,Rn({},f,{ref:n}));return M.createElement("div",null,M.createElement(kr,f),p)}));eo.displayName="Popup";var to=M.createContext(null);function no(){}function lo(){return""}function ao(e){return e?e.ownerDocument:window.document}var ro=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var io=function(e){var t=function(t){_t(l,M.Component);var n=$t(l);function l(e){var t,a;return Pt(this,l),vt(Dt(t=n.call(this,e)),"popupRef",M.createRef()),vt(Dt(t),"triggerRef",M.createRef()),vt(Dt(t),"portalContainer",void 0),vt(Dt(t),"attachId",void 0),vt(Dt(t),"clickOutsideHandler",void 0),vt(Dt(t),"touchOutsideHandler",void 0),vt(Dt(t),"contextMenuOutsideHandler1",void 0),vt(Dt(t),"contextMenuOutsideHandler2",void 0),vt(Dt(t),"mouseDownTimeout",void 0),vt(Dt(t),"focusTime",void 0),vt(Dt(t),"preClickTime",void 0),vt(Dt(t),"preTouchTime",void 0),vt(Dt(t),"delayTimer",void 0),vt(Dt(t),"hasPopupMouseDown",void 0),vt(Dt(t),"onMouseEnter",(function(e){var n=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,n,n?null:e)})),vt(Dt(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),vt(Dt(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),vt(Dt(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),vt(Dt(t),"onPopupMouseLeave",(function(e){var n;e.relatedTarget&&!e.relatedTarget.setTimeout&&wr(null===(n=t.popupRef.current)||void 0===n?void 0:n.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),vt(Dt(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),vt(Dt(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),vt(Dt(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),vt(Dt(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),vt(Dt(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),vt(Dt(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),vt(Dt(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var n;if(t.preClickTime&&t.preTouchTime?n=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?n=t.preClickTime:t.preTouchTime&&(n=t.preTouchTime),Math.abs(n-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 l=!t.state.popupVisible;(t.isClickToHide()&&!l||l&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),vt(Dt(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)})),vt(Dt(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var n=e.target,l=t.getRootDomNode(),a=t.getPopupDomNode();wr(l,n)&&!t.isContextMenuOnly()||wr(a,n)||t.hasPopupMouseDown||t.close()}})),vt(Dt(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var n=Ct(t.triggerRef.current);if(n)return n}catch(e){}return be.default.findDOMNode(Dt(t))})),vt(Dt(t),"getPopupClassNameFromAlign",(function(e){var n=[],l=t.props,a=l.popupPlacement,r=l.builtinPlacements,i=l.prefixCls,o=l.alignPoint,s=l.getPopupClassNameFromAlign;return a&&r&&n.push(function(e,t,n,l){for(var a=n.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(Ir(e[o].points,a,l))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&n.push(s(e)),n.join(" ")})),vt(Dt(t),"getComponent",(function(){var e=t.props,n=e.prefixCls,l=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,u=e.popupStyle,d=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,h=e.zIndex,m=e.popup,g=e.stretch,v=e.alignPoint,b=e.mobile,y=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,S=E.point,w=t.getPopupAlign(),T={};return t.isMouseEnterToShow()&&(T.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(T.onMouseLeave=t.onPopupMouseLeave),T.onMouseDown=t.onPopupMouseDown,T.onTouchStart=t.onPopupMouseDown,M.createElement(eo,Rn({prefixCls:n,destroyPopupOnHide:l,visible:C,point:v&&S,className:a,align:w,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},T,{stretch:g,getRootDomNode:t.getRootDomNode,style:u,mask:d,zIndex:h,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:b,forceRender:y,onClick:x}),"function"==typeof m?m():m)})),vt(Dt(t),"attachParent",(function(e){En.cancel(t.attachId);var n,l=t.props,a=l.getPopupContainer,r=l.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(n=a(i)):n=r(t.getRootDomNode()).body,n?n.appendChild(e):t.attachId=En((function(){t.attachParent(e)}))})),vt(Dt(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})),vt(Dt(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),vt(Dt(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),vt(Dt(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},ro.forEach((function(e){t["fire".concat(e)]=function(n){t.fireEvents(e,n)}})),t}return Lt(l,[{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=Tr(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Tr(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Tr(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Tr(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),En.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,l=e.builtinPlacements;return t&&l?function(e,t,n){return yt(yt({},e[t]||{}),n)}(l,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,l=this.state.popupVisible;this.clearDelayTimer(),l!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:l}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var l=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){l.setPopupVisible(e,r),l.clearDelayTimer()}),a)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var l=this.props[e];l&&l(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,n=this.props,l=n.children,a=n.forceRender,r=n.alignPoint,i=n.className,o=n.autoDestroy,s=M.Children.only(l),u={key:"trigger"};this.isContextMenuToShow()?u.onContextMenu=this.onContextMenu:u.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(u.onClick=this.onClick,u.onMouseDown=this.onMouseDown,u.onTouchStart=this.onTouchStart):(u.onClick=this.createTwoChains("onClick"),u.onMouseDown=this.createTwoChains("onMouseDown"),u.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(u.onMouseEnter=this.onMouseEnter,r&&(u.onMouseMove=this.onMouseMove)):u.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?u.onMouseLeave=this.onMouseLeave:u.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(u.onFocus=this.onFocus,u.onBlur=this.onBlur):(u.onFocus=this.createTwoChains("onFocus"),u.onBlur=this.createTwoChains("onBlur"));var d=ne.default(s&&s.props&&s.props.className,i);d&&(u.className=d);var c=yt({},u);Ot(s)&&(c.ref=It(this.triggerRef,s.ref));var f,p=M.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=M.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),M.createElement(to.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,l={};return void 0!==n&&t.popupVisible!==n&&(l.popupVisible=n,l.prevPopupVisible=t.popupVisible),l}}]),l}();return vt(t,"contextType",to),vt(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:lo,getDocument:ao,onPopupVisibleChange:no,afterPopupVisibleChange:no,onPopupAlign:no,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}(Nr);let oo=class extends e.Component{constructor(e){var t;super(e),t=this,this.searchRef=j.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:l}=t.alias;t.setRecords(g.uniqBy([...t._records.filter((e=>n.includes(e[l]))),...e],l));const a=t.recordsToDict();t.setItemList(a),t.triggerChange(a.map((e=>e.value)));const{closed:r}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(t._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:l}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[l])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:l=[],clickOutside:a}=this.props;g.isEqual(g.intersection(n,l),l)||g.isEqual(l,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:n,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,callback:s,fieldAliasMap:u}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof u?u():u||{},{value:c}=this.props;if(a&&!at(c)){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=g.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==l&&(e[l]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[n]})));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,n;const{$$form:l}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:d,options:c={},searchHelper:f={},style:p={},placeholder:h=we("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:v=!0,readOnly:y,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,S={visible:a,title:we("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${yr[l.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:l.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:g.merge({},f.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),T=o.filter((e=>null==s?void 0:s.includes(e.value))),N=j.default.createElement("ul",{className:"ant-dropdown-menu"},T.length?T.map((e=>j.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):j.default.createElement("li",{className:"ant-dropdown-menu-item"},we("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=dt("form-multiple-search-helper"),{size:R}=l.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return l.isOnlyShow?j.default.createElement(ar,{value:P,bordered:m}):j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},j.default.createElement(io,{popupVisible:!x&&r,popup:N,popupClassName:ne.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ia,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:s,placeholder:h,loading:i,bordered:m,allowClear:v,disabled:x,style:Object.assign({width:"100%"},p),title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const l=e.target;l.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,l),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:x,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),j.default.createElement(Il,S,j.default.createElement(vd,w)))}};oo.contextType=Ol,oo=Ge([Sr],oo);class so extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(oo,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{m(t,l),e.setViewValue(r,n)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}so.contextType=Ol;const{Search:uo}=u.Input;class co extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,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:n,echoRequest:l}=this.searchHelper;if(t||Oe("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||Oe("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&Oe("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.props.option;for(const l in this.alias){const a=Fa(e,this.alias[l]);t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])})},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const l in this.alias)l!==n&&t.SET_FIELDS_VALUE({[l]:Fa(e,this.alias[l])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])});const l=Fa(e,this.alias[n]);this.triggerChange(l);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 n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:t}=this.context,{visible:n,loading:l}=this.state,{value:a=""}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:u={},placeholder:d=we("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:m,suffix:v,maxLength:b}=o,y={visible:n,title:we("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:g.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return t.isOnlyShow?j.default.createElement(ar,{value:a,bordered:c}):j.default.createElement(j.default.Fragment,null,j.default.createElement(uo,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:l,placeholder:d,style:u,prefix:m,suffix:v,maxLength:b,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())}}),j.default.createElement(Il,y,j.default.createElement(Ed,x)))}}co.contextType=Ol;class fo extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(co,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}fo.contextType=Ol;let po=class extends e.Component{constructor(e){var t;super(e),t=this,this.searchRef=j.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:l}=t.alias;t.setRecords(g.uniqBy([...t._records.filter((e=>n.includes(e[l]))),...e],l));const a=t.recordsToDict();t.setItemList(a),t.triggerChange(a.map((e=>e.value)));const{closed:r}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(t._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:l}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[l])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:l=[],clickOutside:a}=this.props;g.isEqual(g.intersection(n,l),l)||g.isEqual(l,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:n,valueKey:l}=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)||{},u="function"==typeof s?s():s||{},{value:d}=this.props;if(a&&!at(d)){this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:d})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=g.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==l&&(e[l]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==n&&(e[n]=e[u.textKey])})),a=a.filter((e=>d.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[n]})));this.setRecords(a),this.setItemList(r),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:l}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:d,options:c={},searchHelper:f={},style:p={},placeholder:h=we("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:v=!0,readOnly:y,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,S={visible:a,title:we("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${yr[l.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:l.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:g.merge({},f.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),T=o.filter((e=>null==s?void 0:s.includes(e.value))),N=j.default.createElement("ul",{className:"ant-dropdown-menu"},T.length?T.map((e=>j.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):j.default.createElement("li",{className:"ant-dropdown-menu-item"},we("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=dt("form-multiple-tree-table-helper"),{size:R}=l.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return l.isOnlyShow?j.default.createElement(ar,{value:P,bordered:m}):j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},j.default.createElement(io,{popupVisible:!x&&r,popup:N,popupClassName:ne.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ia,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:s,placeholder:h,loading:i,bordered:m,allowClear:v,disabled:x,style:Object.assign({width:"100%"},p),title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const l=e.target;l.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,l),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:x,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),j.default.createElement(Il,S,j.default.createElement(Ed,w)))}};po.contextType=Ol,po=Ge([Sr],po);class ho extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(po,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{m(t,l),e.setViewValue(r,n)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}ho.contextType=Ol;const mo=new Array(2).fill("");class go extends e.Component{constructor(e){var t;super(e),t=this,this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:mo},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(mo),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,l=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(l),this.setTextValue(l.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:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:at(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:l=et,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=g.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),a(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!l(s))return i();this.setState({loading:!0});const e=yield t.fetch.api(s);if(nt((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=g.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return r(n)}}catch(e){this.setState({loading:!1})}i()}))))},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ye(t,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,l=e.filter((e=>{var l;const a=null===(l=e[n])||void 0===l?void 0:l.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===l.length)return this.closeSearchHelper(l);this.openSearchHelper()}))},this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;g.isEqual(g.intersection(t,n),n)||g.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:l}=this.context,{fieldName:a}=this.props.option;if(!g.isEqual(l[a],this._ceho_data)&&(this._ceho_data=l[a],this.setItemList(l[a]),n.length)){const e=mo.map(((e,t)=>{var r,i;return null!==(i=null===(r=l[a].find((e=>e.value===n[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:n}=this.alias,{fetchApi:l,params:a={},formatter:r=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:u}=this.props;if(l&&!at(u)){this.setState({loading:!0});try{const o=yield l(r(Object.assign(Object.assign({},a),{keys:u})));if(200===o.code){let l=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,i))&&void 0!==e?e:[];l.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),l=l.filter((e=>u.includes(e[n]))).slice(0,2);const a=l.map((e=>({value:e[n],text:e[t]})));this.setRecords(l),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:n,loading:l,textValue:a}=this.state,{fieldName:r,options:i={},searchHelper:o={},placeholder:s=we("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:c,disabled:f}=this.props.option,{onlySelect:p=!0}=this.searchHelper||o,h={visible:n,title:we("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()}},m=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${r}`:"",initialValue:g.merge({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?j.default.createElement(ar,{value:a.join(" - "),bordered:d}):j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input.Group,null,j.default.createElement(u.Input,{value:a[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],allowClear:!1,bordered:d,readOnly:c,disabled:f,onBlur:e=>{var t,l;const{value:r}=e.target;this._is_change&&!n&&(r?a.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.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]]))}}),j.default.createElement(u.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}),j.default.createElement(u.Input.Search,{value:a[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],loading:l,bordered:d,allowClear:!0,readOnly:c,disabled:f,onBlur:e=>{var t,l;const{value:r}=e.target;this._is_change&&!n&&(r?a.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.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()))}})),j.default.createElement(Il,h,j.default.createElement(Td,m)))}}go.contextType=Ol;class vo extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(s),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(go,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{h(t,l),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},d)))))}}vo.contextType=Ol;const bo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:d,disabled:c}=e.option,{itemList:f=[]}=i,p=at(f)?l:f,h=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?j.default.createElement(ar,{value:h(n),bordered:s}):j.default.createElement(u.Checkbox.Group,{value:n,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,h(e))})(e)}},p.map((e=>j.default.createElement(u.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class yo extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n)try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(bo,{option:this.props.option,items:t,onValuesChange:(t,n)=>{h(t),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}yo.contextType=Ol;const xo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:s,disabled:d=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,h=e=>p?p[Math.ceil(e)-1]:e.toString();return j.default.createElement(u.Rate,{value:n,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:d||t.isOnlyShow,onChange:e=>{(e=>{null==l||l(e),a(e,h(e))})(e)}})};class Eo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(xo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Eo.contextType=Ol;const Co=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:d,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=at(f)?l:f,h=e=>{var t,n;return null!==(n=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return t.isOnlyShow?j.default.createElement(ar,{value:h(n),bordered:s}):j.default.createElement(u.Radio.Group,{value:n,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,h(e))})(t)}},p.map((e=>j.default.createElement(u.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class So 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n)try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Co,{option:this.props.option,items:t,onValuesChange:(t,n)=>{h(t),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}So.contextType=Ol;const wo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=wa,trueValue:p=Sa}=i;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Switch,{checked:n===p,style:o,disabled:d||t.isOnlyShow,checkedChildren:j.default.createElement(b.CheckOutlined,null),unCheckedChildren:j.default.createElement(b.CloseOutlined,null),onChange:e=>{(e=>{null==l||l(e),a(e,we(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?j.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class To extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option,{labelToSwitch:h}=i;return j.default.createElement(u.Form.Item,{label:h?" ":e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(wo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}To.contextType=Ol;const No=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},style:i={},placeholder:o=we("qm.form.inputPlaceholder"),bordered:s=!0,allowClear:d,readOnly:c,disabled:f,onBlur:p=Je,onEnter:h=Je}=e.option,{showCount:m,maxLength:g,autoSize:v}=r,b=Object.assign({},{minRows:1,maxRows:3},v);return j.default.createElement(u.Input.TextArea,{value:n,placeholder:o,style:i,maxLength:g,showCount:m,autoSize:b,bordered:s,allowClear:d,readOnly:c||t.isOnlyShow,disabled:f,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),p(n)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;h(t)}},onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),a(e)})(t)}})};class Io extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(No,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Io.contextType=Ol;const Oo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.datePlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{dateType:h="date",format:m,disabledDate:g,minDateTime:v,maxDateTime:b,shortCuts:y=!0}=i,x=j.default.createRef(),E=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==l||l(e),a(e,C(e))},C=e=>_a(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=Ha(K.default().subtract(e,"day"),Ra[h]);"date"===h&&(t=t.slice(0,10)),E(t),x.current.blur(),x.current.focus()};return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:d}):j.default.createElement(je,{ref:x,style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,picker:Oa[h],format:m,bordered:d,showToday:!1,showTime:"datetime"===h&&{defaultValue:K.default("00:00:00","HH:mm:ss")},allowClear:c,disabled:p,inputReadOnly:f,disabledDate:null!=g?g:e=>((e,t)=>{let[n,l]=t;return n&&l?e.isBefore(n,"day")||e.isAfter(l,"day"):n?e.isBefore(n,"day"):!!l&&e.isAfter(l,"day")})(e,[v,b]),renderExtraFooter:y?()=>j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(0)},we("qm.form.datePickers")[0]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(1)},we("qm.form.datePickers")[1]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(7)},we("qm.form.datePickers")[2]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(30)},we("qm.form.datePickers")[3])):void 0,value:La(n,Ra[h]),onChange:(e,t)=>{E(Ha(e,Ra[h]))}})};class Ro extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Oo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ro.contextType=Ol;const ko=e=>[K.default().subtract(e,"day"),K.default()],Po=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f=t.isFormDisabled}=e.option,{dateType:p="date",format:h,disableds:m=[!1,!1],allowEmpty:g,disabledDate:v,minDateTime:b,maxDateTime:y,shortCuts:x=!0}=i,E={[we("qm.form.dateRangePickers")[0]]:ko(7),[we("qm.form.dateRangePickers")[1]]:ko(30),[we("qm.form.dateRangePickers")[2]]:ko(90),[we("qm.form.dateRangePickers")[3]]:ko(180)},C=e=>_a(e)?"":e.map((e=>["date","exactdate"].includes(p)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:u}):j.default.createElement(je.RangePicker,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,picker:Oa[p],format:h,bordered:u,showTime:"datetime"===p&&{defaultValue:[K.default("00:00:00","HH:mm:ss"),K.default("23:59:59","HH:mm:ss")]},allowClear:d,allowEmpty:g,disabled:f?[!0,!0]:m,inputReadOnly:c,disabledDate:null!=v?v:e=>((e,t)=>{let[n,l]=t;return n&&l?e.isBefore(n,"day")||e.isAfter(l,"day"):n?e.isBefore(n,"day"):!!l&&e.isAfter(l,"day")})(e,[b,y]),ranges:x?E:void 0,value:at(n)?null:[La(null==n?void 0:n[0],Ra[p]),La(null==n?void 0:n[1],Ra[p])],onChange:(e,t)=>{(e=>{"date"===p&&(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==l||l(e),a(e,C(e))})([Ha(null==e?void 0:e[0],Ra[p]),Ha(null==e?void 0:e[1],Ra[p])])}})};class Ao extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Po,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ao.contextType=Ol;const Lo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.timePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f}=e.option,{timeType:p="hour-minute-second",hourStep:h=1,minuteStep:m=1,secondStep:g=1}=i;return t.isOnlyShow?j.default.createElement(ar,{value:n,bordered:u}):j.default.createElement(Ve,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,bordered:u,showNow:!0,hourStep:h,minuteStep:m,secondStep:g,allowClear:d,disabled:f,inputReadOnly:c,format:ka[p],value:La(n,ka[p]),onChange:(e,t)=>{(e=>{const t=Ha(e,ka[p]);null==l||l(t),a(t)})(e)}})};class Ho extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Lo,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ho.contextType=Ol;const _o=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f=t.isFormDisabled}=e.option,{timeType:p="hour-minute-second",disableds:h=[!1,!1],allowEmpty:m,hourStep:g=1,minuteStep:v=1,secondStep:b=1}=i,y=e=>_a(e)?"":e.join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:y(n),bordered:u}):j.default.createElement(Ve.RangePicker,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,bordered:u,showNow:!1,hourStep:g,minuteStep:v,secondStep:b,allowClear:d,allowEmpty:m,disabled:f?[!0,!0]:h,inputReadOnly:c,format:ka[p],value:at(n)?null:[La(null==n?void 0:n[0],ka[p]),La(null==n?void 0:n[1],ka[p])],onChange:(e,t)=>{(e=>{const t=[Ha(null==e?void 0:e[0],ka[p]),Ha(null==e?void 0:e[1],ka[p])];null==l||l(t),a(t,y(t))})(e)}})};class Fo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(_o,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Fo.contextType=Ol;class Do extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=ue.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:l,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(l||Oe("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)||Oe("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Oe("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&Oe("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.props.option;this._record=e;for(const l in this.alias){const a=Fa(e,this.alias[l]);t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])})},this.fetchHandle=g.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:l}=this.props.option;for(const t in this.alias)t!==l&&n.SET_FIELDS_VALUE({[t]:Fa(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:Fa(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=Fa(e,this.alias[l]);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||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,n,l,a,r,i,o;const s=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(l=e.option.request)||void 0===l?void 0:l.params),u=(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);if(g.isEqual(s,u)||this.getItemList(),null===this._prevValue)return;const d=this.getItemValue();this._prevValue!==d&&d!==(null===(o=this._record)||void 0===o?void 0:o[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=d}getItemList(e){var t;return Ye(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:l,params:a={},formatter:r=(e=>e),dataKey:i}=this.searchHelper.request||this.props.option.request||{};if(l){this.setState({loading:!0});try{const o=yield l(r(Object.assign(Object.assign({},a),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=g.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:n,itemList:l,inputText:a}=this.state,{value:r}=this.props,{fieldName:i,options:o={},style:s={},placeholder:d=we("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{listHeight:m=Ta}=o,{hideHeader:v,onlySelect:b=!0}=this.searchHelper||o,y=this.searchHelper.columns||[],x=dt("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=j.default.createElement(u.Spin,{spinning:n},l.length?j.default.createElement("table",{cellSpacing:0,cellPadding:0,className:ne.default("table")},!v&&j.default.createElement("thead",null,j.default.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>j.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),j.default.createElement("tbody",null,l.map(((e,t)=>j.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)))}},y.filter((e=>!e.hidden)).map((t=>j.default.createElement("td",{key:t.dataIndex},g.get(e,t.dataIndex))))))))):j.default.createElement(al,null));return j.default.createElement(xe.Consumer,null,(n=>{const o={[x]:!0,[`${x}--lg`]:"large"===(null==n?void 0:n.size),[`${x}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:r,bordered:c}):j.default.createElement(io,{action:h?[]:["click"],popupVisible:!h&&t,popup:C,popupClassName:ne.default(o,`form-popper__${i}`),popupStyle:{minWidth:E,maxHeight:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:d,allowClear:f,bordered:c,readOnly:p,disabled:h,style:Object.assign({width:"100%"},s),value:null!=a?a:r,title:r,onFocus:()=>{!l.length&&this.fetchHandle(r)},onBlur:e=>{b&&!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(l[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%l.length:(--t+l.length)%l.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),b?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}}))}))}}Do.contextType=Ol;class $o extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Do,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m(t,arguments.length>1?arguments[1]:void 0),e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}$o.contextType=Ol;class Mo extends e.Component{render(){var e;const{$$form:t}=this.context,{type:n,label:l,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:s}=t.state,{showLimit:d,remarkItems:c=[],onCollapse:f=Je}=o,p=[];if(c.length){const n=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],l=null!=d?d:n.length-1;n.slice(l+1).forEach((e=>{var n;const l=c.find((t=>t.fieldName===e.fieldName));if(!l)return;const a=l.showLabel?`${e.label}:`:"",r=null!==(n=t.getViewValue(e.fieldName))&&void 0!==n?n:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return j.default.createElement(u.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},j.default.createElement(ct,{id:a,label:l,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:s[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}Mo.contextType=Ol;const jo=(e,t,n,l)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:l}):e.children?Object.assign(Object.assign({},e),{children:jo(e.children,t,n,l)}):e)),qo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{fieldName:s,options:d={},style:c={},placeholder:f=we("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,asyncLoad:m,readOnly:v,disabled:b}=e.option,{itemList:y,filterable:x=!0,listHeight:E=Ta,checkStrictly:C,checkStrategy:S="SHOW_CHILD",collapseTags:w,defaultExpandAll:T=!m,defaultExpandedKeys:N,openPyt:I=!0}=d,[O,R]=j.default.useState(at(y)?l:y);Vn((()=>{R(at(y)?l:y)}),[y,l]);const k=e=>{var t;return(null===(t=ja(O,e))||void 0===t?void 0:t.text)||""},P=e=>a?e.map((e=>k(e))).filter((e=>!!e)).join(","):k(e);return t.isOnlyShow?j.default.createElement(ar,{value:P(n),bordered:p}):j.default.createElement(u.TreeSelect,qe({fieldNames:{label:"text",value:"value",children:"children"},value:n,multiple:a,treeCheckable:a,treeCheckStrictly:C,showCheckedStrategy:u.TreeSelect[S],popupClassName:`form-popper__${s}`,placeholder:f,listHeight:E,style:c,loading:r,bordered:p,allowClear:h,disabled:b,treeDefaultExpandAll:T,treeDefaultExpandedKeys:N,showSearch:x,maxTagCount:w?"responsive":void 0,loadData:m?e=>{let{key:t,children:n}=e;return Ye(void 0,void 0,void 0,(function*(){var e;if(!m||n)return;const{fetchApi:l,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:u=(e=>e)}=m;if(l)try{const n=yield l(u(Object.assign(Object.assign({},a),{[o]:t})));if(200===n.code){const l=Array.isArray(n.data)?n.data:null!==(e=g.get(n.data,r))&&void 0!==e?e:[],a=jo(O,t,o,Ma(l,o,i));R(a),null==s||s(l)}}catch(e){}}))}:void 0,treeData:O},a?{title:P(n)}:null,{filterTreeNode:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(I?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,P(e),O)})(e)}}))};class Vo 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=Ma(n,r,i);this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(qo,{option:this.props.option,items:t,loading:n,multiple:this.props.multiple,onValuesChange:(t,n,l)=>{m(t,n,l),e.setViewValue(i,n)}}))),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Vo.contextType=Ol;const Ko=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,multiple:l,items:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{changeOnSelect:h,checkStrictly:m,checkStrategy:g="SHOW_PARENT",filterable:v=!0,openPyt:b=!0}=i,{itemList:y=[]}=i,x=at(y)?a:y,E=e=>at(e)?"":l?e.map((e=>qa(x,e).map((e=>e.text)).join("/"))).join(","):qa(x,e).map((e=>e.text)).join("/");return t.isOnlyShow?j.default.createElement(ar,{value:E(n),bordered:d}):j.default.createElement(u.Cascader,qe({value:(e=>at(e)?[]:l?e.map((e=>e.split(","))):e.split(","))(n),fieldNames:{label:"text",value:"value",children:"children"},options:x,multiple:l,maxTagCount:"responsive",changeOnSelect:h||m,showCheckedStrategy:u.Cascader[g],popupClassName:`form-popper__${r}`,placeholder:s,style:o,bordered:d,allowClear:c,disabled:p,showSearch:v&&{filter:(e,t)=>t.some((t=>{var n;const l=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(b?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0}))}},l?{title:E(n)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:l}=e;null==n||n(t),l(t,E(t),x)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class zo 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=Ma(n,r,i);this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(Ko,{option:this.props.option,multiple:t,items:n,onValuesChange:(t,n,l)=>{m(t,n,l),e.setViewValue(i,n)}}))),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}zo.contextType=Ol;const Bo=["110000","120000","310000","500000"],Wo=["810000","820000"],Uo=[{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"}],Go=[{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"}],Yo=e=>nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Xo=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Bo,...Wo].includes(e))):Object.keys(e[t])).map((l=>({l:Yo(e[t][l].slice(0,1)).toUpperCase(),n:e[t][l],c:l,p:t,children:Xo(e,l,n+1)})))},Qo=(e,t)=>t.map((t=>({l:Yo(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Zo extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this.scrollRef=j.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:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),se.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:Qo(ye.default,Bo)},{l:"Z2",n:"港澳",c:"",p:"",children:Qo(ye.default,Wo)}]}createProvince(){var e;return(null!==(e=Xo(ye.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Go.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Bo,...Wo].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return j.default.createElement(u.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}))}},j.default.createElement(u.Radio.Button,{value:"0"},we("qm.form.citySelectType.0")),j.default.createElement(u.Radio.Button,{value:"1"},we("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Uo:Go).map((t=>j.default.createElement("li",{key:t.value,className:ne.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return j.default.createElement(u.Select,{size:"small",placeholder:we("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>j.default.createElement(u.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,n)=>{var l;return j.default.createElement("div",{key:n},j.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),j.default.createElement("dd",null,null===(l=t.children)||void 0===l?void 0:l.map((t=>j.default.createElement("li",{key:t.c,className:ne.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:n}=this.props,{fieldName:l,options:a={},style:r={},placeholder:i=we("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:d,disabled:c}=this.props.option,f=dt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=this.createTextValue(n),m=j.default.createElement("div",{className:"container",style:Object.assign({},r)},j.default.createElement("div",{className:"city-drop"},j.default.createElement("div",{className:"city-drop-toper"},j.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),j.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),j.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),j.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},j.default.createElement("dl",null,this.renderCity(n)))));return j.default.createElement(xe.Consumer,null,(n=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==n?void 0:n.size),[`${f}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:h,bordered:o}):j.default.createElement(io,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:ne.default(a,`form-popper__${l}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:d,disabled:c,style:Object.assign({width:"100%"},r),value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Zo.contextType=Ol;class Jo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Zo,{option:this.props.option,onValuesChange:(t,n)=>{p(t,n),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Jo.contextType=Ol;const es=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:es(e,n)})))};class ts extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=es(ye.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:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,l;return null===(l=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===l?void 0:l.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let l=0;l<t.length;l++){const a=ja(e,t[l]);if(a&&at(a.children)){this.isFetch&&this.getStreetList(t[l]);break}Array.isArray(null==a?void 0:a.children)&&(n[l+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Ye(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:l,formatter:a=(e=>e),dataKey:r,valueKey:i="value",textKey:o="text"}=n;if(l)try{const n=yield l(a({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=g.get(n.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,n)=>{var l;const a=(null===(l=t.find((t=>t.value===e[n])))||void 0===l?void 0:l.text)||`${we("qm.form.selectPlaceholder").replace("...","")}(${we("qm.form.regionSelectLabel")[n]})`;return j.default.createElement(Sl.TabPane,{key:n.toString(),tab:a},j.default.createElement("div",{className:"region-box"},t.map((t=>j.default.createElement("span",{key:t.value,className:ne.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[n]=t.value.toString(),e=e.slice(0,n+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(n+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(n+1)}))}},t.text)))))}));return t.length?j.default.createElement(Sl,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):j.default.createElement(al,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:n}=this.props,{fieldName:l,options:a={},style:r={},placeholder:i=we("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:d,disabled:c}=this.props.option,f=dt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=j.default.createElement("div",{className:"container"},this.renderTabs());let m=this.prevText;if(!t){const e=this.createTextValue(n);(""===e||e.split("/").every((e=>""!==e)))&&(m=e,this.prevText=m)}return j.default.createElement(xe.Consumer,null,(n=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==n?void 0:n.size),[`${f}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:m,bordered:o}):j.default.createElement(io,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:ne.default(a,`form-popper__${l}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,style:Object.assign({width:"100%"},r),readOnly:d,disabled:c,value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&nt((()=>this.initial()))}}))}))}}ts.contextType=Ol;class ns extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(ts,{option:this.props.option,onValuesChange:(t,n)=>{p(t,n),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ns.contextType=Ol;const ls=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i={},style:o={},disabled:s,readOnly:d}=e.option,{multiple:c=!0,maxCount:f=1,fileTypes:p,fileSize:h,fileDirection:m,onPreview:v,onRemove:y}=r,{action:x,headers:E,params:C,withCredentials:S=!1,dataKey:w="",downloadWithHeaders:T,fieldAliasMap:N,beforeUpload:I,button:O}=i,R="function"==typeof N?N():N||{};return j.default.createElement(Os,{name:"file",action:x,multiple:c,headers:E,data:C,withCredentials:S,downloadWithHeaders:T,beforeUpload:I,maxCount:f,fileTypes:p,fileSize:h,fileDirection:m,disabled:s,readOnly:t.isOnlyShow||d,button:O,showUploadList:{showDownloadIcon:!0,downloadIcon:j.default.createElement(b.DownloadOutlined,null)},fileList:n,onChange:e=>{let{file:t,fileList:n}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},l={};for(const a in R)l[a]=e[a]||(null===(t=n.data)||void 0===t?void 0:t[R[a]])||"";return e.response&&200!==n.code&&u.message.error(n.message||we("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},l),{url:e.url||(w?g.get(n.data,w):n.data)||"",status:e.status})}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(n)},onPreview:v,onRemove:y})};class as extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(ls,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}as.contextType=Ol;const rs=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i={},style:o={},disabled:s,readOnly:d}=e.option,{multiple:c=!0,maxCount:f=1,fixedSize:p,quality:h,openCropper:m,fileTypes:v,fileSize:b,onRemove:y}=r,{action:x,headers:E,params:C,withCredentials:S=!1,dataKey:w="",popupClassName:T,fieldAliasMap:N,beforeUpload:I}=i,O="function"==typeof N?N():N||{};return j.default.createElement(ks,{name:"file",action:x,multiple:c,headers:E,data:C,withCredentials:S,popupClassName:T,beforeUpload:I,maxCount:f,fixedSize:p,quality:h,openCropper:m,fileTypes:v,fileSize:b,disabled:s,readOnly:t.isOnlyShow||d,fileList:n,onChange:e=>{let{file:t,fileList:n}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},l={};for(const a in O)l[a]=e[a]||(null===(t=n.data)||void 0===t?void 0:t[O[a]])||"";return e.response&&200!==n.code&&u.message.error(n.message||we("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},l),{url:e.url||(w?g.get(n.data,w):n.data)||"",status:e.status})}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(n)},onRemove:y})};class is extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(rs,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}is.contextType=Ol;const os=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{tinymce:d,thresholdSize:c,onResizeEditor:f}=r;return j.default.createElement(Ns,{value:n,tinymce:d,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:u||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==l||l(e),a(e)})(e)}})};class ss extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(os,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ss.contextType=Ol;class us extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=j.default.createRef(),this.formRef=j.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 n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=g.debounce(this.resizeObserveHandler,10),this.getFormItems=ue.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=ue.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{g.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,l;null===(l=(n=this.props).onValuesChange)||void 0===l||l.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,l;null===(l=(n=this.props).onFieldsChange)||void 0===l||l.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=e=>{let{values:t,errorFields:n}=e;var l,a;null===(a=(l=this.props).onFinishFailed)||void 0===a||a.call(l,n)},this.openValidateInfo=e=>{const t=j.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return j.default.createElement("li",{key:e.name[0],style:{color:"#f5222d"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));u.notification.error({message:we("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&se.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(){sl(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ul(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&&Oe("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const l in e)t.includes(l)||(n[l]=e[l]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>g.isPlainObject(e.extra))).forEach((n=>{var l;t[n.fieldName]=null!==(l=e[n.fieldName])&&void 0!==l?l:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>g.isPlainObject(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:l,options:a}=e;return t=null!=t?t:void 0,Na.includes(l)&&(t=null!=t?t:[]),"CHECKBOX"!==l&&"SWITCH"!==l||(t=null!==(n=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==n?n:wa),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=rt(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(t=(e=this.props).onCollapse)||void 0===t||t.call(e,this.state.collapse)}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,l,a,r;if(Va(e))return Ka(e);if(g.isPlainObject(e)){const{fieldName:i,label:o,options:s={}}=e;if(Va(o))return Ka(o);const{itemList:u=[]}=s,d=null!==(l=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([i])[i])&&void 0!==n?n:this._initialValues[i])&&void 0!==l?l:null===(a=u[0])||void 0===a?void 0:a.value;return(null===(r=u.find((e=>e.value===d)))||void 0===r?void 0:r.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let l=this.formItems.findIndex((e=>e===this.dividers[t+1]));l=l>-1?l:void 0,e.push(this.formItems.slice(n,l).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:n}=e;var l,a;if("DIVIDER"===t)return!0;const r=this.getBlockDerivedItems();for(let e=0,t=r.length;e<t;e++){const t=r[e],i=this.dividers.find((e=>e.fieldName===t[0].fieldName)),o=null!==(a=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==a?a:t.length-1;for(let e=1;e<t.length;e++){if(t[e].fieldName===n&&e>o)return this.state.expand[t[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const l in e){const a=e[l];if(_a(a)&&(e[l]=""),Array.isArray(a)&&a.forEach(((t,n)=>{_a(t)&&(e[l][n]="")})),l.includes("|")&&Array.isArray(a)){const[r,i]=l.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(n=a[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)at(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Ye(this,void 0,void 0,(function*(){const{authConfig:l}=this.props;if(!l)return;let a=te.default(l,["fetch"]);if(l.fetch){const{api:t,params:n,dataKey:r}=l.fetch;try{const l=yield t(n);200===l.code&&(a=null!==(e=r?g.get(l.data,r):l.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(a.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=a.fieldList.find((e=>e.dataIndex===t));if(n){const l=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=n;a||(e.noAuth=!0,l.noAuth=!0),r&&(e.disabled=!0,l.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},l.options=Object.assign({},l.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return j.default.createElement(fr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return j.default.createElement(hr,{option:e})}INPUT_NUMBER(e){return j.default.createElement(gr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return j.default.createElement(br,{option:e})}SEARCH_HELPER(e){return j.default.createElement(Cr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return j.default.createElement(so,{option:e})}TREE_TABLE_HELPER(e){return j.default.createElement(fo,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return j.default.createElement(ho,{option:e})}RANGE_SEARCH_HELPER(e){return j.default.createElement(vo,{option:e})}CHECKBOX(e){return j.default.createElement(ur,{option:e})}MULTIPLE_CHECKBOX(e){return j.default.createElement(yo,{option:e})}RATE(e){return j.default.createElement(Eo,{option:e})}RADIO(e){return j.default.createElement(So,{option:e})}SWITCH(e){return j.default.createElement(To,{option:e})}TEXT_AREA(e){return j.default.createElement(Io,{option:e})}DATE(e){return j.default.createElement(Ro,{option:e})}RANGE_DATE(e){return j.default.createElement(Ao,{option:e})}TIME(e){return j.default.createElement(Ho,{option:e})}RANGE_TIME(e){return j.default.createElement(Fo,{option:e})}SELECT(e){return j.default.createElement(or,{option:e})}MULTIPLE_SELECT(e){return j.default.createElement(or,{option:e,multiple:!0})}IMMEDIATE(e){return j.default.createElement($o,{option:e})}DIVIDER(e){return j.default.createElement(Mo,{option:e})}TREE_SELECT(e){return j.default.createElement(Vo,{option:e})}MULTIPLE_TREE_SELECT(e){return j.default.createElement(Vo,{option:e,multiple:!0})}CASCADER(e){return j.default.createElement(zo,{option:e})}MULTIPLE_CASCADER(e){return j.default.createElement(zo,{option:e,multiple:!0})}CITY_SELECT(e){return j.default.createElement(Jo,{option:e})}REGION_SELECT(e){return j.default.createElement(ns,{option:e})}UPLOAD_FILE(e){return j.default.createElement(as,{option:e})}UPLOAD_IMG(e){return j.default.createElement(is,{option:e})}TINYMCE(e){return j.default.createElement(ss,{option:e})}renderFormLabel(e){if(Va(e)||!g.isPlainObject(e))return e;const{type:t,fieldName:n,label:l,options:a={},onChange:r=Je}=e,{itemList:i=[]}=a;return"SELECT"===t?j.default.createElement(u.Form.Item,{name:n,noStyle:!0},j.default.createElement(ir,{option:e,items:i,loading:!1,onValuesChange:(e,t)=>r(e,t)})):"CHECKBOX"===t?j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{style:{paddingRight:5}},l),j.default.createElement(u.Form.Item,{name:n,noStyle:!0},j.default.createElement(sr,{option:e,onValuesChange:e=>r(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:n,style:l={},render:a}=e,{extra:r}=this.state;if(n)return j.default.createElement(u.Tooltip,{className:"extra-tooltip",title:r[t]},j.default.createElement(b.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t));return j.default.createElement("div",{className:"extra-text",title:a?"":r[t],style:l},j.default.createElement("span",{className:"extra-overflow-cut"},a?a(i,this):r[t]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),l="function"==typeof t?t(n):t;return this.isOnlyShow?null:l}renderFormItem(e){const{label:t,fieldName:n,invisible:l,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,rules:o=[],style:s={},render:d}=e;return at(this.state.formData)?null:j.default.createElement(u.Form.Item,{label:this.renderFormLabel(t),name:n,rules:o,tooltip:a,hidden:l,className:ne.default(r),style:Object.assign({width:"100%"},s),labelCol:{flex:this.verticalLayout?"initial":it(i)}},null==d?void 0:d(e,this))}createFormItem(e){return g.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(Oe("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:n,isFieldsDefine:l}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<n;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:n=1}=t,l=e+n;return i.push(l),l}),0),s=n>Math.ceil(o/e)?Math.ceil(o/e):n,d=[],c=a.map(((t,n)=>{let{selfCol:l=1}=t;const{type:a,fieldName:o}=t;l=l>=24||"DIVIDER"===a||"TINYMCE"===a?e:l;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[n]<s*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&d.push(i[n]),j.default.createElement(u.Col,{key:null!=o?o:n,className:o,span:l*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(rt(t)):null)}));return l&&"default"===t&&c.push(j.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:t,collapse:n}=this.state,{searchButtonCols:l,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=l||1,s=t-e%t-o;return a?j.default.createElement(u.Col,{key:"-",span:o*i,offset:s*i,style:{textAlign:"right"}},j.default.createElement(u.Space,{style:{marginBottom:12}},j.default.createElement(ot,{type:"primary",size:this.$size,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},we("qm.form.search")),j.default.createElement(ot,{size:this.$size,icon:j.default.createElement(b.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},we("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&j.default.createElement("a",{onClick:()=>this.setExpandHandle(!n)},n?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)," ",we(n?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:n}=this.props;if(this.isFilterType)return null;const l=24/e;return n&&"default"===t?j.default.createElement(u.Row,{gutter:0},j.default.createElement(u.Col,{key:"-",span:l},j.default.createElement(u.Form.Item,null,j.default.createElement(u.Space,{style:{marginBottom:12}},j.default.createElement(ot,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},we("qm.form.save")),j.default.createElement(ot,{size:this.$size,onClick:()=>this.RESET_FORM()},we("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:n}=this.props;return j.default.createElement(dr,{uniqueKey:e,items:t,fieldsChange:n})}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[n,l]=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:[we("qm.form.searchHelperTips")],warnings:[]})));n||a.length?t((n||[]).concat(a)):e(l)}))))}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 n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),l=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));l.length&&this.formRef.current.resetFields(l),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),l=t.filter((e=>!n.includes(e))),a={};return l.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){Oe("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:l,fieldsChange:a}=this.props,r=l.find((t=>t.fieldName===e));if(!r)return Oe("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!g.isPlainObject(t))return Oe("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(r.noAuth)return Oe("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||g.set(r,n,t[n]));n&&(a?a([...l]):Oe("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:n,disabled:l,labelWidth:a,labelAlign:r,labelWrap:i,customClass:o}=this.props,s=dt("form"),d={required:"${label}"+we("qm.form.requiredTips")},c={[s]:!0,[`${s}--lg`]:"large"===this.$size,[`${s}--sm`]:"small"===this.$size,[`${s}__only-show`]:this.isOnlyShow,[`${s}__compact`]:this.isCompactMode,[o]:!!o};return j.default.createElement("div",{ref:this.wrapperRef,className:ne.default(c,e),style:t},j.default.createElement(u.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:n,labelAlign:r,labelWrap:i,colon:!1,disabled:l,labelCol:{flex:this.verticalLayout?"initial":it(a)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},j.default.createElement(Ol.Provider,{value:this.provide},j.default.createElement(u.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}us.contextType=xe,us.propTypes=Pa,us.defaultProps=Aa;const ds={onActivate:V.func,onAddUndo:V.func,onBeforeAddUndo:V.func,onBeforeExecCommand:V.func,onBeforeGetContent:V.func,onBeforeRenderUI:V.func,onBeforeSetContent:V.func,onBeforePaste:V.func,onBlur:V.func,onChange:V.func,onClearUndos:V.func,onClick:V.func,onContextMenu:V.func,onCommentChange:V.func,onCopy:V.func,onCut:V.func,onDblclick:V.func,onDeactivate:V.func,onDirty:V.func,onDrag:V.func,onDragDrop:V.func,onDragEnd:V.func,onDragGesture:V.func,onDragOver:V.func,onDrop:V.func,onExecCommand:V.func,onFocus:V.func,onFocusIn:V.func,onFocusOut:V.func,onGetContent:V.func,onHide:V.func,onInit:V.func,onKeyDown:V.func,onKeyPress:V.func,onKeyUp:V.func,onLoadContent:V.func,onMouseDown:V.func,onMouseEnter:V.func,onMouseLeave:V.func,onMouseMove:V.func,onMouseOut:V.func,onMouseOver:V.func,onMouseUp:V.func,onNodeChange:V.func,onObjectResizeStart:V.func,onObjectResized:V.func,onObjectSelected:V.func,onPaste:V.func,onPostProcess:V.func,onPostRender:V.func,onPreProcess:V.func,onProgressState:V.func,onRedo:V.func,onRemove:V.func,onReset:V.func,onSaveContent:V.func,onSelectionChange:V.func,onSetAttrib:V.func,onSetContent:V.func,onShow:V.func,onSubmit:V.func,onUndo:V.func,onVisualAid:V.func,onSkinLoadError:V.func,onThemeLoadError:V.func,onModelLoadError:V.func,onPluginLoadError:V.func,onIconsLoadError:V.func,onLanguageLoadError:V.func},cs=Object.assign({apiKey:V.string,id:V.string,inline:V.bool,init:V.object,initialValue:V.string,onEditorChange:V.func,value:V.string,tagName:V.string,cloudChannel:V.string,plugins:V.oneOfType([V.string,V.array]),toolbar:V.oneOfType([V.string,V.array]),disabled:V.bool,textareaName:V.string,tinymceScriptSrc:V.string,rollback:V.oneOfType([V.number,V.oneOf([!1])]),scriptLoading:V.shape({async:V.bool,defer:V.bool,delay:V.number})},ds),fs=e=>"function"==typeof e,ps=e=>e in ds,hs=e=>e.substr(2),ms=(e,t,n,l,a)=>((e,t,n,l,a,r,i)=>{const o=Object.keys(a).filter(ps),s=Object.keys(r).filter(ps),u=o.filter((e=>void 0===r[e])),d=s.filter((e=>void 0===a[e]));u.forEach((e=>{const t=hs(e),l=i[t];n(t,l),delete i[t]})),d.forEach((n=>{const a=l(e,n),r=hs(n);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,n)=>l=>{var a;return null===(a=t(n))||void 0===a?void 0:a(l,e)}),t,n,l);let gs=0;const vs=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return gs++,e+"_"+n+gs+String(t)},bs=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),ys=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),xs=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Es=()=>({listeners:[],scriptId:vs("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Cs=(()=>{let e=Es();return{load:(t,n,l,a,r,i)=>{const o=()=>((e,t,n,l,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=n,i.async=l,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,n,l,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=Es()}}})(),Ss=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class ws extends M.Component{constructor(e){var t,n,l,a;super(e),t=this,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=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;var n,l,a;const r=t.elementRef.current;if(!r)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(r)){if(0===e)setTimeout((()=>t.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>t.initialise(e+1)),100)}return}const i=Ss(t.view);if(!i)throw new Error("tinymce should have been loaded into global scope");const o=Object.assign(Object.assign({},t.props.init),{selector:void 0,target:r,readonly:t.props.disabled,inline:t.inline,plugins:(s=null===(n=t.props.init)||void 0===n?void 0:n.plugins,u=t.props.plugins,ys(s).concat(ys(u))),toolbar:null!==(l=t.props.toolbar)&&void 0!==l?l:null===(a=t.props.init)||void 0===a?void 0:a.toolbar,setup:e=>{t.editor=e,t.bindHandlers({}),t.inline&&!bs(r)&&e.once("PostRender",(n=>{e.setContent(t.getInitialValue(),{no_events:!0})})),t.props.init&&fs(t.props.init.setup)&&t.props.init.setup(e)},init_instance_callback:e=>{var n,l;const a=t.getInitialValue();t.currentContent=null!==(n=t.currentContent)&&void 0!==n?n:e.getContent(),t.currentContent!==a&&(t.currentContent=a,e.setContent(a),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const r=null!==(l=t.props.disabled)&&void 0!==l&&l;xs(t.editor,r?"readonly":"design"),t.props.init&&fs(t.props.init.init_instance_callback)&&t.props.init.init_instance_callback(e)}});var s,u;t.inline||(r.style.visibility=""),bs(r)&&(r.value=t.getInitialValue()),i.init(o)},this.id=this.props.id||vs("tiny-react"),this.elementRef=M.createRef(),this.inline=null!==(a=null!==(n=this.props.inline)&&void 0!==n?n:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==a&&a,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const l of[t,n])if(l)try{e.selection.moveToBookmark(l),this.valueCursor=l;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;xs(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,l,a,r;null!==Ss(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&Cs.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!==(l=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==l&&l,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,n;return(null===(n=null===(t=null===(e=Ss(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:e="div"}=this.props;return M.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return M.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){ms(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),l=t(this.props);!n&&l?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!l&&(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 Ts;ws.propTypes=cs,ws.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(Ts||(Ts={}));class Ns extends e.Component{constructor(){super(...arguments),this.defaultOption={height:400,plugins:"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",menubar:"file edit view insert format tools table help",toolbar:"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"}}render(){var e;const{size:t,className:n,style:l,tinymce:a={},upload:r={},thresholdSize:i=.5,tinymceScriptSrc:o,disabled:s,value:d,onResizeEditor:c,onChange:f}=this.props,p=this.context.global,h=this.context.locale,m=t||this.context.size||"",v=dt("tinymce"),b={[v]:!0,[`${v}--lg`]:"large"===m,[`${v}--sm`]:"small"===m},y={init:Object.assign(Object.assign({height:a.height||this.defaultOption.height,plugins:a.plugins||this.defaultOption.plugins,toolbar:a.toolbar||this.defaultOption.toolbar,menubar:a.menubar||this.defaultOption.menubar,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:Ts[h],skin:"tinymce-5"},te.default(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Ye(this,void 0,void 0,(function*(){const{action:n,headers:l,withCredentials:a,dataKey:o}=r,s=`data:image/jpeg;base64,${e.base64()}`,d=new FormData;d.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>i)try{const{data:e}=yield ie.default.post(n,d,{headers:l,withCredentials:a});if(200===e.code){const n=o?g.get(e.data,o):e.data;t(n)}}catch(e){u.message.error(we("qm.uploadCropper.uploadError"))}else t(s)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:l}=e.editorContainer;null==c||c({width:n,height:l},t)}))}}),value:d,disabled:s,tinymceScriptSrc:o||(null===(e=null==p?void 0:p.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==f||f(t.getContent(),t)}};return j.default.createElement("div",{className:ne.default(b,n),style:l},j.default.createElement(ws,y))}}Ns.contextType=xe,Ns.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Tinymce","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class Is extends e.Component{constructor(){super(...arguments),this.imgRef=j.default.createRef()}componentDidMount(){const e=Ue(this.props,["className","style","src","alt","imgStyle"]),t={};for(const n in e)void 0!==this.props[n]&&(t[n]=this.props[n]);this.cropper=new de.default(this.imgRef.current,t)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.scale(e,t)}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:t,src:n,alt:l,imgStyle:a}=this.props,r={[dt("cropper")]:!0};return j.default.createElement("div",{className:ne.default(r,e),style:t},j.default.createElement("img",{ref:this.imgRef,src:n,alt:l,style:Object.assign({maxWidth:"100%"},a)}))}}Is.defaultProps={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};class Os extends e.Component{constructor(){super(...arguments),this.beforeUpload=(e,t)=>new Promise(((n,l)=>Ye(this,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:r,maxCount:i,fileList:o=[],beforeUpload:s}=this.props,d=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!r||e.size/1024/1024<r,f=!(i>1)||o.length<i,p=d&&c&&f;if(d||u.message.warning(we("qm.upload.tooltip",{type:a.join(",")})),c||u.message.warning(we("qm.upload.sizeLimit",{size:r})),f||u.message.warning(we("qm.upload.countLimit",{count:i})),!p)return p||u.Upload.LIST_IGNORE;if(s){const a=s(e,t);if(!0===a)return n(e);if(!1===a)return l("not upload");if(a&&"function"==typeof a.then)try{const e=yield a;n(e)}catch(e){l(e)}}else n(e)})))),this.doDownload=e=>Ye(this,void 0,void 0,(function*(){try{e.url&&(yield this.downloadFile(e.url,e.name))}catch(e){u.message.error(we("qm.download.error"))}}))}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}downloadFile(e,t){return Ye(this,void 0,void 0,(function*(){const n=this.props.downloadWithHeaders?{headers:this.props.headers}:null,l=yield ie.default(Object.assign(Object.assign({url:e},n),{responseType:"blob",timeout:0})),a=l.data,r=l.headers["content-disposition"],i=t||(r?r.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));vl(a,i)}))}render(){var e,t;const{fileList:n=[],button:l={},fileDirection:a,disabled:r,readOnly:i,className:o,onPreview:s,onChange:d}=this.props,c=dt("upload-file"),f={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}--horizontal`]:"horizontal"===a};return j.default.createElement(u.Upload,qe({className:ne.default(f,o)},te.default(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:r||i,onChange:d,onPreview:e=>Ye(this,void 0,void 0,(function*(){if("function"==typeof s)return s(e,(t=>this.doDownload(t||e)));r||(yield this.doDownload(e))})),onDownload:e=>Ye(this,void 0,void 0,(function*(){yield this.doDownload(e)}))}),this.props.children||i&&n.length?this.props.children:j.default.createElement(u.Button,{type:null!==(e=l.type)&&void 0!==e?e:"default",icon:null!==(t=l.icon)&&void 0!==t?t:j.default.createElement(b.UploadOutlined,null),disabled:r||i},l.text||we("qm.upload.text")))}}Os.contextType=xe,Os.defaultProps={name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}};class Rs extends e.Component{constructor(){super(...arguments),this.cropperRef=j.default.createRef(),this.state={src:""},this.confirmHandle=()=>Ye(this,void 0,void 0,(function*(){const{quality:e}=this.props,{type:t,name:n,uid:l}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((e=>Ye(this,void 0,void 0,(function*(){let a=new File([e],n,{type:t});Object.assign(a,{uid:l});const{fileTypes:r=[],fileSize:i}=this.props;if(!(!r.length||r.includes(a.name.slice(a.name.lastIndexOf(".")+1).toLowerCase())))return u.message.warning(we("qm.upload.tooltip",{type:r.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(a);const o=this.beforeUploadRef(a,[a]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(a);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=yield o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(a=e),this.resolveRef(a)}catch(e){this.rejectRef(e)}}else Oe("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),t,e),yield tt(100),this.onClose()})),this.onOk=()=>{this.confirmHandle()},this.onClose=()=>{this.setSrc("")}}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:t}=this.props,n=Array.isArray(e)?e[0]:e;if(!n)return null;const l=n.props,{beforeUpload:a}=l,r=Ue(l,["beforeUpload"]);return this.beforeUploadRef=a,j.default.createElement(n.type,Object.assign(Object.assign({},r),{beforeUpload:(e,n)=>new Promise(((l,a)=>Ye(this,void 0,void 0,(function*(){const a=()=>l(u.Upload.LIST_IGNORE);if(t&&!(yield t(e,n)))return void a();this.fileRef=e,this.resolveRef=l,this.rejectRef=a;const r=new FileReader;r.onload=()=>{this.setSrc(r.result),r.onload=null},r.readAsDataURL(e)}))))}))}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return j.default.createElement("div",{className:"cropper-preview"},j.default.createElement("div",{className:"cropper-area"},j.default.createElement("div",{className:"img-cropper"},j.default.createElement(Is,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),j.default.createElement("div",{className:"actions"},j.default.createElement(u.Space,{size:"small"},j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},we("qm.uploadCropper.zoomIn")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},we("qm.uploadCropper.zoomOut")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},we("qm.uploadCropper.rotatePlus")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},we("qm.uploadCropper.rotateSubtract"))))),j.default.createElement("div",{className:"preview-area"},j.default.createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:t}=this.state,n=dt("cropper-preview");return j.default.createElement(j.default.Fragment,null,this.renderUpload(),t&&j.default.createElement(u.Modal,{open:!0,wrapClassName:ne.default(n,e),title:we("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}Rs.contextType=xe;class ks extends e.Component{constructor(){super(...arguments),this.state={previewVisible:!1,currentIndex:0},this.beforeUpload=(e,t)=>new Promise(((n,l)=>Ye(this,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:r,beforeUpload:i}=this.props,o=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!r||e.size/1024/1024<r,d=o&&s;if(o||u.message.warning(we("qm.upload.tooltip",{type:a.join(",")})),s||u.message.warning(we("qm.upload.sizeLimit",{size:r})),!d)return d||u.Upload.LIST_IGNORE;if(i){const a=i(e,t);if(!0===a)return n(e);if(!1===a)return l("not upload");if(a&&"function"==typeof a.then)try{const e=yield a;n(e)}catch(e){l(e)}}else n(e)})))),this.handlePreview=e=>{var t;this.setState({currentIndex:(null===(t=this.props.fileList)||void 0===t?void 0:t.findIndex((t=>t.url===e.url)))||0,previewVisible:!0})}}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}get showUploadButton(){var e,t;const n=null!==(t=null===(e=this.props.fileList)||void 0===e?void 0:e.length)&&void 0!==t?t:0;return!this.props.maxCount||n<this.props.maxCount}render(){const{previewVisible:e,currentIndex:t}=this.state,{fileList:n=[],fixedSize:l,quality:a,fileTypes:r,fileSize:i,disabled:o,readOnly:s,className:d,popupClassName:c,openCropper:f,beforeCrop:p}=this.props,h=dt("upload-img"),m={[h]:!0,[`${h}--lg`]:"large"===this.$size,[`${h}--sm`]:"small"===this.$size},g=j.default.createElement(u.Upload,qe({className:ne.default(m,d)},te.default(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:o||s,onPreview:this.handlePreview}),!this.showUploadButton||s&&n.length?null:j.default.createElement("div",null,j.default.createElement(b.PlusOutlined,null),j.default.createElement("p",null,we("qm.uploadCropper.dragableText"))));return j.default.createElement(j.default.Fragment,null,f?j.default.createElement(Rs,{className:c,fixedSize:l,quality:a,fileTypes:r,fileSize:i,beforeCrop:p},g):g,j.default.createElement("div",{style:{display:"none"}},j.default.createElement(u.Image.PreviewGroup,{preview:{visible:e,current:t,rootClassName:c,onVisibleChange:e=>{this.setState({previewVisible:e})}}},n.map((e=>j.default.createElement(u.Image,{key:e.uid,src:e.url,alt:""}))))))}}ks.contextType=xe,ks.defaultProps={name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0};const Ps=(e,t,n)=>{let l;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[n]===t)))l=r[n];else{const e=Ps(r.children,t,n);e&&(l=e)}}return l},As=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&As(e.children,t),t(e)||e.children&&e.children.length))),Ls=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Ls(e.children,t)),t(e)&&n.push(e)})),n},Hs=(e,t)=>{let n=null;for(let l=0;l<e.length;l++){if(Array.isArray(e[l].children)&&(n=Hs(e[l].children,t)),n)return n;if(t(e[l]))return e[l]}return n},_s=(e,t,n,l)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:l}):e.children?Object.assign(Object.assign({},e),{children:_s(e.children,t,n,l)}):e)),Fs=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Fs(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},Ds=(e,t,n)=>{for(let l=0;l<e.length;l++){if(e[l][n]===t)return[t];if(Array.isArray(e[l].children)){const a=Ds(e[l].children,t,n);if(a)return[e[l][n],a].flat()}}},$s=(e,t)=>{var n;const l=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>l.push(...$s(e,t)))),l},Ms=j.default.forwardRef(((e,t)=>{const{className:n,style:l,filterable:a=!0,multiple:r,draggable:i,dataSource:o,fetch:s,asyncLoad:d,checkStrictly:c,checkStrategy:f="SHOW_CHILD",placeholder:p=we("qm.form.inputPlaceholder"),fieldsDefine:h,value:m,height:v,defaultSelectedKeys:y=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:C=!0,onSelectChange:S,onCheckChange:w,onDragStart:T,onDragChange:N,onExpand:I}=e,{size:O}=j.default.useContext(xe),R=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:O)&&void 0!==n?n:""}),[e.size,O]),k=(null==h?void 0:h.valueKey)||"value",P=(null==h?void 0:h.textKey)||"text";null==h||h.children;const A=j.default.useRef(null),L=dl(A),[H,_]=j.default.useState(v),[F,D]=j.default.useState(!1),$=cl((()=>{_(A.current.offsetHeight-Z.current.offsetHeight-10)}),5);Vn((()=>{v||$()}),[L.height]);const[M,q]=j.default.useState([]),[V,K]=j.default.useState({}),[z,B]=j.default.useState([]),[W,U]=j.default.useState([]),[G,Y]=j.default.useState(""),[X,Q]=j.default.useState(x),Z=j.default.useRef(null),J=j.default.useRef([]),ee=j.default.useRef([]);j.default.useEffect((()=>{Array.isArray(o)&&(te(o),B(le(o)),K({}))}),[o]),j.default.useEffect((()=>{ie()}),[]),Vn((()=>{ie()}),[null==s?void 0:s.params]),Vn((()=>{U(re())}),[V]),j.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],l=Hs(M,(t=>e===t[k]));l&&(Array.isArray(l.children)?l.children.push(...n):l.children=[...n],te([...M]))},REMOVE_RECORD:e=>{var t;const n=Ps(M,e,k);if(void 0===n&&M.find((t=>t[k]===e)))te(M.filter((t=>t[k]!==e)));else{const l=Hs(M,(e=>n===e[k]));if(!l)return;const a=null===(t=l.children)||void 0===t?void 0:t.findIndex((t=>e===t[k]));a>=0&&(l.children.splice(a,1),te([...M]))}},UPDATE_RECORD:(e,t)=>{const n=Hs(M,(t=>e===t[k]));n&&(g.merge(n,t),te([...M]))}})));const te=e=>{q(e),J.current=e,ee.current=Fs(e,k)},le=e=>{if(r)return y;const t=Ls(e,(e=>y.includes(e[P])));return 1===t.length?[t[0][k]]:[]},ae=e=>{var t;return(null===(t=Ds(M,e,k))||void 0===t?void 0:t.slice(0,-1))||[]},re=()=>{if(x)return ee.current;const e=[];return z.forEach((t=>{if(r){if("SHOW_ALL"===f&&!ee.current.includes(t)&&e.push(...ae(t)),"SHOW_CHILD"===f&&e.push(...ae(t)),"SHOW_PARENT"===f){const n=ja(M,t);if(n){const l=ae(t),a=$s(n,k);e.push(...l,...[t,...a].filter((e=>ee.current.includes(e))))}}}else e.push(...ae(t))})),[...new Set(e)]},ie=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!s)return;const{api:t,params:n,dataKey:l,afterFetch:a,callback:r}=s;try{D(!0);const i=yield t(n);if(200===i.code){let t=Array.isArray(i.data)?i.data:null!==(e=g.get(i.data,l))&&void 0!==e?e:[];t="function"==typeof a?yield a(t):t,te(t),B(le(t)),K({}),null==r||r(t)}}catch(e){}D(!1)})),oe=e=>`${e}|${nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=dt("search-tree"),ue={[se]:!0,[`${se}--lg`]:"large"===R,[`${se}--sm`]:"small"===R};return j.default.createElement("div",{ref:A,className:ne.default(ue,n),style:l},j.default.createElement("div",{ref:Z,className:"topper"},E&&j.default.createElement(u.Input.Search,{value:G,size:R,placeholder:p,allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=As(J.current,(t=>{if(!e)return!0;const n=t[P]||"";return-1!==oe(n).indexOf(e)}));Y(e),q(t),x||e?U(Fs(t,k)):K({})})(e.target.value)}),C&&j.default.createElement("a",{className:"trigger",onClick:()=>{Q(!X),U(X?[]:ee.current)}},X?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)," ",we(X?"qm.form.collect":"qm.form.spread"))),j.default.createElement(rl,{spinning:F},j.default.createElement(u.Tree,{fieldNames:{title:P,key:k,children:"children"},multiple:r,draggable:i,blockNode:i,checkable:r,selectable:!r,height:H,disabled:e.disabled,checkStrictly:c,selectedKeys:null!=m?m:z,checkedKeys:null!=m?m:z,expandedKeys:W,treeData:M,loadData:d?e=>{let{key:t,children:n}=e;return Ye(void 0,void 0,void 0,(function*(){var e;if(!s||n)return;const{api:l,params:a,dataKey:r,formatter:i=(e=>e),afterFetch:o}=s;try{const n=yield l(i(Object.assign(Object.assign({},a),{[k]:t})));if(200===n.code){let l=Array.isArray(n.data)?n.data:null!==(e=g.get(n.data,r))&&void 0!==e?e:[];l="function"==typeof o?yield o(l):l;const a=_s(J.current,t,k,l);te(a)}}catch(e){}}))}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!G)return!1;const t=e[P]||"";return-1!==oe(t).indexOf(G)},onDragStart:T,onDragEnter:e=>{U(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,l=e.node.pos.split("-"),a=e.dropPosition-Number(l[l.length-1]),r=(e,t,n)=>{for(let l=0;l<e.length;l++){if(e[l][k]===t)return n(e[l],l,e);e[l].children&&r(e[l].children,t,n)}},i=[...M];let o;if(r(i,n,((e,t,n)=>{n.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,n=[];r(i,t,((t,l,a)=>{n=a,e=l})),-1===a?n.splice(e,0,o):n.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));te(i)},onDragEnd:e=>{null==N||N(e,M)},onExpand:(e,t)=>{at(e)&&Q(!1),ee.current.every((t=>e.includes(t)))&&Q(!0),U(e),null==I||I(e,t)},onSelect:e=>{B(e);const t=Ls(J.current,(t=>e.includes(g.get(t,k))));null==S||S(r?t:t[0])},onCheck:e=>{c&&(e=e.checked),B(e),"SHOW_CHILD"===f&&(e=e.filter((e=>!ee.current.includes(e)))),"SHOW_PARENT"===f&&(e=e.filter(((e,t,n)=>!n.includes(Ps(M,e,k)))));const t=Ls(J.current,(t=>e.includes(g.get(t,k))));null==w||w(r?t:t[0])}})))}));Ms.displayName="QmSearchTree";const js=e.createContext(void 0),qs={dataIndex:q.default.string.isRequired,title:q.default.string.isRequired,description:q.default.string,colSpan:q.default.number,width:q.default.number,minWidth:q.default.number,fixed:q.default.oneOf(["left","right"]),align:q.default.oneOf(["left","center","right"]),theadAlign:q.default.oneOf(["left","center","right"]),printFixed:q.default.bool,hidden:q.default.bool,noAuth:q.default.bool,noFixed:q.default.bool,ellipsis:q.default.bool,className:q.default.string,theadClassName:q.default.string,children:q.default.array,sorter:q.default.oneOfType([q.default.bool,q.default.func]),filter:q.default.shape({type:q.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:q.default.arrayOf(q.default.shape({text:q.default.string,value:q.default.oneOfType([q.default.string,q.default.number])})),style:q.default.object}),precision:q.default.number,displayPrecision:q.default.number,formatType:q.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:q.default.bool,canCopy:q.default.bool,editRender:q.default.func,dictItems:q.default.arrayOf(q.default.shape({text:q.default.string,value:q.default.oneOfType([q.default.string,q.default.number])})),summation:q.default.shape({sumBySelection:q.default.bool,displayWhenNotSelect:q.default.bool,dataKey:q.default.string,unit:q.default.string,render:q.default.func}),groupSummary:q.default.shape({dataKey:q.default.string,unit:q.default.string,render:q.default.func}),shouldCellUpdate:q.default.func,headRender:q.default.func,render:q.default.func};q.default.arrayOf(q.default.shape(qs)).isRequired,q.default.func,q.default.array,q.default.oneOfType([q.default.string,q.default.func]).isRequired,q.default.number,q.default.bool,q.default.bool,q.default.shape({api:q.default.func.isRequired,params:q.default.object.isRequired,formatter:q.default.func,beforeFetch:q.default.func,afterFetch:q.default.func,stopToFirst:q.default.bool,dataKey:q.default.string,callback:q.default.func}),q.default.bool,q.default.bool,q.default.string,q.default.string,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.oneOfType([q.default.object,q.default.func]),q.default.oneOfType([q.default.object,q.default.func]),q.default.array,q.default.func,q.default.bool,q.default.bool,q.default.object,q.default.object,q.default.shape({type:q.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:q.default.array,selectedRowKeys:q.default.array,hideSelectAll:q.default.bool,checkStrictly:q.default.bool,filterable:q.default.bool,selectByClickRow:q.default.bool,selectFirstRowOnChange:q.default.bool,clearableAfterFetched:q.default.bool,selectAllOnCurrentPage:q.default.bool,fetchSelectedRows:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),fetchAllRowKeys:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),disabled:q.default.func,onChange:q.default.func,onSelect:q.default.func,onSelectAll:q.default.func}),q.default.shape({currentRowKey:q.default.oneOfType([q.default.number,q.default.string]),disabled:q.default.func,onChange:q.default.func}),q.default.shape({virtual:q.default.bool,expandIconColumn:q.default.string}),q.default.shape({defaultExpandAllRows:q.default.bool,defaultExpandedRowKeys:q.default.array,expandedRowKeys:q.default.array,hideExpandAll:q.default.bool,rowExpandable:q.default.func,expandedRowClassName:q.default.string,expandedRowRender:q.default.func,onExpand:q.default.func,onChange:q.default.func}),q.default.shape({groupItems:q.default.arrayOf(q.default.shape({dataIndex:q.default.string.isRequired,titleIndex:q.default.string,color:q.default.string,backgroundColor:q.default.string})),fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),onChange:q.default.func}),q.default.func,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.shape({current:q.default.number,pageSize:q.default.number,pageSizeOptions:q.default.array,showSizeChanger:q.default.bool,showQuickJumper:q.default.bool}),q.default.shape({fileName:q.default.string,fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object}),beforeExport:q.default.func,cellStyle:q.default.bool,hideIcon:q.default.bool}),q.default.shape({showLogo:q.default.bool}),q.default.shape({fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),fieldList:q.default.arrayOf(q.default.object)}),q.default.shape({position:q.default.oneOf(["top","bottom"]),hideAlert:q.default.bool,hideClearButton:q.default.bool}),q.default.oneOf(["left","right"]),q.default.func,q.default.func,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func;const Vs=10,Ks="1",zs="0",Bs="YYYY-MM-DD",Ws="YYYY-MM-DD HH:mm:ss",Us="YYYYMMDDHHmmss",Gs={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 Ys;!function(e){e.left="flex-start",e.right="flex-end"}(Ys||(Ys={}));let Xs=[];const Qs={getFocusInstance:function(){var e;return null!==(e=Xs[0])&&void 0!==e?e:null},getInstance:function(e){var t;return null!==(t=Xs.find((t=>t.id===e)))&&void 0!==t?t:null},focus:function(e){const t=this.getInstance(e);t&&0!==Xs.findIndex((e=>e===t))&&(this.deregister(e),Xs=[t,...Xs])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Xs=[{id:e,vm:t},...Xs])},deregister:function(e){e&&(Xs=Xs.filter((t=>t.id!==e)))}};class Zs{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=[]},this.destroy=()=>{for(const e in this)this[e]=null}}}const Js={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:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};let eu;const tu=()=>{var e;if(Xe)return 0;if(void 0!==eu)return eu;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const l=document.createElement("div");l.style.width="100%",t.appendChild(l);const a=l.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),eu=n-a,eu},nu=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=nu(t.children)),t})),lu=(e,t)=>{const{fetch:n,columns:l,height:a,minHeight:r,maxHeight:i,border:o=!0,rowSelection:s,summation:u,expandable:d,treeConfig:c,webPagination:f,scrollPagination:p,dragMergeCell:h,showSuperSearch:m,showFastSearch:g,showGroupSummary:v,showTableImport:b,showClipboard:y,showSelectCollection:x,footRender:E}=e,{tableRef:C,tableFullData:S,tableData:w,selectionKeys:T,sorter:N,filters:I,superFilters:O,pagination:R}=t,{selectionRows:k,summaries:P}=C.current,{expandIconColumn:A=""}=c||{},L=e=>{const t=(e=>{const t=[],n=[],l=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?n.push(r):l.push(r)}return[...t,...l,...n]})(nu(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Js.selectionColumn,title:"radio"===t?we("qm.table.config.selectionText"):"",width:Js.selectionColumnWidth,fixed:"left",type:t}})(s),l=(null==(a=d)?void 0:a.expandedRowRender)?{dataIndex:Js.expandableColumn,title:"",width:Js.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return n&&t.unshift(n),l&&t.unshift(l),zl(t)},H=j.default.useMemo((()=>!!(null==n?void 0:n.api)),[null==n?void 0:n.api]),_=j.default.useMemo((()=>!H&&!!f),[H,f]),F=j.default.useMemo((()=>H&&!!p),[H,p]),D=j.default.useMemo((()=>(H||_)&&!F),[H,_,F]),$=j.default.useMemo((()=>!!(a||r||i)),[a,r,i]),M=j.default.useMemo((()=>L(l)),[l]),q=j.default.useMemo((()=>Kl(M)),[M]),V=j.default.useMemo((()=>q.filter((e=>"function"==typeof e.editRender))),[q]),K=j.default.useMemo((()=>q.filter((e=>!!e.summation))),[q]),z=j.default.useMemo((()=>q.filter((e=>"left"===e.fixed))),[q]),B=j.default.useMemo((()=>q.filter((e=>"right"===e.fixed))),[q]),W=j.default.useMemo((()=>{var e,t;const n=q.filter((e=>![Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(e.dataIndex)));return A&&n.some((e=>e.dataIndex===A))?A:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[q,A]),U=j.default.useMemo((()=>K.length>0),[K]),G=j.default.useMemo((()=>!!E||U),[E,U]),Y=j.default.useMemo((()=>Jl(M).length>1),[M]),X=j.default.useMemo((()=>o||Y),[o,Y]),Q=j.default.useMemo((()=>q.some((e=>e.sorter))),[q]),Z=j.default.useMemo((()=>q.some((e=>e.filter))),[q]),J=j.default.useMemo((()=>K.some((e=>!!e.summation.dataKey))),[K]),ee=j.default.useMemo((()=>!H&&!!b),[H,b]),te=j.default.useMemo((()=>!!y&&V.length>0),[y,V]),ne=j.default.useMemo((()=>!!x&&"checkbox"===(null==s?void 0:s.type)),[x,s]),le=j.default.useMemo((()=>!!m&&Z),[m,Z]),ae=j.default.useMemo((()=>!H&&!!g&&Z),[H,g,Z]),re=j.default.useMemo((()=>!!v&&q.some((e=>!!e.groupSummary))),[q]),ie=j.default.useMemo((()=>{var e;return!!(null===(e=null==u?void 0:u.groupItems)||void 0===e?void 0:e.length)}),[u]),oe=j.default.useMemo((()=>!!h&&!H&&!f),[h,H,f]),se=j.default.useMemo((()=>S.some((e=>Array.isArray(e.children)))),[S]),ue=j.default.useMemo((()=>!w.length),[w]),de=j.default.useMemo((()=>(()=>{const e={};return K.forEach((t=>{const{dataIndex:n,precision:l,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,u=ie?ha(C.current.tableFullData):C.current.tableFullData,d=!k.length&&!!o;let c=(!i||d?u:k).reduce(((e,t)=>{if(null==t?void 0:t[Js.summaryIgnore])return e;const l=la(t,n);return ia(l)?e.plus(l):e}),new ce.default(0));!Object.keys(P).includes(n)||i&&!d||(c=new ce.default(la(P,n))),aa(e,n,c.toNumber());let f=l>=0?c.toFixed(l):c.toString();a>=0&&""!==f&&(f=sa(f,a)),f=oa(f),aa(e,`${n}_text`,s?`${f} ${s}`:f)})),[e]})()),[w,T,P]),fe=j.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(K)),[K]),pe=j.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(N),l=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[l,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{n.push({type:a,bracketLeft:"",fieldName:l,expression:e,value:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(I,O),a=t?{[Js.sorterFieldName]:t}:null,r=l.length?{[Js.filterFieldName]:l}:null,i=fe?{[Js.groupSummary.summaryFieldName]:fe,usedJH:1}:null,o=null!==(e=null==n?void 0:n.params)&&void 0!==e?e:null,s={[Js.currentPageName]:R.current,[Js.pageSizeName]:R.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==n?void 0:n.params,R.current,R.pageSize,N,I,O,fe]);return{isFetch:H,isWebPagination:_,isScrollPagination:F,showPagination:D,shouldUpdateHeight:$,tableColumns:M,flattenColumns:q,editableColumns:V,summationColumns:K,leftFixedColumns:z,rightFixedColumns:B,treeExpandIndex:W,showSummary:U,showFooter:G,isHeadGroup:Y,bordered:X,isHeadSorter:Q,isHeadFilter:Z,isServiceSummation:J,isSelectCollection:ne,isTableImport:ee,isTableClipboard:te,isSuperSearch:le,isFastSearch:ae,isGroupSummary:re,isGroupSubtotal:ie,isDragMergeCell:oe,isTreeTable:se,isTableEmpty:ue,summationRows:de,fetchParams:pe}};function au(e){const t=M.useRef();t.current=e;const n=M.useCallback((function(){for(var e,n=arguments.length,l=new Array(n),a=0;a<n;a++)l[a]=arguments[a];return null===(e=t.current)||void 0===e?void 0:e.call(t,...l)}),[]);return n}const ru=(e,t)=>{const n=M.useRef(!0);M.useLayoutEffect((()=>e(n.current)),t),M.useLayoutEffect((()=>(n.current=!1,()=>{n.current=!0})),[])};function iu(e,t){ru((t=>{if(!t)return e()}),t)}const ou=(e,t)=>{const{rowKey:n,dataSource:l,summation:a,fetch:r,initialSorter:i,initialFilter:o,rowSelection:s,expandable:u,treeConfig:d,authConfig:c,ignorePageIndex:f,columnsChange:p,onChange:h,onDataChange:m,onDataLoad:v,onScrollEnd:b,onFetchError:y}=e,{getRowKey:x,tableRef:E,tableElementRef:C,tableBodyRef:S,$size:w,tableColumns:T,flattenColumns:N,tableFullData:I,pagination:O,layout:R,filters:k,sorter:P,superFilters:A,fetchParams:L,selectionKeys:H,rowExpandedKeys:_,highlightKey:F,summationColumns:D,shouldUpdateHeight:$,isFetch:M,isTreeTable:q,isWebPagination:V,isScrollPagination:K,isServiceSummation:z,isGroupSubtotal:B,doLayout:W,setTableData:U,setTableFlatColumns:G,setTableFullData:Y,setTableOriginData:X,setAllTableData:Q,setDeriveRowKeys:Z,setPagination:J,setSpinning:ee,setSorter:ne,setFilters:le,setSuperFilters:ae,setSelectionKeys:re,setRowExpandedKeys:ie,setHighlightKey:oe,setSelectionRows:se,setScrollXLoad:ue,setScrollYLoad:de,setScrollXStore:ce,setScrollYStore:fe,computeVirtualX:pe,computeVirtualY:he,setFieldAuth:me,setResizeState:ge,setSummaries:ve,setPermission:be,setRecordsMap:ye,resetTableScroll:xe,clearElementStore:Ee,clearRecordsMap:Ce}=t,{store:Se}=E.current,we=dl(C),Te=j.default.useRef(Object.assign({},L)),Ne=j.default.useRef(new Map),Ie=j.default.useRef(!1);Vn((()=>{W(),He(),E.current.scrollXLoad&&Fe()}),[T,w,R.tableAutoHeight]),iu((()=>{Re()}),[we]),Vn((()=>{xt(),Et(),Ct(),M||(V&&ct(),rt(l)),i&&ne(i),o&&le(o)}),[l,null==r?void 0:r.params]),Vn((()=>{const e=Ze(L,Te.current);e||M&&(null==s?void 0:s.clearableAfterFetched)&&St(),!e&&L[Js.currentPageName]>1&&!(null==r?void 0:r.stopToFirst)?ct():M&&nt(),Te.current=L}),[L]),Vn((()=>{V&&gt(),K||xe(),Ge()}),[O.current,O.pageSize]),Vn((()=>{M||Pe(I.length),W()}),[I]),Vn((()=>{q&&(null==d?void 0:d.virtual)&&(ft(),gt())}),[_]);const Re=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:n}=E.current,{height:l}=n,{width:a,height:r}=we,i=r!==l;W(),e&&Fe(),i&&$&&t&&gt(),ge(Object.assign({},n,{width:a,height:r}))},ke=()=>{F&&S.current.setClickedValues([F,""]),"radio"===(null==s?void 0:s.type)&&H.length&&S.current.setClickedValues([H[0],""])},Pe=e=>{e!==O.total&&J((t=>Object.assign({},t,{total:e})))},Ae=e=>{Ie.current=e},Le=cl((e=>{st(),null==b||b(e)})),He=()=>{ue(N.length>Js.virtualScrollX)},_e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollXStore:t}=E.current,{startIndex:n,endIndex:l,offsetSize:a}=t,{toVisibleIndex:r,visibleSize:i}=pe(e,R.tableWidth),o=Math.max(0,r-1-a),s=r+i+a;(r<=n||r>=l-i-1)&&(n===o&&l===s||(ce(Object.assign({},t,{startIndex:o,endIndex:s})),Fe()))},Fe=()=>{De(),$e()},De=()=>{const{scrollXLoad:e,scrollXStore:t}=E.current;if(!e)return;const n=[],l=[],a=[];for(let e=0;e<N.length;e++){const r=N[e];r.fixed?"left"===r.fixed?n.push(r):a.push(r):e>=t.startIndex&&e<t.endIndex&&l.push(r)}G([...n,...l,...a])},$e=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:n}=E.current,{tableBodyWidth:l,gutterWidth:a}=R;if(!n)return;const r=`${N.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,i=`${scrollY?l-a:l}px`;e.$tableBody.style.marginLeft=r,e.$tableXspace.style.width=i},Me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=E.current,{startIndex:n,endIndex:l,offsetSize:a,visibleSize:r,rowHeight:i}=t,{toVisibleIndex:o}=he(e,i),s=Math.max(0,o-1-a),u=o+r+a;(o<=n||o>=l-r-1)&&(n===s&&l===u||(fe(Object.assign({},t,{startIndex:s,endIndex:u})),gt()))},je=e=>B?qe(Ve(e,0)):e,qe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...qe(e.children)),delete e.children,t.push(e)})),t},Ve=(e,t)=>{var l;const r=null===(l=a.groupItems)||void 0===l?void 0:l[t];if(!r)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return ga(e,[r.dataIndex]).map((e=>{const l={children:Ve(e,t+1),_group:r.dataIndex};return"function"!=typeof n&&aa(l,n.toString(),ca()),r.titleIndex&&aa(l,r.titleIndex,la(e[0],r.titleIndex)),aa(l,r.dataIndex,la(e[0],r.dataIndex)),D.forEach((e=>{var t;const{dataIndex:n}=e,a=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Js.summaryIgnore])return e;const l=Number(la(t,n));return Number.isNaN(l)?e:e+l}),0);aa(l,n,a)})),l}))},Ke=e=>{re(e),se((e=>{const{selectionRows:t,allTableData:n,recordsMap:l}=E.current;if(M)return[...t.filter((t=>e.includes(x(t,t.index)))),...n.filter((n=>{const l=x(n,n.index);return e.includes(l)&&-1===t.findIndex((e=>x(e,e.index)===l))}))];const a=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];l.has(n)&&a.push(l.get(n))}return a})(e))},ze=e=>{const{type:t,checkStrictly:n=!0}=s||{},l=Array.isArray(e)?e:H;let a=[];return E.current.treeTable&&!n&&l.forEach((e=>{a.push(...((e,t)=>{var n;const{disabled:l}=s||{},{deriveRowKeys:a,recordsMap:r}=E.current,i=Ql(a,e);let o=[];if(!i)return o;const u=We((null==i?void 0:i.children)||[]);return o=[...new Set([...t,...u])],l&&(o=o.filter((e=>!r.has(e)||!l(r.get(e))))),((null===(n=ba(a,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ql(a,e),l=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=l?[...o,e]:o.filter((t=>t!==e))})),o})(e,l))})),a="radio"===t?l.slice(0,1):[...new Set([...l,...a])],a},Be=e=>{const{allRowKeys:t,flattenRowKeys:n}=E.current,{defaultExpandAllRows:l,expandedRowRender:a}=u||{},r=Array.isArray(e)?e:_;if(E.current.treeTable){a&&Oe("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...H];F&&e.unshift(F);let i=[];return e.forEach((e=>{const t=ba(E.current.deriveRowKeys,e)||[];i.push(...t.length>1?t.slice(0,-1).reverse():t)})),i=l?t:[...new Set([...r,...i])],i.filter((e=>!n.includes(e)))}return u?l?t.slice(0):[...r]:[]},We=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...We(e[n].children)),t.push(e[n].rowKey);return t},Ue=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Ue(e.children,t)),e.rowKey===t&&e.parentRowKey&&n.push(e.parentRowKey)})),n.length&&n.push(...Ue(e,n[n.length-1])),n},Ge=cl((()=>{null==h||h(O,Qe(k),Xe(P),A,{currentDataSource:ht()})})),Xe=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},Qe=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[l,a]=n.split("|");t[`${l}|${a}`]=e[n]}return t},Ze=(e,t)=>{const n=Object.keys(na(e,t));return 1===n.length&&(n.includes(Js.currentPageName)||n.includes(Js.pageSizeName))},Je=()=>Ye(void 0,void 0,void 0,(function*(){var t;if(!c)return;let n=te.default(c,["fetch"]);if(c.fetch){const{api:e,params:l,dataKey:a}=c.fetch;try{const r=yield e(l);200===r.code&&(n=null!==(t=a?g.get(r.data,a):r.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:l=1}=n;be((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!l})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=E.current,l=Wl(e.columns,(e=>{const{dataIndex:l}=e,a=n.fieldList.find((e=>e.dataIndex===l));if(a){const{visible:n=1,disabled:r,secretName:i}=a,o=Ul(t,l);me(l,{visible:n,disabled:r,secretName:i}),n||(e.noAuth=!0,o.noAuth=!0),i&&(e.formatType=`secret-${i}`,o.formatType=`secret-${i}`)}}));null==p||p(l)}})),tt=au((()=>Ye(void 0,void 0,void 0,(function*(){var e,t,n;if(!r)return;const{formatter:l=(e=>e),beforeFetch:i=et,afterFetch:o,callback:s}=r;if(!i(L))return;const u=!!(null===(e=null==a?void 0:a.fetch)||void 0===e?void 0:e.api);ee(!0);try{const[e,i]=u?yield Promise.all([r.api(l(L)),a.fetch.api(l(L))]):[yield r.api(l(L))];if(E.current.unMounted)return;if(u?200===e.code&&200===i.code:200===e.code){const l=null!==(t=r.dataKey)&&void 0!==t?t:Js.dataKey;let a=null!==(n=g.get(e.data,l))&&void 0!==n?n:[];a="function"==typeof o?yield o(a):a;const u=g.get(e.data,l.replace(/[^.]+$/,Js.totalKey))||a.length||0,d=Math.max(Math.ceil(u/O.pageSize),1);if(L[Js.currentPageName]>d)return ut(Object.assign(Object.assign({},O),{current:d}));rt(Ie.current?E.current.tableFullData.concat(a):a),Pe(u),it((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==y||y(e)}var d,c;d=r,c="stopToFirst",Object.prototype.hasOwnProperty.call(d,c)&&(r.stopToFirst=!1),ee(!1),Ae(!1)})))),nt=cl(tt),lt=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=lt(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:n}=O;return!M||K?e:(t-1)*n+e})(t)),e))),rt=e=>{const t=je(lt(e));vt(t),bt(t),yt(),Ke(ze()),ie(Be()),ot(),null==v||v(t)},it=e=>{var t,n,l;if(!z)return;const r=null!==(n=null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:Js.summationKey,i=null!==(l=r?g.get(e,r):e)&&void 0!==l?l:{},o={};D.filter((e=>!!e.summation.dataKey)).forEach((e=>{aa(o,e.dataIndex,Number(la(i,e.summation.dataKey)))})),ve(o)},ot=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=ht();if(e.length){const t=x(e[0],e[0].index);Ke([t])}else Ke([])}},st=()=>{if(!K)return;const e=dt();Ie.current||O.current>=e||(Ae(!0),ut(Object.assign(Object.assign({},O),{current:O.current+1})))},ut=e=>{let{current:t,pageSize:n}=e;J((e=>Object.assign({},e,{current:t,pageSize:n})))},dt=()=>{const{pageSize:e,total:t}=O;return Math.ceil(t/e)||1},ct=()=>{ut(Object.assign({},O,{current:1}))},ft=()=>{if(!E.current.treeTable||!(null==d?void 0:d.virtual))return;const e=pt(E.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=E.current,{rowExpandable:n}=u||{},l=[];return"function"==typeof n&&e.forEach(((e,a)=>!n(e)&&l.push(t[a]))),l.length?_.filter((e=>!l.includes(e))):_})());Ne.current.clear(),e.forEach(((e,t)=>Ne.current.set(e,t)))},pt=(e,t)=>{const n=[];return e.forEach((e=>{if(e.children&&n.push(...pt(e.children,t)),void 0===e.parentRowKey)n.push(e.rowKey);else if(t.includes(e.parentRowKey)){e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1))&&n.push(e.rowKey)}})),n},ht=()=>V?(()=>{const{current:e,pageSize:t}=O;return E.current.tableFullData.slice((e-1)*t,e*t)})():E.current.tableFullData,mt=e=>{const{scrollYLoad:t,scrollYStore:n}=E.current;U(t?e.slice(n.startIndex,n.endIndex):e)},gt=()=>{let e=ht();E.current.treeTable&&(null==d?void 0:d.virtual)&&(e=(e=>{const{allTableData:t,allRowKeys:n}=E.current,l=[];for(let e=0,a=n.length;e<a;e++){const a=n[e];Ne.current.has(a)&&l.push(t[e])}return l})()),de(e.length>Js.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:n,scrollYLoad:l}=E.current,{startIndex:a,rowHeight:r}=n;if(!l)return;const i=`translateY(${Math.max(0,a*r)+"px"})`,o=e.length*r+"px";t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),mt(e)},vt=e=>{Y(e),Q(e),Z(e),ft(),gt()},bt=e=>{X(e)},yt=()=>{const{allTableData:e}=E.current;Ce(),e.forEach((e=>ye(x(e,e.index),e)))},xt=()=>{ne({})},Et=()=>{le({})},Ct=()=>{ae([])},St=()=>{Ke([])};return{initialTable:()=>{Je(),ke(),He(),M?tt():rt(l)},checkDataIndex:()=>{const e=N.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&Oe("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:vt,getTableData:tt,handleTableData:mt,createTableData:rt,createGroupData:je,createSelectionKeys:ze,createRowExpandedKeys:Be,setSelectionKeysEffect:Ke,findParentRowKeys:Ue,getAllChildRowKeys:We,doFieldValidate:(e,t,n,l)=>{if(!Array.isArray(e))return Oe("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Se.removeFromRequired({x:n,y:l}),Se.removeFromValidate({x:n,y:l}),e.forEach((e=>{var a;e.required&&at(t)&&Se.addToRequired({x:n,y:l,text:e.message}),"function"!=typeof e.validator||(null===(a=e.validator)||void 0===a?void 0:a.call(e,t))||Se.addToValidate({x:n,y:l,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:l,removed:a}=Se.state,r=g.intersection(n,a),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:n.filter((e=>!r.includes(e))),updated:l.filter((e=>![...g.intersection(l,n),...g.intersection(l,a)].includes(e))),removed:a.filter((e=>!r.includes(e)))}},dataChange:()=>{null==m||m(E.current.tableFullData)},tableChange:Ge,toLastPage:()=>{const e=dt();O.current!==e&&ut(Object.assign({},O,{current:e}))},toFirstPage:ct,getPageCount:dt,pagerChangeHandle:ut,triggerScrollXEvent:e=>{_e(e)},triggerScrollYEvent:e=>{Me(e)},scrollBottomDebouncer:Le,clearTableSorter:xt,clearTableFilter:Et,clearSuperFilters:Ct,clearRowSelection:St,clearRowHighlight:()=>{oe("")},clearTableLog:()=>{Se.clearAllLog()},destroy:()=>{Ee(),Se.destroy(),Qs.deregister(E.current.uid)}}},su=(e,t)=>{const{height:n,minHeight:l,maxHeight:a,ellipsis:r,showHeader:i,spanMethod:o}=e,{getRowKey:s,tableRef:u,$size:d,tableColumns:c,flattenColumns:f,leftFixedColumns:p,layout:h,scrollX:m,scrollY:v,tableData:b,showFooter:y,showPagination:x,isWebPagination:E,isFullScreen:C,setLayout:S,setScrollX:w,setScrollY:T,setElementStore:N,setScrollXStore:I,setScrollYStore:O,setShouldToTop:R}=t,k=j.default.useRef(v),P=j.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=h,r={};return l&&Object.assign(r,{minHeight:`${ta(l)}px`}),a&&Object.assign(r,{maxHeight:`${ta(a)}px`}),C?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${e}px`}):n?Object.assign(Object.assign({},r),{height:"auto"!==n?`${ta(n)}px`:`${t}px`}):r}),[n,a,l,C,h]),A=()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=u.current;if(!e.$table.offsetParent)return;const l=e.$table.offsetHeight,a=i?e.$header.offsetHeight:h.headerHeight,r=y?e.$footer.offsetHeight:h.footerHeight,o=l-a-r,s=e.$tableBody.offsetHeight,d=t||s>o;let c=0;if(C){const t=e.$toper?e.$toper.offsetHeight+Vs:0,l=e.$pager?e.$pager.offsetHeight+Vs:0;c=n.winHeight-t-l-20}(t||o!==h.viewportHeight)&&_(o),k.current=d,T(d),S((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:o,tableBodyHeight:s,tableFullHeight:c})))},L=e=>{const{scrollXStore:t,isIE:n,scrollBarRef:l}=u.current,a=l.current.scrollLeft,{toVisibleIndex:r,visibleSize:i}=H(a,e),o=n?5:0,s=Math.max(0,r-1-o),d=Math.max(r+i+o,t.endIndex);I(Object.assign({},t,{visibleSize:i,offsetSize:o,startIndex:s,endIndex:d}))},H=(e,t)=>{const n=e+t;let l=-1,a=0,r=0;for(let t=0,i=f.length;t<i;t++){const i=f[t];if(a+=i.width||i.renderWidth,-1===l&&e<a&&(l=t),l>=0&&(r++,a>n))break}return{toVisibleIndex:Math.max(0,l),visibleSize:Math.max(8,r)}},_=e=>{const{scrollBarRef:t,scrollYStore:n,isIE:l}=u.current,a=t.current.scrollTop,{rowHeight:r}=n,{toVisibleIndex:i}=F(a,r),o=Math.max(8,Math.ceil(e/r)+2),s=l?5:0,d=Math.max(0,i-1-s),c=Math.max(i+o+s,n.endIndex);O(Object.assign({},n,{visibleSize:o,offsetSize:s,startIndex:d,endIndex:c}))},F=(e,t)=>{const n=Math.floor(e/t);return{toVisibleIndex:Math.max(0,n)}},D=(e,t)=>{const{elementStore:n,scrollYStore:l,allTableData:a}=u.current,r=n.$tableBody.parentNode.parentNode;if(void 0!==t&&t>=0)r.scrollTop=t*l.rowHeight;else{const t=(E?Zl(b):a).findIndex((t=>e===s(t,t.index)));r.scrollTop=(t<0?0:t)*l.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{N(t,e[t])}))},tableStyles:P,getSpan:(e,t,n,l,a)=>{let r=1,i=1;if("function"==typeof o){const s=o({row:e,column:t,rowIndex:n,columnIndex:l,tableData:a});Array.isArray(s)?(r=s[0],i=s[1]):g.isPlainObject(s)&&(r=s.rowSpan,i=s.colSpan)}const{mergeCells:s}=u.current;if(s.length>0){const e=s.find((e=>e.row===n&&e.col===l));e&&(r=e.rowSpan,i=e.colSpan)}return{rowSpan:r,colSpan:i}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Gl(Ul(c,e)).dataIndex);let t=0;for(let n=0;n<f.length;n++){const l=f[n];if(l.dataIndex===e)break;t+=ta(l.width||l.renderWidth||0)}return t},getStickyRight:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Yl(Ul(c,e)).dataIndex);let t=0;for(let n=f.length-1;n>=0;n--){const l=f[n];if(l.dataIndex===e)break;t+=ta(l.width||l.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:n}=u.current,l=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const a=p.map((e=>e.width||e.renderWidth||Js.defaultColumnWidth)).reduce(((e,t)=>e+t),0);n.$tableBody.parentNode.parentNode.scrollLeft=n.$tableBody.querySelectorAll("tbody > tr > td")[l].offsetLeft-a},scrollYToRecord:D,rowInViewport:e=>{const{elementStore:t,scrollYStore:n}=u.current,{viewportHeight:l,gutterWidth:a}=h,r=e*n.rowHeight,i=t.$tableBody.parentNode.parentNode;return!(r<i.scrollTop||r+n.rowHeight>i.scrollTop+(m?l-a:l))},calcTableHeight:()=>{if("auto"!==n)return;const{elementStore:e,resizeState:t}=u.current,l=t.winHeight-e.$table.getBoundingClientRect().top-(x?yr["small"!==d?"middle":d]+Vs:0)-Vs;S((e=>Object.assign({},e,{tableAutoHeight:l})))},resetTableScroll:()=>{const{shouldToTop:e}=u.current;e&&D("",0),R(!0)},computeVirtualX:H,computeVirtualY:F,doLayout:()=>{r?A():nt((()=>A())),(()=>{const{elementStore:e,scrollXLoad:t}=u.current,n=e.$table.clientWidth,l=k.current?h.gutterWidth:0,{defaultColumnWidth:a}=Js,r=[];let i=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,i+=e.width):(e.renderWidth=void 0,r.push(e))})),r.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||a)),0);if(e<=n-l){w(!1);const t=n-l-e;if(1===r.length)r[0].renderWidth=(r[0].minWidth||a)+t;else{const e=t/r.reduce(((e,t)=>e+(t.minWidth||a)),0);let n=0;r.forEach(((t,l)=>{if(0===l)return;const r=Math.floor((t.minWidth||a)*e);n+=r,t.renderWidth=(t.minWidth||a)+r})),r[0].renderWidth=(r[0].minWidth||a)+t-n}}else w(!0),r.forEach((e=>{e.renderWidth=e.minWidth||a}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else i=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||a)),0),w(i>n),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:i})));S((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&L(n)})()}}},uu=(e,t)=>{const{columns:n,summation:l,rowSelection:a,expandable:r,rowHighlight:i,mergeCells:o=[]}=e,{tableRef:s,topElementRef:u,tableElementRef:d,tableBodyRef:c,$size:f,scrollX:p,pagination:h,selectionKeys:m,rowExpandedKeys:v,highlightKey:b,summationRows:y,showSummary:x,isWebPagination:E,isScrollPagination:C,isTreeTable:S,checkDataIndex:w,toLastPage:T,toFirstPage:N,getPageCount:I,setHandleState:O,scrollYToRecord:R,setSelectionKeysEffect:k,setOriginColumns:P,setRowExpandedKeys:A,setHighlightKey:L,setResizeState:H,setMergeCells:_,setPingRight:F,setUnMounted:D,setHandleChange:$,calcTableHeight:M,createSelectionKeys:q,createRowExpandedKeys:V,createElementStore:K,triggerScrollYEvent:z,initialTable:B,destroy:W}=t,{elementStore:U,handleState:G,scrollYLoad:Y}=s.current,X=j.default.useRef(y);Vn((()=>{if(!a)return;const{onChange:e}=a;"radio"===a.type&&c.current.setClickedValues(m.length?[m[0],""]:[]),s.current.isHandleChange&&(null==e||e(m,s.current.selectionRows)),$(!0)}),[m]),Vn((()=>{if(!r)return;const{allTableData:e,allRowKeys:t}=s.current,{onChange:n}=r;null==n||n(v,v.map((n=>e[t.findIndex((e=>e===n))])))}),[v]),Vn((()=>{var e,t;const{allTableData:n,allRowKeys:l}=s.current;S&&A(V()),i&&(c.current.setClickedValues(b?[b,""]:[]),null===(e=i.onChange)||void 0===e||e.call(i,b,null!==(t=n[l.findIndex((e=>e===b))])&&void 0!==t?t:null))}),[b]),Vn((()=>{var e;g.isEqual(y,X.current)||(X.current=y,x&&l&&(null===(e=l.onChange)||void 0===e||e.call(l,y)))}),[y]),Vn((()=>{const e=q(a.selectedRowKeys);g.isEqual(e,m)||(k(e),S&&A(V()))}),[null==a?void 0:a.selectedRowKeys]),Vn((()=>{const e=V(r.expandedRowKeys);g.isEqual(e,v)||A(e)}),[null==r?void 0:r.expandedRowKeys]),Vn((()=>{const{currentRowKey:e}=i;e!==b&&L(null!=e?e:"")}),[null==i?void 0:i.currentRowKey]),Vn((()=>{const{insert:e,remove:t}=G;e&&(E&&("after"===e?T():N()),R("","after"===e?1e5:0)),t&&h.current>I()&&T(),(e||t)&&O({insert:null,remove:!1})}),[h.total]),Vn((()=>{Y&&z(U.$tableBody.parentNode.parentNode.scrollTop)}),[Y]),Vn((()=>{F(p)}),[p]),Vn((()=>{M()}),[f]),Vn((()=>{_(o),c.current.forceUpdate()}),[o]),Vn((()=>{Y&&(e.height||e.maxHeight||Oe("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||Oe("Table","必须设置组件参数 `ellipsis`")),C&&(e.height||e.maxHeight||Oe("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[Y,C]);const Q=()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(H(Object.assign({},e,{winHeight:n})),M())};j.default.useEffect((()=>(K({$toper:u.current,$table:d.current}),P(rt(n)),B(),_(o),window.addEventListener("resize",Q,!1),M(),w(),()=>{W(),window.removeEventListener("resize",Q),D(!0)})),[])},du=e=>{const{total:t}=e,{tableRef:n,selectionKeys:l,isHeadSorter:a,isHeadFilter:r,isTreeTable:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:u,clearRowSelection:d,clearRowHighlight:c}=j.default.useContext(js),{infoBarConfig:f,rowSelection:p,rowHighlight:h}=n.current.props,{allTableData:m,invalidRowKeys:g}=n.current,{hideAlert:v,hideClearButton:y}=f||{},x=j.default.useMemo((()=>!v),[v]),E=j.default.useMemo((()=>!y&&!!(a||r||p||h)),[y,a,r,p,h]),C={[`${dt("table")}__alert`]:!0};return x?j.default.createElement("div",{className:ne.default(C)},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.InfoCircleFilled,null)),j.default.createElement("span",null,we("qm.table.alert.total",{total:i?m.length:t}),p?`,${we("qm.table.alert.selected",{total:Math.max(l.length-g.length,0)})}`:""),E&&j.default.createElement("em",{onClick:()=>{s(),u(),d(),c(),nt((()=>o()))}},we("qm.table.alert.clear"))):null},cu=j.default.forwardRef(((e,t)=>{const{isFullScreen:n,open:l=!0}=e,{setFullScreen:a}=j.default.useContext(js),r=()=>{a(!n)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table");return l?j.default.createElement("span",{className:`${i}-full-screen`,title:we(n?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},n?j.default.createElement(b.FullscreenExitOutlined,null):j.default.createElement(b.FullscreenOutlined,null))):null}));cu.displayName="FullScreen";const fu=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{getTableData:l}=j.default.useContext(js),a=()=>{l()};j.default.useImperativeHandle(t,(()=>({clickHandle:a})));const r=dt("table");return n?j.default.createElement("span",{className:`${r}-reload`,title:we("qm.table.refresh.text"),onClick:()=>a()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.ReloadOutlined,null))):null}));fu.displayName="Reload";const pu=()=>{const e={dateFormat:e=>{const t=e?K.default(e).format(Bs):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?K.default(e).format(Ws):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?K.default(e).format(Ws.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>ia(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>oa(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,l)=>{var a,r,i,o;const{dictItems:s,precision:u,displayPrecision:d,formatType:c,editRender:f}=n,p=s||(null===(a=null==f?void 0:f(l,n))||void 0===a?void 0:a.items)||[];let h=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)&&(h=t.map((e=>{var t,n;return null!==(n=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),u>=0&&""!==h&&(h=ia(h)?new ce.default(h).toFixed(u):h),d>=0&&""!==h&&(h=sa(h,d)),c){const t=e[`${lt(c)}Format`];t?h=t(h):Oe("Table","字段的格式化类型 `formatType` 配置不正确")}return h},n=e=>Qe(e)?fa(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,l,a,r)=>{const i=la(e,l.dataIndex),o=l.render?l.render(i,e,l,a,r):t(i,l,e);return n(o)}}},hu=j.default.forwardRef(((e,t)=>{var n,l,a,r;const{tableColumns:i,open:o=!0}=e,{global:s}=j.default.useContext(xe),{tableRef:u,flattenColumns:d,summationRows:c,showSummary:f,getSpan:p}=j.default.useContext(js),{tablePrint:h,showHeader:m}=u.current.props,{getTitleFromCellValue:v}=pu(),y=null!==(l=null===(n=null==s?void 0:s.print)||void 0===n?void 0:n.leftLogo)&&void 0!==l?l:"",x=null!==(r=null===(a=null==s?void 0:s.print)||void 0===a?void 0:a.rightLogo)&&void 0!==r?r:"",E=!(!y&&!x),C=j.default.useMemo((()=>rt(Xl(i,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn]))),[i]),S=j.default.useMemo((()=>rt(Xl(d,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn]))),[d]),w=j.default.useMemo((()=>rt(i.filter((e=>e.printFixed)))),[i]),T=e=>{const t=Object.assign({},va(C,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?T(t):t},N=(e,t)=>g.map(g.groupBy(g.flatten(e),t),g.spread((function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return g.mergeWith(...n,((e,n)=>{if(Array.isArray(e))return N(e.concat(n),t)}))}))),I=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(T(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:N(n,"dataIndex")[0]})))(n),t.push(Jl(n))})),t},O=()=>{const{allTableData:e}=u.current,t=(e=>{const t=[];let n=[],l=0,a=0;for(;a<e.length;){const r=e[a];l+=r.width||r.renderWidth||r.minWidth||Js.defaultColumnWidth,l<=Js.printWidth?(n.push(r),a===e.length-1&&t.push(n),a++):a>0?(e.splice(0,a),w.length&&e.unshift(...w),t.push(n),n=[],l=0,a=0):(r.width=Js.printWidth,n.push(r),t.push(n),a++)}return t})([...S]),n=I(t);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 a=0;a<t.length;a++)l+=R(n[a],t[a],e),l+='<div class="page-break"></div>';return l+"</body></html>"},R=(e,t,n)=>{const{showLogo:l=!0}=h;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((e=>{let{width:t,minWidth:n,renderWidth:l}=e;return`<col style="width:${t||l||n||Js.defaultColumnWidth}px">`})).join("")}</colgroup>`,m&&(a+=["<thead>",l&&E?`<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">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${pa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(a+=`<tbody>${n.map((e=>`<tr>${t.map(((t,l)=>{const{rowSpan:a,colSpan:r}=p(e,t,e.index,l,n);return a&&r?`<td rowspan="${a}" colspan="${r}">${v(e,t,e.index,l)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&c.length&&(a+=["<tfoot>",c.map((e=>`<tr>${t.map(((t,l)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(n):la(e,`${a}_text`);return`<td>${0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},k=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:l,isDownload:a}=e,r=`${n}.${l}`;if(window.Blob){const e=new Blob([t],{type:`text/${l}`});if(!a)return Promise.resolve({type:l,content:t,blob:e});vl(e,r)}})({filename:"print",type:"html",isDownload:!1},O()))||void 0===e||e.then((e=>{let{content:t,blob:n}=e,l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),u.current.isIE?(l.contentDocument.write(t),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(n))}))};j.default.useImperativeHandle(t,(()=>({clickHandle:k})));const P=dt("table");return o?j.default.createElement("span",{className:`${P}-print`,title:we("qm.table.print.text"),onClick:()=>k()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.PrinterOutlined,null))):null}));hu.displayName="TablePrint";const mu="606060",gu="thin",vu="d4d4d4",bu=(e,t)=>{t&&(e.height=Math.floor(.75*t))},yu=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},xu=()=>({top:{style:gu,color:{argb:vu}},left:{style:gu,color:{argb:vu}},bottom:{style:gu,color:{argb:vu}},right:{style:gu,color:{argb:vu}}}),Eu=e=>{const{children:t}=e;return t&&t.length?Eu(t[0]):e},Cu=e=>{const{precision:t,formatType:n}=e,l=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:l?`0${l}%`:"0%"}:"finance"===n?{numFmt:l?`#,##0${l}`:"#,##0"}:l?{numFmt:`0${l}`}:null},Su=()=>{const{tableRef:e,getSpan:t,showSummary:n,isHeadGroup:l}=j.default.useContext(js),{spanMethod:a,showHeader:r}=e.current.props,i=(e,t)=>{var n,l,a;return null!==(a=null!==(l=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==l?l:t)&&void 0!==a?a:""};return{exportXLSX:(i,o,s,u)=>Ye(void 0,void 0,void 0,(function*(){const{columns:d,footSummation:c}=i,{scrollYStore:{rowHeight:f}}=e.current,p=Kl(d),h=Jl(d),m=[],g=[],v=[],b=[];let y=0;const x={};p.forEach((e=>{const{dataIndex:t,width:n,minWidth:l,renderWidth:a}=e;x[t]=pa(e.title),v.push({key:t,width:(n||a||l||Js.defaultColumnWidth)/8})})),r&&(l?h.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:l,rowSpan:a}=e,r=Eu(e),i=p.findIndex((e=>{let{dataIndex:t}=e;return t===r.dataIndex}));n[r.dataIndex]=pa(e.title),0!==l&&(l>1||a>1)&&b.push({s:{r:t,c:i},e:{r:t+a-1,c:i+l-1}})})),m.push(n)})):(p.forEach(((e,t)=>{const{colSpan:n,rowSpan:l}=e;(n>1||l>1)&&b.push({s:{r:y,c:t},e:{r:y+l-1,c:t+n-1}})})),m.push(x)),y+=m.length);const E=o.map(((e,n)=>{const l={};return p.forEach(((r,i)=>{if("function"==typeof a){const{rowSpan:l,colSpan:a}=t(e,r,n,i,o);(a>1||l>1)&&b.push({s:{r:n+y,c:i},e:{r:n+y+l-1,c:i+a-1}})}const s=["percent","finance"].includes(r.formatType);l[r.dataIndex]=s?la(e,r.dataIndex):u(e,n,r,i)})),l}));y+=E.length,n&&c&&s(p,o).forEach(((e,t)=>{const n={};p.forEach(((t,l)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(o):la(e,a);n[a]=0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i})),g.push(n)}));const{sheetName:C,useStyle:S}=i,w=new ve.default.Workbook,T=w.addWorksheet(C);T.columns=v,r&&T.addRows(m).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l,theadAlign:a}=n;yu(e,a||l),S&&Object.assign(e,{font:{bold:!0,color:{argb:mu}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:xu()})}))})),T.addRows(E).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l}=n;yu(e,l),Object.assign(e,Cu(n)),S&&Object.assign(e,{font:{color:{argb:mu}},border:xu()})}))})),n&&c&&T.addRows(g).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l}=n;yu(e,l),Object.assign(e,Cu(n)),S&&Object.assign(e,{font:{color:{argb:mu}},border:xu()})}))})),b.forEach((e=>{let{s:t,e:n}=e;T.mergeCells(t.r+1,t.c+1,n.r+1,n.c+1)}));const N=yield w.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),l=-1!==e.indexOf('"');return l&&(t=t.replace(/"/g,'""')),(n||l)&&(t='"'+t+'"'),t},l="\ufeff"+(e=>{let t,l,a,r,i="";for(t=0;t<e.rows.length;t+=1){for(a=e.rows[t],l=0;l<a.cells.length;l+=1)r=a.cells[l],i=i+(l?",":"")+n(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,n)=>{t=t||"",n=n||512;const l=window.atob(e),a=[];let r;for(r=0;r<l.length;r+=n){const e=l.slice(r,r+n),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=l,window.btoa(unescape(encodeURIComponent(a)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:l}=e,a=Kl(n),r=new FileReader;r.onerror=()=>{u.message.error(we("qm.table.import.error"))},r.onload=e=>{const n=a.map((e=>pa(e.title))),l=new ve.default.Workbook,r=e.target;r?l.xlsx.load(r.result).then((e=>{const l=e.worksheets[0];if(l){const e=l.getSheetValues(),r=e.findIndex((e=>e&&e.length>0)),o=e[r],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,o);if(s){const l=e.slice(r+1).map((e=>{const t={};e.forEach(((e,n)=>{let l=e;g.isPlainObject(l)&&(l=e.text),g.isDate(l)&&(l=da(e,Ws)),t[o[n]]=l}));const l={};return n.forEach(((e,n)=>{var r;const{dataIndex:o,dictItems:s}=a[n];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>i(s,e))).filter((e=>""!==e)):t[e]=i(s,t[e])),aa(l,o,t[e])})),l}));null==t||t(l)}else u.message.error(we("qm.table.import.error"))}else u.message.error(we("qm.table.import.error"))})):u.message.error(we("qm.table.import.error"))},r.readAsArrayBuffer(l)}}},wu=e=>{const{fileType:t,onChange:n}=e;let l,a;const r=dt("table"),i=e=>{const t=e.name,n=t.lastIndexOf("."),l=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:l}},o=()=>Ye(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return l||(l=document.createElement("form"),a=document.createElement("input"),l.className=`${r}--file-form`,a.name="file",a.type="file",l.appendChild(a),document.body.appendChild(l)),new Promise(((e,n)=>{const r=!t.type;a.multiple=!!t.multiple,a.accept=r?"":`.${t.type}`,a.onchange=o=>{const{files:s}=o.target,d=s[0];let c="";if(!r)for(let e=0;e<s.length;e++){const{type:n}=i(s[e]);if(t.type!==n){c=n;break}}c?(u.message.warning(we("qm.upload.notType",{type:c})),n()):e(d),document.body.removeChild(l),l=null,a=null},l.reset(),a.click()}))})({type:t});null==n||n(e.name,e)}catch(e){}}));return j.default.createElement(ot,{onClick:()=>o()},we("qm.upload.text"))},Tu=e=>{const{columns:t,onClose:n}=e,{tableRef:l,createTableData:a,dataChange:r}=j.default.useContext(js),{beforeTableImport:i}=l.current.props,{importXLSX:o}=Su(),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState(!0),h=e=>e.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))),[m,g]=j.default.useState([{type:"INPUT",label:we("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:n}=t.GET_FIELDS_VALUE(["fileName"]);return j.default.createElement(j.default.Fragment,null,n?j.default.createElement("span",null,n):j.default.createElement(wu,{fileType:t.state.formData.fileType,onChange:(e,n)=>{t.SET_FIELDS_VALUE({fileName:e,file:n}),n&&p(!1)}}))}},{type:"SELECT",label:we("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:we("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:we("qm.table.import.fillText"),value:"fill"},{text:we("qm.table.import.addText"),value:"add"},{text:we("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{m.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,g([...m])}},{type:"INPUT_NUMBER",label:we("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:l.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),v=dt("table");return j.default.createElement("div",{className:`${v}-import__setting`},j.default.createElement(us,{ref:s,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:m,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:d,disabled:f,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,d]=yield s.current.GET_FORM_DATA();e||(c(!0),o({columns:h(t),file:d.file},(e=>Ye(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:o}=l.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof i)try{e=yield i(e)}catch(e){}if("fill"===d.importType&&a(e),"add"===d.importType&&a([...t,...e]),"insert"===d.importType){const{tableFullData:t}=l.current,n=d.posIndex,r=t.slice(0,n).concat(e).concat(t.slice(n));a(r)}e.forEach((e=>{o.addToInserted(e)})),r(),u.message.success(we("qm.table.import.success",{total:e.length})),c(!1),n()})))))}))},we("qm.table.import.text"))))},Nu=j.default.forwardRef(((e,t)=>{const{tableColumns:n,open:l=!0}=e,[a,r]=j.default.useState(!1),i=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:i})));const o={[`${dt("table")}-import`]:!0},s={visible:a,title:we("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement("span",{className:ne.default(o),title:we("qm.table.import.textNoSpace"),onClick:()=>i()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.ImportOutlined,null))),j.default.createElement(Il,s,j.default.createElement(Tu,{columns:n,onClose:()=>r(!1)})))}));Nu.displayName="TableImport";const Iu=e=>{const{columns:t,onChange:n}=e,{$size:l}=j.default.useContext(js),a=j.default.useRef([]),[r,i]=j.default.useState(!1),[o,s]=j.default.useState(t);Vn((()=>{c()}),[o]),j.default.useEffect((()=>{d()}),[t]);const d=()=>{const e=[];t.forEach(((n,l)=>{const a=n.colSpan;a>1&&t.slice(l+1,l+a).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(t.slice(l,l+a))})),a.current=e},c=()=>{const e=[];o.forEach((t=>{const{colSpan:n,dataIndex:l}=t;if(0===n)return;if(1===n)return e.push(t);const r=a.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(l)));if(-1===r)return e.push(t);e.push(...a.current[r].map(((e,n)=>{let{dataIndex:l}=e;const a=o.find((e=>e.dataIndex===l));return n>0&&void 0!==t.hidden&&(a.hidden=t.hidden),a})))})),null==n||n(e)},f=dt("table"),p={[`${f}__popper`]:!0,"column-filter__popper":!0,[`${f}--lg`]:"large"===l,[`${f}--sm`]:"small"===l},h=[`${f}-column-filter`,{selected:r}];return j.default.createElement(io,{action:["click"],popupVisible:r,popup:j.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},j.default.createElement("div",{className:"main"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:o,setList:e=>{const t=e.map((e=>e.dataIndex)),n=o.map((e=>e.dataIndex));g.isEqual(t,n)||s(Ea(e))}},o.map((e=>((e,t)=>{const{colSpan:n}=e;if(0===n)return j.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const l=["svgicon","handle",`${t}-handle`];return j.default.createElement("li",{key:e.dataIndex,className:"item"},j.default.createElement(u.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,s([...o])}}),j.default.createElement("i",{className:ne.default(l),title:we("qm.table.columnFilter.draggable")},j.default.createElement(b.HolderOutlined,null)),j.default.createElement("span",{className:"text"},pa(e.title)))})(e,"main")))))),popupClassName:ne.default(p),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{i(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement("span",{className:ne.default(h),title:we("qm.table.columnFilter.text")},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.SettingOutlined,null)),j.default.createElement("span",null,we("qm.table.columnFilter.text"))))},Ou=e=>{const{defaultValue:t,onClose:n,onOk:l}=e,{tableRef:a,selectionKeys:r,pagination:i,showSummary:o}=j.default.useContext(js),{rowSelection:s}=a.current.props,u=j.default.useRef(null),[d,c]=j.default.useState(!1),f=j.default.useMemo((()=>Object.assign({},{fileName:`${K.default().format(Us)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:r.length?"selected":"all","startIndex|endIndex":[1,i.total],footSummation:o?1:0,useStyle:0},t,{columns:rt(t.columns||[])})),[]),[p,h]=j.default.useState([{type:"INPUT",label:we("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:we("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:we("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:we("qm.table.export.all"),value:"all"},{text:we("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==s?void 0:s.type)},{text:we("qm.table.export.custom"),value:"custom"}]},onChange:e=>{p.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,h([...p])}},options:{min:1},disabled:!0},{type:"INPUT",label:we("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>j.default.createElement(Iu,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:we("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!o,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:we("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),m=dt("table");return j.default.createElement("div",{className:`${m}-export__setting`},j.default.createElement(us,{ref:u,initialValues:f,items:p,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:d,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();if(!e){c(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);l(t),yield tt(1e3),c(!1),n()}}))},we("qm.table.export.text"))))},Ru=j.default.forwardRef(((e,t)=>{var n;const{tableColumns:l,open:a=!0}=e,{global:r}=j.default.useContext(xe),{tableRef:i,flattenColumns:o,pagination:s,fetchParams:d,isFetch:c,isGroupSubtotal:f,showSummary:p,getSpan:h}=j.default.useContext(js),{exportExcel:m,fetch:v,showHeader:y}=i.current.props,{getTitleFromCellValue:x}=pu(),[E,C]=j.default.useState(!1),[S,w]=j.default.useState(!1),T=j.default.useMemo((()=>{var e;return!!(null===(e=null==m?void 0:m.fetch)||void 0===e?void 0:e.api)}),[m]),N=j.default.useMemo((()=>!s.total||S),[s.total,S]),I=j.default.useMemo((()=>Xl(l,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn])),[l]),O=j.default.useMemo((()=>Xl(o,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn])),[o]),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.map(((e,l)=>{const a=Object.assign(Object.assign({},e),{index:l,pageIndex:l}),r=t?`${t}-${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=n,Array.isArray(e.children)&&(a.children=R(e.children,r,n+1)),O.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&aa(a,t,la(a,t))})),a}))},k=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:l}=e,a=(f?ha(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Js.summaryIgnore])return e;const n=Number(la(t,l));return Number.isNaN(n)?e:e+n}),0);aa(n,l,a)})),[n]},P=(e,t,n,l)=>{const{precision:a,formatType:r}=n;let i=x(e,n,t,l);return a>=0&&!r&&""!==i&&(i=Number(i)),i},{exportXLSX:A,exportCSV:L}=Su(),H=e=>Ye(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:l=(e=>e),afterFetch:a,dataKey:r}=v;let i=[];try{w(!0);const o=yield n(Object.assign(Object.assign({},l(d)),{[Js.currentPageName]:1,[Js.pageSizeName]:null!=e?e:s.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=g.get(o.data,r))&&void 0!==t?t:[];e="function"==typeof a?yield a(e):e,i=Zl(R(e))}}catch(e){}return w(!1),i})),_=e=>{var t;const n=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:n,footSummation:l}=e,a=Jl(n),r=Kl(n);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${r.map((e=>{let{width:t,minWidth:n,renderWidth:l}=e;return`<col style="width:${t||l||n||Js.defaultColumnWidth}px">`})).join("")}</colgroup>`,y&&(i+=["<thead>",a.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${pa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${r.map(((n,l)=>{const{rowSpan:a,colSpan:r}=h(e,n,e.index,l,t);return a&&r?`<td rowspan="${a}" colspan="${r}">${P(e,e.index,n,l)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),p&&l&&(i+=["<tfoot>",k(r,t).map((e=>`<tr>${r.map(((n,l)=>{const{dataIndex:a,summation:r}=n,i=(null==r?void 0:r.render)?r.render(t):la(e,a);return`<td>${0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},D=null!==(n=null==m?void 0:m.fileName)&&void 0!==n?n:`${K.default().format(Us)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),M=()=>{if(N)return u.message.warning(we("qm.table.export.warnText"));var e;T?(e=D,Ye(void 0,void 0,void 0,(function*(){w(!0);try{const{api:t,params:n}=m.fetch,l=yield t(Object.assign(Object.assign(Object.assign({columns:O.map((e=>{const{title:t,dataIndex:n,hidden:l}=e,{type:a}=e.filter||{};return{title:t,dataIndex:n,type:a,hidden:l}}))},d),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Js.currentPageName]:void 0,[Js.pageSizeName]:void 0}));l.data&&(vl(l.data,e),_(e))}catch(e){}w(!1)}))):C(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:M})));const q={[`${dt("table")}-export`]:!0},V={visible:E,title:we("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},z={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:I,useStyle:(null==m?void 0:m.cellStyle)?1:0};return j.default.createElement(j.default.Fragment,null,a&&j.default.createElement("span",{className:ne.default(q),title:we("qm.table.export.textNoSpace"),onClick:()=>M()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.DownloadOutlined,null))),j.default.createElement(Il,V,j.default.createElement(Ou,{defaultValue:z,onClose:()=>C(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:zl(e.columns)}),Ye(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:l,startIndex:a=1,endIndex:r}=t,{allTableData:o,selectionRows:s}=i.current;let u=[];if(c?("all"===l&&(u=yield H()),"custom"===l&&(u=yield H(r),u=u.slice(a-1))):("all"===l&&(u=o.slice(0)),"custom"===l&&(u=o.slice(a-1,r||void 0))),"selected"===l&&(u=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==m?void 0:m.beforeExport))try{u=null==m?void 0:m.beforeExport(u)}catch(e){}if("xlsx"===n){const n=yield A(t,u,k,P);vl(n,`${e}.xlsx`),_(`${e}.xlsx`)}if("csv"===n){const n=L(t,F(t,u));vl(n,`${e}.csv`),_(`${e}.csv`)}}))}})))}));Ru.displayName="TableExport";const ku=e=>{const{columns:t,onClose:n}=e,{tableRef:l,tableBodyRef:a,dataChange:r}=j.default.useContext(js),{beforeClipboard:i}=l.current.props,o=j.default.useRef(null),[s,d]=j.default.useState([{type:"INPUT_NUMBER",label:we("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:we("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:pa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:we("qm.table.clipboard.content"),fieldName:"content",placeholder:we("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[c,f]=j.default.useState(!1),p=dt("table");return j.default.createElement("div",{className:`${p}-clipboard__setting`},j.default.createElement("h3",{className:"info"},we("qm.table.clipboard.supportText")),j.default.createElement(us,{ref:o,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:s,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:c,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;const[s,d]=yield o.current.GET_FORM_DATA();if(s)return;const{tableFullData:c,store:p}=l.current;f(!0);const h=d.content.trim().replace(/(\r|\n)$/,"");let m=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{m=m.replace(/\^/,e)}));let g=m.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof i)try{g=yield i(g,g[0].map(((e,n)=>t[d.colIndex+n].dataIndex)))}catch(s){}g.forEach(((e,n)=>{e.forEach(((e,a)=>{var r,i;const o=c[d.rowIndex-1+n],s=t[d.colIndex+a];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(r=e.extra)||void 0===r?void 0:r.disabled)||(null===(i=l.current.fieldAuth[s.dataIndex])||void 0===i?void 0:i.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(aa(o,s.dataIndex,e),p.addToUpdated(o))}}))})),a.current.forceUpdate(),r(),u.message.success(we("qm.table.clipboard.success",{total:g.length})),f(!1),n()}))},we("qm.table.clipboard.text"))))},Pu=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{flattenColumns:l}=j.default.useContext(js),[a,r]=j.default.useState(!1),i=j.default.useMemo((()=>(e=>e.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))))(l)),[l]),o=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={[`${dt("table")}-clipboard`]:!0},u={visible:a,title:we("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:ne.default(s),title:we("qm.table.clipboard.textNoSpace"),onClick:()=>o()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.CopyOutlined,null))),j.default.createElement(Il,u,j.default.createElement(ku,{columns:i,onClose:()=>r(!1)})))}));Pu.displayName="TableClipboard";const Au=e=>{const{columns:t,onClose:n}=e,{tableRef:l,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=j.default.useContext(js),{rowKey:o}=l.current.props,s=j.default.useRef(null),u=dl(s),d=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=d(e.children)),n})),[c,f]=j.default.useState([{title:we("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...d(t.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))))]),[p]=j.default.useState(l.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})))),[h,m]=j.default.useState(300),g=cl((()=>{const e=s.current;m(e.offsetHeight-2*yr[a]-30)}),5);return Vn((()=>{g()}),[u.width]),j.default.createElement("div",{ref:s,style:{height:"100%"}},j.default.createElement(gd,{size:a,columns:c,dataSource:p,rowKey:o,height:h,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=>f(e)}),j.default.createElement("div",{style:{height:10}}),j.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"}},j.default.createElement(ot,{onClick:()=>n()},we("qm.table.selectCollection.closeButton"))))},Lu=j.default.forwardRef(((e,t)=>{const{columns:n,open:l=!0}=e,{tableRef:a,getRowKey:r,selectionKeys:i,isFetch:o,isTableEmpty:s,setSelectionKeysEffect:u,setSelectionRows:d}=j.default.useContext(js),{rowSelection:c}=a.current.props,[f,p]=j.default.useState(!1),h=j.default.useRef(!1);Vn((()=>{!h.current&&m()}),[s]);const m=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=c;if(o&&t)try{const l=yield t.api(Object.assign({},{selectedKeys:i},t.params));if(200===l.code){let a=Array.isArray(l.data)?l.data:null!==(e=g.get(l.data,t.dataKey))&&void 0!==e?e:[];a=a.filter((e=>!n(e))),u(a.map(((e,t)=>r(e,t)))),d(a),h.current=!0}}catch(e){}})),v=()=>{p(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:v})));const y=dt("table"),x={visible:f,title:we("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>p(!1)};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement("span",{className:`${y}-select-collection`,title:we("qm.table.selectCollection.text"),onClick:()=>v()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.CheckSquareOutlined,null))),j.default.createElement(Il,x,j.default.createElement(Au,{columns:n,onClose:()=>p(!1)})))}));Lu.displayName="SelectCollection";const Hu=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,getRowKey:a,$size:r,flattenColumns:i,pagination:o,setPagination:s,scrollYToRecord:d,setHighlightKey:c,setShouldToTop:f,isTreeTable:p,isWebPagination:h}=j.default.useContext(js),{uniqueKey:m}=l.current.props,v=j.default.useRef(null),y=j.default.useRef(null),x=j.default.useRef([]),E=j.default.useRef(""),C=j.default.useRef(-1),S=j.default.useRef("stop");Vn((()=>{const{current:e,pageSize:t}=o,n=l.current.tableFullData.slice((e-1)*t,e*t),r=Zl(n).findIndex((e=>a(e,e.index)===E.current));d("",r)}),[o.current]);const w=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},T=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:w(e.filter.type),fieldName:e.dataIndex,label:pa(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA(),[n,l]=yield y.current.GET_FORM_DATA(),a=g.omitBy(Object.assign({},t,l),at);R(a)}))}})),N={case:0,fullchar:0},I=j.default.useMemo((()=>i.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[i]),[O,R]=j.default.useState({}),[k,P]=j.default.useState(N),[A]=j.default.useState(T([I[0]])),[L]=j.default.useState(T(I.slice(1))),[H,_]=j.default.useState(0),F=j.default.useMemo((()=>!Object.keys(O).length),[O]);Vn((()=>{S.current="ready"}),[O,k]);const D=e=>{P(Object.assign({},k,e))},$=(e,t,n)=>new Promise(((l,a)=>{u.Modal.confirm({title:we("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),l()},onCancel:()=>{n(),l()}})})),M=e=>Ye(void 0,void 0,void 0,(function*(){if(!Object.keys(O).length)return u.Modal.warning({title:we("qm.button.confirmPrompt"),content:we("qm.table.fastSearch.queryCondition")});if("ready"===S.current&&(S.current="stop",x.current=(e=>{const{allTableData:t}=l.current,n=[];for(let l=0,r=t.length;l<r;l++){const r=t[l];let i=!0;for(const t in e){const{type:n}=I.find((e=>e.dataIndex===t)).filter;let l=la(r,t),o=!0;if("text"===n||"textarea"===n?o=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(l):(l="string"==typeof(a=l)&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(a)?l.slice(0,10):l,o=l==e[t]),!o){i=!1;break}}i&&n.push(r)}var a;return n})(O),_(x.current.length)),!x.current.length)return c(""),u.Modal.warning({title:we("qm.button.confirmPrompt"),content:we("qm.table.fastSearch.notMatch")});"next"===e&&(C.current=C.current<0?0:C.current+1,C.current>x.current.length-1&&(yield $(we("qm.table.fastSearch.toTheEnd"),(()=>C.current=0),(()=>C.current=x.current.length-1)))),"prev"===e&&(C.current=C.current<0?x.current.length-1:C.current-1,C.current<0&&(yield $(we("qm.table.fastSearch.toStart"),(()=>C.current=x.current.length-1),(()=>C.current=0))));const t=x.current[C.current],n=a(t,t.index);let r=t.index;if(p&&h){const e=ba(l.current.deriveRowKeys,n)[0];r=l.current.tableFullData.findIndex((t=>a(t,t.index)===e))}((e,t)=>{if(E.current=e,h){const{pageSize:e}=o,n=Math.ceil((t+1)/e);f(!1),s(Object.assign({},o,{current:n}))}else d(e)})(n,r),c(n)})),q=()=>{v.current.RESET_FORM(),y.current.RESET_FORM()},V=j.default.useMemo((()=>m?`fastSearch_${m}`:""),[m]),[K,z]=j.default.useState([]),[B,W]=j.default.useState(""),[U,G]=j.default.useState("");Vn((()=>{if(U){const{filters:e,config:t}=K.find((e=>e.value===U)).list;v.current.SET_FIELDS_VALUE(te.default(e,L.map((e=>e.fieldName)))),y.current.SET_FIELDS_VALUE(te.default(e,A.map((e=>e.fieldName)))),R(e),P(t)}else q(),R({}),P(N)}),[U]),j.default.useEffect((()=>{Y()}),[]);const Y=()=>Ye(void 0,void 0,void 0,(function*(){if(!V)return;let e=yield ge.default.getItem(V);e||(e=yield X(V),Array.isArray(e)&&(yield ge.default.setItem(V,e))),Array.isArray(e)&&e.length&&(z(e),G(e[0].value))})),X=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),Q=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),Z=dt("table");return j.default.createElement("div",{className:`${Z}-fast-search__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{className:"top"},j.default.createElement("div",{className:"container"},j.default.createElement(Sl,{defaultActiveKey:"1",size:"small",tabBarExtraContent:j.default.createElement("span",null,we("qm.table.alert.total",{total:H}))},j.default.createElement(Sl.TabPane,{tab:we("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},j.default.createElement(us,{ref:v,items:A,cols:1,labelWidth:110})),j.default.createElement(Sl.TabPane,{tab:we("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},j.default.createElement(us,{ref:y,items:L,cols:1,labelWidth:110})))),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:r,value:B,placeholder:we("qm.table.highSearch.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;W(t)}}),j.default.createElement(ot,{type:"primary",disabled:!B||F,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!V)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...K,{text:B,value:e,list:{filters:O,config:k}}];z(t),G(e),W(""),yield ge.default.setItem(V,t),yield Q(V,t)}))},we("qm.table.highSearch.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[r]}px`}},j.default.createElement("span",null,we("qm.table.fastSearch.savedSetting"))),j.default.createElement("ul",null,K.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===U}),title:e.text,onClick:()=>{return t=e.value,void G(t!==U?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=K.filter((e=>e.value!==n));z(e),n===U&&G(""),yield ge.default.setItem(V,e),yield Q(V,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!K.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.default.createElement("div",{className:"bottom"},j.default.createElement("div",null,j.default.createElement(u.Checkbox,{checked:!!k.case,onChange:e=>D({case:e.target.checked})},we("qm.table.fastSearch.matchCase")),j.default.createElement(u.Checkbox,{checked:!!k.fullchar,onChange:e=>D({fullchar:e.target.checked})},we("qm.table.fastSearch.matchFullchar"))),j.default.createElement("div",null,j.default.createElement(ot,{onClick:()=>q()},we("qm.table.fastSearch.clear"))))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${yr[r]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.fastSearch.closeButton")),j.default.createElement(ot,{type:"primary",style:{marginRight:8},onClick:()=>M("prev")},we("qm.table.fastSearch.queryPrev")),j.default.createElement(ot,{type:"primary",onClick:()=>M("next")},we("qm.table.fastSearch.queryNext"))))},_u=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{$size:l}=j.default.useContext(js),[a,r]=j.default.useState(!1),i=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:i})));const o=dt("table"),s={visible:a,title:we("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${yr[l]+20}px`},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${o}-super-search`,title:we("qm.table.fastSearch.text"),onClick:()=>i()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.MonitorOutlined,null))),j.default.createElement(Il,s,j.default.createElement(Hu,{onClose:()=>r(!1)})))}));_u.displayName="FastSearch";const Fu=e=>{const{columns:t,group:n,summary:l}=e,{tableRef:a,$size:r,pagination:i,fetchParams:o,isFetch:s}=j.default.useContext(js),{fetch:u}=a.current.props,d=e=>{var n;const l=t.find((t=>t.dataIndex===e));return{title:l.title,precision:l.precision,dictItems:null!==(n=l.dictItems)&&void 0!==n?n:[]}},c=n.map((e=>Object.assign({dataIndex:e.group},d(e.group)))),f=l.map((e=>e.summary===Js.groupSummary.total.value?{dataIndex:e.summary,title:Js.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},d(e.summary)),{formula:e.formula}))),p=j.default.useMemo((()=>Object.assign({},o,{[Js.sorterFieldName]:void 0,[Js.groupSummary.summaryFieldName]:l.map((e=>`${e.formula}|${e.summary}`)).join(","),[Js.groupSummary.groupbyFieldName]:n.map((e=>e.group)).join(","),usedJH:2,[Js.currentPageName]:1})),[o,n,l]),[h,m]=j.default.useState(((e,n)=>[{title:we("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...n.map((e=>{var n;const l=null===(n=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===n?void 0:n.groupSummary;let a=l?{summation:l}:null;return e.dataIndex===Js.groupSummary.total.value&&(a={dataIndex:Js.groupSummary.recordTotalIndex,summation:{render:()=>i.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(c,f)),[v]=j.default.useState(s?[]:(e=>{const t=ga(e,n.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};h.forEach((n=>{const{dataIndex:l}=n;"index"!==l&&aa(t,l,la(e[0],l))})),l.forEach((n=>{const l=n.summary!==Js.groupSummary.total.value?n.summary:Js.groupSummary.recordTotalIndex,a=n.formula;"count"===a&&aa(t,l,e.length),"sum"===a&&aa(t,l,g.sumBy(e,l)),"max"===a&&aa(t,l,g.maxBy(e,l)[l]),"min"===a&&aa(t,l,g.minBy(e,l)[l]),"avg"===a&&aa(t,l,(g.sumBy(e,l)/e.length).toFixed(2))})),a.push(t)})),a})(a.current.tableFullData)),b=Object.assign(Object.assign({size:r,height:400},s?{fetch:{api:u.api,params:p,dataKey:null==u?void 0:u.dataKey}}:{dataSource:v}),{columns:h,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${K.default().format(Us)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>m(e)});return j.default.createElement(gd,b)},Du=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,$size:a,flattenColumns:r}=j.default.useContext(js),{uniqueKey:i}=l.current.props,o=j.default.useRef(null),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState([]),[h,m]=j.default.useState(""),[g,v]=j.default.useState("");Vn((()=>{if(g){const{group:e,summary:t}=f.find((e=>e.value===g)).list;T(e),R(t)}else{const e=H();T((null==e?void 0:e.group)||[]),R((null==e?void 0:e.summary)||[])}}),[g]),j.default.useEffect((()=>{_()}),[]);const y=j.default.useMemo((()=>i?`summary_${i}`:""),[i]),x=j.default.useMemo((()=>r.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex)))),[r]),E=x.filter((e=>!e.groupSummary)).map((e=>({text:pa(e.title),value:e.dataIndex}))),C=[Js.groupSummary.total,...x.filter((e=>!!e.groupSummary)).map((e=>({text:pa(e.title),value:e.dataIndex})))],S=[{text:we("qm.table.groupSummary.sumText"),value:"sum"},{text:we("qm.table.groupSummary.maxText"),value:"max"},{text:we("qm.table.groupSummary.minText"),value:"min"},{text:we("qm.table.groupSummary.avgText"),value:"avg"},{text:we("qm.table.groupSummary.countText"),value:"count"}],[w,T]=j.default.useState([]),[N,I]=j.default.useState([{title:we("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{o.current.REMOVE_RECORDS(t)}},we("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:we("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:E.map((e=>Object.assign(Object.assign({},e),{disabled:w.findIndex((t=>t.group===e.value))>-1})))})}]),[O,R]=j.default.useState([]),[k,P]=j.default.useState([{title:we("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(t)}},we("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:we("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>Object.assign(Object.assign({},e),{disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:we("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Js.groupSummary.total.value?S.slice(S.length-1):S})}]),A=j.default.useMemo((()=>{const e=w.length&&w.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[w,O]),L=()=>{y&&sessionStorage.setItem(y,JSON.stringify({group:w.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}))},H=()=>{if(!y)return;const e=sessionStorage.getItem(y);return e?JSON.parse(e):null},_=()=>Ye(void 0,void 0,void 0,(function*(){if(!y)return;const e=H();if(e){const{group:t,summary:n}=e;T(t),R(n)}let t=yield ge.default.getItem(y);t||(t=yield F(y),Array.isArray(t)&&(yield ge.default.setItem(y,t))),Array.isArray(t)&&t.length&&(p(t),!e&&v(t[0].value))})),F=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),$=dt("table"),M={visible:d,title:we("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>c(!1)};return j.default.createElement("div",{className:`${$}-group-summary__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{style:{width:"30%"}},j.default.createElement(gd,{ref:o,size:a,columns:N,dataSource:w,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>I(e),onDataChange:e=>{T(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{o.current.INSERT_RECORDS({})},style:{marginRight:0}}))),j.default.createElement("div",{className:"container line"},j.default.createElement(gd,{ref:s,size:a,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{R(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:a,value:h,placeholder:we("qm.table.groupSummary.configText"),disabled:A,onChange:e=>{const{value:t}=e.target;m(t)}}),j.default.createElement(ot,{type:"primary",disabled:!h||A,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!y)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...f,{text:h,value:e,list:{group:w.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];p(t),v(e),m(""),yield ge.default.setItem(y,t),yield D(y,t)}))},we("qm.table.groupSummary.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[a]}px`}},j.default.createElement("span",null,we("qm.table.groupSummary.savedSetting"))),j.default.createElement("ul",null,f.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===g}),title:e.text,onClick:()=>{return t=e.value,void v(t!==g?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=f.filter((e=>e.value!==n));p(e),n===g&&v(""),yield ge.default.setItem(y,e),yield D(y,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!f.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.default.createElement(Il,M,j.default.createElement(Fu,{columns:x,group:w,summary:O})),j.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"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.groupSummary.closeButton")),j.default.createElement(ot,{type:"primary",disabled:A,onClick:()=>(L(),void c(!0))},we("qm.table.groupSummary.confirmButton"))))},$u=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,[l,a]=j.default.useState(!1),r=()=>{a(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table"),o={visible:l,title:we("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${i}-group-summary`,title:we("qm.table.groupSummary.text"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.PieChartOutlined,null))),j.default.createElement(Il,o,j.default.createElement(Du,{onClose:()=>a(!1)})))}));$u.displayName="GroupSummary";const Mu=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,$size:a,flattenColumns:r,setSuperFilters:i,clearTableFilter:o}=j.default.useContext(js),{uniqueKey:s}=l.current.props,d=j.default.useRef(null),[c,f]=j.default.useState([]),[p,h]=j.default.useState([]),[m,g]=j.default.useState(""),[v,y]=j.default.useState("");Vn((()=>{f(v?p.find((e=>e.value===v)).list:H()||[])}),[v]),j.default.useEffect((()=>{_()}),[]);const x=j.default.useMemo((()=>s?`superSearch_${s}`:""),[s]),E=j.default.useMemo((()=>r.filter((e=>!!e.filter))),[r]),C=ma(c),S=j.default.useMemo((()=>!(C&&ql(C))),[C]),w=j.default.useMemo((()=>!!c.length&&S),[c,S]),T=[{value:"and",text:we("qm.table.highSearch.andText")},{value:"or",text:we("qm.table.highSearch.orText")}],N=r.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:pa(e.title)}))),I=e=>["in","nin"].includes(e),O=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},R=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:we("qm.table.highSearch.gtText")},{value:"<",text:we("qm.table.highSearch.ltText")},{value:">=",text:we("qm.table.highSearch.gteText")},{value:"<=",text:we("qm.table.highSearch.lteText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:we("qm.table.highSearch.inText")},{value:"nin",text:we("qm.table.highSearch.ninText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:we("qm.table.highSearch.likeText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}]}return t},[k,P]=j.default.useState([{title:we("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(t)}},we("qm.table.highSearch.removeText")))},{title:we("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>j.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:we("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:N,rules:[{required:!0,message:we("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,l;const a=Object.values(t)[0],r=null===(n=E.find((e=>e.dataIndex===a)))||void 0===n?void 0:n.filter.type,i=R(r);e.fieldType=r,e.expression=a?null===(l=i[0])||void 0===l?void 0:l.value:"",e.condition=I(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:we("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:we("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=E.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:R(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=I(e.expression)?[]:""}}}},{title:we("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,l;const a=E.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(l=null!==(n=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==a?void 0:a.dictItems)&&void 0!==l?l:[];return{type:O(r,I(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:we("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>j.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:we("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:T,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),A=()=>{o(),i(c.map((e=>te.default(e,["index","pageIndex"])))),L(),t()},L=()=>{x&&sessionStorage.setItem(x,JSON.stringify(c.filter((e=>!!e.fieldName))))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},_=()=>Ye(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();e&&f(e);let t=yield ge.default.getItem(x);t||(t=yield F(x),Array.isArray(t)&&(yield ge.default.setItem(x,t))),Array.isArray(t)&&t.length&&(h(t),!e&&y(t[0].value))})),F=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),$=dt("table");return j.default.createElement("div",{className:`${$}-super-search__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{className:"container"},j.default.createElement(gd,{ref:d,size:a,columns:k,dataSource:c,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),f([...c]))},onDataChange:e=>{f(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{d.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Js.highSearch.showSQL&&C&&j.default.createElement("code",{className:"lang-js"},C)),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:a,value:m,placeholder:we("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;g(t)}}),j.default.createElement(ot,{type:"primary",disabled:!m||S,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!x)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...p,{text:m,value:e,list:c.filter((e=>!!e.fieldName))}];h(t),y(e),g(""),yield ge.default.setItem(x,t),yield D(x,t)}))},we("qm.table.highSearch.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[a]}px`}},j.default.createElement("span",null,we("qm.table.highSearch.savedSetting"))),j.default.createElement("ul",null,p.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===v}),title:e.text,onClick:()=>{return t=e.value,void y(t!==v?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=p.filter((e=>e.value!==n));h(e),n===v&&y(""),yield ge.default.setItem(x,e),yield D(x,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!p.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.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"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.highSearch.closeButton")),j.default.createElement(ot,{type:"primary",disabled:w,onClick:()=>A()},we("qm.table.highSearch.searchButton"))))},ju=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,[l,a]=j.default.useState(!1),r=()=>{a(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table"),o={visible:l,title:we("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${i}-super-search`,title:we("qm.table.highSearch.text"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.FunnelPlotOutlined,null))),j.default.createElement(Il,o,j.default.createElement(Mu,{onClose:()=>a(!1)})))}));ju.displayName="SuperSearch";const qu=j.default.forwardRef(((e,t)=>{const{tableColumns:n,showFullScreen:l,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:s,showCollection:d,showFastSearch:c,showSuperSearch:f,showGroupSummary:p,showToolBox:h}=e,{global:m}=j.default.useContext(xe),{tableRef:g,isFullScreen:v,$size:y}=j.default.useContext(js),{uniqueKey:x,exportExcel:E}=g.current.props,C=j.default.useRef(null),S=j.default.useRef(null),w=j.default.useRef(null),T=j.default.useRef(null),N=j.default.useRef(null),I=j.default.useRef(null),O=j.default.useRef(null),R=j.default.useRef(null),k=j.default.useRef(null),P=j.default.useRef(null),A=j.default.useRef(!1),L=j.default.useMemo((()=>x?`toolBox_${x}`:""),[x]),[H,_]=j.default.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),F={fullScreen:l,reload:a,print:r,import:i,export:o&&!(null==E?void 0:E.hideIcon),clipboard:s,collection:d,fastSearch:c,superSearch:f,groupSummary:p},[D,$]=j.default.useState(!1);Vn((()=>{A.current&&(q(),A.current=!1)}),[H]),j.default.useEffect((()=>{M()}),[]),j.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!N.current)return Oe("Table","执行导出需要配置 `exportExcel` 参数");N.current.clickHandle()}})));const M=()=>{if(!L||!h)return;const e=JSON.parse(localStorage.getItem(L));e||V(L).then((e=>{e&&(_(Object.assign({},H,e)),localStorage.setItem(L,JSON.stringify(e)))})).catch((()=>{})),e&&_(Object.assign({},H,e))},q=()=>{if(!L||!h)return;const e={};for(const t in H)H[t]&&(e[t]=H[t]);localStorage.setItem(L,JSON.stringify(e)),K(L,e)},V=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==m?void 0:m.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),K=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==m?void 0:m.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),z=e=>Ye(void 0,void 0,void 0,(function*(){$(!1),yield tt(100),e.current.clickHandle()})),B=(e,t)=>{A.current=!0,_(Object.assign({},H,{[t]:e}))},W=dt("table"),U={"top-toolbox__popper":!0,[`${W}--lg`]:"large"===y,[`${W}--sm`]:"small"===y};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement(cu,{ref:C,isFullScreen:v,open:!h||H.fullScreen}),a&&j.default.createElement(fu,{ref:S,open:!h||H.reload}),r&&j.default.createElement(hu,{ref:w,tableColumns:n,open:!h||H.print}),i&&j.default.createElement(Nu,{ref:T,tableColumns:n,open:!h||H.import}),o&&j.default.createElement(Ru,{ref:N,tableColumns:n,open:(!h||H.export)&&!(null==E?void 0:E.hideIcon)}),s&&j.default.createElement(Pu,{ref:I,open:!h||H.clipboard}),d&&j.default.createElement(Lu,{ref:O,columns:n,open:!h||H.collection}),c&&j.default.createElement(_u,{ref:R,open:!h||H.fastSearch}),p&&j.default.createElement($u,{ref:k,open:!h||H.groupSummary}),f&&j.default.createElement(ju,{ref:P,open:!h||H.superSearch}),h&&j.default.createElement(u.Dropdown,{open:D,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.fullScreen,style:{marginRight:6},onChange:e=>B(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.screen.full"))),onClick:()=>z(C)},{key:"reload",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.reload,style:{marginRight:6},onChange:e=>B(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.refresh.text"))),onClick:()=>z(S)},{key:"print",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.print,style:{marginRight:6},onChange:e=>B(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.print.text"))),onClick:()=>z(w)},{key:"import",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.import,style:{marginRight:6},onChange:e=>B(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.import.textNoSpace"))),onClick:()=>z(T)},{key:"export",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.export,style:{marginRight:6},onChange:e=>B(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.export.textNoSpace"))),onClick:()=>z(N)},{key:"clipboard",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.clipboard,style:{marginRight:6},onChange:e=>B(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.clipboard.textNoSpace"))),onClick:()=>z(I)},{key:"collection",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.collection,style:{marginRight:6},onChange:e=>B(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.selectCollection.text"))),onClick:()=>z(O)},{key:"fastSearch",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.fastSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.fastSearch.text"))),onClick:()=>z(R)},{key:"groupSummary",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.groupSummary,style:{marginRight:6},onChange:e=>B(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.groupSummary.text"))),onClick:()=>z(k)},{key:"superSearch",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.superSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.highSearch.text"))),onClick:()=>z(P)}];return j.default.createElement(u.Menu,{items:e.filter((e=>F[e.key]))})})(),overlayClassName:ne.default(U),overlayStyle:{minWidth:120},onOpenChange:e=>{$(e)}},j.default.createElement("span",{className:`${W}-toolbox`,title:we("qm.table.toolbox.text")},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.AppstoreAddOutlined,null)))))}));qu.displayName="ToolBox";const Vu=(e,t)=>e.map((e=>(e.children&&(e.children=Vu(e.children,t)),t(e)))),Ku=j.default.forwardRef(((e,t)=>{const{columns:n}=e,{global:l}=j.default.useContext(xe),{tableRef:a,$size:r}=j.default.useContext(js),{showColumnDefine:i,uniqueKey:o,onlyShowIcon:s,columnsChange:d}=a.current.props,c=j.default.useRef([]),f=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),p=e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)),h=e=>e.filter((e=>!e.noAuth&&!e.fixed)),[m,v]=j.default.useState(!1),[y,x]=j.default.useState(f(n)),[E,C]=j.default.useState(p(n)),[S,w]=j.default.useState(h(n)),T=j.default.useMemo((()=>o?`table_${o}`:""),[o]),N=j.default.useMemo((()=>[...y,...S,...E]),[y,S,E]);Vn((()=>{L(n),P(n),R(n)}),[n]),j.default.useLayoutEffect((()=>{k()}),[]),j.default.useImperativeHandle(t,(()=>({initialHandler:k})));const I=()=>{if(!T)return;const e=JSON.parse(localStorage.getItem(T));var t;if(e||(t=T,Ye(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(T,JSON.stringify(e)),k()):(null==l?void 0:l.getComponentConfigApi)&&R(n)})).catch((()=>{})),!e)return;return g.xor(Bl(e).map((e=>e.dataIndex)),Bl(n).map((e=>e.dataIndex))).length>0?Vu(n,(t=>{const n=Ul(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Vu(e,(e=>{const t=Ul(n,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},O=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=O(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)})),R=e=>{if(!T)return;const t=O(e),n=JSON.parse(localStorage.getItem(T));var r,i;a.current.columnsDefined&&!g.isEqual(t,n)&&(localStorage.setItem(T,JSON.stringify(t)),r=T,i=t,Ye(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},k=()=>{const e=I();e&&(null==d||d(e))},P=e=>{const t=f(e),n=p(e),l=h(e);return x(t),C(n),w(l),[...t,...l,...n]},L=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((n,l)=>{const a=n.colSpan;a>1&&e.slice(l+1,l+a).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(l,l+a))})),c.current=t},H=()=>{const e=t=>t.map((t=>{const l=Ul(n,t.dataIndex)||rt(t);return t.children&&(l.children=e(t.children)),Object.assign(l,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==d||d(e(a.current.originColumns))},_=()=>{const e=[];N.forEach((t=>{const{colSpan:n,dataIndex:l}=t;if(0===n)return;if(1===n)return e.push(t);const a=c.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(l)));if(-1===a)return e.push(t);e.push(...c.current[a].map(((e,n)=>{let{dataIndex:l}=e;const a=N.find((e=>e.dataIndex===l));return n>0&&(void 0!==t.hidden&&(a.hidden=t.hidden),void 0!==t.fixed?a.fixed=t.fixed:a.fixed&&delete a.fixed),a})))})),n.forEach(((t,n)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(n,0,t)})),null==d||d(e)},F=(e,t)=>{if(e.noFixed)return;t?e.fixed=t:delete e.fixed;const l=P(n);null==d||d(l)},D=(e,t)=>{var n;const{colSpan:l,noFixed:a}=e;if(0===l)return j.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const r=pa(e.title),i=["svgicon","handle",`${t}-handle`],o=j.default.createElement("li",{key:e.dataIndex,className:"item"},j.default.createElement(u.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,_()}}),j.default.createElement("i",{className:ne.default(i),title:we("qm.table.columnFilter.draggable")},j.default.createElement(b.HolderOutlined,null)),j.default.createElement("span",{className:"text",title:r},r),"main"===t?j.default.createElement("span",{className:ne.default("fixed",a?"disabled":"")},j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.fixedLeft"),onClick:()=>F(e,"left")},j.default.createElement(b.StepBackwardOutlined,null)),j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.fixedRight"),onClick:()=>F(e,"right")},j.default.createElement(b.StepForwardOutlined,null))):"sub"!==t?j.default.createElement("span",{className:ne.default("fixed",a?"disabled":"")},j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.cancelFixed"),onClick:()=>F(e)},j.default.createElement(b.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(n=e.children)||void 0===n?void 0:n.length)?j.default.createElement(u.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:$(e.children,e.dataIndex)},o):o},$=(e,t)=>j.default.createElement("div",{className:"column-filter--wrap"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:l=>{const a=l.map((e=>e.dataIndex)),r=e.map((e=>e.dataIndex));g.isEqual(a,r)||((e,t)=>{Ul(n,t).children=e,null==d||d([...n])})(Ea(l),t)}},e.map((e=>D(e,"sub"))))),M=dt("table"),q={[`${M}__popper`]:!0,"column-filter__popper":!0,[`${M}--lg`]:"large"===r,[`${M}--sm`]:"small"===r},V=[`${M}-column-filter`,{selected:m}];return i?j.default.createElement(io,{action:["click"],popupVisible:m,popup:j.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},j.default.createElement("div",{className:"reset"},j.default.createElement(ot,{type:"text",size:"small",onClick:H},we("qm.table.columnFilter.reset"))),j.default.createElement("div",{className:"left"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));g.isEqual(t,n)||x(Ea(e))},onEnd:()=>_()},y.map((e=>D(e,"left"))))),j.default.createElement("div",{className:"divider"}),j.default.createElement("div",{className:"main"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:S,setList:e=>{const t=e.map((e=>e.dataIndex)),n=S.map((e=>e.dataIndex));g.isEqual(t,n)||w(Ea(e))},onEnd:()=>_()},S.map((e=>D(e,"main"))))),j.default.createElement("div",{className:"divider"}),j.default.createElement("div",{className:"right"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:E,setList:e=>{const t=e.map((e=>e.dataIndex)),n=E.map((e=>e.dataIndex));g.isEqual(t,n)||C(Ea(e))},onEnd:()=>_()},E.map((e=>D(e,"right")))))),popupClassName:ne.default(q),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{v(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},j.default.createElement("span",{className:ne.default(V),title:s?we("qm.table.columnFilter.text"):void 0},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.SettingOutlined,null)),!s&&j.default.createElement("span",null,we("qm.table.columnFilter.text")))):null}));Ku.displayName="ColumnFilter";const zu=()=>j.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Bu=e=>{const{column:t,filters:n}=e,{$size:l,setFilters:a,clearSuperFilters:r}=j.default.useContext(js),i=j.default.useRef(null),o=j.default.useRef(null),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState(!1),[h,m]=j.default.useState({}),v=j.default.useMemo((()=>{const{dataIndex:e,filter:n}=t;return`${e}|${n.type}`}),[t]),b=j.default.useMemo((()=>{let e=!1;for(const t in n[v])if(!at(n[v][t])||f){e=!0;break}return e}),[v,n,f]);j.default.useEffect((()=>{d&&setTimeout((()=>y()),50)}),[d]),j.default.useEffect((()=>{var e;g.isEqual(h[v],n[v])||m({[v]:n[v]||{}}),p(""===(null===(e=n[v])||void 0===e?void 0:e["=="]))}),[n]);const y=()=>{switch(t.filter.type){case"text":i.current.focus();break;case"number":o.current.focus();break;case"textarea":s.current.focus()}},x=e=>{e&&m(e),r(),a((e=>{for(const t in e){for(const n in e[t])if(at(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},n),h),e))),c(!1)},E={text:e=>{var t,n;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input,{ref:i,size:l,placeholder:we("qm.table.filter.searchText",{text:pa(e.title)}),style:{width:"180px"},value:null!==(n=null===(t=h[v])||void 0===t?void 0:t.like)&&void 0!==n?n:"",disabled:f,onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&x()}}),j.default.createElement("div",{style:{marginTop:8}},j.default.createElement(u.Checkbox,{checked:f,onChange:e=>{const{checked:t}=e.target,n=t?"":null;m((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),p(t)}},we("qm.table.filter.nullValue"))))},textarea:e=>{var t,n;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input.TextArea,{ref:s,size:l,placeholder:we("qm.table.filter.searchAreaText",{text:pa(e.title)}),style:{width:"220px"},value:null!==(n=null===(t=h[v])||void 0===t?void 0:t.likes)&&void 0!==n?n:"",disabled:f,onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),x())}}),j.default.createElement("div",{style:{marginTop:8}},j.default.createElement(u.Checkbox,{checked:f,onChange:e=>{const{checked:t}=e.target,n=t?"":null;m((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),p(t)}},we("qm.table.filter.nullValue"))))},number:e=>{const t=e=>{var t,n;return{value:null!==(n=null===(t=h[v])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:l,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||m((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return j.default.createElement("ul",null,j.default.createElement("li",null,j.default.createElement("span",null,"> "),j.default.createElement(u.InputNumber,qe({ref:o},t(">"),{placeholder:we("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"< "),j.default.createElement(u.InputNumber,qe({},t("<"),{placeholder:we("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"= "),j.default.createElement(u.InputNumber,qe({},t("=="),{placeholder:we("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"!="),j.default.createElement(u.InputNumber,qe({},t("!="),{placeholder:we("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>{var t;return{value:ua(null===(t=h[v])||void 0===t?void 0:t[e],Bs),format:Bs,size:l,onChange:t=>{m((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:da(t,Bs)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return j.default.createElement("ul",null,j.default.createElement("li",null,j.default.createElement("span",null,"> "),j.default.createElement(je,qe({},t(">"),{placeholder:we("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"< "),j.default.createElement(je,qe({},t("<"),{placeholder:we("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"= "),j.default.createElement(je,qe({},t("=="),{placeholder:we("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"!="),j.default.createElement(je,qe({},t("!="),{placeholder:we("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("ul",null,j.default.createElement(u.Radio.Group,{style:{width:"100%"},value:null===(t=h[v])||void 0===t?void 0:t["=="],onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{"==":t}})))}},a.map((e=>j.default.createElement("li",{key:e.value},j.default.createElement(u.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("ul",null,j.default.createElement(u.Checkbox.Group,{style:{width:"100%"},value:null===(t=h[v])||void 0===t?void 0:t.in,onChange:e=>{m((t=>Object.assign({},t,{[v]:{in:e}})))}},a.map((e=>j.default.createElement("li",{key:e.value},j.default.createElement(u.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("div",{style:Object.assign({height:200},n.style)},j.default.createElement(Ms,{multiple:!0,value:(null===(t=h[v])||void 0===t?void 0:t.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));m((e=>Object.assign({},e,{[v]:{in:t}})))}}))}},C=()=>j.default.createElement(u.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},j.default.createElement(ot,{size:l,onClick:()=>{x({[v]:{}})}},we("qm.table.filter.reset")),j.default.createElement(ot,{type:"primary",size:l,onClick:()=>x()},we("qm.table.filter.search"))),S=dt("table"),w={"head-filter__popper":!0,[`${S}--lg`]:"large"===l,[`${S}--sm`]:"small"===l},T=["cell--filter",{selected:d,actived:b}];return j.default.createElement(io,{action:["click"],popupVisible:d,popup:(()=>{const e=t.filter.type,n=E[e];return n?j.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},j.default.createElement("div",null,n(t)),C()):(Oe("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:ne.default(w),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{c(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},j.default.createElement("div",{className:ne.default(T),title:we("qm.table.filter.text"),onClick:e=>e.stopPropagation()},j.default.createElement("span",{className:"svgicon icon"},j.default.createElement(zu,null))))},Wu=e=>{const{column:t}=e,{tableRef:n,bordered:l}=j.default.useContext(js),{columns:a,resizable:r,columnsChange:i=Je}=n.current.props,o=j.default.useMemo((()=>Yl(t)),[t]),s={resizable:!0,"is--line":r&&!l};return j.default.createElement("div",{className:ne.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:l}=n.current,r=l.$resizableBar,s=t.offsetWidth/2,u=e.clientX,d=ea(t,l.$table).left-l.$tableBody.parentNode.parentNode.scrollLeft+s;l.$table.classList.add("c--resize"),r.style.left=`${d}px`,r.style.display="block";const c=o.width||o.renderWidth;let f=c;return document.onmousemove=function(e){if("number"!=typeof c)return;const t=e.clientX-u,n=c+t;n<(o.minWidth||Js.defaultColumnWidth)||(f=Math.floor(n),r.style.left=`${t+d}px`)},document.onmouseup=function(){l.$table.classList.remove("c--resize"),r.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof f&&(Ul(a,o.dataIndex).width=f,i([...a]))},!1}})},Uu=e=>{const{selectionKeys:t}=e,{tableRef:n,getRowKey:l,pagination:a,fetchParams:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:s,isFetch:d,isWebPagination:c}=j.default.useContext(js),{rowSelection:f}=n.current.props,{fetchAllRowKeys:p,selectAllOnCurrentPage:h,filterable:m,onSelectAll:v}=f,y=j.default.useRef([]),x=j.default.useMemo((()=>d&&!!p),[d,p]),E=j.default.useMemo((()=>!x&&!!h),[x,h]),C=j.default.useMemo((()=>(null==m||m)&&!E),[m,E]),S=()=>{const{tableFullData:e}=n.current,{current:t,pageSize:l}=a;return c?e.slice((t-1)*l,t*l):e},w=(()=>{const{allTableData:e,allRowKeys:t,selectionRows:a}=n.current,{disabled:r}=f;if(x)return y.current.length?y.current:g.union(t,a.map((e=>l(e,e.index))));if(!E)return r?t.filter(((t,n)=>!r(e[n]))):t;const i=r?S().filter((e=>!r(e))).map((e=>l(e,e.index))):S().map((e=>l(e,e.index)));return g.union(i,a.map((e=>l(e,e.index))))})(),T=t.filter((e=>!w.includes(e))),N=t.length-T.length,I=N>0&&N<w.length,O=!!N&&N===w.length;o(T);const R=()=>Ye(void 0,void 0,void 0,(function*(){var e;const t=p;let n=[];s(!0);try{const a=yield t.api(r);if(200===a.code){n=Array.isArray(a.data)?a.data:null!==(e=g.get(a.data,t.dataKey))&&void 0!==e?e:[];const{disabled:r}=f;r&&(n=g.xor(n,S().filter((e=>r(e))).map((e=>l(e,e.index))))),y.current=n}}catch(e){}return s(!1),n})),k=e=>Ye(void 0,void 0,void 0,(function*(){let t=[];t=x?e?yield R():[]:e?w.slice(0):[],t=[...new Set([...t,...T])],i(t),null==v||v(e,t)})),P=()=>{const e=[{key:1,label:we("qm.table.selection.all"),onClick:()=>{k(!0)}},{key:2,label:we("qm.table.selection.invert"),onClick:()=>Ye(void 0,void 0,void 0,(function*(){let e=[];e=x?g.xor(t,yield R()):g.xor(t,w),e=[...new Set([...e,...T])],i(e)}))},{key:3,label:we("qm.table.selection.clear"),onClick:()=>{k(!1)}}];return j.default.createElement(u.Menu,{items:e})};return j.default.createElement("div",{className:"cell--selection"},j.default.createElement(u.Checkbox,{checked:O,indeterminate:I,disabled:!w.length,onChange:e=>k(e.target.checked)}),C&&j.default.createElement(u.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>P()},j.default.createElement(b.DownOutlined,{className:"svgicon icon"})),E&&j.default.createElement(u.Tooltip,{placement:"top",title:we("qm.table.selection.currentPage")},j.default.createElement(b.InfoCircleOutlined,{className:"info"})))},Gu=e=>{const{style:t}=e,{tableRef:n,isTreeTable:l,setRowExpandedKeys:a}=j.default.useContext(js),{expandable:r}=n.current.props,[i,o]=j.default.useState((null==r?void 0:r.defaultExpandAllRows)||!1);Vn((()=>{const{allRowKeys:e,flattenRowKeys:t}=n.current;a(i?e.filter((e=>!(l&&t.includes(e)))):[])}),[i]);const s={[`${dt("expand")}--icon`]:!0,expanded:i,collapsed:!i};return j.default.createElement("span",{className:ne.default(s),title:"",onClick:e=>{e.stopPropagation(),o(!i)},style:t})},Yu=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Xu=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Qu=e=>{const{tableColumns:t,sorter:n,filters:l}=e,{tableRef:a,layout:r,scrollY:i,flattenColumns:o,superFilters:s,selectionKeys:d,rightFixedColumns:c,treeExpandIndex:f,isFetch:p,isTreeTable:h,isGroupSubtotal:m,tableChange:v,setSorter:y,setElementStore:x,resetTableScroll:E,getStickyLeft:C,getStickyRight:S,createGroupData:w,createTableFullData:T}=j.default.useContext(js),{ellipsis:N,resizable:I,multipleSort:O,rowSelection:R,expandable:k}=a.current.props,[P,A]=Js.sortDirections,{tableOriginData:L}=a.current,H=j.default.useRef(null),_=j.default.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),F=j.default.useMemo((()=>!p),[p]),D=j.default.useMemo((()=>!p),[p]),$=j.default.useMemo((()=>!(null==k?void 0:k.hideExpandAll)),[k]),M=j.default.useMemo((()=>!!R&&(p?!(!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys):!R.hideSelectAll)),[p,R]);Vn((()=>{U(),v(),E()}),[n]),Vn((()=>{X(),v(),E()}),[l]),Vn((()=>{X(),v(),E()}),[s]),j.default.useEffect((()=>{q(),!at(n)&&nt((()=>U())),!at(l)&&nt((()=>X()))}),[]);const q=()=>{x("$header",H.current)},V=(e,t,l)=>{var o,s,u;const{isIE:d}=a.current,{gutterWidth:c}=r,{dataIndex:f,colSpan:p,rowSpan:h,fixed:m,align:g,theadAlign:v,theadClassName:b="",sorter:y,filter:x,required:E,headRender:w}=e;if(0===p)return null;const T=v||g,O=["header--column",{"col--ellipsis":null!==(o=e.ellipsis)&&void 0!==o?o:N,"col--center":"center"===T,"col--right":"right"===T,"column--required":!!E,"column-has-sorter":y,"column-has-filter":x,"column--sort":!!n[f],"cell-fix-left":!d&&"left"===m,"cell-fix-right":!d&&"right"===m,"cell-fix-left-last":!d&&"left"===m&&!(null===(s=l[t+1])||void 0===s?void 0:s.fixed),"cell-fix-right-first":!d&&"right"===m&&!(null===(u=l[t-1])||void 0===u?void 0:u.fixed),[b]:!!b}],R=d?null:{left:"left"===m?`${C(f)}px`:"",right:"right"===m?`${S(f)+(i?c:0)}px`:""},k=I&&![Js.expandableColumn,Js.selectionColumn].includes(f);return j.default.createElement("th",{key:f,className:ne.default(O),colSpan:p,rowSpan:h,style:Object.assign({},R),onClick:t=>W(t,e)},j.default.createElement("div",{className:"cell--wrapper"},w?j.default.createElement("div",{className:"cell--text cell"},w(e,a.current.tableFullData)):j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{className:"cell--text"},K(e)),x?B(e):null)),k&&j.default.createElement(Wu,{column:e}))},K=e=>{const{dataIndex:t,type:l,sorter:a,title:r,description:i}=e;if(t===Js.selectionColumn&&"checkbox"===l){if("checkbox"===l)return j.default.createElement("div",{className:"cell"},M?j.default.createElement(Uu,{selectionKeys:d}):we("qm.table.config.selectionText"));if("radio"===l)return j.default.createElement("div",{className:"cell"},r)}const o=[];return o.push(j.default.createElement("div",{key:0,className:"cell",title:pa(r)},h&&t===f&&$?j.default.createElement(Gu,null):null,t===Js.expandableColumn&&$?j.default.createElement(Gu,null):r)),i&&o.push(j.default.createElement(u.Tooltip,{key:1,placement:"top",title:i},j.default.createElement(b.InfoCircleOutlined,{className:"tip"}))),a&&o.push(z(n[t])),o},z=e=>{const t=["svgicon cell--sorter__asc",{actived:e===P}],n=["svgicon cell--sorter__desc",{actived:e===A}];return j.default.createElement("div",{key:2,className:"cell--sorter",title:we("qm.table.sorter.text")},j.default.createElement("span",{className:ne.default(t)},j.default.createElement(Yu,null)),j.default.createElement("span",{className:ne.default(n)},j.default.createElement(Xu,null)))},B=e=>j.default.createElement(Bu,{column:e,filters:l}),W=(e,t)=>{const{sorter:l,dataIndex:a}=t;if(l){const e=n[a],t=e?e===A?null:A:P;O?(delete n[a],y(Object.assign({},n,{[a]:t}))):y(Object.assign({},{[a]:t}))}},U=()=>{F&&G()},G=e=>{const t=g.pickBy(n,(e=>null!==e));for(const e in t){const n=o.find((t=>t.dataIndex===e));n?Y(n,t[e]):delete t[e]}e||Object.keys(t).length||Y({dataIndex:"index"},P)},Y=(e,t)=>{const{tableFullData:n}=a.current,{dataIndex:l,sorter:r}=e,i=(e,n)=>{const a=la(e,l),r=la(n,l);return Number.isNaN(a-r)?t===P?a.toString().localeCompare(r.toString()):r.toString().localeCompare(a.toString()):t===P?a-r:r-a},o=m?w(ha(n).sort("function"==typeof r?r:i)):n.sort("function"==typeof r?r:i).slice(0);T(o)},X=()=>{D&&Q()},Q=()=>{const e=s.length?ma(s):ma(l),t=""!==e?m?w(Vl(ha(L),e,_)):Vl(L,e,_):L;T(t),G(!0)},Z=Jl(t),J=dt("table"),{tableBodyWidth:ee}=r;return j.default.createElement("div",{ref:H,className:`${J}--header-wrapper`},j.default.createElement("table",{className:`${J}--header`,cellSpacing:"0",cellPadding:"0",style:{width:ee?`${ee}px`:""}},(()=>{const{gutterWidth:e}=r;return j.default.createElement("colgroup",null,o.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})})),i&&j.default.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),j.default.createElement("thead",null,(e=>{const{isIE:t}=a.current,n=["gutter",{"cell-fix-right":!!c.length}],l=t?null:{right:c.length?0:""};return e.map(((e,t)=>j.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,n)=>V(t,n,e))),i&&j.default.createElement("th",{className:ne.default(n),style:Object.assign({},l)}))))})(Z))))},Zu=j.default.createContext([]);function Ju(e,t){const[n,l]=M.useState(!1);return M.useEffect((()=>{let n;const a=e.current,r=e=>{n=e},i=e=>{((e,n)=>{const r=e.target,i=null==n?void 0:n.target,o=!r||!i,s=(null==a?void 0:a.contains(r))||(null==a?void 0:a.contains(i)),u=a===r,d=(null==t?void 0:t.map((e=>Array.from(document.querySelectorAll(e)))).flat())||[],c=d.some((e=>null==e?void 0:e.contains(r)))||d.includes(i);l(!(o||s||u||c))})(e,n)};return a&&(Kn(document,"mousedown",r),Kn(document,"mouseup",i)),()=>{a&&(zn(document,"mousedown",r),zn(document,"mouseup",i))}}),[e]),n}function ed(){const[,e]=M.useReducer((e=>e+1),0);return e}function td(){const{locale:e}=M.useContext(xe);return{t:we,$locale:e}}const nd=e=>{const{selectionKeys:t,column:n,record:l,rowKey:a}=e,{tableRef:r,isTreeTable:i,getAllChildRowKeys:o}=j.default.useContext(js),{rowSelection:s}=r.current.props,d=j.default.useMemo((()=>n.type||""),[n.type]),c=e=>{var n,l;const a=null===(n=s.checkStrictly)||void 0===n||n;if(!i||a)return!1;const u=Ql(r.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let l=!1,a=!1;for(const t of e)if(n.has(t)?l=!0:a=!0,l&&a)break;return l&&a})(o(null!==(l=null==u?void 0:u.children)&&void 0!==l?l:[]),t)};return"radio"===d?(()=>{const e=s.disabled,n=null==e?void 0:e(l),r=!n&&t[0]===a;return j.default.createElement(u.Radio,{checked:r,disabled:n})})():(()=>{const e=s.disabled,n=null==e?void 0:e(l),r=!!t.includes(a);return j.default.createElement(u.Checkbox,{checked:r,indeterminate:c(a),disabled:n})})()},ld=e=>{const{record:t,rowKey:n,style:l}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=j.default.useContext(js),{expandable:o={}}=a.current.props,[s]=j.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),u=j.default.useMemo((()=>r.includes(n)),[r,n]);Vn((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,u,t)}),[u]);const d={[`${dt("expand")}--icon`]:!0,expanded:u,collapsed:!u,disabled:s};return j.default.createElement("span",{className:ne.default(d),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=u?r.filter((e=>e!==n)):[...r,n];i(t)},style:l})},ad=j.default.forwardRef(((e,t)=>{const{size:n,defaultValue:l,value:a,min:r,max:i,prefix:o,suffix:s,placeholder:d,maxLength:c,precision:f,stringMode:p,allowClear:h,readOnly:m,disabled:g,formatter:v=(e=>e.toString()),parser:b=(e=>e),onFocus:y}=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 ce.default(t).toFixed(f)),t},E=void 0!==a,[C,S]=j.default.useState(null!=l?l:""),w=v(E?a:C),T=b(w);Vn((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,T)}),[C]);return j.default.createElement(u.Input,{ref:t,size:n,value:w,maxLength:c,prefix:o,suffix:s,placeholder:d,allowClear:h,readOnly:m,disabled:g,onChange:t=>{const n=b(t.target.value);let l=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===f&&n.includes(".")&&(l=!1),r>=0&&n.startsWith("-")&&(l=!1),l){if(!p&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):S(t)})(n)}},onFocus:y,onBlur:()=>{var t;const n=x(T);null===(t=e.onBlur)||void 0===t||t.call(e,n,T)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(T),T))}})}));ad.displayName="InputNumber";const{Search:rd}=u.Input,id=j.default.forwardRef(((e,t)=>{var n,l,a,r,i,o;const{column:s,record:d,rowKey:c,columnKey:f}=e,{tableRef:p,tableBodyRef:h,$size:m,flattenColumns:v,updateTableData:y,doFieldValidate:x,dataChange:E}=j.default.useContext(js),C=j.default.useContext(Zu),S=ed(),{store:w,fieldAuth:T}=p.current,N=(null===(n=s.editRender)||void 0===n?void 0:n.call(s,d,s))||{},I=j.default.useRef(null),O=j.default.useRef(null),R=j.default.useRef(null),k=j.default.useRef(null),P=j.default.useRef(null),A=j.default.useRef(!1),L=j.default.useRef({}),H=j.default.useRef({}),_=j.default.useRef([]),[F,D]=j.default.useState(!1),[$,M]=j.default.useState(!1),[q,V]=j.default.useState(!1),[K,z]=j.default.useState(N.items||[]),[B,W]=j.default.useState(),U=(N.editable||g.isEqual(C,[c,f]))&&!N.disabled&&!(null===(l=T[f])||void 0===l?void 0:l.disabled),G=`${c}|${f}`,Y=2===C.length?`${C[0]}|${C[1]}`:"",X=![...w.state.required,...w.state.validate].some((e=>{let{x:t,y:n}=e;return t===c&&n===f})),Q=(null===(a=w.state.required.find((e=>{let{x:t,y:n}=e;return t===c&&n===f})))||void 0===a?void 0:a.text)||"",Z=(null===(r=w.state.validate.find((e=>{let{x:t,y:n}=e;return t===c&&n===f})))||void 0===r?void 0:r.text)||"",J=w.state.edited.some((e=>{let{x:t,y:n}=e;return t===c&&n===f})),ee=U||!X||F||q||$,te=!!(null===(i=N.helper)||void 0===i?void 0:i.combinedDataIndex)&&("search-helper"===N.type||"tree-helper"===N.type),le=null===(o=N.type)||void 0===o?void 0:o.endsWith("multiple");j.default.useEffect((()=>{ee&&Y===G&&oe()}),[C]),j.default.useLayoutEffect((()=>{const{items:e}=N;le&&e&&ie(e.map((e=>({[H.current.valueKey]:e.value,[H.current.textKey]:e.text}))))}),[]);const ae=()=>{y(),E()},re=(e,t)=>{D(e),null==t||t()},ie=e=>{_.current=e},oe=()=>{var e,t,n,l;const{type:a}=N;switch(a){case"text":null===(e=O.current)||void 0===e||e.focus();break;case"number":null===(t=R.current)||void 0===t||t.select();break;case"search-helper":null===(n=k.current)||void 0===n||n.focus();break;case"tree-helper":null===(l=P.current)||void 0===l||l.focus()}};j.default.useImperativeHandle(t,(()=>({focus:oe})));const se=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},ue=(e,t,n)=>{const{cornerSign:l=!0}=N.extra||{};w.addToUpdated(e),l&&w.addToEdited({x:t,y:n})},de=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",fe={text:(e,t,n)=>{const{dataIndex:l}=t,{type:a,extra:r={},rules:i=[],onInput:o,onChange:s,onEnter:d,onBlur:p}=N,h=la(e,l),g=Object.assign({},{minRows:1,maxRows:4},r.autoSize),v=n?{rows:g.minRows,autoSize:g}:null,b=r.password?u.Input.Password:n?u.Input.TextArea:u.Input;return j.default.createElement(b,qe({ref:O,size:m,value:h,maxLength:r.maxLength,showCount:r.showCount},v,{autoComplete:r.password?"new-password":"off",placeholder:r.placeholder||we("qm.table.editable.inputPlaceholder"),allowClear:r.allowClear,readOnly:r.readOnly,disabled:r.disabled,suffix:r.suffix,onChange:t=>{var n;const a=null!==(n=t.target.value)&&void 0!==n?n:"";aa(e,l,a),x(i,a,c,f),S(),null==o||o({[G]:a}),A.current=!0},onFocus:()=>M(!0),onBlur:t=>{var n;M(!1);const l=null!==(n=t.target.value)&&void 0!==n?n:"";A.current&&(A.current=!1,ue(e,c,f),null==s||s({[G]:l},e),null==p||p({[G]:l},e),ae())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==d||d({[G]:l},e)}},onKeyDown:e=>{n&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>fe.text(e,t,!0),number:(e,t)=>{var n;const{dataIndex:l,precision:a,formatType:r}=t,{type:i,extra:o={},rules:s=[],onInput:u,onChange:d,onEnter:p,onBlur:h}=N,g=la(e,l);let v,b;return"finance"===r&&(v=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"===r&&(v=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ce.default(e).times(100).toNumber()}`,b=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ce.default(e).times(.01).toString()),j.default.createElement(ad,{ref:R,size:m,value:g,min:o.min,max:o.max,precision:a,stringMode:o.stringMode,prefix:o.prefix,suffix:null!==(n=o.suffix)&&void 0!==n?n:"percent"===r?"%":void 0,placeholder:o.placeholder||we("qm.table.editable.inputPlaceholder"),maxLength:o.maxLength,allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,formatter:v,parser:b,onChange:t=>{aa(e,l,t),x(s,t,c,f),S(),null==u||u({[G]:t}),A.current=!0},onFocus:()=>M(!0),onBlur:(t,n)=>{if(M(!1),!A.current)return;A.current=!1;let a=o.stringMode?t:de(t);"percent"===r&&"."===n.charAt(n.length-1)&&(a=Number(t)/100),aa(e,l,a),ue(e,c,f),null==d||d({[G]:a},e),null==h||h({[G]:a},e),ae()},onEnter:(t,n)=>{let l=o.stringMode?t:de(t);"percent"===r&&"."===n.charAt(n.length-1)&&(l=Number(t)/100),null==p||p({[G]:l},e)}})},select:(e,t,n)=>{var l;const{dataIndex:a,dictItems:r=[]}=t,{type:i,extra:o={},rules:s=[],items:d,onChange:h,onEnter:g}=N;p.current;const v=d||r,b=la(e,a);let y=b;return j.default.createElement(u.Select,{mode:n?"multiple":void 0,size:m,popupClassName:"table-editable__popper",value:b||void 0,placeholder:o.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,listHeight:o.listHeight,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},showSearch:null===(l=o.filterable)||void 0===l||l,filterOption:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${l}|${nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{aa(e,a,t),x(s,t,c,f),ue(e,c,f),null==h||h({[G]:t},e),ae()},onSelect:e=>{y=e},onInputKeyDown:t=>{13===t.keyCode&&nt((()=>null==g?void 0:g({[G]:y},e)))}},v.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>fe.select(e,t,!0),date:(e,t,n)=>{var l;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onChange:s}=N,u=n||"exactdate",d=la(e,a);return j.default.createElement(je,{size:m,popupClassName:"table-editable__popper",value:null!==(l=ua(d,Ra[u]))&&void 0!==l?l:void 0,picker:Oa[u],format:i.format,showTime:"datetime"===u,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=i;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:i.placeholder,allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const n=da(t,Ra[u]);aa(e,a,n),x(o,n,c,f),ue(e,c,f),null==s||s({[G]:n},e),ae()}})},datetime:(e,t)=>fe.date(e,t,"datetime"),month:(e,t)=>fe.date(e,t,"month"),year:(e,t)=>fe.date(e,t,"year"),time:(e,t)=>{var n;const{dataIndex:l}=t,{type:a,extra:r={},rules:i=[],onChange:o}=N,s="HH:mm:ss",u=la(e,l);return j.default.createElement(Ve,{size:m,popupClassName:"table-editable__popper",value:null!==(n=ua(u,s))&&void 0!==n?n:void 0,format:r.format||s,placeholder:r.placeholder,allowClear:r.allowClear,disabled:r.disabled,style:{width:"100%"},onChange:t=>{const n=da(t,s);aa(e,l,n),x(i,n,c,f),ue(e,c,f),null==o||o({[G]:n},e),ae()}})},checkbox:(e,t)=>{const{dataIndex:n}=t,{type:l,extra:a={},rules:r=[],onChange:i}=N,{trueValue:o=Ks,falseValue:s=zs,disabled:d}=a,p=la(e,n);return j.default.createElement(u.Checkbox,{checked:p===o,disabled:d,onChange:t=>{const l=t.target.checked?o:s;aa(e,n,l),x(r,l,c,f),ue(e,c,f),null==i||i({[G]:l},e),ae()}})},switch:(e,t)=>{const{dataIndex:n}=t,{type:l,extra:a={},rules:r=[],onChange:i}=N,{trueValue:o=Ks,falseValue:s=zs,disabled:d}=a,p=la(e,n);return j.default.createElement(u.Switch,{checked:p===o,disabled:d,onChange:t=>{const l=t?o:s;aa(e,n,l),x(r,l,c,f),ue(e,c,f),null==i||i({[G]:l},e),ae()}})},"search-helper":(e,t)=>{var n;const{dataIndex:l,precision:a}=t,{type:r,extra:i={},rules:o=[],helper:s={},onInput:u,onChange:d,onEnter:p}=N,h=ra(e,te?s.combinedDataIndex:l),b=s.fieldAliasMap;b||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const y="function"==typeof b?b():b||{};Object.keys(y).includes(l)||Oe("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(s.combinedDataIndex.split("|").every((e=>Object.keys(y).includes(e)))||Oe("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),y[l].includes("|")&&Oe("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=e=>{const{filterAliasMap:t}=s,n=""!==e?e:void 0,a=("function"==typeof t?t():t)||[],r={[l]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(g.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},C=e=>{const{autoQueryAssign:t=!0}=s;t&&(L.current=E(e)),D(!0)},S=(n,l)=>{const{beforeOpen:a}=s,r=(null!=a?a:et)({[G]:h},e,t);(null==r?void 0:r.then)?r.then((()=>{C(n),null==l||l()})).catch((()=>{})):!1!==r&&(C(n),null==l||l())},w=e=>{const t={};for(const n in y){const a=y[n];n!==l&&(t[n]=ra(e,a))}const n=y[l]?ra(e,y[l]):"";O(n,t);const{closed:a}=s;re(!1,(()=>se(I.current))),oe(),null==a||a(e)},T=()=>{const{onlySelect:e=!0}=s;A.current&&O(e?"":h),re(!1,(()=>se(I.current)))},O=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var r;if(g.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],a=v.find((e=>e.dataIndex===t));if(a){aa(e,t,l,a.precision);const n=null===(r=a.editRender)||void 0===r?void 0:r.call(a,e,a);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t)}else aa(e,t,l)}te&&!t&&((e,t,n,l)=>{if(!t.includes("|"))return aa(e,t,n,l);const a=n.split("|")||[];t.split("|").forEach(((t,n)=>{var l;t&&aa(e,t,null===(l=a[n])||void 0===l?void 0:l.trim())}))})(e,s.combinedDataIndex,""),aa(e,l,t,a),x(o,t,c,f),ue(e,c,f),null==d||d({[G]:t},e),ae(),L.current={},A.current=!1,W(void 0)},R={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{T()}},P=Object.assign(Object.assign({},s),{size:m,initialValue:Object.assign({},L.current,s.initialValue),onClose:e=>{e?w(e):T()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement(rd,{ref:k,value:null!=B?B:h,placeholder:i.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=s;if(A.current&&!F)return n&&a&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=s,{beforeFetch:l=et}=t.fetch;return new Promise(((a,r)=>Ye(void 0,void 0,void 0,(function*(){var i;const o=g.merge({},t.fetch.params,Object.assign(Object.assign({},n),E(e)),{currentPage:1,pageSize:500});if(!l(o))return r();V(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(i=g.get(e.data,t.fetch.dataKey))&&void 0!==i?i:[];a(n)}else r()}catch(e){r(e)}finally{nt((()=>V(!1)))}}))))})(n).then((e=>function(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>ra(t,y[l]).toString().includes(e)));if(1===t.length)return w(t[0]);S(e)}(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==u||u({[G]:t}),A.current=!0,W(t)},onKeyUp:t=>{var n;if(13===t.keyCode){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==p||p({[G]:l},e)}},onDoubleClick:e=>{const{value:t}=e.target;S(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&S(e)}}),j.default.createElement(Il,R,j.default.createElement(vd,P)))},"search-helper-multiple":(e,t)=>{var n;const{dataIndex:l}=t,{type:a,items:r=[],extra:i={},rules:o=[],helper:s={},onInput:d,onChange:p,onEnter:h}=N,v=la(e,l),y=s.fieldAliasMap;y||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof y?y():y||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||Oe("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=E;const C=n=>{const{beforeOpen:l}=s,a=(null!=l?l:et)({[G]:v},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},S=()=>{re(!1,(()=>se(I.current)))},w=t=>{aa(e,l,t),x(o,t,c,f),ue(e,c,f),null==p||p({[G]:t},e,_.current),ae()},T={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},s),{size:m,multiple:!0,initialValue:g.merge({},s.initialValue),defaultSelectedKeys:v,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:l}=E;ie(g.uniqBy([..._.current.filter((e=>t.includes(e[l]))),...e],l));const a=_.current.map((e=>({text:e[n],value:e[l]}))),i=g.uniqBy([...a,...r],"value").filter((e=>t.includes(e.value)));z(i),w(i.map((e=>e.value)));const{closed:o}=s;re(!1,(()=>se(I.current))),null==o||o(_.current)})(e,t):S()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},j.default.createElement(u.Select,{mode:"multiple",open:!1,value:v,placeholder:i.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==h||h({[G]:v},e))},onDoubleClick:()=>{i.disabled||C()},onChange:e=>{const{valueKey:t}=E;ie(_.current.filter((n=>e.includes(n[t])))),w(e)}},K.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text)))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{C()}})))),j.default.createElement(Il,T,j.default.createElement(vd,O)))},"tree-helper":(e,t)=>{var n,l;const{dataIndex:a,precision:r}=t,{type:i,extra:o={},rules:s=[],helper:u={},onChange:d,onEnter:p}=N,h=ra(e,te?u.combinedDataIndex:a),b=u.fieldAliasMap;b||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const y="function"==typeof b?b():b||{};Object.keys(y).includes(a)||Oe("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(u.combinedDataIndex.split("|").every((e=>Object.keys(y).includes(e)))||Oe("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),y[a].includes("|")&&Oe("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=n=>{const{beforeOpen:l}=u,a=(null!=l?l:et)({[G]:h},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},C=()=>{re(!1,(()=>se(I.current)))},S=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var l;if(g.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const a=n[t],r=v.find((e=>e.dataIndex===t));if(r){aa(e,t,a,r.precision);const n=null===(l=r.editRender)||void 0===l?void 0:l.call(r,e,r);n&&Array.isArray(n.rules)&&x(n.rules,a,c,t)}else aa(e,t,a)}aa(e,a,t,r),x(s,t,c,f),ue(e,c,f),null==d||d({[G]:t},e),ae()},w={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=u.width)&&void 0!==n?n:"30%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{C()}},T=Object.assign(Object.assign({},u),{defaultSelectedKeys:[h],size:m,onClose:e=>{e?(e=>{const t={};for(const n in y){const l=y[n];n!==a&&(t[n]=ra(e,l))}const n=y[a]?ra(e,y[a]):"";S(n,t);const{closed:l}=u;re(!1,(()=>se(I.current))),oe(),null==l||l(e)})(e):C()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement(rd,{ref:P,value:h,allowClear:null===(l=o.allowClear)||void 0===l||l,readOnly:o.readOnly,disabled:o.disabled,placeholder:o.placeholder||we("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{var n;if(13===t.keyCode){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==p||p({[G]:l},e)}},onDoubleClick:()=>{E()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?E():S(""))}}),j.default.createElement(Il,w,j.default.createElement(Cd,T)))},"tree-helper-multiple":(e,t)=>{var n;const{dataIndex:l}=t,{type:a,extra:r={},items:i=[],rules:o=[],helper:s={},onInput:d,onChange:p,onEnter:h}=N,v=la(e,l),y=s.fieldAliasMap;y||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof y?y():y||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||Oe("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=E;const C=n=>{const{beforeOpen:l}=s,a=(null!=l?l:et)({[G]:v},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},S=()=>{re(!1,(()=>se(I.current)))},w=t=>{aa(e,l,t),x(o,t,c,f),ue(e,c,f),null==p||p({[G]:t},e,_.current),ae()},T={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},s),{size:m,multiple:!0,initialValue:g.merge({},s.initialValue),defaultSelectedKeys:v,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=E;ie(e);const l=_.current.map((e=>({text:e[t],value:e[n]})));z(l),w(l.map((e=>e.value)));const{closed:a}=s;re(!1,(()=>se(I.current))),null==a||a(_.current)})(e):S()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},j.default.createElement(u.Select,{mode:"multiple",open:!1,value:v,placeholder:r.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:r.allowClear,maxTagCount:r.collapseTags?"responsive":void 0,maxTagTextLength:r.maxTagTextLength,disabled:r.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==h||h({[G]:v},e))},onDoubleClick:()=>{r.disabled||C()},onChange:e=>{const{valueKey:t}=E;ie(_.current.filter((n=>e.includes(n[t])))),w(e)}},K.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text)))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:r.disabled,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{C()}})))),j.default.createElement(Il,T,j.default.createElement(Cd,O)))}};return j.default.createElement(j.default.Fragment,null,ee?(()=>{const{type:e}=N,t=fe[e];if(!t)return Oe("Table","单元格编辑的类型 `type` 配置不正确"),null;const n=["cell--edit",{"is-error":!X}];return j.default.createElement("div",{ref:I,className:ne.default(n)},t(d,s),!X&&j.default.createElement("div",{className:"cell-error"},Q||Z))})():(()=>{const{extra:t={}}=N;return j.default.createElement("span",{style:{color:t.disabledColor}},e.children)})(),J&&j.default.createElement("i",{className:"cell--sign"}))}));id.displayName="CellEdit";const od=function(e){if(!j.default.isValidElement(e))return null;for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return j.default.cloneElement(e,...n)},sd=e=>{const{text:t,options:n,showMessage:l=!0,onCopy:a}=e;return od(e.children,{onClick:r=>{const i=j.default.Children.only(e.children),o=fe.default(t,n);null==a||a(t,o),o&&l&&u.message.success(we("qm.clipboard.success")),i&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(r)}})};sd.displayName="QmCopyToClipboard";const ud=j.default.forwardRef(((e,t)=>{const{column:n,row:l,rowIndex:a,columnIndex:r,rowKey:i,depth:o,showTitle:s}=e,{tableRef:u,selectionKeys:d,treeExpandIndex:c,updateMark:f,isTreeTable:p}=j.default.useContext(js),{treeConfig:h}=u.current.props,{dataIndex:m,canCopy:v,render:y,editRender:x,shouldCellUpdate:E}=n,{t:C}=td(),{renderText:S,getTitleFromCellNode:w}=pu(),T=j.default.useRef(null),[N,I]=function(e,t,n){const l=M.useRef({});return"value"in l.current&&!n(l.current.condition,t)||(l.current.value=e(),l.current.condition=t),l.current.value}((()=>{const e=la(l,m),o=y?y(e,l,n,a,r):S(e,n,l);return[o,x?j.default.createElement(id,{ref:t,column:n,record:l,rowKey:i,columnKey:m},o):null]}),[f,rt(l),y,x],((e,t)=>{if(E){const[,n]=e,[,l]=t;return E(l,n)}return!g.isEqual(e,t)}));j.default.useEffect((()=>{if([Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(m))return;const e=T.current.parentNode;s?e.title=w(N):e.removeAttribute("title")}),[s,N]);const O=e=>Array.isArray(e.children);return j.default.createElement("div",{ref:T,className:"cell"},(()=>{if(m===Js.expandableColumn)return j.default.createElement(ld,{record:l,rowKey:i});if(m===Js.selectionColumn)return j.default.createElement(nd,{selectionKeys:d,column:n,record:l,rowKey:i});if(I)return I;if(p&&m===c)return j.default.createElement(j.default.Fragment,null,(e=(null==h?void 0:h.virtual)?l._level:o)?j.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*Js.treeTable.textIndent+"px"}}):null,j.default.createElement(ld,{key:"expand",record:l,rowKey:i,style:O(l)?{}:{visibility:"hidden"}}),N);var e;if(v){const e=w(N);return j.default.createElement("div",{className:"cell--copy"},j.default.createElement("span",{className:"text"},N),e&&j.default.createElement(sd,{text:e},j.default.createElement(b.CopyOutlined,{className:"icon",title:C("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return N})())}));ud.displayName="Cell";const dd=j.default.forwardRef(((e,t)=>{const{tableFlatColumns:n,tableData:l}=e,{getRowKey:a,tableRef:r,flattenColumns:i,editableColumns:o,leftFixedColumns:s,rightFixedColumns:u,sorter:d,layout:c,showFooter:f,scrollX:p,scrollY:h,selectionKeys:m,rowExpandedKeys:v,highlightKey:b,isPingLeft:y,isPingRight:x,isTableEmpty:E,isTreeTable:C,isGroupSubtotal:S,isWebPagination:w,isDragMergeCell:T,setElementStore:N,createTableFullData:I,setSelectionKeysEffect:O,setHighlightKey:R,getStickyLeft:k,getStickyRight:P,scrollXToColumn:L,scrollYToRecord:H,rowInViewport:_,dataChange:F,setPingLeft:D,setPingRight:$,setFullScreen:M,findParentRowKeys:q,getAllChildRowKeys:V,triggerScrollXEvent:K,triggerScrollYEvent:z,scrollBottomDebouncer:B}=j.default.useContext(js),{height:W,minHeight:U,maxHeight:G,rowHeight:Y,rowSelection:X,rowHighlight:Q,treeConfig:Z,expandable:J,stripe:ee,summation:te,rowStyle:le,cellStyle:ae,spanMethod:re,nativeScrollBar:ie,ellipsis:se,showHeader:ue,rowDraggable:de,onRowClick:ce,onRowDblclick:fe,onRowContextmenu:pe,onRowEnter:he}=r.current.props,me=j.default.useRef(null),ge=j.default.useRef({}),ve=j.default.useRef(null),be=j.default.useRef(null),ye=j.default.useRef({prevST:0,prevSL:0}),{dragStart:xe,renderDragPanel:Ee,closeDragPanel:Ce}=(()=>{const{tableRef:e,layout:t,flattenColumns:n,isDragMergeCell:l}=j.default.useContext(js),{mergeCells:a=[],onMergeChange:r}=e.current.props,[i,o]=j.default.useState(!1),s=j.default.useRef(null),u=j.default.useRef(null),d=j.default.useRef({x:0,y:0,disX:0,disY:0}),c=dt("table");Vn((()=>{l||y()}),[l]);const f=()=>{y(),Gn(s.current,{display:"none"})},p=e=>{const t=[];for(let n=0;n<e.rowSpan;n++)for(let l=0;l<e.colSpan;l++)t.push([e.row+n,e.col+l]);return t},h=()=>{d.current={x:0,y:0,disX:0,disY:0},u.current&&!x(u.current)||(u.current=null,f()),o(!0),document.removeEventListener("mousemove",m)},m=e=>{const{pageX:n,pageY:l}=e,{x:a,y:r,disX:i,disY:o}=d.current;let u=i,c=o,f=n-a,p=l-r;return f<0&&(f=Math.abs(f),u=i-f,Gn(s.current,{left:`${u}px`})),p<0&&(p=Math.abs(p),c=o-p,Gn(s.current,{top:`${c+t.headerHeight}px`})),Gn(s.current,{width:`${f}px`,height:`${p}px`}),v(u,c,f,p),!1},v=cl(((t,l,a,r)=>{const{allTableData:i,scrollYStore:o}=e.current;let s=-1,d=-1,c=-1,f=-1;for(let e=0;e<i.length;e++)l>o.rowHeight*e&&l<o.rowHeight*(e+1)&&(s=e),l+r>o.rowHeight*e&&l+r<o.rowHeight*(e+1)&&(d=e);let p=0;for(let e=0;e<n.length;e++)t>p&&t<p+E(n[e])&&(c=e),t+a>p&&t+a<p+E(n[e])&&(f=e),p+=E(n[e]);const h={row:s,col:c,rowSpan:d-s+1,colSpan:f-c+1};g.isEqual(u,h)||(u.current=h,b(s,d,c,f))}),5),b=(t,n,l,a)=>{const{elementStore:r,scrollYStore:i}=e.current,o=r.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<o.length;e++){const r=o[e].children;for(let o=0;o<r.length;o++)if(r[o].classList.remove("selected"),(t!==n||l!==a)&&e+i.startIndex>=t&&e+i.startIndex<=n){const e=Number(r[o].getAttribute("colspan")),t=Number(r[o].getAttribute("data-index")),n=e>1?t+e-1:t;n>=l&&n<=a&&r[o].classList.add("selected")}}},y=()=>{const{elementStore:t}=e.current,n=t.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<n.length;e++){const t=n[e].children;for(let e=0;e<t.length;e++)t[e].classList.remove("selected")}},x=e=>1===e.rowSpan&&1===e.colSpan,E=e=>e.width||e.renderWidth||e.minWidth||Js.defaultColumnWidth;return{dragStart:n=>{const{pageX:l,pageY:a}=n,{elementStore:r}=e.current,{x:i,y:c}=Qn(r.$table),{scrollLeft:f,scrollTop:p}=r.$tableBody.parentNode.parentNode;u.current=null,d.current={x:l,y:a,disX:l+f-i,disY:a+p-(c+t.headerHeight)},Gn(s.current,{width:0,height:0,left:l-i+"px",top:a-c+"px",display:"block"}),y(),o(!1),document.addEventListener("mousemove",m,{passive:!0}),document.addEventListener("mouseup",h,{passive:!0,once:!0})},renderDragPanel:()=>j.default.createElement("div",{ref:s,className:`${c}--merge-cell`,onMouseDown:e=>e.stopPropagation()},i&&j.default.createElement(j.default.Fragment,null,j.default.createElement(ot,{size:"small",className:"btn cancel",onClick:()=>{if(u.current&&!x(u.current)){const e=p(u.current),t=a.findIndex((t=>{const n=p(t);return g.intersectionWith(n,e,g.isEqual).length===n.length}));-1!==t&&(null==r||r(a.filter(((e,n)=>n!==t))))}f()}},we("qm.table.mergeCell.cancel")),j.default.createElement(ot,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(u.current&&!x(u.current)){const e=p(u.current);let t=!1;for(let n=0;n<a.length;n++)g.intersectionWith(p(a[n]),e,g.isEqual).length&&(t=!0);t||null==r||r([...a,u.current])}f()}},we("qm.table.mergeCell.confirm")))),closeDragPanel:f}})(),Se=r.current.scrollXLoad?n:i,Te=j.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:l,tableAutoHeight:a}=c,r={};return E&&Object.assign(r,{minHeight:"100px"}),U&&Object.assign(r,{minHeight:ta(U)-e-n+"px"}),G&&Object.assign(r,{maxHeight:ta(G)-e-n+"px"}),W||l||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[W,G,U,E,c]),Ne=j.default.useMemo((()=>{const{scrollYStore:e}=r.current,{viewportHeight:t,gutterWidth:n}=c;return Math.floor((p?t-n:t)/e.rowHeight)}),[c,p]),[Ie,Oe]=j.default.useState([]),Re=ed(),ke=Ju(me,[".table-editable__popper"]);j.default.useImperativeHandle(t,(()=>({setClickedValues:_e,createFocus:Le,forceUpdate:Re}))),Vn((()=>{ke&&(_e([]),T&&Ce())}),[ke]),Vn((()=>{Ie.length&&Qs.focus(r.current.uid)}),[Ie]),j.default.useEffect((()=>{Ae();const e=oe.default(document,"keydown",Pe);return()=>e.remove()}),[]);const Pe=au((e=>{var t,n,i,s,u,d,c;const{keyCode:f}=e;if(r.current.uid===(null===(t=Qs.getFocusInstance())||void 0===t?void 0:t.id)&&(27===f&&(_e([]),R(""),M(!1)),Ie.length&&(Jn(document.activeElement,me.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===f&&("radio"===(null==X?void 0:X.type)||Q)){const t=null!==(s=null!==(i=m[0])&&void 0!==i?i:b)&&void 0!==s?s:null,n=null!==(u=l.find((e=>a(e,e.index)===t)))&&void 0!==u?u:null;n&&(null==he||he(n,e))}if(38===f||40===f){Wn(e);const{allTableData:t}=r.current,n=w?Zl(l):t,i=n.length;let o=n.findIndex((e=>a(e,e.index)===Ie[0]));const s=38===f?(--o+i)%i:++o%i,u=n[s],p=a(u,u.index);"radio"!==(null==X?void 0:X.type)||(null===(d=X.disabled)||void 0===d?void 0:d.call(X,u))||O([p]),Q&&!(null===(c=Q.disabled)||void 0===c?void 0:c.call(Q,u))&&R(p),_(s)||(38===f&&H(p,s),40===f&&H(p,Ne>s+1?0:s+1-Ne)),_e([p,Ie[1]])}if(9===f){if(Wn(e),!o.length)return _e([]);const t=o.length;let n=o.findIndex((e=>e.dataIndex===Ie[1]));const l=++n%t,a=o[l].dataIndex;_e([Ie[0],a]),L(a)}}})),Ae=()=>{N("$tableBody",me.current),N("$tableXspace",ve.current),N("$tableYspace",be.current)},Le=(e,t)=>{var n;null===(n=ge.current[`${e}-${t}`])||void 0===n||n.focus()},He=(e,t,n)=>{var l,r;const{dataIndex:i}=n;if([Js.expandableColumn,Js.operationColumn].includes(i))return;const o=a(t,t.index);_e([o,i]);const s=null===(l=n.editRender)||void 0===l?void 0:l.call(n,t,n),u=s&&!s.disabled,{type:d,selectByClickRow:c=!0,disabled:f=Je}=X||{};!d||f(t)||u||(c||i===Js.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:l=!0,onSelect:a}=X||{};if("radio"===n&&O([e]),"checkbox"===n){const n=!m.includes(e),r=C&&!l?De(e,m,n):Fe(e,m,n);O(r),null==a||a(n,t,r)}})(o,t),[Js.selectionColumn].includes(i)||(!Q||(null===(r=Q.disabled)||void 0===r?void 0:r.call(Q,t))||u||R(o),null==ce||ce(t,n,e))},_e=e=>{g.isEqual(e,Ie)||Oe(e)},Fe=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),De=(e,t,n)=>{var l;const{disabled:a}=X||{},{deriveRowKeys:i,recordsMap:o}=r.current,s=Ql(i,e);let u=[];const d=V((null==s?void 0:s.children)||[]);u=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t))),a&&(u=u.filter((e=>!o.has(e)||!a(o.get(e)))));return((null===(l=ba(i,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ql(i,e),l=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>u.includes(e.rowKey)));u=l?[...u,e]:u.filter((t=>t!==e))})),u},$e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];return e.forEach((e=>{const l=e.index,r=a(e,e.index);if(n.push(Me(e,l,r,t)),null==J?void 0:J.expandedRowRender){const{expandedRowClassName:t,rowExpandable:a=et}=J;v.includes(r)&&a(e)&&n.push(j.default.createElement("tr",{key:`expand_${r}`,className:"body--row-expanded"},j.default.createElement("td",{colSpan:Se.length,className:"body--column",style:{paddingLeft:X?2*Js.selectionColumnWidth:Js.selectionColumnWidth}},j.default.createElement("div",{className:ne.default("cell",t)},J.expandedRowRender(e,l)))))}if(!(null==Z?void 0:Z.virtual)&&(e=>Array.isArray(e.children))(e)){const l="function"!=typeof(null==J?void 0:J.rowExpandable)||J.rowExpandable(e);v.includes(r)&&l&&n.push(...$e(e.children,t+1))}})),n},Me=function(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=["body--row",Object.assign({"body--row-striped":ee&&t%2!=0,"body--row-selected":m.includes(n),"body--row-current":b===n},S?ze(e._group):null)];return j.default.createElement("tr",{key:n,className:ne.default(a)},Se.map(((a,r)=>je(a,r,e,t,n,l))))},je=(e,t,n,l,a,i)=>{var o,c,f;const{isIE:p}=r.current,{dataIndex:h,fixed:m,align:g,className:v="",editRender:b}=e,{rowSpan:y,colSpan:x}=Ve(n,e,l,t);if(!y||!x)return null;const E=null!==(o=e.ellipsis)&&void 0!==o?o:se,C=!p&&"left"===m,w=!p&&"right"===m,T=["body--column",{"col--ellipsis":E,"col--center":"center"===g,"col--right":"right"===g,"column--sort":!!d[h],"cell-fix-left":C,"cell-fix-right":w,"cell-fix-left-last":C&&(null===(c=s[s.length-1])||void 0===c?void 0:c.dataIndex)===h,"cell-fix-right-first":w&&(null===(f=u[0])||void 0===f?void 0:f.dataIndex)===h,[v]:!!v}],N=p?null:{left:C?`${k(h)}px`:"",right:w?`${P(h)}px`:""},I=le?"function"==typeof le?le(n,l):le:null,O=ae?"function"==typeof ae?ae(n,e,l,t):ae:null,R=S?Ke(n._group):null,A=Object.assign({},N,Y?{height:Y}:null,R,I,O);if(b){const{extra:t}=b(n,e)||{};(null==t?void 0:t.disabledBackgroundColor)&&Object.assign(A,{backgroundColor:null==t?void 0:t.disabledBackgroundColor})}return j.default.createElement("td",{key:h,rowSpan:y>1?y:void 0,colSpan:x>1?x:void 0,"data-index":t,className:ne.default(T),style:A,onClick:t=>He(t,n,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:l}=n;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(l)||null==fe||fe(t,n,e)})(t,n,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:l}=n;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(l)||null==pe||pe(t,n,e)})(t,n,e)},j.default.createElement(ud,{ref:e=>ge.current[`${a}-${h}`]=e,row:n,column:e,rowIndex:l,columnIndex:t,rowKey:a,depth:i,showTitle:E}))},Ve=(e,t,n,a)=>{let i=1,o=1;if("function"==typeof re){const r=re({row:e,column:t,rowIndex:n,columnIndex:a,tableData:l});if(Array.isArray(r)?(i=r[0],o=r[1]):g.isPlainObject(r)&&(i=r.rowSpan,o=r.colSpan),e===l[0]&&0===i){i=1;for(let e=1;e<l.length;e++){const{rowSpan:n}=Ve(l[e],t,l[e].index,a);if(n>0)break;i++}}}const{mergeCells:s}=r.current;if(s.length>0){const e=s.find((e=>e.row===n&&e.col===a));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}},Ke=e=>{var t;const{backgroundColor:n,color:l}=null!==(t=te.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:l}},ze=e=>{const t=te.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Be=dt("table"),We=T?{onMouseDown:xe}:null;return j.default.createElement(j.default.Fragment,null,j.default.createElement(gl,{ref:r.current.scrollBarRef,wrapClassName:`${Be}--body-wrapper`,wrapStyle:Te,native:ie,onScroll:e=>{const{elementStore:t,scrollXLoad:n,scrollYLoad:l}=r.current,{prevST:a,prevSL:i}=ye.current,o=h?c.gutterWidth:0,{scrollTop:s,scrollLeft:u}=e;if(u!==i){ue&&(t.$header.scrollLeft=u),f&&(t.$footer.scrollLeft=u);const e=u>0,n=Math.ceil(u)+c.tableWidth<c.tableBodyWidth+o;y!==e&&D(e),x!==n&&$(n)}if(l&&s!==a&&z(s),n&&u!==i&&K(u),h&&s!==a){const n=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+c.viewportHeight-o>=n&&B({type:"scroll",target:e,preventDefault:Je,stopPropagation:Je})}ye.current.prevST=s,ye.current.prevSL=u}},j.default.createElement("div",{ref:be,className:"body--y-space"}),j.default.createElement("div",{ref:ve,className:"body--x-space",style:{width:h?c.tableBodyWidth-c.gutterWidth:c.tableBodyWidth}}),j.default.createElement(Zu.Provider,{value:Ie},j.default.createElement("table",qe({ref:me,className:`${Be}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},We,{style:{width:0}}),j.default.createElement("colgroup",null,Se.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})}))),de?j.default.createElement(A.ReactSortable,{itemKey:e=>a(e,e.index),tag:"tbody",animation:200,list:l,setList:e=>{const t=e.map((e=>a(e,e.index))),n=l.map((e=>a(e,e.index)));if(g.isEqual(t,n))return;const i=Ea(e),o=[];r.current.tableFullData.forEach((e=>{l.includes(e)?o.push(i.shift()):o.push(e)})),I(o),F()}},l.map((e=>Me(e,e.index,a(e,e.index))))):j.default.createElement("tbody",null,$e(l))))),T&&Ee())}));dd.displayName="TableBody";const cd=e=>{const{summationRows:t}=e,{tableRef:n,sorter:l,layout:a,scrollY:r,flattenColumns:i,leftFixedColumns:o,rightFixedColumns:s,setElementStore:u,getStickyLeft:d,getStickyRight:c}=j.default.useContext(js),{footRender:f}=n.current.props,p=j.default.useRef(null);j.default.useEffect((()=>{h()}),[]);const h=()=>{u("$footer",p.current)},m=(e,t,i)=>{var u,f;const{isIE:p}=n.current,{gutterWidth:h}=a,{dataIndex:m,fixed:g,align:v,summation:b}=e,y=["footer--column","col--ellipsis",{"col--center":"center"===v,"col--right":"right"===v,"column--sort":!!l[m],"cell-fix-left":!p&&"left"===g,"cell-fix-right":!p&&"right"===g,"cell-fix-left-last":!p&&"left"===g&&(null===(u=o[o.length-1])||void 0===u?void 0:u.dataIndex)===m,"cell-fix-right-first":!p&&"right"===g&&(null===(f=s[0])||void 0===f?void 0:f.dataIndex)===m}],x=p?null:{left:"left"===g?`${d(m)}px`:"",right:"right"===g?`${c(m)+(r?h:0)}px`:""},E=(null==b?void 0:b.render)?b.render(n.current.tableFullData):la(t,`${m}_text`),C=0===i&&""===E?we("qm.table.config.summaryText"):E;return j.default.createElement("td",{key:m,title:C,className:ne.default(y),style:Object.assign({},x)},j.default.createElement("div",{className:"cell"},C))},g=dt("table"),{tableBodyWidth:v}=a;return j.default.createElement("div",{ref:p,className:`${g}--footer-wrapper`},f?f(i,n.current.tableFullData):j.default.createElement("table",{className:`${g}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:v?`${v}px`:""}},(()=>{const{gutterWidth:e}=a;return j.default.createElement("colgroup",null,i.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})})),r&&j.default.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),j.default.createElement("tfoot",null,(()=>{const{isIE:e}=n.current,l=["gutter",{"cell-fix-right":!!s.length}],a=e?null:{right:s.length?0:""};return t.map(((e,t)=>j.default.createElement("tr",{key:t,className:"footer--row"},i.map(((t,n)=>m(t,e,n))),r&&j.default.createElement("td",{className:ne.default(l),style:Object.assign({},a)}))))})())))};var fd;!function(e){e.small="small",e.middle="default",e.large="default"}(fd||(fd={}));const pd=e=>{var t,n,l,a;const{current:r,pageSize:i,total:o,onChange:s}=e,{global:d}=j.default.useContext(xe),{tableRef:c,$size:f,setElementStore:p}=j.default.useContext(js),{uniqueKey:h,paginationConfig:m,infoBarConfig:g}=c.current.props,v=j.default.useRef(null),b=j.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);j.default.useEffect((()=>{y(),S()}),[]);const y=()=>{p("$pager",v.current)},x=null!==(t=null==m?void 0:m.showSizeChanger)&&void 0!==t?t:Js.pagination.showSizeChanger,E=null!==(n=null==m?void 0:m.showQuickJumper)&&void 0!==n?n:Js.pagination.showQuickJumper,C=(null==m?void 0:m.pageSizeOptions)||(null===(a=null===(l=null==d?void 0:d.table)||void 0===l?void 0:l.pagination)||void 0===a?void 0:a.pageSizeOptions)||Js.pagination.pageSizeOptions,S=()=>Ye(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield w(b);e&&e!==i&&(s(r,e),localStorage.setItem(b,e.toString()))})),w=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),N={[`${dt("table")}-pager`]:!0};return j.default.createElement("div",{ref:v,className:ne.default(N)},j.default.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&j.default.createElement(du,{total:o})),j.default.createElement(u.Pagination,{size:fd[f],showSizeChanger:x,showQuickJumper:E,pageSizeOptions:C,current:r,pageSize:i,total:o,onChange:(e,t)=>{s(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},hd=()=>{const{layout:e}=j.default.useContext(js),t=j.default.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),n=dt("table");return j.default.createElement("div",{className:`${n}--empty`,style:t},j.default.createElement(al,null))},md=()=>{const{setElementStore:e}=j.default.useContext(js),t=j.default.useRef(null);j.default.useEffect((()=>{n()}),[]);const n=()=>{e("$resizableBar",t.current)},l=dt("table");return j.default.createElement("div",{ref:t,className:`${l}--resizable-bar`})},gd=j.default.forwardRef(((e,t)=>{const{rowKey:n,columns:l,loading:a,resizable:r,customClass:i,tablePrint:o,exportExcel:s,infoBarConfig:u,topSpaceAlign:d,showTableInfo:c,showFullScreen:f,showRefresh:p,showToolBox:h,showHeader:m}=e,{size:v}=j.default.useContext(xe),b=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:v)&&void 0!==n?n:""}),[e.size,v]),y=j.default.useRef(null),x=j.default.useRef(null),E=j.default.useRef(null),C=j.default.useRef(null),S=j.default.useRef(null),w=j.default.useCallback(((e,t)=>{const l="function"==typeof n?n(e,t):e[n];return void 0===l?(Oe("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l}),[n]),{tableRef:T,tableFullData:N,setElementStore:I,setOriginColumns:O,setTableFullData:R,setTableOriginData:k,setAllTableData:P,setDeriveRowKeys:A,setInvalidRowKeys:L,setFieldAuth:H,setMergeCells:_,setColumnsDefined:F,setScrollXStore:D,setScrollYStore:$,setScrollXLoad:M,setScrollYLoad:q,setResizeState:V,setHandleState:K,setSummaries:z,setSelectionRows:B,setShouldToTop:W,setRecordsMap:U,setUnMounted:G,setHandleChange:Y,clearElementStore:X,clearRecordsMap:Q}=((e,t)=>{let{getRowKey:n,$size:l}=t;const{rowHeight:a,dynamicThead:r}=e,i=j.default.useRef({props:e,uid:ca(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},mergeCells:[],columnsDefined:!r,scrollBarRef:j.default.createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:a||Js.rowHeightMaps[l]},store:new Zs,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollXLoad:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,unMounted:!1,isHandleChange:!0,isIE:!Xe&&/MSIE|Trident/.test(navigator.userAgent)});var o;o=e,i.current.props=o;const s=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return e.map((e=>{const i=n(e,e.index),o=l?`${l}#${i}`:`${i}`,u=a?`${a}-${e.index+1}`:`${e.index+1}`,d={level:r,rowKey:i,rowKeyPath:o,indexPath:u};return e.indexPath=u,e._level=r,e.children&&(d.children=s(e.children,i,o,u,r+1)),t?Object.assign({},d,{parentRowKey:t}):d}))},u=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...u(e.children)):t.push(e.rowKey)})),t};return Object.assign(Object.assign({tableRef:i},i.current),{setElementStore:(e,t)=>{i.current.elementStore[e]=t},setOriginColumns:e=>{i.current.originColumns=e},setTableFullData:e=>{i.current.tableFullData=e},setTableOriginData:e=>{i.current.tableOriginData=e},setAllTableData:e=>{const t=Zl(e);i.current.allTableData=t,i.current.allRowKeys=t.map((e=>n(e,e.index)))},setDeriveRowKeys:e=>{const t=i.current.tableFullData.some((e=>Array.isArray(e.children)));i.current.treeTable=t,i.current.deriveRowKeys=t?s(e,""):[],i.current.flattenRowKeys=t?u(i.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{i.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{i.current.fieldAuth[e]=t},setMergeCells:e=>{const t=[];e.forEach((e=>{t.push(e);for(let n=1;n<e.colSpan;n++)for(let l=0;l<e.rowSpan;l++)t.push({row:e.row+l,col:e.col+n,rowSpan:0,colSpan:0});for(let n=1;n<e.rowSpan;n++)for(let l=0;l<e.colSpan;l++)t.push({row:e.row+n,col:e.col+l,rowSpan:0,colSpan:0})})),i.current.mergeCells=t},setColumnsDefined:e=>{i.current.columnsDefined=e},setScrollXStore:e=>{i.current.scrollXStore=e},setScrollYStore:e=>{i.current.scrollYStore=e},setResizeState:e=>{i.current.resizeState=e},setHandleState:e=>{i.current.handleState=e},setSummaries:e=>{i.current.summaries=e},setScrollXLoad:e=>{i.current.scrollXLoad=e},setScrollYLoad:e=>{i.current.scrollYLoad=e},setShouldToTop:e=>{i.current.shouldToTop=e},setSelectionRows:e=>{i.current.selectionRows=e},setRecordsMap:(e,t)=>{i.current.recordsMap.set(e,t)},setUnMounted:e=>{i.current.unMounted=e},setHandleChange:e=>{i.current.isHandleChange=e},clearElementStore:()=>{for(const e in i.current.elementStore)i.current.elementStore[e]=null},clearRecordsMap:()=>{i.current.recordsMap.clear()}})})(e,{getRowKey:w,$size:b}),{tableData:Z,setTableData:J,tableFlatColumns:ee,setTableFlatColumns:te,filters:le,setFilters:ae,sorter:re,setSorter:ie,superFilters:oe,setSuperFilters:se,pagination:ue,setPagination:de,selectionKeys:ce,setSelectionKeys:fe,rowExpandedKeys:pe,setRowExpandedKeys:he,highlightKey:me,setHighlightKey:ge,updateMark:ve,forceUpdate:be,layout:ye,setLayout:Ee,permission:Ce,setPermission:Se,spinning:we,setSpinning:Te,scrollX:Ne,setScrollX:Ie,scrollY:Re,setScrollY:ke,isPingLeft:Pe,setPingLeft:Ae,isPingRight:Le,setPingRight:He,isFullScreen:_e,setFullScreen:Fe,updateTableData:De}=(e=>{var t,n,l,a,r,i,o,s,u,d,c;const{uniqueKey:f,nativeScrollBar:p,initialSorter:h={},initialFilter:m={},paginationConfig:v,rowSelection:b,expandable:y,rowHighlight:x}=e,{global:E}=j.default.useContext(xe),C={current:null!==(t=null==v?void 0:v.current)&&void 0!==t?t:Js.pagination.current,pageSize:null!==(i=null!==(l=null!==(n=(()=>{if(f)return Number(localStorage.getItem(`tablePager_${f}`))||void 0})())&&void 0!==n?n:null==v?void 0:v.pageSize)&&void 0!==l?l: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:Js.pagination.pageSize,total:0},S=null!==(s=null!==(o=null==b?void 0:b.selectedRowKeys)&&void 0!==o?o:null==b?void 0:b.defaultSelectedRowKeys)&&void 0!==s?s:[],w=null!==(d=null!==(u=null==y?void 0:y.expandedRowKeys)&&void 0!==u?u:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==d?d:[],[T,N]=j.default.useState([]),[I,O]=j.default.useState([]),[R,k]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),m),[P,A]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),h),[L,H]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),[]),[_,F]=j.default.useState(C),[D,$]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),S),[M,q]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),w),[V,K]=j.default.useState(null!==(c=null==x?void 0:x.currentRowKey)&&void 0!==c?c:""),[z,B]=j.default.useReducer((e=>e+1),0),[W,U]=j.default.useState({gutterWidth:p?tu():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[G,Y]=j.default.useState({export:!0,import:!0,print:!0}),[X,Q]=j.default.useState(!1),[Z,J]=j.default.useState(!1),[ee,te]=j.default.useState(!1),[ne,le]=j.default.useState(!1),[ae,re]=j.default.useState(!1),[ie,oe]=j.default.useState(!1);return{tableData:T,setTableData:N,tableFlatColumns:I,setTableFlatColumns:O,filters:R,setFilters:k,sorter:P,setSorter:A,superFilters:L,setSuperFilters:H,pagination:_,setPagination:F,selectionKeys:D,setSelectionKeys:$,rowExpandedKeys:M,setRowExpandedKeys:q,highlightKey:V,setHighlightKey:K,updateMark:z,forceUpdate:B,layout:W,permission:G,setPermission:Y,setLayout:U,spinning:X,setSpinning:Q,scrollX:Z,setScrollX:J,scrollY:ee,setScrollY:te,isPingLeft:ne,setPingLeft:le,isPingRight:ae,setPingRight:re,isFullScreen:ie,setFullScreen:oe,updateTableData:()=>{N([...T])}}})(e),{isFetch:$e,isWebPagination:Me,isScrollPagination:je,showPagination:Ve,shouldUpdateHeight:Ke,tableColumns:ze,flattenColumns:Be,editableColumns:We,summationColumns:Ue,leftFixedColumns:Ge,rightFixedColumns:Qe,treeExpandIndex:Ze,showSummary:Je,showFooter:et,isHeadGroup:tt,bordered:nt,isHeadSorter:lt,isHeadFilter:at,isServiceSummation:rt,isSelectCollection:it,isTableImport:ot,isTableClipboard:st,isSuperSearch:ut,isFastSearch:ct,isGroupSummary:ft,isGroupSubtotal:pt,isDragMergeCell:ht,isTreeTable:mt,isTableEmpty:gt,summationRows:vt,fetchParams:bt}=lu(e,{getRowKey:w,tableRef:T,tableFullData:N,tableData:Z,sorter:re,filters:le,superFilters:oe,selectionKeys:ce,pagination:ue}),{createElementStore:yt,tableStyles:xt,getSpan:Et,getStickyLeft:Ct,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Tt,rowInViewport:Nt,calcTableHeight:It,resetTableScroll:Ot,computeVirtualX:Rt,computeVirtualY:kt,doLayout:Pt}=su(e,{getRowKey:w,tableRef:T,$size:b,tableColumns:ze,flattenColumns:Be,leftFixedColumns:Ge,layout:ye,scrollX:Ne,scrollY:Re,tableData:Z,showFooter:et,showPagination:Ve,isWebPagination:Me,isFullScreen:_e,setLayout:Ee,setScrollX:Ie,setScrollY:ke,setElementStore:I,setScrollXStore:D,setScrollYStore:$,setShouldToTop:W}),{initialTable:At,checkDataIndex:Lt,createTableFullData:Ht,getTableData:_t,handleTableData:Ft,createTableData:Dt,createGroupData:$t,createSelectionKeys:Mt,createRowExpandedKeys:jt,setSelectionKeysEffect:qt,findParentRowKeys:Vt,getAllChildRowKeys:Kt,doFieldValidate:zt,getTableLog:Bt,dataChange:Wt,tableChange:Ut,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,pagerChangeHandle:Qt,triggerScrollXEvent:Zt,triggerScrollYEvent:Jt,scrollBottomDebouncer:en,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearRowSelection:an,clearRowHighlight:rn,clearTableLog:on,destroy:sn}=ou(e,{getRowKey:w,tableRef:T,tableElementRef:x,tableBodyRef:E,$size:b,tableColumns:ze,flattenColumns:Be,tableFullData:N,pagination:ue,layout:ye,filters:le,sorter:re,superFilters:oe,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,summationColumns:Ue,shouldUpdateHeight:Ke,isFetch:$e,isTreeTable:mt,isWebPagination:Me,isScrollPagination:je,isServiceSummation:rt,isGroupSubtotal:pt,doLayout:Pt,setTableData:J,setTableFlatColumns:te,setTableFullData:R,setTableOriginData:k,setAllTableData:P,setDeriveRowKeys:A,setPagination:de,setSpinning:Te,setSorter:ie,setFilters:ae,setSuperFilters:se,setSelectionKeys:fe,setRowExpandedKeys:he,setHighlightKey:ge,setSelectionRows:B,setScrollXLoad:M,setScrollYLoad:q,setScrollXStore:D,setScrollYStore:$,computeVirtualX:Rt,computeVirtualY:kt,setFieldAuth:H,setResizeState:V,setSummaries:z,setPermission:Se,setRecordsMap:U,resetTableScroll:Ot,clearElementStore:X,clearRecordsMap:Q});uu(e,{tableRef:T,topElementRef:y,tableElementRef:x,tableBodyRef:E,$size:b,scrollX:Ne,pagination:ue,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,showSummary:Je,summationRows:vt,isWebPagination:Me,isScrollPagination:je,isTreeTable:mt,checkDataIndex:Lt,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,setHandleState:K,scrollYToRecord:Tt,setOriginColumns:O,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ge,setResizeState:V,setMergeCells:_,setPingRight:He,setUnMounted:G,setHandleChange:Y,calcTableHeight:It,createSelectionKeys:Mt,createRowExpandedKeys:jt,createElementStore:yt,triggerScrollYEvent:Jt,initialTable:At,destroy:sn});const un=j.default.useMemo((()=>({getRowKey:w,tableRef:T,tableBodyRef:E,$size:b,flattenColumns:Be,editableColumns:We,leftFixedColumns:Ge,rightFixedColumns:Qe,treeExpandIndex:Ze,sorter:re,filters:le,superFilters:oe,layout:ye,bordered:nt,showFooter:et,showSummary:Je,summationRows:vt,scrollX:Ne,scrollY:Re,pagination:ue,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,updateMark:ve,isFetch:$e,isPingLeft:Pe,isPingRight:Le,isHeadSorter:lt,isHeadFilter:at,isFullScreen:_e,isTableEmpty:gt,isHeadGroup:tt,isTreeTable:mt,isGroupSubtotal:pt,isWebPagination:Me,isDragMergeCell:ht,dataChange:Wt,tableChange:Ut,getTableData:_t,setElementStore:I,createTableFullData:Ht,updateTableData:De,setSorter:ie,setFilters:ae,setSuperFilters:se,setHighlightKey:ge,setRowExpandedKeys:he,setSelectionRows:B,setSelectionKeysEffect:qt,setInvalidRowKeys:L,getSpan:Et,getStickyLeft:Ct,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Tt,rowInViewport:Nt,setPagination:de,setPingLeft:Ae,setPingRight:He,setSpinning:Te,setFullScreen:Fe,setShouldToTop:W,doFieldValidate:zt,createTableData:Dt,createGroupData:$t,findParentRowKeys:Vt,getAllChildRowKeys:Kt,triggerScrollXEvent:Zt,triggerScrollYEvent:Jt,scrollBottomDebouncer:en,resetTableScroll:Ot,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearRowSelection:an,clearRowHighlight:rn})),[b,Be,We,Ge,Qe,Ze,re,le,oe,ye,nt,et,Je,vt,Ne,Re,ue,bt,ce,pe,me,ve,$e,Pe,Le,lt,at,_e,gt,tt,mt,pt,Me,ht]);((e,t)=>{const{getRowKey:n,tableRef:l,toolBoxRef:a,tableBodyRef:r,columnFilterRef:i,flattenColumns:o,editableColumns:s,pagination:u,fetchParams:d,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,isFetch:h,dataChange:m,getTableData:v,handleTableData:b,createTableData:y,createTableFullData:x,calcTableHeight:E,scrollXToColumn:C,scrollYToRecord:S,doFieldValidate:w,setTableOriginData:T,setHandleState:N,setColumnsDefined:I,setSelectionKeysEffect:O,setRowExpandedKeys:R,setHighlightKey:k,setSelectionRows:P,setOriginColumns:A,setHandleChange:L,forceUpdate:H,getTableLog:_,clearRowSelection:F,clearRowHighlight:D,clearTableSorter:$,clearTableFilter:M,clearSuperFilters:q,clearTableLog:V}=t,{columns:K,columnsChange:z}=l.current.props,B=(e,t,l)=>e.filter((e=>{const a=n(e,e.index);e.children&&(e.children=B(e.children,t,l));const r=t.includes(a);return r&&(null==l||l(e,a)),!r}));j.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{E()},DO_REFRESH:e=>Ye(void 0,void 0,void 0,(function*(){h&&(yield v(),null==e||e())})),GET_LOG:()=>_(),GET_FETCH_PARAMS:()=>{const e={};for(const t in d)Object.keys(u).includes(t)||(e[t]=d[t]);return e},CLEAR_TABLE_DATA:()=>{h||(F(),D(),$(),M(),q(),V(),y([]))},CLEAR_LOG:()=>{V()},CREATE_FOCUS:(e,t)=>{r.current.createFocus(e,t)},FORCE_UPDATE:()=>{H()},DO_EXPORT:()=>{a.current.exportHandle()},SCROLL_TO_RECORD:e=>{S(e)},SCROLL_TO_COLUMN:e=>{C(e)},SET_SELECTION:function(e){!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&!g.isEqual(e,c)&&L(!1),O(e)},SET_HIGHLIGHT:e=>{k(e)},SET_EXPANDABLE:e=>{R(e)},SET_SELECTION_ROWS:e=>{P(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{A(e),I(!0),i.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const l=Ul(K,e);if(!l)return Oe("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!g.isPlainObject(t))return Oe("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(l.noAuth)return Oe("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&g.set(l,e,t[e]);n&&(z?z([...K]):Oe("Table","需要设置 `columnsChange` 参数"),H())},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:r}=l.current,i=(Array.isArray(e)?e:[e]).filter((e=>g.isPlainObject(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:n}=t;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(n)||aa(e,n,la(e,n))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),u=void 0===(null==t?void 0:t.parentRowKey),d=r;if(u)s?d.unshift(...i):d.push(...i);else{const e=ya(r,(e=>t.parentRowKey===n(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}y(d),u&&N(Object.assign({},l.current.handleState,{insert:s?"before":"after"})),H(),m()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=l.current,r=(Array.isArray(e)?e:[e]).map((e=>g.isPlainObject(e)?n(e,e.index):e));if(!r.length)return;let i=!1;const o=B(a,r,((e,n)=>{t.addToRemoved(e),s.forEach((l=>{const{dataIndex:a,editRender:r}=l,i=null==r?void 0:r(e,l);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:n,y:a}),t.removeFromValidate({x:n,y:a}),t.removeFromEdited({x:n,y:a}))})),i=!0}));i&&(x(o),O(c.filter((e=>!r.includes(e)))),r.includes(p)&&D(),R(f.filter((e=>!r.includes(e)))),N(Object.assign({},l.current.handleState,{remove:!0})),m(),setTimeout((()=>{T(B(l.current.tableOriginData,r))})))},VALIDATE_FIELDS:(e,t)=>{l.current.allTableData.forEach((l=>{s.forEach((a=>{const{dataIndex:r,editRender:i}=a,o=null==i?void 0:i(l,a);if(!o)return;const s=n(l,l.index);if(e&&!e.includes(s))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:d}=o;!d&&u.length&&w(u,la(l,r),s,r)}))}));const{required:a,validate:r}=_(),i=[...a,...r];return i.length&&S(i[0].rowKey),H(),{required:a,validate:r}}})))})(t,{getRowKey:w,tableRef:T,toolBoxRef:C,tableBodyRef:E,columnFilterRef:S,flattenColumns:Be,editableColumns:We,pagination:ue,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,isFetch:$e,dataChange:Wt,getTableData:_t,handleTableData:Ft,createTableData:Dt,createTableFullData:Ht,calcTableHeight:It,scrollXToColumn:wt,scrollYToRecord:Tt,doFieldValidate:zt,setTableOriginData:k,setHandleState:K,setColumnsDefined:F,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ge,setSelectionRows:B,setOriginColumns:O,setHandleChange:Y,forceUpdate:be,getTableLog:Bt,clearRowSelection:an,clearRowHighlight:rn,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearTableLog:on}),j.default.useEffect((()=>{Qs.register(T.current.uid,null!=t?t:{current:null})}),[]);const dn=dt("table"),cn={[`${dn}--wrapper`]:!0,[`${dn}--lg`]:"large"===b,[`${dn}--sm`]:"small"===b,[`${dn}--maximize`]:_e,[i]:!!i},fn={[dn]:!0,"is--border":nt,"is--fixed":Ge.length||Qe.length,"is--sortable":lt,"is--filterable":at,"is--head-group":tt,"is--merge-cell":ht,"is--ping-left":Pe,"is--ping-right":Le};return j.default.createElement(js.Provider,{value:un},j.default.createElement("div",{className:ne.default(cn)},c&&j.default.createElement("div",{ref:y,className:`${dn}-top`},j.default.createElement("div",{className:`${dn}-top__space`},"bottom"!==(null==u?void 0:u.position)&&j.default.createElement(du,{total:ue.total}),j.default.createElement("div",{className:`${dn}-top__space-slot`,style:{justifyContent:Ys[d]}},e.children)),j.default.createElement("div",{className:`${dn}-top__actions`},j.default.createElement(qu,{ref:C,showFullScreen:f,showReload:p&&$e,showPrint:Ce.print&&!!o,showImport:Ce.import&&ot,showExport:Ce.export&&!!s,showClipboard:st,showCollection:it,showFastSearch:ct,showSuperSearch:ut,showGroupSummary:ft,showToolBox:h,tableColumns:ze}),j.default.createElement(Ku,{ref:S,columns:l}))),j.default.createElement(rl,{spinning:null!=a?a:we},j.default.createElement("div",{ref:x,className:ne.default(fn),style:xt},j.default.createElement("div",{className:`${dn}--main-wrapper`},m&&j.default.createElement(Qu,{tableColumns:ze,sorter:re,filters:le}),j.default.createElement(dd,{ref:E,tableFlatColumns:ee,tableData:Z}),et&&j.default.createElement(cd,{summationRows:vt})),nt&&j.default.createElement("div",{className:`${dn}--border-line`}),gt&&j.default.createElement(hd,null),r&&j.default.createElement(md,null))),Ve&&j.default.createElement(pd,qe({},ue,{onChange:(e,t)=>Qt({current:e,pageSize:t})}))))}));gd.defaultProps={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},gd.displayName="QmTable";const vd=e=>{var t;const{uniqueKey:n,multiple:l,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},className:u,style:d,onClose:c}=e,{size:f}=j.default.useContext(xe),p=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:f)&&void 0!==n?n:""}),[e.size,f]),h=j.default.useRef(null),m=j.default.useRef(null),v=j.default.useRef(null),b=dl(h),[y,x]=j.default.useState(s),[E,C]=j.default.useState(),[S,w]=j.default.useState(i),[T,N]=j.default.useState(!1),[I,O]=j.default.useState(300),[R,k]=j.default.useState(o),[P,A]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[L,H]=j.default.useState(g.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[_,F]=j.default.useState([]),D=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*yr[p]-30)},$=cl(D,5);Vn((()=>{$()}),[b.width]),Vn((()=>{g.isEqual(o,R)||k(o)}),[o]),j.default.useEffect((()=>{M()}),[L]),j.default.useEffect((()=>{r&&v.current.SET_SELECTION_ROWS(r)}),[r]),j.default.useEffect((()=>{var e;a&&(null===(e=m.current)||void 0===e||e.SET_FIELDS_VALUE(a))}),[]);const M=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=y;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=et}=n;if(i(L)){N(!0);try{const t=yield a(L);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,r))&&void 0!==e?e:[];l||(w([]),yield tt(0)),F(n)}}catch(e){}N(!1)}})),q=e=>{l||(C(e),c(e))},V=e=>{H(Object.assign({},L,e))},K={[`${dt("search-helper")}--wrapper`]:!0},z=y.webPagination?{dataSource:_,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},y.fetch),{params:L})};return j.default.createElement("div",{ref:h,className:ne.default(K,u),style:d},j.default.createElement("div",{className:"form-wrap"},R.length?j.default.createElement(us,{ref:m,items:R,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>V(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield m.current.GET_FORM_DATA();e||V(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:v,uniqueKey:n,height:I,columns:P,rowKey:y.rowKey||"pageIndex"},z,{rowSelection:{type:l?"checkbox":"radio",clearableAfterFetched:!l,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:S,onChange:(e,t)=>{w(e),C(l?t:t[0])}},paginationConfig:y.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>c(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!E,onClick:()=>c(E,l?S:void 0)},we("qm.dialog.confirm"))))};vd.displayName="SearchHelper";const bd=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...bd(e.children)),e.children&&t.push(e.value)})),t},yd=(e,t)=>{let n=null;for(let l=0;l<e.length;l++){if(Array.isArray(e[l].children)&&(n=yd(e[l].children,t)),n)return n;if(t(e[l]))return e[l]}return n},xd=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&xd(e.children,t),t(e)||e.children&&e.children.length))),Ed=e=>{var t;const{uniqueKey:n,multiple:l,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},tree:d={},className:c,style:f,onClose:p}=e,{size:h}=j.default.useContext(xe),m=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:h)&&void 0!==n?n:""}),[e.size,h]),v=j.default.useRef(null),b=j.default.useRef(null),y=j.default.useRef(null),x=dl(v),[E,C]=j.default.useState(s),[S,w]=j.default.useState(),[T,N]=j.default.useState(i),[I,O]=j.default.useState(!1),[R,k]=j.default.useState(300),[P,A]=j.default.useState(300),[L,H]=j.default.useState(o),[_,F]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[D,$]=j.default.useState(g.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[M,q]=j.default.useState([]),V=()=>{const e=v.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*yr[m]-30)},K=cl(V,5);Vn((()=>{K()}),[x.width]),Vn((()=>{g.isEqual(o,L)||H(o)}),[o]),j.default.useEffect((()=>{z()}),[D]),j.default.useEffect((()=>{r&&y.current.SET_SELECTION_ROWS(r)}),[r]),j.default.useEffect((()=>{var e;a&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(a)),te()}),[]);const z=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=E;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=et}=n;if(i(D)){O(!0);try{const t=yield a(D);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,r))&&void 0!==e?e:[];l||(N([]),yield tt(0)),q(n)}}catch(e){}O(!1)}})),B=e=>{l||(w(e),p(e))},W=e=>{$(Object.assign({},D,e))},[U,G]=j.default.useState([]),[Y,X]=j.default.useState([]),[Q,Z]=j.default.useState(""),J=j.default.useRef(U),ee=j.default.useRef([]);Vn((()=>{X(bd(U))}),[U]);const te=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:l,valueKey:a="value",textKey:r="text"}=d.fetch;try{const i=yield t(n);if(200===i.code){const t=Array.isArray(i.data)?i.data:null!==(e=g.get(i.data,l))&&void 0!==e?e:[],n=Ma(t,a,r);G(n),J.current=n,ee.current=t}}catch(e){}})),le=e=>`${e}|${nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ae={[`${dt("tree-table-helper")}--wrapper`]:!0},re=E.webPagination?{dataSource:M,loading:I,webPagination:!0}:{fetch:Object.assign(Object.assign({},E.fetch),{params:D})};return j.default.createElement("div",{ref:v,className:ne.default(ae,c),style:f},j.default.createElement(nl,{defaultValue:200,style:{height:"100%"}},j.default.createElement(nl.Pane,{min:100,style:{overflowY:"auto"}},j.default.createElement(u.Input.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:we("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=xd(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==le(n).indexOf(e)}));Z(e),G(t)})(e.target.value)}),j.default.createElement(u.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:Y,treeData:U,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==le(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return Oe("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const l in t)n[l]=g.get(e,t[l]);W(n)})(yd(ee.current,(n=>g.get(n,t)===e[0]))||{})}})),j.default.createElement(nl.Pane,{className:"split-pane"},j.default.createElement("div",{className:"form-wrap"},L.length?j.default.createElement(us,{ref:b,items:L,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>H(e),onCollapse:()=>V(),onFinish:e=>W(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||W(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:y,uniqueKey:n,height:P,columns:_,rowKey:E.rowKey||"pageIndex"},re,{rowSelection:{type:l?"checkbox":"radio",clearableAfterFetched:!l,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{N(e),w(l?t:t[0])}},paginationConfig:E.paginationConfig,columnsChange:e=>F(e),onRowDblclick:B,onRowEnter:B}))))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>p(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!S,onClick:()=>p(S,l?T:void 0)},we("qm.dialog.confirm"))))};Ed.displayName="TreeTableHelper";const Cd=e=>{var t,n,l;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:u}=e,{size:d}=j.default.useContext(xe),c=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:d)&&void 0!==n?n:""}),[e.size,d]),[f,p]=j.default.useState(),[h]=j.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),m={[`${dt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},te.default(r.fetch,["params","valueKey","textKey"])),{params:h}):void 0;return j.default.createElement("div",{className:ne.default(m,o),style:s},j.default.createElement(Ms,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(n=r.fetch)||void 0===n?void 0:n.valueKey,textKey:null===(l=r.fetch)||void 0===l?void 0:l.textKey},asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[c]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>u(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!f,onClick:()=>u(f)},we("qm.dialog.confirm"))))};Cd.displayName="TreeHelper";const Sd="_startSign",wd="_endSign",Td=e=>{var t;const{uniqueKey:n,initialValue:l,filters:a=[],table:r={},onClose:i}=e,{size:o}=j.default.useContext(xe),s=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:o)&&void 0!==n?n:""}),[e.size,o]),d=j.default.useRef(null),c=j.default.useRef(null),f=j.default.useRef(null),p=dl(d),[h,m]=j.default.useState(r),[v,y]=j.default.useState(!1),[x,E]=j.default.useState([]),[C,S]=j.default.useState(300),[w,T]=j.default.useState(a),[N,I]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},{title:we("qm.form.rangeSearchHelper")[0],dataIndex:Sd,width:80,align:"right",render:(e,t)=>j.default.createElement("span",{className:"icon-sign"},e)},...e||(r.columns||[]),{title:we("qm.form.rangeSearchHelper")[1],dataIndex:wd,fixed:"right",width:80,render:(e,t)=>j.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=j.default.useState(g.merge({},null===(t=r.fetch)||void 0===t?void 0:t.params,l)),[k,P]=j.default.useState([]),A=j.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),L=j.default.useMemo((()=>2===A.length&&A.every((e=>void 0!==e))),[A]),H=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*yr[s]-30)},_=cl(H,5);Vn((()=>{_()}),[p.width]),Vn((()=>{g.isEqual(a,w)||T(a)}),[a]),j.default.useEffect((()=>{F()}),[O]);const F=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:l,dataKey:a,beforeFetch:r=et}=n;if(r(O)){y(!0);try{const t=yield l(O);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[];P(n)}}catch(e){}y(!1)}})),D=(e,t)=>{delete e[t]},$=()=>{x.forEach((e=>{e&&(D(e,Sd),D(e,wd))})),E([])},M=e=>{$(),R(Object.assign({},O,e))},q=dt("range-helper"),V=h.webPagination?{dataSource:k,loading:v,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return j.default.createElement("div",{ref:d,className:`${q}--wrapper`},j.default.createElement("div",{className:"form-wrap"},w.length?j.default.createElement(us,{ref:c,items:w,initialValues:l,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>T(e),onCollapse:()=>H(),onFinish:e=>M(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||M(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:f,height:C,columns:N,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=A[0]&&e.pageIndex<=A[1]?{backgroundColor:"#f5f5f5"}:{}},V,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[Sd,wd].includes(n)&&(n===Sd&&(e[n]?(D(e,n),E([void 0,x[1]])):e.pageIndex>A[1]?u.message.warning(we("qm.searchHelper.rangeStartTip")):(x[0]&&D(x[0],n),e[n]="[",E([e,x[1]]))),n===wd&&(e[n]?(D(e,n),E([x[0],void 0])):e.pageIndex<A[0]?u.message.warning(we("qm.searchHelper.rangeEndTip")):(x[1]&&D(x[1],n),e[n]="]",E([x[0],e]))),f.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===A[0]&&(e[Sd]="["),e.pageIndex===A[1]&&(e[wd]="]")}))}}),j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.ClearOutlined,null),title:we("qm.table.alert.clear"),onClick:()=>$()}))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>i(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!L,onClick:()=>i(x.map((e=>(e=>{const t={};for(const n in e)[Sd,wd].includes(n)||(t[n]=e[n]);return t})(e))))},we("qm.dialog.confirm"))))};Td.displayName="RangeTableHelper";const Nd=e=>null!=e;function Id(e,t,n,l){const[a,r]=j.default.useState(void 0);j.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=j.default.useState(null),s=au((()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:l,right:a,bottom:r,left:i}=e.getBoundingClientRect();return l>=0&&i>=0&&a<=t&&r<=n})(a)&&t&&a.scrollIntoView(l);const{left:e,top:n,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:n,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)}));j.default.useLayoutEffect((()=>(s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)})),[a,t,s]);return[j.default.useMemo((()=>{if(!i)return i;const e=(null==n?void 0:n.offset)||6,t=(null==n?void 0:n.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,n]),a]}function Od(e){return void 0!==e}function Rd(e,t){const{defaultValue:n,value:l,onChange:a,postState:r}=t||{},[i,o]=M.useState((()=>Od(l)?l:Od(n)?"function"==typeof n?n():n:"function"==typeof e?e():e)),s=Od(l)?l:i,u=r?r(s):s,d=au(a),[c,f]=M.useState([s]);iu((()=>{const e=c[0];i!==e&&d(i,e)}),[c]),iu((()=>{Od(l)||o(l)}),[l]);return[u,au((e=>{o(e),f([s])}))]}const kd=8;const Pd={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"]}},Ad={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"]}},Ld=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Hd(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:l,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(Pd).forEach((e=>{const u=l&&Ad[e]||Pd[e],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,Ld.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,l=t>12?t+2:12;return{arrowOffsetHorizontal:l,arrowOffsetVertical:n?kd:l}}({contentRadius:r,limitVerticalRadius:!0});if(l)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-c.arrowOffsetHorizontal-o;break;case"leftBottom":case"rightBottom":d.offset[1]=c.arrowOffsetHorizontal+o}d.overflow=function(e,t,n,l){if(!1===l)return{adjustX:!1,adjustY:!1};const a=l&&"object"==typeof l?l:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+n,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+n,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,n),i&&(d.htmlRegion="visibleFirst")})),s}var _d={},Fd={exports:{}},Dd={exports:{}};!function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Dd),function(e){var t=Dd.exports.default;function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,l=new WeakMap;return(n=function(e){return e?l:t})(e)}e.exports=function(e,l){if(!l&&e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return{default:e};var a=n(l);if(a&&a.has(e))return a.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,a&&a.set(e,r),r},e.exports.__esModule=!0,e.exports.default=e.exports}(Fd);var $d,Md={exports:{}};($d=Md).exports=function(e){return e&&e.__esModule?e:{default:e}},$d.exports.__esModule=!0,$d.exports.default=$d.exports;var jd={exports:{}},qd={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(qd);var Vd={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l,a,r,i,o=[],s=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(l=r.call(n)).done)&&(o.push(l.value),o.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(Vd);var Kd={exports:{}},zd={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l},e.exports.__esModule=!0,e.exports.default=e.exports}(zd),function(e){var t=zd.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Kd);var Bd={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(Bd),function(e){var t=qd.exports,n=Vd.exports,l=Kd.exports,a=Bd.exports;e.exports=function(e,r){return t(e)||n(e,r)||l(e,r)||a()},e.exports.__esModule=!0,e.exports.default=e.exports}(jd);var Wd={exports:{}},Ud={exports:{}},Gd={exports:{}},Yd={exports:{}};!function(e){var t=Dd.exports.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var a=l.call(e,n||"default");if("object"!==t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Yd),function(e){var t=Dd.exports.default,n=Yd.exports;e.exports=function(e){var l=n(e,"string");return"symbol"===t(l)?l:String(l)},e.exports.__esModule=!0,e.exports.default=e.exports}(Gd),function(e){var t=Gd.exports;e.exports=function(e,n,l){return(n=t(n))in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e},e.exports.__esModule=!0,e.exports.default=e.exports}(Ud),function(e){var t=Ud.exports;function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}e.exports=function(e){for(var l=1;l<arguments.length;l++){var a=null!=arguments[l]?arguments[l]:{};l%2?n(Object(a),!0).forEach((function(n){t(e,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Wd);var Xd=Fd.exports.default,Qd=Md.exports.default;Object.defineProperty(_d,"__esModule",{value:!0});var Zd=_d.default=function(e){var t=tc.useState("ssr-id"),n=(0,Jd.default)(t,2),l=n[0],a=n[1],r=(0,ec.default)({},tc).useId,i=null==r?void 0:r();if(tc.useEffect((function(){if(!r){var e=nc;nc+=1,a("rc_unique_".concat(e))}}),[]),e)return e;return i||l};_d.resetUuid=function(){nc=0};var Jd=Qd(jd.exports),ec=Qd(Wd.exports),tc=Xd(j.default);var nc=0;const lc={fill:"transparent",pointerEvents:"auto"},ac=e=>{const{prefixCls:t,rootClassName:n,pos:l,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:u}=e,d=`${t}-mask-${Zd()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return j.default.createElement(pe.default,{open:o,autoLock:!0},j.default.createElement("div",{className:ne.default(`${t}-mask`,n),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:u,pointerEvents:"none"},r)},a?j.default.createElement("svg",{style:{width:"100%",height:"100%"}},j.default.createElement("defs",null,j.default.createElement("mask",{id:d},j.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),l&&j.default.createElement("rect",{x:l.left,y:l.top,rx:l.radius,width:l.width,height:l.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),j.default.createElement("rect",qe({},l?null:lc,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${d})`})),l&&j.default.createElement(j.default.Fragment,null,j.default.createElement("rect",qe({},lc,{x:"0",y:"0",width:"100%",height:`${l.top}px`})),j.default.createElement("rect",qe({},lc,{x:"0",y:"0",width:l.left,height:"100%"})),j.default.createElement("rect",qe({},lc,{x:"0",y:l.top+l.height,width:"100%",height:`calc(100vh - ${l.top+l.height}px)`})),j.default.createElement("rect",qe({},lc,{x:l.left+l.width,y:"0",width:`calc(100vw - ${l.left+l.width}px)`,height:"100%"})))):null))},rc=e=>{const{prefixCls:t,zIndex:n,open:l,onPause:a,onPlay:r}=e,[i,o]=Rd(void 0,{value:l,postState:e=>null==e||e}),s=j.default.useRef(null),u=j.default.useRef(!1),d=au((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));j.default.useEffect((()=>{const e=oe.default(document,"keyup",d);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{u.current?u.current=!1:(o(!i),i?null==a||a():null==r||r())};return j.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:n+1},onMouseDown:e=>{c(e);const t=s.current,n=t.offsetWidth,l=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-Qn(t).x,o=e.clientY-Qn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,d=e.clientY-o;s<0&&(s=0),s>a-n-1&&(s=a-n-1),d<0&&(d=0),d>r-l-1&&(d=r-l-1),Gn(t,{left:`${s}px`,top:`${d}px`}),u.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?j.default.createElement(b.PauseOutlined,null):j.default.createElement(b.CaretRightOutlined,null))},ic=e=>{const{prefixCls:t,current:n,total:l=0,cover:a,title:r,description:i,helper:o={},type:s,zIndex:d,onClose:c,onPrev:f,onNext:p,onFinish:h,className:m,indicatorsRender:g}=e,{t:v}=td(),y="primary"!==s?"primary":"default",x=au((e=>{w(e),40===e.keyCode&&(n<l-1?null==p||p():null==h||h()),38===e.keyCode&&n>0&&(null==f||f())}));j.default.useEffect((()=>{const e=oe.default(document,"keyup",x);return()=>e.remove()}),[]);const E=Nd(a)?j.default.createElement("div",{className:`${t}-cover`},a):null,C=Nd(i)?j.default.createElement("div",{className:`${t}-description`},i):null;let S;S=g?g(n,l):[...Array.from({length:l}).keys()].map(((e,l)=>j.default.createElement("span",{key:e,className:ne.default(l===n&&`${t}-indicator-active`,`${t}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return j.default.createElement("div",{className:ne.default(`${t}-content`,m)},j.default.createElement("div",{className:`${t}-inner`},j.default.createElement(b.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&j.default.createElement(u.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:o.content,title:o.title},j.default.createElement(b.QuestionCircleOutlined,{className:ne.default(`${t}-close`,"help-icon")})),E,j.default.createElement("div",{className:`${t}-header`},j.default.createElement("div",{className:`${t}-title`},r)),C,j.default.createElement("div",{className:`${t}-footer`},l>1&&j.default.createElement("div",{className:`${t}-indicators`},S),j.default.createElement(ut,{className:`${t}-buttons`},0!==n?j.default.createElement(ot,{className:`${t}-prev-btn`,size:"small",onMouseDown:w,onClick:f},v("qm.tour.prevStep")):null,n===l-1?j.default.createElement(ot,{className:`${t}-finish-btn`,type:y,size:"small",onClick:h},v("qm.tour.finish")):j.default.createElement(ot,{className:`${t}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:p},v("qm.tour.nextStep"))))))},oc=e=>{const{current:t,renderPanel:n}=e;return j.default.createElement(j.default.Fragment,null,"function"==typeof n?n(e,t):j.default.createElement(ic,e))},sc={left:"50%",top:"50%",width:1,height:1},uc=j.default.forwardRef(((e,t)=>{const{steps:n=[],defaultCurrent:l,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:u="default",mask:d=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:h,placement:m,helper:g,zIndex:v,renderPanel:b,indicatorsRender:y,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,S=Ue(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),w=j.default.useRef(),[T,N]=Rd(0,{value:a,defaultValue:l}),[I,O]=Rd(void 0,{value:s,postState:e=>!(T<0||T>=n.length)&&(null!=e&&e)}),[R,k]=Rd(1051,{value:v,defaultValue:v}),[P,A]=j.default.useState(),L=j.default.useRef(I);j.default.useLayoutEffect((()=>{I&&!L.current&&N(0),L.current=I,A(I)}),[I]),j.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:H,type:_,placement:F,trigger:D,delay:$,style:M,arrow:q,className:V,mask:K,scrollIntoViewOptions:z,zIndex:B,action:W}=n[T]||{},U=B||R,G=_||u,Y=I&&(null!=K?K:d),X=null!=z?z:C,[Q,Z]=Id(H,!!s,x,X),J=((e,t,n)=>{var l;return null!==(l=null!=n?n:t)&&void 0!==l?l:null===e?"center":"bottom"})(Z,m,F),ee=!!Z&&(void 0===q?c:q),te="object"==typeof ee&&ee.pointAtCenter;j.default.useLayoutEffect((()=>{var e;null===(e=w.current)||void 0===e||e.forceAlign()}),[te,T]),Vn((()=>{I&&(re(),null==W||W(Z,T))}),[I,Z]);const le=e=>{N(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(T)},re=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var l;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Un(l=n,"display")||"hidden"===Un(l,"visibility")||"0"===Un(l,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ye(void 0,void 0,void 0,(function*(){if(!D||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,l=Z.offsetHeight,[a,r]=[e+n/2,t+l/2],i=new MouseEvent(D,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield tt(null!=$?$:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,ue=Object.assign({},h,M),de=dt("tour"),ce=[{[`${de}-primary`]:"primary"===G},p,V],fe=Hd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return j.default.createElement(j.default.Fragment,null,j.default.createElement(ac,{zIndex:U,prefixCls:de,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:P,animated:E,rootClassName:p}),j.default.createElement(he.default,qe({ref:w},S,{zIndex:U,builtinPlacements:fe,popupStyle:ue,popupPlacement:J,popupVisible:P,popupClassName:ne.default(ce),prefixCls:de,popup:()=>j.default.createElement(oc,qe({key:"content",arrow:ee,prefixCls:de,total:n.length,helper:g,renderPanel:b,indicatorsRender:y,onPrev:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),le(T-1)})),onNext:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),le(T+1)})),onClose:ae,current:T,onFinish:()=>{ae(),null==o||o()}},Object.assign({},n[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),j.default.createElement(pe.default,{open:P,autoLock:!0},j.default.createElement("div",{className:ne.default(p,`${de}-target-placeholder`),style:Object.assign(Object.assign({},Q||sc),{position:"fixed",pointerEvents:"none"})}))),f&&j.default.createElement(pe.default,{open:I},j.default.createElement(rc,{zIndex:U,prefixCls:de,onPause:()=>A(!1),onPlay:()=>A(!0)})))}));uc.displayName="QmTour";const dc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],cc=e=>({_s:e,status:dc[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),fc=e=>e?6:5,pc=(e,t,n,l,a)=>{clearTimeout(l.current);const r=cc(e);t(r),n.current=r,null==a||a({current:r})},hc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enter:n=!0,exit:l=!0,preEnter:a,preExit:r,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:u,onStateChange:d}=t||{},[c,f]=e.useState((()=>cc(o?2:fc(s)))),p=e.useRef(c),h=e.useRef(),[m,v]=(e=>g.isPlainObject(e)?[e.enter,e.exit]:[e,e])(i),b=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return fc(t)}})(p.current._s,u);e&&pc(e,f,p,h,d)}),[d,u]),y=e.useCallback((e=>{const t=e=>{switch(pc(e,f,p,h,d),e){case 1:m>=0&&(h.current=setTimeout(b,m));break;case 4:v>=0&&(h.current=setTimeout(b,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(n?a?0:1:2):i&&t(l?r?3:4:fc(u))}),[b,d,n,l,a,r,m,v,u]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[c,y,b]},mc=e=>{const{name:t,in:n,timeout:l,preEnter:a=!0,preExit:r}=e,[i,o]=hc({timeout:l,preEnter:a,preExit:r,initialEntered:n});return iu((()=>{o()}),[n]),j.default.createElement(j.default.Fragment,null,j.default.Children.map(e.children,(e=>j.default.isValidElement(e)?od(e,{className:ne.default(e.props.className,t,i.status)}):e)))};var gc={previewWidth:1100,defaultDistance:.45,logoHeight:60};const vc=e.createContext(void 0);var bc=null;function yc(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),l=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!n&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(l){if((l=l[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){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 xc(e,t){var n;try{var l=navigator.userAgent,a=!!l.match(/MSIE/i)||!!l.match(/Trident/i);if(yc()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void u.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&l.match(/x64/i);if(e||t?n=a?e:t:bc?n=bc:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),bc=n),!n||!n.VERSION)return l.indexOf("Chrome"),l.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&yc(),n}catch(e){u.message.error("getLodop 出错:"+e)}}yc();const Ec=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:l}=window.screen;if(n&&l)t[0]=n,t[1]=l;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Cc=j.default.forwardRef(((e,t)=>{const{templateRender:n,directPrint:l}=e,{global:a}=j.default.useContext(xe),{$$preview:r}=j.default.useContext(vc),{state:i,isWindowsPrinter:o,pageSize:s}=r,u=j.default.useRef(null),d=j.default.useRef({}),c=j.default.useRef([]),f=j.default.useRef([]),p=j.default.useRef([]),[h,m]=j.default.useState(!0);j.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:P,DIRECT_PRINT:A}))),Vn((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),j.default.useEffect((()=>{d.current.templateEl=u.current.querySelector(".origin-template").children[0],d.current.previewEl=u.current.querySelector(".workspace")}),[]);const g=j.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*gc.defaultDistance+10*gc.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=j.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*gc.defaultDistance+10*gc.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),b=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Ec(g-10*(e.left-gc.defaultDistance)-10*(e.right-gc.defaultDistance))}),[i,g]),y=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Ec(v-10*(e.top-gc.defaultDistance)-10*(e.bottom-gc.defaultDistance))}),[i,v]),x=i.form.scale,E=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:Ec(10*e.left),right:Ec(10*e.right),top:Ec(10*e.top),bottom:Ec(10*e.bottom)}}),[i]),C=j.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:n,top:l,bottom:a}=E,r=b+t+n,o=gc.previewWidth-r<=0?0:(gc.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let u=0;return x>1&&(u=s>o?-1*o:-1*s),x<1&&(u=r-2*s>gc.previewWidth?0:o>0?s:(gc.previewWidth-(r-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":y+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${l}px`,paddingBottom:`${a}px`,transform:`translateX(${u}px) scale(${x})`,opacity:h?0:1}}),[i,h,E,x,y,b]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const S=()=>{var e,t,n,l;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!==(l=null===(n=null==a?void 0:a.print)||void 0===n?void 0:n.rightLogo)&&void 0!==l?l:"";return[`<tr style="height: ${gc.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("")},w=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=w().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=d.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},N=()=>{const e=d.current.templateEl.children[0].children,t=[],n=[];for(let l=0;l<e.length;l++){if("template-cols"===e[l].getAttribute("type"))continue;const a=e[l].clientHeight;e[l].style.height=a+"px",n.push(a),t.push(e[l].outerHTML)}f.current=n,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:n}}=i;if(l)return p.current.push([w(),S(),...c.current]);const a=t.fixedLogo?y-gc.logoHeight:y;let o=[];if(p.current=[],"stylus"===n)p.current.push([w(),...t.fixedLogo?[S()]:[],...c.current]);else{let e=0;for(let n=0,l=f.current.length;n<l;n++){const r=c.current[n],i=f.current[n];t.fixedLogo||0!==n||(e+=gc.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([w(),...t.fixedLogo?[S()]:[],...o]),o=[],e=0,n-=1),n===l-1&&o.length&&p.current.push([w(),...t.fixedLogo?[S()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,S());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:n}=i;let l=`<table cellspacing="0" cellpadding="0" border="0" class="${d.current.templateEl.className}">`;l+=null!==(t=null===(e=p.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",l+="</table>",d.current.previewEl.innerHTML=l,d.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${d.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>"+S()+w()+e.join("")+"</table>"},P=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=d.current.templateEl)||void 0===e?void 0:e.tagName))return L();d.current.previewEl.innerHTML||(T(),yield tt(0),N(),I(),m(!1))})),A=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=d.current.templateEl)||void 0===e?void 0:e.tagName))return L();T(),yield tt(0),N(),I(),m(!1),r.doPrint(R()),yield tt(0),r.doClose()})),L=()=>{Oe("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[dt("print-container")]:!0,"no-visible":l};return j.default.createElement("div",{ref:u,className:ne.default(H)},j.default.createElement(rl,{wrapperClassName:"spin",spinning:h,tip:"Loading..."},j.default.createElement("div",{className:"preview"},j.default.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==n?void 0:n()),j.default.createElement("div",{className:"workspace",style:C}))))}));Cc.displayName="Container";class Sc extends e.Component{constructor(){super(...arguments),this.formRef=j.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:we("qm.print.setPanel.printParameter")},{type:"SELECT",label:we("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:we("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:we("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:we("qm.print.setPanel.vertical"),value:"vertical"},{text:we("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:we("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:we("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:we("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:we("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("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:we("qm.print.setPanel.sizeUnit"),disright:we("qm.print.setPanel.sizeUnit"),distop:we("qm.print.setPanel.sizeUnit"),disbottom:we("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 j.default.createElement(j.default.Fragment,null,j.default.createElement(us,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),j.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"}},j.default.createElement(ot,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},we("qm.dialog.close")),j.default.createElement(ot,{type:"primary",onClick:()=>this.confirmHandle()},we("qm.dialog.confirm"))))}}Sc.contextType=xe;class wc extends e.Component{constructor(){var e,t,n;super(...arguments),this.provide={$$preview:this},this.containRef=j.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:gc.defaultDistance,right:gc.defaultDistance,top:gc.defaultDistance,bottom:gc.defaultDistance},pageSize:"210*297",direction:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.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 ge.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,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const n=this.context.global,l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[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=xc();if(!t)return;const{uniqueKey:n,closeAfterPrint:l}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:d}=gc,{left:c,right:f,top:p,bottom:h}=a.distance;t.PRINT_INIT(null!=n?n: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*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-d)+"mm",10*(c-d)+"mm",`RightMargin: ${10*(f-d)}mm`,`BottomMargin: ${"stylus"!==i?10*(h-d):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?l&&this.doClose():u.message.error(we("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=xc();if(!t)return;const{uniqueKey:n,closeAfterPrint:l}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?l&&this.doClose():u.message.error(we("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(`${K.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:we("qm.print.laserPrinter"),value:"laser"},{text:we("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=xc(),t=[{text:we("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let l=0;l<n;l++)t.push({text:e.GET_PRINTER_NAME(l),value:l})}catch(e){Oe("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 n=yield ge.default.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),g.isPlainObject(n)&&(yield ge.default.setItem(this.printerKey,n))),g.isPlainObject(n)&&Object.keys(n).length&&g.merge(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:n,form:l,currentPage:a,totalPage:r,printPage:i}=this.state,o=dt("print-preview"),s={visible:n,title:we("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[o]:!0};return e?j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{className:ne.default(d)},j.default.createElement("div",{className:"outer"},j.default.createElement("div",{className:"header"},j.default.createElement("span",null,we("qm.print.printer"),":",j.default.createElement(u.Select,{value:l.printerName,onChange:e=>{this.setState((t=>g.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",null,we("qm.print.type"),":",j.default.createElement(u.Select,{value:l.printerType,onChange:e=>{this.setState((t=>g.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",null,we("qm.print.copies"),":",j.default.createElement(u.InputNumber,{value:l.copies,min:1,precision:0,onChange:e=>{this.setState((t=>g.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),j.default.createElement("span",null,we("qm.print.printPage.0"),j.default.createElement(u.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"}}),we("qm.print.printPage.1")),j.default.createElement("span",null,j.default.createElement(u.Pagination,{size:"small",current:a,pageSize:1,total:r,onChange:this.pageChangeHandle})),j.default.createElement("span",null,j.default.createElement(ot,{type:"text",icon:j.default.createElement(b.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},we("qm.print.setting"))),j.default.createElement("span",null,j.default.createElement(ot,{type:"text",icon:j.default.createElement(b.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},we("qm.print.export"))),j.default.createElement("span",null,j.default.createElement(ot,{icon:j.default.createElement(b.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},we("qm.print.print")))),j.default.createElement("div",{className:"main"},j.default.createElement(vc.Provider,{value:this.provide},j.default.createElement(Cc,{ref:this.containRef,templateRender:t,directPrint:!1}))),j.default.createElement("div",{className:"footer"},j.default.createElement("span",null,we("qm.print.scale"),":",j.default.createElement(u.Slider,{value:l.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>g.merge({},t,{form:{scale:e}})))}}),j.default.createElement("em",{className:"scale-text"},`${Math.floor(100*l.scale)}%`)),j.default.createElement("span",null,we("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),j.default.createElement("span",null,we("qm.print.pageNumber"),":",we("qm.print.pagination",{currentPage:a,totalPage:r}))))),j.default.createElement(Il,s,j.default.createElement(Sc,{setting:l.setting,onChange:e=>{this.setState((t=>g.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):j.default.createElement(vc.Provider,{value:this.provide},j.default.createElement(Cc,{ref:this.containRef,templateRender:t,directPrint:!0}))}}wc.contextType=xe;class Tc extends e.Component{constructor(){super(...arguments),this.previewRef=j.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 n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:n,defaultConfig:l,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:we("qm.print.preview"),width:`${gc.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:n,defaultConfig:l,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?j.default.createElement(Il,i,j.default.createElement(wc,o)):e?j.default.createElement(wc,o):null},this.DO_PRINT=()=>Ye(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield tt(0),this.setState({visible:!0}),yield tt(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:n,type:l,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:l,shape:r,icon:n,loading:e,disabled:a,click:this.clickHandle};return j.default.createElement(j.default.Fragment,null,this.props.children&&j.default.createElement(ot,i,this.props.children),this.createRender())}}function Nc(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Ic(e){const t=Nc(e);return t?t.frameElement:null}function Oc(e){const t=Pc(e);return Rc([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Rc(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 kc(e,t){const n=Ic(e);if(n&&n!==t){const l=[e.getBoundingClientRect()];let a=n,r=!1;for(;a;){const e=Oc(a);if(l.push(e),a=Ic(a),r)break;a&&Nc(a)===t&&(r=!0)}return Rc(l)}return e.getBoundingClientRect()}function Pc(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)}}Tc.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:q.default.elementType},Tc.defaultProps={preview:!0,type:"primary",icon:j.default.createElement(b.PrinterOutlined,null)},Tc.contextType=xe;const Ac=Object.assign;class Lc{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=Dc.border,this.padding.style.borderColor=Dc.padding,this.content.style.backgroundColor=Dc.background,Ac(this.node.style,{borderColor:Dc.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){Fc(t,"margin",this.node),Fc(t,"border",this.border),Fc(t,"padding",this.padding),Ac(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"}),Ac(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Hc{constructor(e,t){this.tip=e.createElement("div"),Ac(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),Ac(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),Ac(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),l=function(e,t,n){const l=Math.max(n.height,20),a=Math.max(n.width,60),r=5;let i;i=e.top+e.height+l<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-l<=t.top+t.height?e.top-l-r<t.top+r?t.top+r:e.top-l-r:t.top+t.height-l-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:n.width,height:n.height});Ac(this.tip.style,l.style)}}class _c{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Hc(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new Lc(this.window.document,this.container));const l={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=kc(e,this.window),a=Pc(e);l.top=Math.min(l.top,n.top-a.marginTop),l.right=Math.max(l.right,n.left+n.width+a.marginRight),l.bottom=Math.max(l.bottom,n.top+n.height+a.marginBottom),l.left=Math.min(l.left,n.left-a.marginLeft);this.rects[t].update(n,a)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,l.right-l.left,l.bottom-l.top);const a=kc(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:l.top,left:l.left,height:l.bottom-l.top,width:l.right-l.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Fc(e,t,n){Ac(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const Dc={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 $c=null,Mc=null;function jc(){null!=window.document&&($c=null,null!==Mc&&(Mc.remove(),Mc=null))}class qc{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=>Jn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,jc();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,l,a;n=[t],l=null,a=!1,null!=window.document?(null!==$c&&clearTimeout($c),null!=n&&(null===Mc&&(Mc=new _c),Mc.inspect(n,l),a&&($c=setTimeout((()=>jc()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=g.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 n=e;const l=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,l=Array.from(n.classList).reverse();e<l.length;e++)t.test(l[e])&&n.classList.remove(l[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),l=n.className.trim();if(t.filter((e=>e.className.includes(l))).length<=1){if(l){const t=l.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&l.unshift(e),n=n.parentElement}return l.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(){jc(),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 Vc(e){return document.querySelector(e)}const Kc=e=>{const{action:t,onConfirm:n,onCancel:l,onFinish:a}=e,{t:r}=td();return j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),j.default.createElement(ut,{style:{width:"100%",justifyContent:"flex-end"}},j.default.createElement(ot,{size:"small",onClick:()=>null==l?void 0:l()},r("qm.guideTracker.closeButton")),j.default.createElement(ot,{size:"small",onClick:()=>null==n?void 0:n()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),j.default.createElement(ot,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},zc={left:"50%",top:"50%",width:1,height:1},Bc=j.default.forwardRef(((e,t)=>{const{open:n,current:l,defaultCurrent:a,steps:r=[],placement:i="bottom",control:o=!0,overlayClassName:s,overlayStyle:d,destroyOnHide:c,contentRender:f,zIndex:p,helper:h={},selectFilter:m=(e=>e),onSelect:v,onChange:y,onClose:x,onFinish:E}=e,{t:C}=td(),S=j.default.useRef(),w=j.default.useRef(r.length),[T,N]=Rd(0,{value:l,defaultValue:a}),[I,O]=Rd(void 0,{value:n,postState:e=>null!=e&&e}),[R,k]=Rd(1051,{value:p,defaultValue:p}),[P,L]=j.default.useState({}),[H,_]=j.default.useState(!1),[F,D]=j.default.useState(I),[$,M]=j.default.useState(!1),[q,V]=Id(P.node,!!n),[K,z]=j.default.useState(22),B=j.default.useRef(!1),W=j.default.useMemo((()=>T>=r.length?"add":"edit"),[T,r]),U=j.default.useMemo((()=>`${T+1} / ${r.length}`),[T,r]);j.default.useLayoutEffect((()=>{S.current=new qc({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=m(t),L({id:ca(),node:e,path:t}),N(w.current),_(!0),Y(),null==v||v(t,e)}})}),[]),j.default.useEffect((()=>(I?G():Y(),I?setTimeout((()=>D(!0)),16):D(!1),()=>{Y()})),[I]),j.default.useEffect((()=>{w.current=r.length}),[r]);const G=()=>{S.current.startHandle()},Y=()=>{S.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};j.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),GET_CURRENT_STEP:()=>({current:T,selector:P.path})})));const Q=dt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],J=Hd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return j.default.createElement(j.default.Fragment,null,j.default.createElement(he.default,{zIndex:R,builtinPlacements:J,popupPlacement:i,popupVisible:I&&H,popupClassName:ne.default(Z,s),popupStyle:d,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return j.default.createElement("div",{className:`${Q}-content`},j.default.createElement("div",{className:`${Q}-inner`},j.default.createElement(b.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(T),e()}}),j.default.createElement(u.Dropdown,{open:$,trigger:["click"],dropdownRender:()=>r.length?j.default.createElement("div",{className:"ant-dropdown-menu step-list"},j.default.createElement(A.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.id)),n=r.map((e=>e.id));if(g.isEqual(t,n))return;const l=t.findIndex((e=>e===P.id)),a=-1!==l?l:T;N(a),null==y||y(Ea(e),a)}},r.map(((e,t)=>j.default.createElement("li",{key:t,className:ne.default("item",{actived:e.id===P.id})},j.default.createElement(b.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),j.default.createElement("span",{className:"box"},j.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==T&&(L({id:e.id,node:Vc(e.selector),path:e.selector}),N(t),z(22===K?K+1:K-1),null==y||y(r,t))}},e.title),j.default.createElement(u.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const n=r.filter((t=>t.id!==e.id)),l=t===T;let a=t<=T?T-1:T;if(a=a<0?0:a,a=a>n.length?n.length:a,l&&n[a]){const{id:e,selector:t}=n[a];L({id:e,node:Vc(t),path:t})}N(a),null==y||y(n,a)}},j.default.createElement(b.CloseOutlined,{className:"close-icon"})))))))):j.default.createElement(j.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>M(e)},j.default.createElement(b.MenuOutlined,{className:ne.default(`${Q}-close`,"menu-icon"),style:{width:K}})),h.content&&j.default.createElement(u.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:h.content,title:h.title},j.default.createElement(b.QuestionCircleOutlined,{className:ne.default(`${Q}-close`,"help-icon")})),j.default.createElement("div",{className:"panel-label"},j.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),j.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),f?f({id:P.id,selector:P.path,actionStatus:W,DO_CLOSE:e},T):j.default.createElement(Kc,{action:W,onConfirm:()=>{null==y||y("add"===W?[...r,{id:P.id,selector:P.path,title:"Guide Title"}]:[...r],T),e()},onCancel:()=>{null==x||x(T),e()},onFinish:()=>{e(),null==x||x(T),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:c},j.default.createElement(pe.default,{open:I&&H,autoLock:!0},j.default.createElement("div",{className:ne.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},q||zc),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),o&&j.default.createElement(pe.default,{open:F},j.default.createElement(rc,{zIndex:R,prefixCls:Q,onPause:()=>{B.current=H,_(!1),Y()},onPlay:()=>{B.current?_(!0):G()}})))}));Bc.displayName="QmGuideTracker";const Wc=e=>{var t,n,l,a,r,i,o,s;const{content:u,image:d,width:c,height:f,font:p={},gap:h=[100,100],offset:m=[50,50],rotate:g=-22,zIndex:v=9,alpha:b=1,antiTamper:y=!0,grayscale:x,className:E,style:C}=e,S=j.default.useRef(null),w=j.default.useRef(new Map),T=null!==(t=p.fontSize)&&void 0!==t?t:16,N=null!==(n=p.fontWeight)&&void 0!==n?n:"normal",I=null!==(l=p.fontStyle)&&void 0!==l?l:"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",P=Array.isArray(u)?u:[u],A=h[0],L=h[1],H=A/2,_=L/2,F=null!==(o=m[0])&&void 0!==o?o:H,D=null!==(s=m[1])&&void 0!==s?s:_,$=j.default.useMemo((()=>{const e=F-H,t=D-_;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}}),[H,_,F,D,v]),q=(e,t)=>{var n;if(S.current){const l=w.current.get(S.current);l&&(S.current.contains(l)&&S.current.removeChild(l),w.current.delete(S.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((e=>{let[t,n]=e;return`${l=t,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`;var l})).join(";"))(Object.assign(Object.assign({},$),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=S.current)||void 0===n||n.append(a),w.current.set(S.current,a)}},V=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[l,a]=(e=>{let t=120,n=64;if(!d&&e.measureText){e.font=`${T}px ${O}`;const l=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...l)),n=T*P.length+3*(P.length-1)}return[null!=c?c:t,null!=f?f:n]})(t),r=l*n,i=a*n,o=(A+l)*n,s=(L+a)*n,u=A/2*n,p=L/2*n,h=o/2,m=s/2,v=2*(A+l);e.width=2*o,e.height=2*s,t.globalAlpha=b,t.save(),t.translate(h,m),t.rotate(Math.PI/180*g),t.translate(-h,-m);const y=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:l}=n;for(let e=0;e<l.length;e+=4){const t=(l[e]+l[e+1]+l[e+2])/3;l[e]=t,l[e+1]=t,l[e+2]=t}t.putImageData(n,0,0)})(e),q(e.toDataURL(),v)},E=()=>{const e=Number(T)*n;t.font=`${I} normal ${N} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),P.forEach(((l,a)=>{t.fillText(null!=l?l:"",u,p+a*(e+3*n))})),y()};if(d){const e=new Image;e.onload=()=>{t.drawImage(e,u,p,r,i),y()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=d}else E()},K=e=>Array.from(w.current.values()).includes(e);j.default.useEffect((()=>{V()}),[u,d,c,f,p,h,m,g,v,b,y,x]),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=window&&"MutationObserver"in window,a=M.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};M.useEffect((()=>(r(),l&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,n)),()=>r())),[e])}(S,(e=>{if(y)for(const t of e){const e=Array.from(t.removedNodes).some((e=>K(e))),n="attributes"===t.type&&K(t.target);if(e||n){V();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=dt("watermark");return j.default.createElement("div",{ref:S,className:ne.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},Uc=new Map,Gc=new WeakMap;let Yc,Xc=0;function Qc(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Gc.has(n)||(Xc+=1,Gc.set(n,Xc.toString())),Gc.get(n)):"0"):e[t]}`;var n})).toString()}function Zc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yc;if(void 0===window.IntersectionObserver&&void 0!==l){const a=e.getBoundingClientRect();return t(l,{isIntersecting:l,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=Qc(e);let n=Uc.get(t);if(!n){const l=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var n;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(n=l.get(t.target))||void 0===n||n.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:r,elements:l},Uc.set(t,n)}return n}(n),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(),Uc.delete(a))}}const Jc=e=>{const{forceRender:t,height:n,placeholder:l=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:u}=function(){let{root:e,rootMargin:t,threshold:n,triggerOnce:l,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var u;const[d,c]=j.default.useState(null),[f,p]=j.default.useState({inView:!1,entry:void 0}),h=j.default.useRef(s);j.default.useEffect((()=>{if(i||!d)return;let s;return s=Zc(d,((e,t)=>{var n;p({inView:e,entry:t}),null===(n=h.current)||void 0===n||n.call(h,e,t),t.isIntersecting&&l&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:n,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(n)?n.toString():n,d,e,t,l,i,r,a,o]);const m=null===(u=f.entry)||void 0===u?void 0:u.target,g=j.default.useRef();d||!m||l||i||g.current===m||(g.current=m,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}));j.default.useEffect((()=>{n||Oe("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const d={[dt("lazy-load")]:!0};return j.default.createElement("div",{ref:o,className:ne.default(d,r),style:i},t||s?e.children:j.default.createElement("div",{className:"placeholder",style:{height:n}},l))};class ef{constructor(e,t,n,l){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=l||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 tf{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,l=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new tf(e[1],n,l,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const l=e.x-t.x,a=e.y-t.y,r=t.x-n.x,i=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,u=(t.x+n.x)/2,d=(t.y+n.y)/2,c=Math.sqrt(l*l+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),h=u+(o-u)*p,m=d+(s-d)*p,g=t.x-h,v=t.y-m;return{c1:new ef(o+g,s+v),c2:new ef(u+g,d+v)}}constructor(e,t,n,l,a,r){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=l,this.startWidth=a,this.endWidth=r}length(){let e,t,n=0;for(let l=0;l<=10;l+=1){const a=l/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(l>0){const l=r-e,a=i-t;n+=Math.sqrt(l*l+a*a)}e=r,t=i}return n}point(e,t,n,l,a){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*l*(1-e)*e*e+a*e*e*e}}class nf{constructor(e,t){var n=this;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.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent),this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{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.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",this.isMobile&&("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)=>"touches"in e?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:"touches"in e?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n._drawingStroke)return;if(0===n._data.length)return void n._strokeBegin(e);const l=n._createPoint(e.x,e.y,e.pressure),a=n._data[n._data.length-1],r=a.points,i=r.length>0&&r[r.length-1],o=!!i&&l.distanceTo(i)<=n.minDistance,s=n._getPointGroupOptions(a);if(!i||!i||!o){const e=n._addPoint(l,s);t&&(i?e&&n._drawCurve(e,s):n._drawDot(l,s)),r.push({time:l.time,x:l.x,y:l.y,pressure:l.pressure})}},this._strokeEnd=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n._drawingStroke&&(t&&n._strokeUpdate(e),n._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,l=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,l),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,l=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<a;n+=1){const r=n/a,i=r*r,o=i*r,s=1-r,u=s*s,d=u*s;let c=d*e.startPoint.x;c+=3*u*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=d*e.startPoint.y;f+=3*u*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*l,t.maxWidth);this._drawCurveSegment(c,f,p)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const l=this.ctx;l.moveTo(e,t),l.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const l=this.canvas.getBoundingClientRect();return new ef(e-l.left,t-l.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),l=tf.fromPoints(n,e);return n.shift(),l}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const l=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(l,n),r={end:a,start:this._lastWidth};return this._lastVelocity=l,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:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,l-t,a-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(l,t),i=Math.min(a,n),o=.5*(Math.max(l,t)-r),s=.5*(Math.max(a,n)-i),u=r+o,d=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(u,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(n-a,t-l)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),u=15*Math.sin(i),d=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(l,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(l,a);const f=l+s,p=a+u;this.ctx.lineTo(f,p);const h=l+d,m=a+c;this.ctx.lineTo(h,m),this.ctx.lineTo(l,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const l=e.width,a=e.data,r=[];return r[0]=a[4*(n*l+t)],r[1]=a[4*(n*l+t)+1],r[2]=a[4*(n*l+t)+2],r[3]=a[4*(n*l+t)+3],r},this.setAxisColor=(e,t,n,l)=>{const a=e.width,r=e.data;r[4*(n*a+t)]=l[0],r[4*(n*a+t)+1]=l[1],r[4*(n*a+t)+2]=l[2],r[4*(n*a+t)+3]=l[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=l.width,r=l.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=this.getAxisColor(l,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(l,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,n)}this.ctx.putImageData(l,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const l=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,n+a*l+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(e),this.textInput.focus())},this.setInputStyle=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.textInput.style.left=t+"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=n-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:t,y:n}},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,this.backgroundColor?(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)):1!==this.ratio&&t.scale(this.ratio,this.ratio),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n.canvas.width===n.width)return n.canvas.toDataURL(e,t);const l=document.createElement("canvas");l.width=n.width,l.height=n.height;return l.getContext("2d").drawImage(n.canvas,0,0,l.width,l.height),l.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;return n.toDataURL("image/jpeg",e)},this.destroy=()=>{this.removeListener();for(const e in this)this[e]=null},this.initial(e,t)}initial(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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.backgroundColor=t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this._strokeMoveUpdate=this.throttle?function(e){let t,n,l,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,r=0,i=null;const o=()=>{r=Date.now(),i=null,t=e.apply(n,l),i||(n=null,l=[])};return function(){const s=Date.now(),u=a-(s-r);n=this;for(var d=arguments.length,c=new Array(d),f=0;f<d;f++)c[f]=arguments[f];return l=c,u<=0||u>a?(i&&(clearTimeout(i),i=null),r=s,t=e.apply(n,l),i||(n=null,l=[])):i||(i=window.setTimeout(o,u)),t}}(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()}}nf.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],l=window.atob(t[1]),a=l.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=l.charCodeAt(e);return new Blob([r],{type:n})},nf.canvasToDataURL=e=>e.toDataURL("image/png",1),nf.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const lf=()=>j.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),af=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),rf=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),of=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),sf=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),uf=j.default.forwardRef(((e,t)=>{const{open:n,width:l,height:a,imageName:r,penColor:i,minWidth:o,maxWidth:s,backgroundColor:d,className:c,style:f,onOk:p,onCancel:h}=e,{t:m}=td(),g=j.default.useRef(),v=j.default.useRef(null),y=j.default.useRef(null),x=j.default.useRef(null),E=[2,4,6],C=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[w,T]=Rd(void 0,{value:n,postState:e=>null!=e&&e}),N=j.default.useMemo((()=>!!e.children),[e.children]),[I,O]=j.default.useState(N?"square":"line"),[R,k]=j.default.useState(E[0]),[P,A]=j.default.useState(N?S[0]:S[4]),[L,H]=j.default.useState(C[1]),[_,F]=j.default.useState("bottomLeft"),[D,$]=j.default.useState(!1),[M,q]=j.default.useState(!1);j.default.useEffect((()=>{var e,t;const n={width:null!=l?l:null===(e=y.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=y.current)||void 0===t?void 0:t.offsetHeight,maxWidth:R,mode:I,penColor:P,fontSize:L,backgroundColor:d,openSmooth:!N};return n.openSmooth&&Object.assign(n,{penColor:i,minWidth:o,maxWidth:s}),g.current=new nf(v.current,n),()=>g.current.destroy()}),[]);const V=e=>{var t,n;const[r,i]=[null!=l?l:null===(t=y.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(n=y.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=g.current;let u=!1;r&&r!==o&&(g.current.width=r,u=!0),i&&i!==s&&(g.current.height=i,u=!0),(u||e)&&g.current.update()};Vn((()=>{N&&w&&V()}),[w,N]),Vn((()=>{g.current.setDrawMode(I)}),[I]),Vn((()=>{g.current.setLineWidth(R)}),[R]),Vn((()=>{g.current.setPenColor(P)}),[P]),Vn((()=>{g.current.setFontSize(L)}),[L]);const z=()=>Ye(void 0,void 0,void 0,(function*(){const e=N?y.current.parentNode:v.current;if(e)try{const t=yield me.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return nf.canvasToDataURL(t)}catch(e){Oe("Signature","生成合成图片失败!")}})),B=()=>{g.current.clear(),null==h||h()};j.default.useImperativeHandle(t,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>g.current.clear(),IS_EMPTY:()=>g.current.isEmpty(),UPDATE:V,GET_DATE_URL:z})));const W=e=>{e&&F((()=>{const e=x.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},U=e=>j.default.createElement("div",{className:ne.default("ant-dropdown-menu","content")},"text"!==e?j.default.createElement("div",{className:"lineWidth"},E.map((e=>j.default.createElement("span",{key:e,className:ne.default("dot",`s${e}`,{active:e===R}),onClick:()=>k(e)})))):j.default.createElement("div",{className:"fontSize"},j.default.createElement(u.Select,{size:"small",value:L,options:C.map((e=>({value:e,label:e.toString()}))),onChange:e=>H(e)})),j.default.createElement("span",{className:"divider"}),j.default.createElement("div",{className:"penColor"},S.map((e=>j.default.createElement("span",{key:e,className:ne.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},j.default.createElement(b.CheckOutlined,{className:"icon"})))))),G=dt("signature"),Y={[G]:!0,"is-annotation":N},X=l?Object.assign(Object.assign({},f),{width:l}):f;return j.default.createElement("div",{className:ne.default(Y,c),style:X},N&&j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{ref:y,className:"content"},e.children),M&&j.default.createElement(rl,{spinning:!0,className:"spinning"})),j.default.createElement("div",{className:ne.default("signature",{show:w})},j.default.createElement("canvas",{ref:v,className:I}),N&&j.default.createElement("div",{ref:x,className:"signature__tool-bar"},j.default.createElement("div",{className:"wrapper"},j.default.createElement("div",{className:ne.default("actions",{hidden:D})},j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("square")},j.default.createElement(b.BorderOutlined,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("round")},j.default.createElement(lf,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("arrow")},j.default.createElement(rf,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("line")},j.default.createElement(b.EditOutlined,null))),j.default.createElement(u.Dropdown,{dropdownRender:()=>U("text"),overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("text")},j.default.createElement(af,null))),j.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){yield Ye(void 0,void 0,void 0,(function*(){q(!0);const e=yield z();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):K.default().format(Us);vl(nf.dataURLToBlob(e),`${t}.png`)}q(!1)})),B()}))},j.default.createElement(b.DownloadOutlined,null)),j.default.createElement("button",{className:"btn",onClick:()=>O("eraser")},j.default.createElement(of,null)),j.default.createElement("button",{className:"btn",onClick:()=>g.current.undo()},j.default.createElement(sf,null)),j.default.createElement("button",{className:"btn",onClick:()=>g.current.clear()},j.default.createElement(b.ClearOutlined,null)),j.default.createElement("span",{className:"divider"}),j.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},j.default.createElement(b.CloseOutlined,null)),j.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){q(!0),yield tt(10);const e=yield z();q(!1),B(),null==p||p(e)}))},j.default.createElement(b.CheckOutlined,null))),j.default.createElement("button",{className:"btn btn-fold",title:m(D?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!D)},D?j.default.createElement(b.LeftOutlined,null):j.default.createElement(b.RightOutlined,null))))))}));uf.displayName="QmSignature";const df="1.9.5";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return u.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return u.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return u.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return u.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return u.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return u.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return u.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return u.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return u.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return u.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return u.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return u.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return u.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return u.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return u.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return u.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return u.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return u.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return u.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return u.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return u.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return u.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return u.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return u.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return u.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return u.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return u.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return u.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return u.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return u.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return u.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return u.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return u.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return u.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return u.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return u.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return u.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return u.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return u.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return u.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return u.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return u.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return u.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return u.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return u.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return u.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return u.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return u.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return u.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return u.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return u.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return u.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return u.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return u.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return u.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return u.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return u.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return u.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return u.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return u.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return u.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return u.notification}}),exports.Calendar=Me,exports.DatePicker=je,exports.DcpAnchor=El,exports.DcpButton=ot,exports.DcpCollapse=jn,exports.DcpConfigProvider=We,exports.DcpCopyToClipboard=sd,exports.DcpCountup=ll,exports.DcpCropper=Is,exports.DcpDivider=ct,exports.DcpDownload=bl,exports.DcpDrawer=wl,exports.DcpEmpty=al,exports.DcpForm=us,exports.DcpGuideTracker=Bc,exports.DcpLazyLoad=Jc,exports.DcpModal=Il,exports.DcpPrint=Tc,exports.DcpRangeTableHelper=Td,exports.DcpScrollbar=gl,exports.DcpSearchHelper=vd,exports.DcpSearchTree=Ms,exports.DcpSignature=uf,exports.DcpSpace=ut,exports.DcpSpin=rl,exports.DcpSplit=nl,exports.DcpTable=gd,exports.DcpTabs=Sl,exports.DcpTinymce=Ns,exports.DcpTour=uc,exports.DcpTransition=mc,exports.DcpTreeHelper=Cd,exports.DcpTreeTableHelper=Ed,exports.DcpUploadFile=Os,exports.DcpUploadImg=ks,exports.DcpWatermark=Wc,exports.QmAnchor=El,exports.QmButton=ot,exports.QmCollapse=jn,exports.QmConfigProvider=We,exports.QmCopyToClipboard=sd,exports.QmCountup=ll,exports.QmCropper=Is,exports.QmDivider=ct,exports.QmDownload=bl,exports.QmDrawer=wl,exports.QmEmpty=al,exports.QmForm=us,exports.QmGuideTracker=Bc,exports.QmLazyLoad=Jc,exports.QmModal=Il,exports.QmPrint=Tc,exports.QmRangeTableHelper=Td,exports.QmScrollbar=gl,exports.QmSearchHelper=vd,exports.QmSearchTree=Ms,exports.QmSignature=uf,exports.QmSpace=ut,exports.QmSpin=rl,exports.QmSplit=nl,exports.QmTable=gd,exports.QmTabs=Sl,exports.QmTinymce=Ns,exports.QmTour=uc,exports.QmTransition=mc,exports.QmTreeHelper=Cd,exports.QmTreeTableHelper=Ed,exports.QmUploadFile=Os,exports.QmUploadImg=ks,exports.QmWatermark=Wc,exports.TimePicker=Ve,exports.pinyin=nr,exports.version=df;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("prop-types"),n=require("dayjs");require("dayjs/locale/zh-cn");var l=require("dayjs/plugin/localeData"),a=require("dayjs/plugin/advancedFormat"),r=require("dayjs/plugin/customParseFormat"),i=require("dayjs/plugin/quarterOfYear"),o=require("dayjs/plugin/weekOfYear"),s=require("dayjs/plugin/weekday"),u=require("antd"),d=require("dayjs/plugin/weekYear"),c=require("antd/es/calendar/generateCalendar");require("antd/es/calendar/style");var f=require("antd/es/date-picker/generatePicker");require("antd/es/date-picker/style/index");var p=require("antd/es/locale/zh_CN"),h=require("antd/es/locale/en_GB"),m=require("omit.js"),g=require("lodash-es"),v=require("classnames"),b=require("@ant-design/icons"),y=require("react-draggable"),x=require("react-countup"),E=require("resize-observer-polyfill"),C=require("axios"),S=require("add-dom-event-listener"),w=require("scroll-into-view-if-needed"),T=require("memoize-one"),N=require("cropperjs"),I=require("big.js"),O=require("copy-to-clipboard"),R=require("@rc-component/portal"),k=require("@rc-component/trigger"),P=require("html2canvas"),A=require("react-sortablejs"),L=require("localforage"),H=require("exceljs"),_=require("react-dom"),F=require("china-area-data");function D(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function $(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var M=$(e),j=D(e),q=D(t),V=$(t),K=D(n),z=D(l),B=D(a),W=D(r),U=D(i),G=D(o),Y=D(s),X=D(d),Q=D(c),Z=D(f),J=D(p),ee=D(h),te=D(m),ne=D(v),le=D(y),ae=D(x),re=D(E),ie=D(C),oe=D(S),se=D(w),ue=D(T),de=D(N),ce=D(I),fe=D(O),pe=D(R),he=D(k),me=D(P),ge=D(L),ve=D(H),be=D(_),ye=D(F);const xe=e.createContext({locale:"zh-cn",size:"middle"});var Ee={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?"},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:"点击上传"},uploadCropper:{dragableText:"拖放或点击",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 数据"},mergeCell:{cancel:"恢复",confirm:"合并"},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:"模糊匹配",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",tabPanes:["查找条件","更多条件"],matchCase:"大小写匹配",matchFullchar:"全字符匹配",clear:"清空条件",queryPrev:"查找上一个",queryNext:"查找下一个"}}}};let Ce=Ee;function Se(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const we=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[l,a]=t;let r;const i=l.split(".");let o=Ce;for(let e=0,t=i.length;e<t;e++){if(r=o[i[e]],e===t-1)return Se(r,a);if(!r)return"";o=r}return""},Te=e=>{Ce=e||Ce,Ce.name&&K.default.locale(Ce.name)};class Ne extends Error{constructor(e){super(e),this.name="QmDesignError"}}function Ie(e,t){throw new Ne(`[${e}] ${t}`)}function Oe(e,t){console.warn(new Ne(`[${e}] ${t}`))}const Re=e=>"number"==typeof e||void 0===e||(["px","rem","em","vw","vh","%"].some((t=>e.endsWith(t)))||e.startsWith("calc")),ke=e=>["","small","middle","large"].includes(e);K.default.extend(z.default),K.default.extend(B.default),K.default.extend(W.default),K.default.extend(U.default),K.default.extend(G.default),K.default.extend(Y.default);var Pe={},Ae=[];function Le(e,t){if(!e&&void 0!==console){var n=Ae.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function He(e,t){!function(e,t,n){t||Pe[n]||(e(!1,n),Pe[n]=!0)}(Le,e,t)}K.default.extend(W.default),K.default.extend(B.default),K.default.extend(Y.default),K.default.extend(z.default),K.default.extend(G.default),K.default.extend(X.default),K.default.extend((function(e,t){var n=t.prototype,l=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return l.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]},De=function(){He(!1,"Not match any format. Please help to fire a issue about this.")},$e={getNow:function(){return K.default()},getFixedDate:function(e){return K.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 K.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 K.default().locale(Fe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return K.default().locale(Fe(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(Fe(e)).format(n)},parse:function(e,t,n){for(var l=Fe(e),a=0;a<n.length;a+=1){var r=n[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],u=K.default(o,"YYYY").startOf("year").locale(l),d=0;d<=52;d+=1){var c=u.add(d,"week");if(c.format("Wo")===s)return c}return De(),null}var f=K.default(i,r).locale(l);if(f.isValid())return f}return t&&De(),null}}};const Me=Q.default($e),je=Z.default($e);function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},qe.apply(this,arguments)}const Ve=M.forwardRef(((e,t)=>M.createElement(je,qe({},e,{picker:"time",mode:void 0,ref:t}))));Ve.displayName="TimePicker";const Ke=M.forwardRef(((e,t)=>M.createElement(je.RangePicker,qe({},e,{picker:"time",mode:void 0,ref:t}))));Ke.displayName="RangePicker",Ve.RangePicker=Ke;var ze={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?"},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"},uploadCropper:{dragableText:"Drop or click",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"},mergeCell:{cancel:"reset",confirm:"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",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?",tabPanes:["Search condition","More conditions"],matchCase:"Case matching",matchFullchar:"Full character matching",clear:"Clear condition",queryPrev:"Find previous",queryNext:"Find next"}}}};const Be={[ze.name]:{qm:ze,antd:ee.default},[Ee.name]:{qm:Ee,antd:J.default}};class We extends e.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},Te(Object.assign({},Be,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:n,size:l}=t.value,{locale:a,size:r,global:i}=e;return a!==n&&Te(Object.assign({},Be,i.langPackage)[a].qm),a!==n||r!==l?{value:Object.assign({},t.value,{locale:a,size:r})}:null}render(){const{global:e}=this.props,{value:t}=this.state,n=Object.assign({},Be,e.langPackage);return j.default.createElement(xe.Provider,{value:t},j.default.createElement(u.ConfigProvider,{locale:n[t.locale].antd,componentSize:t.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}function Ue(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(l=Object.getOwnPropertySymbols(e);a<l.length;a++)t.indexOf(l[a])<0&&Object.prototype.propertyIsEnumerable.call(e,l[a])&&(n[l[a]]=e[l[a]])}return n}function Ge(e,t,n,l){var a,r=arguments.length,i=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,n):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,l);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,n,i):a(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i}function Ye(e,t,n,l){return new(n||(n=Promise))((function(a,r){function i(e){try{s(l.next(e))}catch(e){r(e)}}function o(e){try{s(l.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,o)}s((l=l.apply(e,t||[])).next())}))}We.propTypes={locale:q.default.string,size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},theme:q.default.string,global:q.default.object},We.defaultProps={locale:"zh-cn",size:"middle",global:{}};var Xe="undefined"==typeof window;const Qe=e=>j.default.isValidElement(e),Ze=e=>Qe(e)&&e.type===j.default.Fragment,Je=()=>{},et=()=>!0,tt=e=>Ye(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),nt=e=>{Promise.resolve().then(e)},lt=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),at=e=>!!(!e&&0!==e||g.isArray(e)&&!e.length||g.isPlainObject(e)&&!Object.keys(e).length);const rt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(g.isPlainObject(e)||g.isArray(e)){const n=Array.isArray(e),l=n?[]:{};if(t.get(e))return e;t.set(e,l);const a=n?void 0:Object.keys(e);return function(e,t){let n=-1;const l=e.length;for(;++n<l;)t(e[n],n)}(a||e,((n,r)=>{a&&(r=n),l[r]=rt(e[r],t)})),l}return e},it=e=>g.isNumber(e)?`${e}px`:e.toString();class ot extends e.Component{constructor(){super(...arguments),this.state={isLoading:!1},this.clickHandle=e=>Ye(this,void 0,void 0,(function*(){var t,n;this.setState({isLoading:!0});try{yield null===(n=(t=this.props).click)||void 0===n?void 0:n.call(t,e)}catch(e){Oe("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:t,authConfig:n,click:l,confirm:a}=this.props,{isLoading:r}=this.state,i=e||this.context.size||"",o=g.isFunction(l)?{onClick:this.clickHandle}:null,s=Object.assign(Object.assign(Object.assign({},te.default(this.props,["authConfig","click","confirm"])),{size:i,loading:r||t||!1}),o);if(n){const{visible:e=1,disabled:t}=n||{};if(!e)return null;t&&(s.disabled=!0)}return a?j.default.createElement(u.Popconfirm,{title:a.title||we("qm.button.confirmTitle"),disabled:s.disabled,onConfirm:e=>{var t,n;null===(t=a.onConfirm)||void 0===t||t.call(a),null===(n=s.onClick)||void 0===n||n.call(s,e)},onCancel:e=>{var t;null===(t=a.onCancel)||void 0===t||t.call(a,e)}},j.default.createElement(u.Button,qe({},s,{onClick:Je}),this.props.children)):j.default.createElement(u.Button,s,this.props.children)}}var st;ot.propTypes={click:q.default.func,confirm:q.default.shape({title:q.default.node,onConfirm:q.default.func,onCancel:q.default.func})},ot.contextType=xe,function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(st||(st={}));class ut extends e.Component{render(){const{size:e}=this.props,t=e||this.context.size||"",n=g.isNumber(e)?e:st[e||t||"default"],l=Object.assign(Object.assign({},this.props),{size:n});return j.default.createElement(u.Space,l,this.props.children)}}ut.contextType=xe;const dt=e=>`qm-${e}`;class ct extends e.Component{constructor(){super(...arguments),this.clickHandle=()=>{const{collapse:e,onCollapseChange:t=Je}=this.props;t(!e)}}render(){const{size:e,label:t,extra:n,collapse:l,bordered:a,disabled:r,id:i,className:o,style:s}=this.props,d=e||this.context.size||"",c=dt("divider"),f={[c]:!0,[`${c}-borderless`]:!a,[`${c}--lg`]:"large"===d,[`${c}--sm`]:"small"===d};return j.default.createElement("div",{id:i,className:ne.default(f,o),style:s},j.default.createElement("span",{className:ne.default(`${c}__title`)},t),j.default.createElement("div",{className:ne.default(`${c}__extra`)},n),void 0!==l&&j.default.createElement(u.Button,{type:"link",className:ne.default(`${c}__collapse`),disabled:r,onClick:this.clickHandle},we(l?"qm.divider.collect":"qm.divider.spread"),l?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)))}}ct.contextType=xe,ct.propTypes={label:q.default.string,size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Divider","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},extra:q.default.oneOfType([q.default.element,q.default.string]),collapse:q.default.bool,bordered:q.default.bool},ct.defaultProps={bordered:!0};const ft=()=>({height:0,opacity:0}),pt=(e,t)=>"height"===t.propertyName,ht={motionName:"rc-collapse-motion",onEnterStart:ft,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:ft,onEnterEnd:pt,onLeaveEnd:pt,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"};function mt(e){return mt="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},mt(e)}function gt(e){var t=function(e,t){if("object"!==mt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var l=n.call(e,t||"default");if("object"!==mt(l))return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mt(t)?t:String(t)}function vt(e,t,n){return(t=gt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l}function Et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l,a,r,i,o=[],s=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(l=r.call(n)).done)&&(o.push(l.value),o.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(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 Ct(e){return function(e){return e instanceof HTMLElement||e instanceof SVGElement}(e)?e:e instanceof j.default.Component?be.default.findDOMNode(e):null}var St,wt={exports:{}},Tt={};function Nt(e,t){"function"==typeof e?e(t):"object"===mt(e)&&e&&"current"in e&&(e.current=t)}function It(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var l=t.filter((function(e){return e}));return l.length<=1?l[0]:function(e){t.forEach((function(t){Nt(t,e)}))}}function Ot(e){var t,n,l=wt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof l||null!==(t=l.prototype)&&void 0!==t&&t.render)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render)}function Rt(e,t){if(null==e)return{};var n,l,a=function(e,t){if(null==e)return{};var n,l,a={},r=Object.keys(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}wt.exports=(St||(St=1,function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,l=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var m=e.type;switch(m){case s:case u:case l:case r:case a:case c:return m;default:var g=m&&m.$$typeof;switch(g){case o:case d:case h:case p:case i:return g;default:return f}}case n:return f}}}var x=s,E=u,C=o,S=i,w=t,T=d,N=l,I=h,O=p,R=n,k=r,P=a,A=c,L=!1;function H(e){return y(e)===u}Tt.AsyncMode=x,Tt.ConcurrentMode=E,Tt.ContextConsumer=C,Tt.ContextProvider=S,Tt.Element=w,Tt.ForwardRef=T,Tt.Fragment=N,Tt.Lazy=I,Tt.Memo=O,Tt.Portal=R,Tt.Profiler=k,Tt.StrictMode=P,Tt.Suspense=A,Tt.isAsyncMode=function(e){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(e)||y(e)===s},Tt.isConcurrentMode=H,Tt.isContextConsumer=function(e){return y(e)===o},Tt.isContextProvider=function(e){return y(e)===i},Tt.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Tt.isForwardRef=function(e){return y(e)===d},Tt.isFragment=function(e){return y(e)===l},Tt.isLazy=function(e){return y(e)===h},Tt.isMemo=function(e){return y(e)===p},Tt.isPortal=function(e){return y(e)===n},Tt.isProfiler=function(e){return y(e)===r},Tt.isStrictMode=function(e){return y(e)===a},Tt.isSuspense=function(e){return y(e)===c},Tt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===l||e===u||e===r||e===a||e===c||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===o||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},Tt.typeOf=y}()),Tt);var kt=M.createContext({});function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function At(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,gt(l.key),l)}}function Lt(e,t,n){return t&&At(e.prototype,t),n&&At(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ht(e,t)}function _t(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&&Ht(e,t)}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Dt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,l=Ft(e);if(t){var a=Ft(this).constructor;n=Reflect.construct(l,arguments,a)}else n=l.apply(this,arguments);return function(e,t){if(t&&("object"===mt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dt(e)}(this,n)}}var Mt=function(e){_t(n,M.Component);var t=$t(n);function n(){return Pt(this,n),t.apply(this,arguments)}return Lt(n,[{key:"render",value:function(){return this.props.children}}]),n}();function jt(e){var t=M.useRef(!1),n=Et(M.useState(e),2),l=n[0],a=n[1];return M.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[l,function(e,n){n&&t.current||a(e)}]}var qt="none",Vt="appear",Kt="enter",zt="leave",Bt="none",Wt="prepare",Ut="start",Gt="active",Yt="end",Xt="prepared";function Qt(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Zt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Jt,en,tn,nn=(Jt=Qt(),en="undefined"!=typeof window?window:{},tn={animationend:Zt("Animation","AnimationEnd"),transitionend:Zt("Transition","TransitionEnd")},Jt&&("AnimationEvent"in en||delete tn.animationend.animation,"TransitionEvent"in en||delete tn.transitionend.transition),tn),ln={};if(Qt()){var an=document.createElement("div");ln=an.style}var rn={};function on(e){if(rn[e])return rn[e];var t=nn[e];if(t)for(var n=Object.keys(t),l=n.length,a=0;a<l;a+=1){var r=n[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in ln)return rn[e]=t[r],rn[e]}return""}var sn=on("animationend"),un=on("transitionend"),dn=!(!sn||!un),cn=sn||"animationend",fn=un||"transitionend";function pn(e,t){return e?"object"===mt(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var hn=function(t){var n=e.useRef(),l=e.useRef(t);l.current=t;var a=M.useCallback((function(e){l.current(e)}),[]);function r(e){e&&(e.removeEventListener(fn,a),e.removeEventListener(cn,a))}return M.useEffect((function(){return function(){r(n.current)}}),[]),[function(e){n.current&&n.current!==e&&r(n.current),e&&e!==n.current&&(e.addEventListener(fn,a),e.addEventListener(cn,a),n.current=e)},r]},mn=Qt()?e.useLayoutEffect:e.useEffect,gn=function(e){return+setTimeout(e,16)},vn=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(gn=function(e){return window.requestAnimationFrame(e)},vn=function(e){return window.cancelAnimationFrame(e)});var bn=0,yn=new Map;function xn(e){yn.delete(e)}var En=function(e){var t=bn+=1;return function n(l){if(0===l)xn(t),e();else{var a=gn((function(){n(l-1)}));yn.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};En.cancel=function(e){var t=yn.get(e);return xn(t),vn(t)};var Cn=[Wt,Ut,Gt,Yt],Sn=[Wt,Xt],wn=!1,Tn=!0;function Nn(e){return e===Gt||e===Yt}var In=function(e,t,n){var l=Et(jt(Bt),2),a=l[0],r=l[1],i=function(){var e=M.useRef(null);function t(){En.cancel(e.current)}return M.useEffect((function(){return function(){t()}}),[]),[function n(l){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=En((function(){a<=1?l({isCanceled:function(){return r!==e.current}}):n(l,a-1)}));e.current=r},t]}(),o=Et(i,2),s=o[0],u=o[1];var d=t?Sn:Cn;return mn((function(){if(a!==Bt&&a!==Yt){var e=d.indexOf(a),t=d[e+1],l=n(a);l===wn?r(t,!0):t&&s((function(e){function n(){e.isCanceled()||r(t,!0)}!0===l?n():Promise.resolve(l).then(n)}))}}),[e,a]),M.useEffect((function(){return function(){u()}}),[]),[function(){r(Wt,!0)},a]};var On=function(t){var n=t;"object"===mt(t)&&(n=t.transitionSupport);var l=M.forwardRef((function(t,l){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,u=t.children,d=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!n||!1===t)}(t,M.useContext(kt).motion),h=e.useRef(),m=e.useRef();var g=function(t,n,l,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,u=a.motionLeave,d=void 0===u||u,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,h=a.onEnterPrepare,m=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,b=a.onLeaveStart,y=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,S=a.onEnterEnd,w=a.onLeaveEnd,T=a.onVisibleChanged,N=Et(jt(),2),I=N[0],O=N[1],R=Et(jt(qt),2),k=R[0],P=R[1],A=Et(jt(null),2),L=A[0],H=A[1],_=e.useRef(!1),F=e.useRef(null);function D(){return l()}var $=e.useRef(!1);function j(){P(qt,!0),H(null,!0)}function q(e){var t=D();if(!e||e.deadline||e.target===t){var n,l=$.current;k===Vt&&l?n=null==C?void 0:C(t,e):k===Kt&&l?n=null==S?void 0:S(t,e):k===zt&&l&&(n=null==w?void 0:w(t,e)),k!==qt&&l&&!1!==n&&j()}}var V=Et(hn(q),1)[0],K=function(e){var t,n,l;switch(e){case Vt:return vt(t={},Wt,p),vt(t,Ut,g),vt(t,Gt,y),t;case Kt:return vt(n={},Wt,h),vt(n,Ut,v),vt(n,Gt,x),n;case zt:return vt(l={},Wt,m),vt(l,Ut,b),vt(l,Gt,E),l;default:return{}}},z=M.useMemo((function(){return K(k)}),[k]),B=Et(In(k,!t,(function(e){if(e===Wt){var t=z[Wt];return t?t(D()):wn}var n;return U in z&&H((null===(n=z[U])||void 0===n?void 0:n.call(z,D(),null))||null),U===Gt&&(V(D()),c>0&&(clearTimeout(F.current),F.current=setTimeout((function(){q({deadline:!0})}),c))),U===Xt&&j(),Tn})),2),W=B[0],U=B[1],G=Nn(U);$.current=G,mn((function(){O(n);var e,l=_.current;_.current=!0,!l&&n&&s&&(e=Vt),l&&n&&i&&(e=Kt),(l&&!n&&d||!l&&f&&!n&&d)&&(e=zt);var a=K(e);e&&(t||a[Wt])?(P(e),W()):P(qt)}),[n]),e.useEffect((function(){(k===Vt&&!s||k===Kt&&!i||k===zt&&!d)&&P(qt)}),[s,i,d]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(F.current)}}),[]);var Y=M.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===qt&&((Y.current||I)&&(null==T||T(I)),Y.current=!0)}),[I,k]);var X=L;return z[Wt]&&U===Ut&&(X=yt({transition:"none"},X)),[k,U,X,null!=I?I:n]}(p,r,(function(){try{return h.current instanceof HTMLElement?h.current:Ct(m.current)}catch(e){return null}}),t),v=Et(g,4),b=v[0],y=v[1],x=v[2],E=v[3],C=M.useRef(E);E&&(C.current=!0);var S,w=M.useCallback((function(e){h.current=e,Nt(l,e)}),[l]),T=yt(yt({},f),{},{visible:r});if(u)if(b===qt)S=E?u(yt({},T),w):!o&&C.current&&c?u(yt(yt({},T),{},{className:c}),w):s||!o&&!c?u(yt(yt({},T),{},{style:{display:"none"}}),w):null;else{var N,I;y===Wt?I="prepare":Nn(y)?I="active":y===Ut&&(I="start");var O=pn(d,"".concat(b,"-").concat(I));S=u(yt(yt({},T),{},{className:ne.default(pn(d,b),(N={},vt(N,O,O&&I),vt(N,d,"string"==typeof d),N)),style:x}),w)}else S=null;M.isValidElement(S)&&Ot(S)&&(S.ref||(S=M.cloneElement(S,{ref:w})));return M.createElement(Mt,{ref:m},S)}));return l.displayName="CSSMotion",l}(dn);function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},Rn.apply(this,arguments)}var kn="add",Pn="keep",An="remove",Ln="removed";function Hn(e){var t;return yt(yt({},t=e&&"object"===mt(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function _n(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Hn)}var Fn=["component","children","onVisibleChanged","onAllRemoved"],Dn=["status"],$n=["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]:On,n=function(e){_t(l,M.Component);var n=$t(l);function l(){var e;Pt(this,l);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return vt(Dt(e=n.call.apply(n,[this].concat(a))),"state",{keyEntities:[]}),vt(Dt(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:yt(yt({},e),{},{status:Ln})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==Ln})).length})),e}return Lt(l,[{key:"render",value:function(){var e=this,n=this.state.keyEntities,l=this.props,a=l.component,r=l.children,i=l.onVisibleChanged,o=l.onAllRemoved,s=Rt(l,Fn),u=a||M.Fragment,d={};return $n.forEach((function(e){d[e]=s[e],delete s[e]})),delete s.keys,M.createElement(u,s,n.map((function(n){var l=n.status,a=Rt(n,Dn),s=l===kn||l===Pn;return M.createElement(t,Rn({},d,{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 n=e.keys,l=t.keyEntities,a=_n(n),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],l=0,a=t.length,r=_n(e),i=_n(t);r.forEach((function(e){for(var t=!1,r=l;r<a;r+=1){var o=i[r];if(o.key===e.key){l<r&&(n=n.concat(i.slice(l,r).map((function(e){return yt(yt({},e),{},{status:kn})}))),l=r),n.push(yt(yt({},o),{},{status:Pn})),l+=1,t=!0;break}}t||n.push(yt(yt({},e),{},{status:An}))})),l<a&&(n=n.concat(i.slice(l).map((function(e){return yt(yt({},e),{},{status:kn})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,l=t.status;return n!==e||l!==An}))).forEach((function(t){t.key===e&&(t.status=Pn)}))})),n}(l,a);return{keyEntities:r.filter((function(e){var t=l.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==Ln||e.status!==An}))}}}]),l}();vt(n,"defaultProps",{component:"div"})}(dn);const Mn=j.default.forwardRef(((e,t)=>{const{forceRender:n,className:l,style:a,boxStyle:r,isActive:i}=e,[o,s]=j.default.useState(i||n);if(j.default.useEffect((()=>{(n||i)&&s(!0)}),[n,i]),!o)return null;const u=dt("collapse");return j.default.createElement("div",{ref:t,className:ne.default(`${u}-content`,{[`${u}-content-active`]:i,[`${u}-content-inactive`]:!i},l),style:a},j.default.createElement("div",{className:`${u}-content-box`,style:r},e.children))}));Mn.displayName="PanelContent";const jn=e=>{const{defaultActive:t,label:n,extra:l,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:u,destroyOnClose:d=!1,onChange:c}=e,[f,p]=j.default.useState(!!t),h=dt("collapse"),m=ne.default({[`${h}`]:!0,[`${h}-active`]:f,[`${h}-disabled`]:s},a);return j.default.createElement("div",{className:m,style:r},j.default.createElement(ct,{label:n,extra:l,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),j.default.createElement(On,qe({visible:f},ht,{leavedClassName:`${h}-content-hidden`,forceRender:u,removeOnLeave:d}),((t,n)=>{let{className:l,style:a}=t;return j.default.createElement(Mn,{ref:n,prefixCls:h,className:l,style:a,boxStyle:i,isActive:f,forceRender:u},e.children)})))};jn.displayName="QmCollapse";const qn=j.default.createContext(void 0);function Vn(e,t){((e,t)=>{const n=M.useRef(!0);M.useEffect((()=>e(n.current)),t),M.useEffect((()=>(n.current=!1,()=>{n.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Kn=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},zn=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},Bn=e=>e.stopPropagation(),Wn=e=>e.preventDefault(),Un=(e,t)=>{if(Xe||!e||!t)return null;"float"===(t=lt(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const l=window.getComputedStyle(e);return l?l[t]:""}catch(n){return e.style[t]}},Gn=(e,t,n)=>{!Xe&&e&&t&&(g.isPlainObject(t)?Object.keys(t).forEach((n=>{Gn(e,n,t[n])})):(t=lt(t),e.style[t]=n))},Yn=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Xn=(e,t)=>Math.abs(Yn(e)-Yn(t)),Qn=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Zn=(e,t)=>{var n;let l=e;for(;l;){if(null===(n=l.classList)||void 0===n?void 0:n.contains(t))return l;l=l.parentNode}return null},Jn=(e,t)=>{if(Xe||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},el=e=>{const{minValues:t,onDragChange:n,onDragging:l}=e,{splitRef:a,direction:r}=j.default.useContext(qn),[i,o]=j.default.useState(),[s,u]=j.default.useState(0),d="vertical"===r?"y":"x",c=()=>{const{w:e,h:n}={w:a.current.offsetWidth,h:a.current.offsetHeight};return[t[0],("vertical"===r?n:e)-t[1]]},f={[`${dt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return j.default.createElement(le.default,{bounds:i,axis:d,position:{x:0,y:0},positionOffset:{[d]:-1*s},onStart:()=>{n(!0),(()=>{const e=a.current.children[0];if(!e)return;const t=c(),n=e.offsetWidth,l=e.offsetHeight;o({left:t[0]-n,right:t[1]-n,top:t[0]-l,bottom:t[1]-l})})()},onDrag:(e,t)=>{u(t[d]),l(t[d])},onStop:()=>n(!1)},j.default.createElement("div",{className:ne.default(f),title:we("qm.split.resize")}))};el.displayName="ResizeBar";const tl=j.default.forwardRef(((e,t)=>{const{offset:n,className:l,style:a}=e,{direction:r,dragging:i}=j.default.useContext(qn),o="vertical"===r?"height":"width",s={[dt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[l]:!!l},u=void 0!==n?{[o]:it(n)}:{flex:1,[o]:0};return j.default.createElement("div",{ref:t,className:ne.default(s),style:Object.assign(Object.assign({},u),a)},e.children)}));tl.displayName="QmSplitPane";const nl=e=>{const{direction:t="horizontal",defaultValue:n="50%",uniqueKey:l,className:a,style:r,onDragStart:i,onDrag:o=Je,onDragEnd:s}=e,{global:u}=j.default.useContext(xe),d=j.default.useRef(null),c=j.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),h=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},m=j.default.useMemo((()=>l?`split_${l}`:""),[l]),[g,v]=j.default.useState(!1),[b,y]=j.default.useState(f(n)),x=j.default.useRef(0);Vn((()=>{g?(x.current="vertical"===t?c.current.offsetHeight:c.current.offsetWidth,null==i||i(p(b))):(null==s||s(p(b)),localStorage.setItem(m,b),S(m,b))}),[g]),j.default.useEffect((()=>{E()}),[]);const E=()=>{if(!m)return;const e=localStorage.getItem(m);e?y(f(e)):C(m).then((e=>{localStorage.setItem(m,f(e||n)),E()})).catch((()=>{}))},C=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),S=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==u?void 0:u.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),w=j.default.useMemo((()=>({splitRef:d,direction:t,dragging:g})),[t,g]),T=[];j.default.Children.map(e.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmSplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&T.push(e)}));const[N,I]=T,O=j.default.useMemo((()=>[h(N),h(I)]),[N,I]),R={[dt("split")]:!0,vertical:"vertical"===t};return j.default.createElement(qn.Provider,{value:w},j.default.createElement("div",{ref:d,className:ne.default(R,a),style:r},j.default.createElement(tl,qe({},N.props,{ref:c,offset:b})),j.default.createElement(el,{minValues:O,onDragChange:e=>v(e),onDragging:e=>{const t=x.current+e;y(`${t}px`),o(t)}}),j.default.createElement(tl,I.props)))};nl.Pane=tl,nl.displayName="QmSplit";class ll extends e.Component{render(){const{size:e,className:t,style:n}=this.props,l=e||this.context.size||"",a=dt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===l,[`${a}--sm`]:"small"===l};return j.default.createElement(ae.default,qe({},this.props,{className:ne.default(r,t),style:n}),this.props.children)}}ll.defaultProps={duration:2},ll.contextType=xe;class al extends e.Component{render(){const{size:e,className:t}=this.props,n=e||this.context.size||"",l=dt("empty"),a=Object.assign(Object.assign({},this.props),{image:u.Empty.PRESENTED_IMAGE_SIMPLE}),r={[l]:!0,[`${l}--lg`]:"large"===n,[`${l}--sm`]:"small"===n};return j.default.createElement(u.Empty,qe({},a,{className:ne.default(r,t)}))}}al.contextType=xe,al.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class rl extends e.Component{render(){const{fullHeight:e,className:t,style:n={}}=this.props,l={[`${dt("spin")}-full-height`]:e},a=Object.assign(Object.assign({wrapperClassName:ne.default(l,t)},te.default(this.props,["fullHeight"])),{style:Object.assign(Object.assign({},n),{maxHeight:"none"})});return j.default.createElement(u.Spin,a,this.props.children)}}rl.defaultProps={tip:"Loading...",fullHeight:!1};const il=j.default.createContext(void 0),ol=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},sl=function(e,t){!Xe&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new re.default(ol),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},ul=function(e,t){var n;e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||null===(n=e.__ro__)||void 0===n||n.disconnect())};function dl(e){const[t,n]=M.useState({width:0,height:0});return M.useEffect((()=>{const t=e.current,l=e=>{const{width:t,height:l}=e.contentRect;n({width:t,height:l})};return t&&sl(t,l),()=>{t&&ul(t,l)}}),[e]),t}function cl(e,t){var n=this;const l=M.useRef(null);return M.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]),function(){for(var a=arguments.length,r=new Array(a),i=0;i<a;i++)r[i]=arguments[i];l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(n,r)),t)}}const fl=6,pl={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"}},hl=e=>{const{thumb:t,always:n,barSize:l=fl,direction:a="vertical",onDrag:r=Je}=e,{dragging:i,scrollbarElement:o,wrapElement:s}=j.default.useContext(il),u=pl[a],d=j.default.useRef(t),c=j.default.useRef(null),f=j.default.useRef(null),p=j.default.useRef({}),h=j.default.useRef(!1),m=j.default.useRef(!1),g=j.default.useRef(Xe?null:document.onselectstart),[v,b]=j.default.useState(!1);j.default.useEffect((()=>{d.current=t}),[t]),j.default.useEffect((()=>{const e=o.current;return Kn(e,"mousemove",C),Kn(e,"mouseleave",S),()=>{E(),zn(document,"mouseup",x),zn(e,"mousemove",C),zn(e,"mouseleave",S)}}),[]);const y=e=>{if(!c.current||!f.current)return;if(!h.current)return;const t=p.current[u.axis];if(!t)return;const n=100*(-1*(c.current.getBoundingClientRect()[u.direction]-e[u.client])-(f.current[u.offset]-t))/c.current[u.offset];s.current[u.scroll]=n*s.current[u.scrollSize]/100,r(!0)},x=()=>{h.current=!1,p.current={[u.axis]:0},zn(document,"mousemove",y),zn(document,"mouseup",x),E(),m.current&&b(!1),r(!1)},E=()=>{document.onselectstart!==g.current&&(document.onselectstart=g.current)},C=()=>{m.current=!1,b(!!d.current.size)},S=()=>{m.current=!0,b(h.current)},w=dt("scrollbar"),T={[`${w}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},N={[u.reverse]:l},I={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return j.default.createElement(mc,{name:"fade",in:n||i||v,timeout:300},j.default.createElement("div",{ref:c,className:ne.default(T),style:N},j.default.createElement("div",{ref:f,className:`${w}__thumb`,style:I,onMouseDown:e=>{e.stopPropagation(),Kn(document,"mousemove",y),Kn(document,"mouseup",x),h.current=!0,g.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(p.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},ml=20,gl=j.default.forwardRef(((e,t)=>{const{wrapClassName:n,wrapStyle:l,barWidth:a,always:r,native:i,minSize:o=ml,onScroll:s}=e,u=j.default.useRef(null),d=j.default.useRef(null),c=j.default.useRef(null),[f,p]=j.default.useState({size:0,offset:0,ratio:1}),[h,m]=j.default.useState({size:0,offset:0,ratio:1}),[v,b]=j.default.useState(!1),y=dl(u),x=dl(c);Vn((()=>{!i&&E()}),[x.width,x.height,y.width,y.height]);const E=cl((()=>{if(!d.current)return;const e=d.current.offsetHeight-4,t=d.current.offsetWidth-4,n=Math.pow(e,2)/d.current.scrollHeight,l=Math.pow(t,2)/d.current.scrollWidth,a=Math.max(n,o),r=Math.max(l,o),i=n/(e-n)/(a/(e-a)),s=l/(t-l)/(r/(t-r)),u=a+4<e?a:0,c=r+4<t?r:0,g=100*d.current.scrollTop/e*i,v=100*d.current.scrollLeft/t*s;p(Object.assign({},f,{size:c,ratio:s,offset:v})),m(Object.assign({},h,{size:u,ratio:i,offset:g}))}),5),C=e=>{b(e)},S=e=>{g.isNumber(e)?d.current.scrollTop=e:Oe("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},w=e=>{g.isNumber(e)?d.current.scrollLeft=e:Oe("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};j.default.useImperativeHandle(t,(()=>{var e,t;return{container:u.current,scrollTop:(null===(e=d.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=d.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:S,SET_SCROLL_LEFT:w}}));const T=j.default.useMemo((()=>({dragging:v,scrollbarElement:u,wrapElement:d})),[v]),N=dt("scrollbar"),I={[`${N}__wrap`]:!0,[`${N}__wrap--hidden`]:!i};return j.default.createElement("div",{ref:u,className:ne.default(N,e.className),style:e.style},j.default.createElement("div",{ref:d,className:ne.default(I,n),style:l,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!i&&(()=>{if(!d.current)return;const e=d.current.offsetHeight-4,t=d.current.offsetWidth-4,n=100*d.current.scrollTop/e*h.ratio,l=100*d.current.scrollLeft/t*f.ratio;p(Object.assign({},f,{offset:l})),m(Object.assign({},h,{offset:n}))})(),null==s||s({scrollTop:t,scrollLeft:n})}},j.default.createElement("div",{ref:c,className:`${N}__view`},e.children)),!i&&j.default.createElement(il.Provider,{value:T},j.default.createElement(hl,{direction:"horizontal",thumb:f,barSize:a,always:r,onDrag:C}),j.default.createElement(hl,{direction:"vertical",thumb:h,barSize:a,always:r,onDrag:C})))}));gl.displayName="QmScrollbar";const vl=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let l=document.createElement("a");l.href=n,l.download=decodeURI(t),l.click(),l=null}};class bl extends e.Component{constructor(){super(...arguments),this.state={loading:!1},this.downloadHandle=()=>Ye(this,void 0,void 0,(function*(){var e,t,n,l;this.setState({loading:!0});try{const{action:n,beforeDownload:l=et}=this.props,a=g.isString(n)?n:yield this.getActionUrl();if(!a)return Oe("Download","参数 `action` 有误!");if(!l(a))return;yield this.downloadFile(a),yield tt(100),null===(t=(e=this.props).onSuccess)||void 0===t||t.call(e),u.message.success(we("qm.download.success"))}catch(e){null===(l=(n=this.props).onError)||void 0===l||l.call(n,e),u.message.error(we("qm.download.error"))}this.setState({loading:!1})}))}getActionUrl(){return Ye(this,void 0,void 0,(function*(){const e=this.props.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}))}downloadFile(e){return Ye(this,void 0,void 0,(function*(){const{fileName:t,headers:n,params:l,withCredentials:a}=this.props,r=yield ie.default({url:e,params:l,headers:n,withCredentials:a,responseType:"blob",timeout:0}),i=r.data,o=r.headers["content-disposition"],s=t||(o?o.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));vl(i,s)}))}render(){const{size:e}=this.props,{loading:t}=this.state,n=e||this.context.size||"",l=te.default(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return j.default.createElement(u.Button,qe({},l,{size:n,loading:t,onClick:this.downloadHandle}),this.props.children)}}bl.propTypes={action:q.default.oneOfType([q.default.string,q.default.shape({api:q.default.func.isRequired,params:q.default.object})]),size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},fileName:q.default.string,headers:q.default.object,withCredentials:q.default.bool,params:q.default.object,beforeDownload:q.default.func,onSuccess:q.default.func,onError:q.default.func},bl.defaultProps={icon:j.default.createElement(b.DownloadOutlined,null),children:we("qm.download.text"),withCredentials:!1},bl.contextType=xe;class yl extends e.Component{renderLabel(){const{activeKey:e,labels:t,onTabClick:n}=this.props;return t.map(((t,l)=>{const a={item:!0,actived:l===e};return j.default.createElement("div",{key:l,className:ne.default(a),onClick:e=>n(l,e)},j.default.createElement("span",null,t))}))}render(){return j.default.createElement(j.default.Fragment,null,this.renderLabel())}}class xl extends e.Component{render(){const{label:e,showDivider:t,className:n,style:l}=this.props,a={[dt("anchor-item")]:!0};return j.default.createElement("div",{className:ne.default(a,n),style:l},t&&j.default.createElement(ct,{label:e,style:{marginBottom:10}}),this.props.children)}}xl.displayName="QmAnchorItem";class El extends e.Component{get __is_conf(){var e;return!!(null===(e=this.props.labelList)||void 0===e?void 0:e.length)}constructor(t){super(t),this.currentState="ready",this.scrollRef=e.createRef(),this.onScrollHandle=e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})},this.onTabClickHandle=e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),se.default(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))},this.SCROLL_TO_ITEM=e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)},this.state={activeKey:t.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=oe.default(this.scrollRef.current,"scroll",g.throttle(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=Xn(this.getTargetElement(e),this.scrollRef.current))}createDistances(){var e;const{labelList:t=[]}=this.props;return(this.__is_conf?t.map((e=>document.getElementById(e.id))):Array.from((null===(e=this.scrollRef.current)||void 0===e?void 0:e.children)||[])).map((e=>Xn(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),n=this.createDistances();let l=-1;for(let e=0;e<n.length;e++){const a=n[e],r=n[e+1]||1e4;t>=a-1&&t<r&&(l=e)}return l}getTargetElement(e){const{labelList:t=[]}=this.props;return this.__is_conf?document.getElementById(t[e].id):this.scrollRef.current.children[e]}render(){const{activeKey:e}=this.state,{size:t,labelWidth:n,tabPosition:l,labelList:a=[],onTabClick:r,className:i,style:o}=this.props,s=t||this.context.size||"",u=dt("anchor"),d={[u]:!0,[`${u}-left`]:"left"===l,[`${u}-top`]:"top"===l,[`${u}--lg`]:"large"===s,[`${u}--sm`]:"small"===s},c=[];j.default.Children.map(this.props.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmAnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&c.push(e)}));const f=this.__is_conf?a.map((e=>e.label)):c.map((e=>e.props.label)),p=this.__is_conf?a.map((e=>e.id)):c.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=f.length,j.default.createElement("div",{className:ne.default(d,i),style:o},j.default.createElement("div",{className:ne.default("anchor-nav"),style:{width:n?it(n):""}},j.default.createElement(yl,{activeKey:e,labels:f,onTabClick:(e,t)=>{this.onTabClickHandle(e),null==r||r({label:f[e],id:p[e]},t)}})),j.default.createElement("div",{ref:this.scrollRef,className:ne.default("anchor-container")},this.__is_conf?this.props.children:c))}}El.Item=xl,El.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelWidth:(e,t,n)=>{if(!Re(e[t]))return Ie("Anchor","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},labelList:q.default.arrayOf(q.default.shape({id:q.default.string,label:q.default.string}))},El.defaultProps={tabPosition:"left"},El.contextType=xe;class Cl extends e.Component{render(){return j.default.createElement(u.Tabs.TabPane,this.props,this.props.children)}}Cl.displayName="QmTabPane";class Sl extends e.Component{render(){const{items:e,size:t,tabPosition:n,tabBarGutter:l,className:a,authConfig:r}=this.props,i=t||this.context.size||"",o=dt("tabs"),s={[o]:!0,[`${o}--lg`]:"large"===i,[`${o}--sm`]:"small"===i},d=Object.assign(Object.assign({},te.default(this.props,["items","authConfig"])),{size:i,tabBarGutter:null!=l?l:["top","bottom"].includes(n)?30:0}),c=[];j.default.Children.map(this.props.children,(e=>{var t;Qe(e)&&!Ze(e)&&"QmTabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&c.push(e)}));const f=e?[...e]:c.map((e=>{let{key:t,props:n}=e;return{key:t,label:n.tab,disabled:n.disabled,closable:n.closable,forceRender:n.forceRender,children:n.children}}));if(r){const{fieldList:e=[]}=r||{};for(let t=0;t<f.length;t++){const n=f[t],l=e.find((e=>e.dataIndex===n.key)),{visible:a=1,disabled:r}=l||{};a?r&&(n.disabled=!0):(f.splice(t,1),t--)}}return j.default.createElement(u.Tabs,qe({},d,{items:f,className:ne.default(s,a)}))}}Sl.TabPane=Cl,Sl.contextType=xe,Sl.defaultProps={tabPosition:"top"};class wl extends e.Component{constructor(){super(...arguments),this.titleRef=j.default.createRef(),this.$drawer=null,this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1},this.afterVisibleChange=e=>{var t,n;const{loading:l}=this.props;e?(this.opened=!0,g.isUndefined(l)&&setTimeout((()=>this.setState({spinning:!1})),100)):(null===(n=(t=this.props).onClosed)||void 0===n||n.call(t),this.setState({fullscreen:!1}))},this.toggleHandle=()=>{this.$drawer=Zn(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){var n;const{visible:l,open:a,loading:r,destroyOnClose:i}=this.props,o=null!=a?a:l,s=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:u}=this.state;o&&o!==s&&(!i&&this.opened||g.isUndefined(r)&&this.setState({spinning:!0})),this.$drawer&&u!==t.fullscreen&&Gn(this.$drawer,u?{width:"100%"}:{width:it(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:t,showHeader:n,showFullScreen:l}=this.props;return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{ref:this.titleRef,className:ne.default("text")},n&&t),l&&j.default.createElement("button",{type:"button",className:ne.default("full-screen"),onClick:this.toggleHandle},j.default.createElement(e?b.FullscreenExitOutlined:b.FullscreenOutlined)))}render(){var e;const{spinning:t,sloading:n}=this.state,{visible:l,open:a,size:r,className:i,loading:o,showHeader:s,maskClosable:d,onClose:c}=this.props,f=this.context.global,p=r||this.context.size||"",h=dt("drawer"),m={[h]:!0,"no-header":!s,[`${h}--lg`]:"large"===p,[`${h}--sm`]:"small"===p};return j.default.createElement(u.Drawer,qe({},te.default(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(e=null!=d?d:null==f?void 0:f.maskClosable)&&void 0!==e&&e,className:ne.default(m,i),title:this.renderTitle(),footer:null,onClose:c,afterOpenChange:this.afterVisibleChange}),this.props.children,(o||n||t)&&j.default.createElement(rl,{spinning:!0,className:ne.default("spinning")}))}}wl.contextType=xe,wl.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Drawer","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:q.default.bool},wl.defaultProps={width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null};const Tl="10vh";var Nl;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Nl||(Nl={}));class Il extends e.Component{constructor(){super(...arguments),this.$event=null,this.draggleRef=j.default.createRef(),this.opened=!1,this.state={fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0},this.addMouseDownEvent=()=>{this.$event||(this.$event=oe.default(document.body,"mousedown",Bn))},this.removeMouseDownEvent=()=>{var e;this.$event&&(null===(e=this.$event)||void 0===e||e.remove(),this.$event=null)},this.onStart=(e,t)=>{const{clientWidth:n,clientHeight:l}=window.document.documentElement,a=this.draggleRef.current.getBoundingClientRect();a&&this.setState({bounds:{left:-a.left+t.x,right:n-(a.right-t.x)-1,top:-a.top+t.y,bottom:l-(a.bottom-t.y)-1}})},this.toggleHandle=e=>{const t=Zn(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body"),{width:l,height:a,showHeader:r}=this.props,{fullscreen:i}=this.state;i?(Gn(t,{width:it(l||"60%"),height:"auto",top:Tl}),Gn(n,{height:a?it(a):this.defaultHeight,maxHeight:"auto"===a?this.defaultHeight:""})):(Gn(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Gn(n,{height:`calc(100vh - ${Nl[r?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{var e,t;null===(t=(e=this.props).onFullChange)||void 0===t||t.call(e,this.state.fullscreen)}))},this.afterVisibleChange=()=>{const{onClosed:e}=this.props;null==e||e(),this.setState({fullscreen:!1})},this.START_LOADING=()=>{this.setState({sloading:!0})},this.STOP_LOADING=()=>{this.setState({sloading:!1})}}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${Tl} - ${Tl} - ${Nl[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){var n;const{visible:l,open:a,loading:r,stopMouseDownEvent:i,destroyOnClose:o}=this.props,s=null!=a?a:l,u=null!==(n=e.open)&&void 0!==n?n:e.visible,{fullscreen:d}=this.state;if(s&&s!==u){if(!o&&this.opened||g.isUndefined(r)&&this.setState({spinning:!0}),i&&this.addMouseDownEvent(),!o&&this.opened)return;setTimeout((()=>{this.opened=!0,g.isUndefined(r)&&this.setState({spinning:!1})}),400)}s||this.removeMouseDownEvent(),d!==t.fullscreen&&(d?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:t}=this.state,{title:n,showHeader:l,showFullScreen:a}=this.props;return j.default.createElement("div",{onMouseOver:()=>{t&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},j.default.createElement("span",{className:ne.default("text")},l&&n),a&&j.default.createElement("button",{type:"button",className:ne.default("full-screen"),onClick:this.toggleHandle},j.default.createElement(e?b.FullscreenExitOutlined:b.FullscreenOutlined)))}render(){var e;const{spinning:t,sloading:n,fullscreen:l,disabled:a,bounds:r,position:i}=this.state,{visible:o,open:s,height:d,className:c,loading:f,draggable:p,showHeader:h,maskClosable:m,bodyStyle:g,onClose:v}=this.props,b=this.context.global,y=dt("modal"),x={height:d?it(d):this.defaultHeight,maxHeight:"auto"===d?this.defaultHeight:"",overflow:"auto"},E={[y]:!0,"no-header":!h,[`${y}--lg`]:"large"===this.$size,[`${y}--sm`]:"small"===this.$size};return j.default.createElement(u.Modal,qe({},te.default(this.props,["visible","loading","showFullScreen","maskClosable","stopMouseDownEvent","onClose","onClosed"]),{open:null!=s?s:o,maskClosable:null!==(e=null!=m?m:null==b?void 0:b.maskClosable)&&void 0!==e&&e,className:ne.default(E,c),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},x,g),onCancel:v,afterClose:this.afterVisibleChange,modalRender:e=>j.default.createElement(le.default,{disabled:!p||a||l,bounds:r,position:i,onStart:(e,t)=>this.onStart(e,t)},j.default.createElement("div",{ref:this.draggleRef},e))}),this.props.children,(f||n||t)&&j.default.createElement(rl,{spinning:!0,className:ne.default("spinning")}))}}Il.contextType=xe,Il.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Modal","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},spinning:q.default.bool},Il.defaultProps={width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Tl}};const Ol=e.createContext(void 0),Rl=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var kl={operations:function(e){const t=e.split(" "),n=[];let l=0;n[l]=[];for(let e=0;e<t.length;e++)Rl.includes(t[e])?(n[l]=n[l].join(" "),l++,n[l]=[]):n[l].push(t[e]);return n[l]=n[l].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,l=(e=Array.isArray(e)?e:[e]).length;n<l;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<l-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const Pl=["==","<",">","<=",">=","!=","like","likes","in","nin"];var Al=function(e){let t=0;const n=e.length;for(let l=0;l<n;l++){const n=e.charAt(l);"("===n&&t++,")"===n&&t--}return 0===t},Ll=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const l=n.split(" ").filter((e=>""!==e));for(let e=0;e<l.length;e++)Pl.includes(l[e])&&("this"!=l[e-1]?l[e-1]=t+"."+l[e-1]:l[e-1]=t),Pl.includes(l[e])&&(l.splice(e-1,3,`__query__(${l[e-1]}, '${l[e]}', ${l[e+1]})`),e-=2);return e=l.join(" ")};const Hl=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,_l=["string","number","boolean","symbol"],Fl=e=>_l.includes(typeof e),Dl=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),$l=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(Hl,"\\$1"),"i");window.__query__=function(){return((e,t,n)=>{e=null!=e?e:"";let l=!0;switch(t){case"like":l=null!==e.toString().match($l(n));break;case"likes":l=n.split(/,|,/).some((t=>null!==e.toString().match($l(t))));break;case"in":Fl(n)&&(n=[n]),Array.isArray(n)&&(l=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":Fl(n)&&(n=[n]),Array.isArray(n)&&(l=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":l=(Dl(e)?e.slice(0,10):e)!=n;break;case"<":l=(Dl(e)?e.slice(0,10):e)<n;break;case"<=":l=(Dl(e)?e.slice(0,10):e)<=n;break;case">":l=(Dl(e)?e.slice(0,10):e)>n;break;case">=":l=(Dl(e)?e.slice(0,10):e)>=n;break;default:l=(Dl(e)?e.slice(0,10):e)==n}return l})(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const Ml=kl.stringify,jl=kl.array_format,ql=Al,Vl=(e,t,n)=>{let l=[];t=kl.replace_symbols(t);try{if(n){const n=new Function("record",`return ${Ll(t,"record")};`);l=xa(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${Ll(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)n(e,t)&&l.push(e[t])}}catch(t){Oe("Table","组件 `initialFilter` 参数有误!"),l=e}return l},Kl=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Kl(e.children)):t.push(e)})),t},zl=e=>e.filter((e=>(e.children&&(e.children=zl(e.children)),!e.hidden&&!e.noAuth))),Bl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Bl(e.children))})),t},Wl=(e,t)=>e.map((e=>(e.children&&(e.children=Wl(e.children,t)),null==t||t(e),e))),Ul=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=Ul(n.children,t);if(e)return e}}return null},Gl=e=>{const t=e.children;return t?t[0].children?Gl(t[0]):t[0]:e},Yl=e=>{const t=e.children;return t?t[t.length-1].children?Yl(t[t.length-1]):t[t.length-1]:e},Xl=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ql=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=Ql(n.children,t);if(e)return e}}return null},Zl=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Zl(e.children))})),t},Jl=e=>{let t=1;const n=(e,l)=>{var a;if(l&&(e.level=l.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((l=>{e.fixed?l.fixed=e.fixed:delete l.fixed,n(l,e),t+=l.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,n(e,null)}));const l=[];for(let e=0;e<t;e++)l.push([]);return Bl(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,l[e.level-1].push(e)})),l},ea=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const l=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,l&&l!==document.documentElement&&l!==document.body&&(n.top-=l.scrollTop,n.left-=l.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return ea(e.offsetParent,t,n)}return n},ta=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,na=(e,t)=>g.transform(e,((e,n,l)=>{g.isEqual(n,t[l])||(e[l]=g.isPlainObject(n)&&g.isPlainObject(t[l])?na(n,t[l]):n)})),la=(e,t)=>{var n;return null!==(n=g.get(e,t))&&void 0!==n?n:""},aa=(e,t,n,l)=>{l>=0&&null!=n&&(n=Number(n).toFixed(l)),g.set(e,t,null!=n?n:"")},ra=(e,t)=>{if(!t.includes("|"))return la(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(la(e,t))})),n.every((e=>!e))?"":n.join(" | ")},ia=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),oa=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let l=n?t[0].slice(1):t[0],a="";for(;l.length>3;)a=`,${l.slice(-3)}${a}`,l=l.slice(0,l.length-3);return l&&(a=l+a),`${n}${a}${t[1]?`.${t[1]}`:""}`},sa=(e,t)=>{const n=e.toString();if(!ia(n)||0===t)return e;const l=Number.parseFloat(n).toString(),a=l.indexOf(".");if(-1===a)return l+"."+"0".repeat(t);const r=Math.max(0,t-(l.length-a-1));return l+"0".repeat(r)},ua=(e,t)=>e?K.default(e,t):null,da=(e,t)=>e?K.default(e).format(t):"",ca=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},fa=e=>{const t=[];if(j.default.isValidElement(e)){const{children:n}=e.props;j.default.Children.forEach(n,(e=>{t.push(...fa(e))}))}else t.push(e);return t},pa=e=>fa(e).join(""),ha=e=>e.filter((e=>!e._group)),ma=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="";if(Array.isArray(e)){let l=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)?jl(r.condition):Ml(r.condition,"^");n+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,l=r.logic.length}n=n.slice(0,-1*l-2)}else{const l=5;for(const l in e){const[a,r]=l.includes("|")?l.split("|"):[l,""],i=e[l];for(const e in i){n+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?jl(i[e]):Ml(i[e],"^")} and `}}n=n.slice(0,-1*l)}return n.replace(/\s+/g," ").trim()},ga=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>{const l=JSON.stringify((t=>{const n=[];return e.forEach((e=>n.push(la(t,e)))),n})(n));t[l]=t[l]||[],t[l].push(n)})),Object.keys(t).map((e=>t[e]))},va=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const l=va(e[n].children,t);if(l)return[e[n],l].flat()}}},ba=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const l=ba(e[n].children,t);if(l)return[e[n].rowKey,l].flat()}}},ya=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=ya(n.children,t);if(e)return e}if(t(n))return n}return null},xa=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&xa(e.children,t),t(e)||e.children&&e.children.length))),Ea=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Ca=80,Sa="1",wa="0",Ta=400,Na=["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"],Ia={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 Oa,Ra,ka;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Oa||(Oa={})),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"}(Ra||(Ra={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ka||(ka={}));const Pa={items:q.default.arrayOf(q.default.shape({type:q.default.string.isRequired,fieldName:q.default.string.isRequired})),initialValues:q.default.object,initialExtras:q.default.object,layout:q.default.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:q.default.number,customClass:q.default.string,compactMode:q.default.bool,labelWidth:q.default.oneOfType([q.default.number,q.default.string]),labelAlign:q.default.oneOf(["left","right"]),labelWrap:q.default.bool,formType:q.default.oneOf(["default","search","onlyShow"]),disabled:q.default.bool,uniqueKey:q.default.string,defaultRows:q.default.number,defaultExpand:q.default.bool,searchButtonCols:q.default.number,scrollToFirstError:q.default.bool,authConfig:q.default.object,isAutoFocus:q.default.bool,isCollapse:q.default.bool,isFieldsDefine:q.default.bool,isSearchBtn:q.default.bool,isSubmitBtn:q.default.bool,fieldsChange:q.default.func,onValuesChange:q.default.func,onFieldsChange:q.default.func,onFinish:q.default.func,onFinishFailed:q.default.func,onReset:q.default.func,onCollapse:q.default.func},Aa={layout:"horizontal",labelWidth:Ca,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Je,onFieldsChange:Je,onFinish:Je,onFinishFailed:Je,onReset:Je,onCollapse:Je,onFormItemsChange:Je},La=(e,t)=>{if(!e)return null;if(t===Ra.week){const t=e.match(/^(\d{4})-(\d+)/);return t?K.default().year(Number(t[1])).week(Number(t[2])):null}if(t===Ra.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?K.default().year(Number(t[1])).quarter(Number(t[2])):null}return K.default(e,t)},Ha=(e,t)=>e?K.default(e).format(t):"",_a=e=>""===e||null==e,Fa=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const l=t.split("|");let a="";for(let t=0,r=l.length;t<r;t++){a+=(null!==(n=e[l[t].trim()])&&void 0!==n?n:"")+(t===r-1?"":" | ")}return a},Da=(e,t,n)=>{for(const l in n)if(Object.keys(t).includes(l)&&t[l]!==n[l])if(t[l].includes("|")){const a=t[l].split("|"),r=n[l].split("|");a.forEach(((t,n)=>e[t]=e[r[n]]))}else e[t[l]]=e[n[l]]},$a=(e,t,n)=>{for(const l in n)if(Object.keys(t).includes(l)&&t[l]!==n[l])if(t[l].includes("|")){const a=t[l].split("|"),r=n[l].split("|");a.forEach(((t,n)=>e[t]=e[r[n]]))}else e[t[l]]=e[n[l]]},Ma=(e,t,n)=>e.map((e=>{const l={value:e[t],text:e[n]};return e.disabled&&(l.disabled=!0),e.isLeaf&&(l.isLeaf=!0),!g.isUndefined(e.selectable)&&(l.selectable=e.selectable),Array.isArray(e.children)&&(l.children=Ma(e.children,t,n)),l})),ja=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=ja(n.children,t);if(e)return e}}return null},qa=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const l=[];return e.forEach((e=>{e.value==t.split(",")[n]&&l.push(e),Array.isArray(e.children)&&l.push(...qa(e.children,t,n+1))})),l},Va=e=>Qe(e)||"string"==typeof e,Ka=e=>Qe(e)?fa(e).join(""):null!=e?e:"",za=(e,t,n,l)=>{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={[l?"textKey":t]:e.displayName[0],[l?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[l?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Ba={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 Wa="阿",Ua="鿿",Ga=1,Ya=2,Xa=3;let Qa,Za=null;function Ja(e){return e||null===Za?("object"==typeof Intl&&Intl.Collator?(Qa=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Za=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Za=!1,Za):Za}function er(e){const t=Ba.UNIHANS,n=Ba.PINYINS,l=Ba.EXCEPTIONS,a={source:e};if(e in l)return a.type=Ya,a.target=l[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Ga,a.target=e,a;if(r=Qa.compare(e,Wa),r<0)return a.type=Xa,a.target=e,a;if(0===r)a.type=Ya,i=0;else{if(r=Qa.compare(e,Ua),r>0)return a.type=Xa,a.target=e,a;0===r&&(a.type=Ya,i=t.length-1)}if(a.type=Ya,i<0){let n=0,l=t.length-1;for(;n<=l;){i=~~((n+l)/2);const a=t[i];if(r=Qa.compare(e,a),0===r)break;r>0?n=i+1:l=i-1}}return r<0&&i--,a.target=n[i],a.target||(a.type=Xa,a.target=a.source),a}function tr(e){return"string"==typeof e&&Ja()?e.split("").map((e=>er(e))):e}var nr={isSupported:Ja,parse:tr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Ba)})))},genToken:er,convertToPinyin:(e,t,n)=>tr(e).map((e=>t&&e.type===Ya?e.target.toLowerCase():e.target)).join(n||"")};var lr={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)}};nr.isSupported()&&lr.shouldPatch(nr.genToken)&&nr.patchDict(lr);const ar=e=>{const{value:t,bordered:n}=e;return j.default.createElement(u.Input,{value:t,title:t,bordered:n,readOnly:!0})};ar.displayName="FormItemView";const{Option:rr}=u.Select,ir=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{fieldName:s,options:d={},style:c={},placeholder:f=we("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=e.option,{itemList:v=[],filterable:b=!0,listHeight:y=Ta,collapseTags:x,maxTagTextLength:E,openPyt:C=!0}=d,S=at(v)?l:v,w=e=>{var t;return a?S.filter((t=>null==e?void 0:e.includes(t.value))).map((e=>e.text)).join(","):(null===(t=S.find((t=>t.value===e)))||void 0===t?void 0:t.text)||""};return t.isOnlyShow?j.default.createElement(ar,{value:w(n),bordered:p}):j.default.createElement(u.Select,qe({value:n,mode:a?"multiple":void 0,popupClassName:`form-popper__${s}`,placeholder:f,style:c,loading:r,bordered:p,allowClear:h,disabled:g,showSearch:b,listHeight:y,maxTagCount:x?"responsive":void 0,maxTagTextLength:E},a?{title:w(n)}:null,{filterOption:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,w(e),S)})(e)}}),S.map((e=>j.default.createElement(rr,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class or 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:g=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(m)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(ir,{option:this.props.option,items:t,loading:n,multiple:this.props.multiple,onValuesChange:(t,n,l)=>{g(t,n,l),e.setViewValue(i,n)}}))),p&&j.default.createElement(u.Col,null,e.renderFormItemButton(i,p)),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}or.contextType=Ol;const sr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=wa,trueValue:p=Sa}=i,h=e=>we(e===p?"am.form.trueText":"am.form.falseText");return j.default.createElement(u.Checkbox,{checked:n===p,style:o,disabled:d||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==l||l(e),a(e,h(e))})(t?p:f)}},c?r:null)};class ur extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option,{labelToCheckbox:h}=i;return j.default.createElement(u.Form.Item,{label:h?" ":e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(sr,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ur.contextType=Ol;class dr extends e.Component{constructor(){super(...arguments),this.linkRef=j.default.createRef(),this.state={visible:!1},this.getFormFieldsConfig=e=>Ye(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.saveFormFieldsConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const n=this.context.global,l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),this.resetFieldsHandle=e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||rt(e);return Object.assign(t,{hidden:e.hidden})}));this.changeHandle(t),this.setLocalFields(t)}}get formUniqueKey(){return this.props.uniqueKey?`form_${this.props.uniqueKey}`:""}componentDidMount(){this.initLocalfields()}getLocalFields(){if(!this.formUniqueKey)return;const e=JSON.parse(localStorage.getItem(this.formUniqueKey));if(e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{var t;e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):(null===(t=this.context.global)||void 0===t?void 0:t.getComponentConfigApi)&&this.setLocalFields(this.props.items)})).catch((()=>{})),!e)return;return g.xor(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:n}=t,l=e.find((e=>e.fieldName===n));return l?(g.isUndefined(l.hidden)||(t.hidden=l.hidden),t):t})):e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return g.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(this.formUniqueKey));g.isEqual(t,n)||(localStorage.setItem(this.formUniqueKey,JSON.stringify(t)),this.saveFormFieldsConfig(this.formUniqueKey,t))}initLocalfields(){const e=this.getLocalFields();e&&this.changeHandle(e)}changeHandle(e){const{fieldsChange:t}=this.props;null==t||t([...e])}popupRender(){const{items:e}=this.props;return j.default.createElement(Ol.Consumer,null,(t=>{const n=t.$$form;return j.default.createElement("div",{className:ne.default("ant-dropdown-menu","fields-list")},j.default.createElement("div",{className:"reset"},j.default.createElement(ot,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(n.getOriginItems())},we("qm.table.columnFilter.reset"))),j.default.createElement(A.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const l=t.map((e=>e.fieldName)),a=e.map((e=>e.fieldName));if(g.isEqual(l,a))return;n.setExpandHandle(!0);const r=Ea(t);this.changeHandle(r),this.setLocalFields(r)}},e.map((t=>{var l;return j.default.createElement("li",{key:t.fieldName,className:"item",style:t.noAuth?{display:"none"}:void 0},j.default.createElement(u.Checkbox,{disabled:(null===(l=t.rules)||void 0===l?void 0:l.findIndex((e=>e.required)))>-1,checked:!t.hidden,onChange:n=>{const{checked:l}=n.target;t.hidden=!l,this.changeHandle(e),this.setLocalFields(e)}}),j.default.createElement(b.HolderOutlined,{className:"handle",title:we("qm.form.draggable")}),j.default.createElement("span",{className:"title"},n.getFormItemLabel(t.label)))}))))}))}render(){const{visible:e}=this.state,t=dt("form-fields-filter");return j.default.createElement(Ol.Consumer,null,(n=>{const{$size:l}=n.$$form,a={[t]:!0,[`${t}--lg`]:"large"===l,[`${t}--sm`]:"small"===l};return j.default.createElement(u.Dropdown,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:ne.default(a),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},j.default.createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},j.default.createElement(b.UnorderedListOutlined,null)))}))}}dr.contextType=xe;const cr=j.default.forwardRef(((e,t)=>{const{$$form:n}=j.default.useContext(Ol),{value:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},placeholder:s=we("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p,onBlur:h=Je,onEnter:m=Je}=e.option,{prefix:v,suffix:b,password:y,maxLength:x,pattern:E,toUpper:C,toTrim:S,autoFocus:w,autoComplete:T,secretType:N}=i,I=N&&(f||p),O=j.default.useRef(),R=e=>{null==a||a(e),r(e)},k=y?u.Input.Password:u.Input,P=I?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return 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}(l,N):l;return n.isOnlyShow?j.default.createElement(ar,{value:(e=>e&&y?new Array(e.length).fill("*").join(""):e)(P),bordered:d}):j.default.createElement(k,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:P,autoComplete:y?"new-password":T,autoFocus:w,placeholder:s,style:o,title:y?"":P,prefix:v,suffix:b,maxLength:x,bordered:d,allowClear:c,readOnly:f,disabled:p,onBlur:t=>{var n;let l=null!==(n=t.target.value)&&void 0!==n?n:"";if(S){const e=l.trim();l!==e&&(l=e,R(l))}(t=>{const{onBlur:n}=e;null==n||n(t)})(l),h(l)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:l}=e.target;m(l),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=O.current)||void 0===t||t.blur())}},onChange:e=>{let t=e.target.value;g.isRegExp(E)&&(t=E.test(t)?t:null!=l?l:""),C&&(t=t.toUpperCase()),R(t)}})}));cr.displayName="VInput";class fr 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:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(cr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(a,t)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(a,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}fr.contextType=Ol;const pr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n=[],onChange:l,onValuesChange:a}=e,{options:r={},placeholder:i=we("qm.form.rangeInputNumberPlaceholder"),bordered:o=!0,allowClear:s,readOnly:d,disabled:c}=e.option,{prefix:f,suffix:p,maxLength:h}=r,m=e=>{const t=e.every((e=>!e))?[]:e;null==l||l(t),a(t,g(t))},g=e=>e.join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:g(n),bordered:o}):j.default.createElement(u.Input.Group,null,j.default.createElement(u.Input,{value:n[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:i[0],prefix:f,suffix:p,maxLength:h,allowClear:s,bordered:o,readOnly:d,disabled:c,onChange:e=>{const{value:t}=e.target;m([t,n[1]])}}),j.default.createElement(u.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:o,disabled:c,readOnly:!0}),j.default.createElement(u.Input,{value:n[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:i[1],prefix:f,suffix:p,maxLength:h,bordered:o,allowClear:s,readOnly:d,disabled:c,onChange:e=>{const{value:t}=e.target;m([n[0],t])}}))};class hr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:d,rules:c=[],onChange:f=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(o),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(i)},required:e.getFormItemRequired(c)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(pr,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;f(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(a,t)}}))),s&&j.default.createElement(u.Col,{flex:it(s.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}hr.contextType=Ol;const mr=j.default.forwardRef(((e,t)=>{const{$$form:n}=j.default.useContext(Ol),{value:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},placeholder:s=we("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:c,disabled:f,onBlur:p=Je,onEnter:h=Je}=e.option,{step:m=1,min:v,max:b,precision:y,autoFocus:x,stringMode:E,textAlign:C="left",controls:S=!0,formatter:w,parser:T}=i,N=j.default.useRef(),I=j.default.useRef(l),O=e=>{const t=_a(e)?"":g.isNumber(e)?e.toFixed(y):new ce.default(e).toFixed(y);return"function"==typeof w?w(t):t},R={[C]:!0,controls:S};return n.isOnlyShow?j.default.createElement(ar,{value:O(l),bordered:d}):j.default.createElement(u.InputNumber,{ref:e=>{N.current=e,"function"==typeof t&&t(e)},value:l,className:ne.default(R),placeholder:s,style:Object.assign({width:"100%"},o),step:m,min:v,max:b,controls:S,precision:y,autoFocus:x,stringMode:E,formatter:w,parser:T,bordered:d,readOnly:c,disabled:f,onBlur:()=>{nt((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(I.current),p(I.current)}))},onKeyUp:e=>{var t;13===e.keyCode&&(h(l),n.isFilterType&&(n.SUBMIT_FORM(),null===(t=N.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{I.current=e,null==a||a(e),r(e,O(e))})(t)}})}));mr.displayName="VInputNumber";class gr 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:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(mr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(a,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}gr.contextType=Ol;const vr=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n=[],onChange:l,onValuesChange:a}=e,{options:r={},placeholder:i=we("qm.form.rangeInputNumberPlaceholder"),bordered:o=!0,allowClear:s,readOnly:d,disabled:c}=e.option,{step:f=1,min:p=0,max:h,textAlign:m="left",controls:g=!0,precision:v,formatter:b,parser:y}=r,x=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),E(e)},E=e=>{const t=e.every((e=>null===e))?[]:[...e];null==l||l(t),a(t,C(t))},C=e=>_a(e)?"":e.map((e=>_a(e)?"":Number(e).toFixed(v))),S={[m]:!0,controls:g};return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:o}):j.default.createElement(u.Input.Group,null,j.default.createElement(u.InputNumber,{value:n[0],className:ne.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:i[0],step:f,min:p,max:h,controls:g,precision:v,formatter:b,parser:y,bordered:o,readOnly:d,disabled:c,onChange:e=>{E([e,n[1]])},onBlur:()=>{x(n)}}),j.default.createElement(u.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:o,disabled:c,readOnly:!0}),j.default.createElement(u.InputNumber,{value:n[1],className:ne.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:i[1],step:f,min:p,max:h,controls:g,precision:v,formatter:b,parser:y,bordered:o,readOnly:d,disabled:c,onChange:e=>{E([n[0],e])},onBlur:()=>{x(n)}}))};class br extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:s,validateTrigger:d,rules:c=[],onChange:f=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(o),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(i)},required:e.getFormItemRequired(c)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(vr,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;f(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(a,t)}}))),s&&j.default.createElement(u.Col,{flex:it(s.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},s)))))}}var yr;br.contextType=Ol,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(yr||(yr={}));const{Search:xr}=u.Input;class Er extends e.Component{constructor(e){var t;super(e),t=this,this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,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:n,echoRequest:l}=this.searchHelper;if(t||Oe("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||Oe("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&Oe("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.searchHelper,l=""!==e?e:void 0,a=("function"==typeof n?n():n)||[],r={[t]:l};return(Array.isArray(a)?a:[a]).forEach((e=>{if(g.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](l):l;else r[e]=l})),r},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:l=et,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=g.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),a(this.createFilters(e))),{currentPage:1,pageSize:500});if(!l(s))return i();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=g.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(n)}else i()}catch(e){i(e)}finally{nt((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const l in this.alias){const a=Fa(e,this.alias[l]);void 0!==a&&(t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a))}for(const n in this.extras){const l=Fa(e,this.extras[n]);void 0!==l&&t.SET_FIELDS_EXTRA({[n]:l})}},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return Ye(t,void 0,void 0,(function*(){const{fieldName:t}=this.props.option,l=e.filter((e=>{var l;return null===(l=Fa(e,this.alias[t]))||void 0===l?void 0:l.toString().toLowerCase().includes(n.toLowerCase())}));if(1===l.length)return this.closeSearchHelper(l[0]);this.openSearchHelper(n)}))},this.openSearchHelper=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:l}=this.searchHelper,a=(null!=l?l:et)(n.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:n}=this.props.option;this._record=e;for(const l in this.alias)l!==n&&t.SET_FIELDS_VALUE({[l]:Fa(e,this.alias[l])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])});const l=Fa(e,this.alias[n]);this.triggerChange(l),this.searchHelperChangeHandle(l);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 n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:t}=this.context,{visible:n,loading:l}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:u={},placeholder:d=we("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:m,suffix:g,maxLength:v}=o,b={visible:n,title:we("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()}},y=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?j.default.createElement(ar,{value:a,bordered:c}):j.default.createElement(j.default.Fragment,null,j.default.createElement(xr,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:l,placeholder:d,style:u,prefix:m,suffix:g,maxLength:v,bordered:c,allowClear:f,readOnly:p,disabled:h,onBlur:e=>{var t;const{value:l}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(l),this._is_change&&!n&&(l?a?(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e,l))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(l):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!n&&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):nt((()=>this.clearSearchHelperValue())))}}),j.default.createElement(Il,b,j.default.createElement(vd,y)))}}Er.contextType=Ol;class Cr extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[]}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Er,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Cr.contextType=Ol;const Sr=t=>{class n extends e.Component{constructor(){var e;super(...arguments),e=this,this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,l;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(a))||(null===(l=this.$el)||void 0===l?void 0:l.contains(r)),s=this.$el===a,u=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=u.some((e=>null==e?void 0:e.contains(a)))||u.includes(r);let c;c=!(i||o||s||d),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}}componentDidMount(){this.event1=oe.default(document,"mousedown",this.mousedownHandler),this.event2=oe.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:n}=this.state;return j.default.createElement(t,qe({ref:e},this.props,{clickOutside:n,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${t.displayName||t.name})`,j.default.forwardRef(((e,t)=>j.default.createElement(n,qe({},e,{forwardedRef:t}))))};function wr(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Tr(e,t,n,l){var a=be.default.unstable_batchedUpdates?function(e){be.default.unstable_batchedUpdates(n,e)}:n;return e.addEventListener&&e.addEventListener(t,a,l),{remove:function(){e.removeEventListener&&e.removeEventListener(t,a,l)}}}var Nr=e.forwardRef((function(t,n){var l=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(n,(function(){return{}}));var s=e.useRef(!1);return!s.current&&Qt()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==l||l(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e,t;null===(e=o.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(o.current)}}),[]),o.current?be.default.createPortal(r,o.current):null}));function Ir(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Or;function Rr(e){var t=e.prefixCls,n=e.motion,l=e.animation,a=e.transitionName;return n||(l?{motionName:"".concat(t,"-").concat(l)}:a?{motionName:a}:null)}function kr(e){var t=e.prefixCls,n=e.visible,l=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=yt({motionAppear:!0},Rr({motion:r,prefixCls:t,transitionName:o,animation:i}))),M.createElement(On,Rn({},s,{visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return M.createElement("div",{style:{zIndex:l},className:ne.default("".concat(t,"-mask"),n)})}))}function Pr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pr(Object(n),!0).forEach((function(t){Hr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lr(e){return Lr="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},Lr(e)}function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _r={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Fr(){if(void 0!==Or)return Or;Or="";var e=document.createElement("p").style;for(var t in _r)t+"Transform"in e&&(Or=t);return Or}function Dr(){return Fr()?"".concat(Fr(),"TransitionProperty"):"transitionProperty"}function $r(){return Fr()?"".concat(Fr(),"Transform"):"transform"}function Mr(e,t){var n=Dr();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function jr(e,t){var n=$r();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var qr,Vr=/matrix\((.*)\)/,Kr=/matrix3d\((.*)\)/;function zr(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Br(e,t,n){var l=n;if("object"!==Lr(t))return void 0!==l?("number"==typeof l&&(l="".concat(l,"px")),void(e.style[t]=l)):qr(e,t);for(var a in t)t.hasOwnProperty(a)&&Br(e,a,t[a])}function Wr(e,t){var n=e["page".concat(t?"Y":"X","Offset")],l="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var a=e.document;"number"!=typeof(n=a.documentElement[l])&&(n=a.body[l])}return n}function Ur(e){return Wr(e)}function Gr(e){return Wr(e,!0)}function Yr(e){var t=function(e){var t,n,l,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),l=Math.floor(t.top),{left:n-=i.clientLeft||r.clientLeft||0,top:l-=i.clientTop||r.clientTop||0}}(e),n=e.ownerDocument,l=n.defaultView||n.parentWindow;return t.left+=Ur(l),t.top+=Gr(l),t}function Xr(e){return null!=e&&e==e.window}function Qr(e){return Xr(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Zr=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Jr=/^(top|right|bottom|left)$/,ei="currentStyle",ti="runtimeStyle",ni="left";function li(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function ai(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function ri(e,t,n){"static"===Br(e,"position")&&(e.style.position="relative");var l=-999,a=-999,r=li("left",n),i=li("top",n),o=ai(r),s=ai(i);"left"!==r&&(l=999),"top"!==i&&(a=999);var u,d="",c=Yr(e);("left"in t||"top"in t)&&(d=(u=e).style.transitionProperty||u.style[Dr()]||"",Mr(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(l,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),zr(e);var f=Yr(e),p={};for(var h in t)if(t.hasOwnProperty(h)){var m=li(h,n),g="left"===h?l:a,v=c[h]-f[h];p[m]=m===h?g+v:g-v}Br(e,p),zr(e),("left"in t||"top"in t)&&Mr(e,d);var b={};for(var y in t)if(t.hasOwnProperty(y)){var x=li(y,n),E=t[y]-c[y];b[x]=y===x?p[x]+E:p[x]-E}Br(e,b)}function ii(e,t){var n=Yr(e),l=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue($r());if(n&&"none"!==n){var l=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(l[12]||l[4],0),y:parseFloat(l[13]||l[5],0)}}return{x:0,y:0}}(e),a={x:l.x,y:l.y};"left"in t&&(a.x=l.x+t.left-n.left),"top"in t&&(a.y=l.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),l=n.getPropertyValue("transform")||n.getPropertyValue($r());if(l&&"none"!==l){var a,r=l.match(Vr);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,jr(e,"matrix(".concat(a.join(","),")"))):((a=l.match(Kr)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,jr(e,"matrix3d(".concat(a.join(","),")")))}else jr(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function oi(e,t){for(var n=0;n<e.length;n++)t(e[n])}function si(e){return"border-box"===qr(e,"boxSizing")}"undefined"!=typeof window&&(qr=window.getComputedStyle?function(e,t,n){var l=n,a="",r=Qr(e);return(l=l||r.defaultView.getComputedStyle(e,null))&&(a=l.getPropertyValue(t)||l[t]),a}:function(e,t){var n=e[ei]&&e[ei][t];if(Zr.test(n)&&!Jr.test(t)){var l=e.style,a=l[ni],r=e[ti][ni];e[ti][ni]=e[ei][ni],l[ni]="fontSize"===t?"1em":n||0,n=l.pixelLeft+"px",l[ni]=a,e[ti][ni]=r}return""===n?"auto":n});var ui=["margin","border","padding"],di=-1,ci=2,fi=1;function pi(e,t,n){var l,a,r,i=0;for(a=0;a<t.length;a++)if(l=t[a])for(r=0;r<n.length;r++){var o=void 0;o="border"===l?"".concat(l).concat(n[r],"Width"):l+n[r],i+=parseFloat(qr(e,o))||0}return i}var hi={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 mi(e,t,n){var l=n;if(Xr(e))return"width"===t?hi.viewportWidth(e):hi.viewportHeight(e);if(9===e.nodeType)return"width"===t?hi.docWidth(e):hi.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=si(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=qr(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===l&&(l=i?fi:di);var s=void 0!==r||i,u=r||o;return l===di?s?u-pi(e,["border","padding"],a):o:s?l===fi?u:u+(l===ci?-pi(e,["border"],a):pi(e,["margin"],a)):o+pi(e,ui.slice(l),a)}oi(["Width","Height"],(function(e){hi["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],hi["viewport".concat(e)](n))},hi["viewport".concat(e)]=function(t){var n="client".concat(e),l=t.document,a=l.body,r=l.documentElement[n];return"CSS1Compat"===l.compatMode&&r||a&&a[n]||r}}));var gi={position:"absolute",visibility:"hidden",display:"block"};function vi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var l,a=t[0];return 0!==a.offsetWidth?l=mi.apply(void 0,t):function(e,t,n){var l,a={},r=e.style;for(l in t)t.hasOwnProperty(l)&&(a[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=a[l])}(a,gi,(function(){l=mi.apply(void 0,t)})),l}function bi(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}oi(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);hi["outer".concat(t)]=function(t,n){return t&&vi(t,e,n?0:fi)};var n="width"===e?["Left","Right"]:["Top","Bottom"];hi[e]=function(t,l){var a=l;return void 0!==a?t?(si(t)&&(a+=pi(t,["padding","border"],n)),Br(t,e,a)):void 0:t&&vi(t,e,di)}}));var yi={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Qr,offset:function(e,t,n){if(void 0===t)return Yr(e);!function(e,t,n){if(n.ignoreShake){var l=Yr(e),a=l.left.toFixed(0),r=l.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}n.useCssRight||n.useCssBottom?ri(e,t,n):n.useCssTransform&&$r()in document.body.style?ii(e,t):ri(e,t,n)}(e,t,n||{})},isWindow:Xr,each:oi,css:Br,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:bi,getWindowScrollLeft:function(e){return Ur(e)},getWindowScrollTop:function(e){return Gr(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)yi.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};bi(yi,hi);var xi=yi.getParent;function Ei(e){if(yi.isWindow(e)||9===e.nodeType)return null;var t,n=yi.getDocument(e).body,l=yi.css(e,"position");if(!("fixed"===l||"absolute"===l))return"html"===e.nodeName.toLowerCase()?null:xi(e);for(t=xi(e);t&&t!==n&&9!==t.nodeType;t=xi(t))if("static"!==(l=yi.css(t,"position")))return t;return null}var Ci=yi.getParent;function Si(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},l=Ei(e),a=yi.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;l;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===l.clientWidth||l===i||l===o||"visible"===yi.css(l,"overflow")){if(l===i||l===o)break}else{var s=yi.offset(l);s.left+=l.clientLeft,s.top+=l.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+l.clientWidth),n.bottom=Math.min(n.bottom,s.top+l.clientHeight),n.left=Math.max(n.left,s.left)}l=Ei(l)}var u=null;yi.isWindow(e)||9===e.nodeType||(u=e.style.position,"absolute"===yi.css(e,"position")&&(e.style.position="fixed"));var d=yi.getWindowScrollLeft(r),c=yi.getWindowScrollTop(r),f=yi.viewportWidth(r),p=yi.viewportHeight(r),h=o.scrollWidth,m=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(h=r.innerWidth),"hidden"===g.overflowY&&(m=r.innerHeight),e.style&&(e.style.position=u),t||function(e){if(yi.isWindow(e)||9===e.nodeType)return!1;var t=yi.getDocument(e),n=t.body,l=null;for(l=Ci(e);l&&l!==n&&l!==t;l=Ci(l))if("fixed"===yi.css(l,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,c),n.right=Math.min(n.right,d+f),n.bottom=Math.min(n.bottom,c+p);else{var v=Math.max(h,d+f);n.right=Math.min(n.right,v);var b=Math.max(m,c+p);n.bottom=Math.min(n.bottom,b)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function wi(e){var t,n,l;if(yi.isWindow(e)||9===e.nodeType){var a=yi.getWindow(e);t={left:yi.getWindowScrollLeft(a),top:yi.getWindowScrollTop(a)},n=yi.viewportWidth(a),l=yi.viewportHeight(a)}else t=yi.offset(e),n=yi.outerWidth(e),l=yi.outerHeight(e);return t.width=n,t.height=l,t}function Ti(e,t){var n=t.charAt(0),l=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===n?o+=r/2:"b"===n&&(o+=r),"c"===l?i+=a/2:"r"===l&&(i+=a),{left:i,top:o}}function Ni(e,t,n,l,a){var r=Ti(t,n[1]),i=Ti(e,n[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+l[0]-a[0]),top:Math.round(e.top-o[1]+l[1]-a[1])}}function Ii(e,t,n){return e.left<n.left||e.left+t.width>n.right}function Oi(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Ri(e,t,n){var l=[];return yi.each(e,(function(e){l.push(e.replace(t,(function(e){return n[e]})))})),l}function ki(e,t){return e[t]=-e[t],e}function Pi(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Ai(e,t){e[0]=Pi(e[0],t.width),e[1]=Pi(e[1],t.height)}function Li(e,t,n,l){var a=n.points,r=n.offset||[0,0],i=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;r=[].concat(r),i=[].concat(i);var u={},d=0,c=Si(s,!(!(o=o||{})||!o.alwaysByViewport)),f=wi(s);Ai(r,f),Ai(i,t);var p=Ni(f,t,a,r,i),h=yi.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&l){if(o.adjustX&&Ii(p,f,c)){var m=Ri(a,/[lr]/gi,{l:"r",r:"l"}),g=ki(r,0),v=ki(i,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(Ni(f,t,m,g,v),f,c)||(d=1,a=m,r=g,i=v)}if(o.adjustY&&Oi(p,f,c)){var b=Ri(a,/[tb]/gi,{t:"b",b:"t"}),y=ki(r,1),x=ki(i,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(Ni(f,t,b,y,x),f,c)||(d=1,a=b,r=y,i=x)}d&&(p=Ni(f,t,a,r,i),yi.mix(h,p));var E=Ii(p,f,c),C=Oi(p,f,c);if(E||C){var S=a;E&&(S=Ri(a,/[lr]/gi,{l:"r",r:"l"})),C&&(S=Ri(a,/[tb]/gi,{t:"b",b:"t"})),a=S,r=n.offset||[0,0],i=n.targetOffset||[0,0]}u.adjustX=o.adjustX&&E,u.adjustY=o.adjustY&&C,(u.adjustX||u.adjustY)&&(h=function(e,t,n,l){var a=yi.clone(e),r={width:t.width,height:t.height};return l.adjustX&&a.left<n.left&&(a.left=n.left),l.resizeWidth&&a.left>=n.left&&a.left+r.width>n.right&&(r.width-=a.left+r.width-n.right),l.adjustX&&a.left+r.width>n.right&&(a.left=Math.max(n.right-r.width,n.left)),l.adjustY&&a.top<n.top&&(a.top=n.top),l.resizeHeight&&a.top>=n.top&&a.top+r.height>n.bottom&&(r.height-=a.top+r.height-n.bottom),l.adjustY&&a.top+r.height>n.bottom&&(a.top=Math.max(n.bottom-r.height,n.top)),yi.mix(a,r)}(p,f,c,u))}return h.width!==f.width&&yi.css(s,"width",yi.width(s)+h.width-f.width),h.height!==f.height&&yi.css(s,"height",yi.height(s)+h.height-f.height),yi.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:u}}function Hi(e,t,n){var l=n.target||t,a=wi(l),r=!function(e,t){var n=Si(e,t),l=wi(e);return!n||l.left+l.width<=n.left||l.top+l.height<=n.top||l.left>=n.right||l.top>=n.bottom}(l,n.overflow&&n.overflow.alwaysByViewport);return Li(e,a,n,r)}Hi.__getOffsetParent=Ei,Hi.__getVisibleRectForElement=Si;var _i={},Fi=[];function Di(e,t){if(!e&&void 0!==console){var n=Fi.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function $i(e,t){if(!e&&void 0!==console){var n=Fi.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function Mi(e,t,n){t||_i[n]||(e(!1,n),_i[n]=!0)}function ji(e,t){Mi(Di,e,t)}ji.preMessage=function(e){Fi.push(e)},ji.resetWarned=function(){_i={}},ji.noteOnce=function(e,t){Mi($i,e,t)};var qi=Qt()?M.useLayoutEffect:M.useEffect;function Vi(e,t){var n=null,l=null;var a=new re.default((function(e){var a=Et(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),u=Math.floor(o);n===s&&l===u||Promise.resolve().then((function(){t({width:s,height:u})})),n=s,l=u}}));return e&&a.observe(e),function(){a.disconnect()}}function Ki(e){return"function"!=typeof e?null:e()}function zi(e){return"object"===mt(e)&&e?e:null}var Bi=function(e,t){var n=e.children,l=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,u=void 0===s?0:s,d=j.default.useRef({}),c=j.default.useRef(),f=j.default.Children.only(n),p=j.default.useRef({});p.current.disabled=l,p.current.target=a,p.current.align=r,p.current.onAlign=i;var h=function(e,t){var n=j.default.useRef(!1),l=j.default.useRef(null);function a(){window.clearTimeout(l.current)}return[function r(i){if(a(),n.current&&!0!==i)l.current=window.setTimeout((function(){n.current=!1,r()}),t);else{if(!1===e(i))return;n.current=!0,l.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,n=e.target,l=e.align,a=e.onAlign,r=c.current;if(!t&&n&&r){var i,o=Ki(n),s=zi(n);d.current.element=o,d.current.point=s,d.current.align=l;var u=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,l=t.height;if(n||l)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Hi(r,o,l):s&&(i=function(e,t,n){var l,a,r=yi.getDocument(e),i=r.defaultView||r.parentWindow,o=yi.getWindowScrollLeft(i),s=yi.getWindowScrollTop(i),u=yi.viewportWidth(i),d=yi.viewportHeight(i),c={left:l="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=l>=0&&l<=o+u&&a>=0&&a<=s+d,p=[n.points[0],"cc"];return Li(e,c,Ar(Ar({},n),{},{points:p}),f)}(r,s,l)),function(e,t){e!==document.activeElement&&wr(t,e)&&"function"==typeof e.focus&&e.focus()}(u,r),a&&i&&a(r,i),!0}return!1}),u),m=Et(h,2),g=m[0],v=m[1],b=Et(j.default.useState(),2),y=b[0],x=b[1],E=Et(j.default.useState(),2),C=E[0],S=E[1];return qi((function(){x(Ki(a)),S(zi(a))})),j.default.useEffect((function(){var e,t;d.current.element===y&&((e=d.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=l.has(t);if(ji(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(n&&r>1)return!1;l.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"===mt(t)&&"object"===mt(a)){var u=Object.keys(t);return u.length===Object.keys(a).length&&u.every((function(n){return e(t[n],a[n],o)}))}return!1}(e,t)}(d.current.align,r)||g()})),j.default.useEffect((function(){return Vi(c.current,g)}),[c.current]),j.default.useEffect((function(){return Vi(y,g)}),[y]),j.default.useEffect((function(){l?v():g()}),[l]),j.default.useEffect((function(){if(o)return Tr(window,"resize",g).remove}),[o]),j.default.useEffect((function(){return function(){v()}}),[]),j.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),j.default.isValidElement(f)&&(f=j.default.cloneElement(f,{ref:It(f.ref,c)})),f},Wi=j.default.forwardRef(Bi);function Ui(){Ui=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,l=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new T(a||[]);return l(i,"_invoke",{value:E(e,n,o)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function f(){}function p(){}function h(){}var m={};s(m,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(N([])));v&&v!==t&&n.call(v,r)&&(m=v);var b=h.prototype=f.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(l,r,i,o){var s=d(e[l],e,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==mt(c)&&n.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){u.value=e,i(u)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;l(this,"_invoke",{value:function(e,n){function l(){return new t((function(t,l){a(e,n,t,l)}))}return r=r?r.then(l,l):l()}})}function E(e,t,n){var l="suspendedStart";return function(a,r){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===a)throw r;return I()}for(n.method=a,n.arg=r;;){var i=n.delegate;if(i){var o=C(i,n);if(o){if(o===c)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===l)throw l="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);l="executing";var s=d(e,t,n);if("normal"===s.type){if(l=n.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(l="completed",n.method="throw",n.arg=s.arg)}}}function C(e,t){var n=t.method,l=e.iterator[n];if(void 0===l)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),c;var a=d(l,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 S(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 w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function N(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 l=-1,a=function t(){for(;++l<e.length;)if(n.call(e,l))return t.value=e[l],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=h,l(b,"constructor",{value:h,configurable:!0}),l(h,"constructor",{value:p,configurable:!0}),p.displayName=s(h,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,h):(e.__proto__=h,s(e,o,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},y(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,l,a,r){void 0===r&&(r=Promise);var i=new x(u(t,n,l,a),r);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},y(b),s(b,o,"Generator"),s(b,r,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var l in t)n.push(l);return n.reverse(),function e(){for(;n.length;){var l=n.pop();if(l in t)return e.value=l,e.done=!1,e}return e.done=!0,e}},e.values=N,T.prototype={constructor:T,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(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function l(n,l){return i.type="throw",i.arg=e,t.next=n,l&&(t.method="next",t.arg=void 0),!!l}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return l("end");if(r.tryLoc<=this.prev){var o=n.call(r,"catchLoc"),s=n.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return l(r.catchLoc,!0);if(this.prev<r.finallyLoc)return l(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return l(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return l(r.finallyLoc)}}}},abrupt:function(e,t){for(var l=this.tryEntries.length-1;l>=0;--l){var a=this.tryEntries[l];if(a.tryLoc<=this.prev&&n.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 n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var l=n.completion;if("throw"===l.type){var a=l.arg;w(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function Gi(e,t,n,l,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(l,a)}function Yi(e){return function(){var t=this,n=arguments;return new Promise((function(l,a){var r=e.apply(t,n);function i(e){Gi(r,l,a,i,o,"next",e)}function o(e){Gi(r,l,a,i,o,"throw",e)}i(void 0)}))}}Wi.displayName="Align";var Xi=["measure","alignPre","align",null,"motion"],Qi=M.forwardRef((function(t,n){var l=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,u=t.stretch,d=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,h=t.getRootDomNode,m=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,b=t.onMouseLeave,y=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),S=e.useRef(),w=Et(e.useState(),2),T=w[0],N=w[1],I=function(e){var t=Et(M.useState({width:0,height:0}),2),n=t[0],l=t[1];return[M.useMemo((function(){var t={};if(e){var l=n.width,a=n.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&l?t.width=l:-1!==e.indexOf("minWidth")&&l&&(t.minWidth=l)}return t}),[e,n]),function(e){var t=e.offsetWidth,n=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(n-i)<1&&(t=r,n=i),l({width:t,height:n})}]}(u),O=Et(I,2),R=O[0],k=O[1];var P=function(t,n){var l=Et(jt(null),2),a=l[0],r=l[1],i=e.useRef();function o(e){r(e,!0)}function s(){En.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&n(),a&&(i.current=En(Yi(Ui().mark((function e(){var t,n;return Ui().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Xi.indexOf(a),(n=Xi[t+1])&&-1!==t&&o(n);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=En((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(l,(function(){u&&k(h())})),A=Et(P,2),L=A[0],H=A[1],_=Et(e.useState(0),2),F=_[0],D=_[1],$=e.useRef();function j(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function q(e,t){var n=m(t);T!==n&&N(n),D((function(e){return e+1})),"align"===L&&(null==g||g(e,t))}qi((function(){"alignPre"===L&&D(0)}),[L]),qi((function(){"align"===L&&(F<3?j():H((function(){var e;null===(e=$.current)||void 0===e||e.call($)})))}),[F]);var V=yt({},Rr(t));function K(){return new Promise((function(e){$.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=V[e];V[e]=function(e,n){return H(),null==t?void 0:t(e,n)}})),M.useEffect((function(){V.motionName||"motion"!==L||H()}),[V.motionName,L]),M.useImperativeHandle(n,(function(){return{forceAlign:j,getElement:function(){return S.current}}}));var z=yt(yt({},R),{},{zIndex:s,opacity:"motion"!==L&&"stable"!==L&&l?0:void 0,pointerEvents:l||"stable"===L?void 0:"none"},i),B=!0;null==f||!f.points||"align"!==L&&"stable"!==L||(B=!1);var W=o;return M.Children.count(o)>1&&(W=M.createElement("div",{className:"".concat(a,"-content")},o)),M.createElement(On,Rn({visible:l,ref:S,leavedClassName:"".concat(a,"-hidden")},V,{onAppearPrepare:K,onEnterPrepare:K,removeOnLeave:d,forceRender:c}),(function(e,t){var n=e.className,l=e.style,i=ne.default(a,r,T,n);return M.createElement(Wi,{target:p||h,key:"popup",ref:C,monitorWindowResize:!0,disabled:B,align:f,onAlign:q},M.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:b,onMouseDownCapture:y,onTouchStartCapture:x,onClick:E,style:yt(yt({},l),z)},W))}))}));Qi.displayName="PopupInner";var Zi=M.forwardRef((function(e,t){var n=e.prefixCls,l=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,u=i.popupMotion,d=void 0===u?{}:u,c=i.popupRender,f=e.onClick,p=M.useRef();M.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var h=yt({zIndex:a},s),m=r;return M.Children.count(r)>1&&(m=M.createElement("div",{className:"".concat(n,"-content")},r)),c&&(m=c(m)),M.createElement(On,Rn({visible:l,ref:p,removeOnLeave:!0},d),(function(e,t){var l=e.className,a=e.style,r=ne.default(n,o,l);return M.createElement("div",{ref:t,className:r,onClick:f,style:yt(yt({},a),h)},m)}))}));Zi.displayName="MobilePopupInner";var Ji=["visible","mobile"],eo=M.forwardRef((function(t,n){var l=t.visible,a=t.mobile,r=Rt(t,Ji),i=Et(e.useState(l),2),o=i[0],s=i[1],u=Et(e.useState(!1),2),d=u[0],c=u[1],f=yt(yt({},r),{},{visible:o});e.useEffect((function(){s(l),l&&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))}())}),[l,a]);var p=d?M.createElement(Zi,Rn({},f,{mobile:a,ref:n})):M.createElement(Qi,Rn({},f,{ref:n}));return M.createElement("div",null,M.createElement(kr,f),p)}));eo.displayName="Popup";var to=M.createContext(null);function no(){}function lo(){return""}function ao(e){return e?e.ownerDocument:window.document}var ro=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var io=function(e){var t=function(t){_t(l,M.Component);var n=$t(l);function l(e){var t,a;return Pt(this,l),vt(Dt(t=n.call(this,e)),"popupRef",M.createRef()),vt(Dt(t),"triggerRef",M.createRef()),vt(Dt(t),"portalContainer",void 0),vt(Dt(t),"attachId",void 0),vt(Dt(t),"clickOutsideHandler",void 0),vt(Dt(t),"touchOutsideHandler",void 0),vt(Dt(t),"contextMenuOutsideHandler1",void 0),vt(Dt(t),"contextMenuOutsideHandler2",void 0),vt(Dt(t),"mouseDownTimeout",void 0),vt(Dt(t),"focusTime",void 0),vt(Dt(t),"preClickTime",void 0),vt(Dt(t),"preTouchTime",void 0),vt(Dt(t),"delayTimer",void 0),vt(Dt(t),"hasPopupMouseDown",void 0),vt(Dt(t),"onMouseEnter",(function(e){var n=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,n,n?null:e)})),vt(Dt(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),vt(Dt(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),vt(Dt(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),vt(Dt(t),"onPopupMouseLeave",(function(e){var n;e.relatedTarget&&!e.relatedTarget.setTimeout&&wr(null===(n=t.popupRef.current)||void 0===n?void 0:n.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),vt(Dt(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),vt(Dt(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),vt(Dt(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),vt(Dt(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),vt(Dt(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),vt(Dt(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),vt(Dt(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var n;if(t.preClickTime&&t.preTouchTime?n=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?n=t.preClickTime:t.preTouchTime&&(n=t.preTouchTime),Math.abs(n-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 l=!t.state.popupVisible;(t.isClickToHide()&&!l||l&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),vt(Dt(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)})),vt(Dt(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var n=e.target,l=t.getRootDomNode(),a=t.getPopupDomNode();wr(l,n)&&!t.isContextMenuOnly()||wr(a,n)||t.hasPopupMouseDown||t.close()}})),vt(Dt(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var n=Ct(t.triggerRef.current);if(n)return n}catch(e){}return be.default.findDOMNode(Dt(t))})),vt(Dt(t),"getPopupClassNameFromAlign",(function(e){var n=[],l=t.props,a=l.popupPlacement,r=l.builtinPlacements,i=l.prefixCls,o=l.alignPoint,s=l.getPopupClassNameFromAlign;return a&&r&&n.push(function(e,t,n,l){for(var a=n.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(Ir(e[o].points,a,l))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&n.push(s(e)),n.join(" ")})),vt(Dt(t),"getComponent",(function(){var e=t.props,n=e.prefixCls,l=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,u=e.popupStyle,d=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,h=e.zIndex,m=e.popup,g=e.stretch,v=e.alignPoint,b=e.mobile,y=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,S=E.point,w=t.getPopupAlign(),T={};return t.isMouseEnterToShow()&&(T.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(T.onMouseLeave=t.onPopupMouseLeave),T.onMouseDown=t.onPopupMouseDown,T.onTouchStart=t.onPopupMouseDown,M.createElement(eo,Rn({prefixCls:n,destroyPopupOnHide:l,visible:C,point:v&&S,className:a,align:w,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},T,{stretch:g,getRootDomNode:t.getRootDomNode,style:u,mask:d,zIndex:h,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:b,forceRender:y,onClick:x}),"function"==typeof m?m():m)})),vt(Dt(t),"attachParent",(function(e){En.cancel(t.attachId);var n,l=t.props,a=l.getPopupContainer,r=l.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(n=a(i)):n=r(t.getRootDomNode()).body,n?n.appendChild(e):t.attachId=En((function(){t.attachParent(e)}))})),vt(Dt(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})),vt(Dt(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),vt(Dt(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),vt(Dt(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},ro.forEach((function(e){t["fire".concat(e)]=function(n){t.fireEvents(e,n)}})),t}return Lt(l,[{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=Tr(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Tr(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Tr(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Tr(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),En.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,l=e.builtinPlacements;return t&&l?function(e,t,n){return yt(yt({},e[t]||{}),n)}(l,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,l=this.state.popupVisible;this.clearDelayTimer(),l!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:l}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var l=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){l.setPopupVisible(e,r),l.clearDelayTimer()}),a)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var l=this.props[e];l&&l(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,n=this.props,l=n.children,a=n.forceRender,r=n.alignPoint,i=n.className,o=n.autoDestroy,s=M.Children.only(l),u={key:"trigger"};this.isContextMenuToShow()?u.onContextMenu=this.onContextMenu:u.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(u.onClick=this.onClick,u.onMouseDown=this.onMouseDown,u.onTouchStart=this.onTouchStart):(u.onClick=this.createTwoChains("onClick"),u.onMouseDown=this.createTwoChains("onMouseDown"),u.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(u.onMouseEnter=this.onMouseEnter,r&&(u.onMouseMove=this.onMouseMove)):u.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?u.onMouseLeave=this.onMouseLeave:u.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(u.onFocus=this.onFocus,u.onBlur=this.onBlur):(u.onFocus=this.createTwoChains("onFocus"),u.onBlur=this.createTwoChains("onBlur"));var d=ne.default(s&&s.props&&s.props.className,i);d&&(u.className=d);var c=yt({},u);Ot(s)&&(c.ref=It(this.triggerRef,s.ref));var f,p=M.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=M.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),M.createElement(to.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,l={};return void 0!==n&&t.popupVisible!==n&&(l.popupVisible=n,l.prevPopupVisible=t.popupVisible),l}}]),l}();return vt(t,"contextType",to),vt(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:lo,getDocument:ao,onPopupVisibleChange:no,afterPopupVisibleChange:no,onPopupAlign:no,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}(Nr);let oo=class extends e.Component{constructor(e){var t;super(e),t=this,this.searchRef=j.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:l}=t.alias;t.setRecords(g.uniqBy([...t._records.filter((e=>n.includes(e[l]))),...e],l));const a=t.recordsToDict();t.setItemList(a),t.triggerChange(a.map((e=>e.value)));const{closed:r}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(t._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:l}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[l])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:l=[],clickOutside:a}=this.props;g.isEqual(g.intersection(n,l),l)||g.isEqual(l,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:n,valueKey:l}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,callback:s,fieldAliasMap:u}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof u?u():u||{},{value:c}=this.props;if(a&&!at(c)){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=g.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==l&&(e[l]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),a=a.filter((e=>c.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[n]})));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,n;const{$$form:l}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:d,options:c={},searchHelper:f={},style:p={},placeholder:h=we("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:v=!0,readOnly:y,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,S={visible:a,title:we("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${yr[l.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:l.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:g.merge({},f.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),T=o.filter((e=>null==s?void 0:s.includes(e.value))),N=j.default.createElement("ul",{className:"ant-dropdown-menu"},T.length?T.map((e=>j.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):j.default.createElement("li",{className:"ant-dropdown-menu-item"},we("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=dt("form-multiple-search-helper"),{size:R}=l.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return l.isOnlyShow?j.default.createElement(ar,{value:P,bordered:m}):j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},j.default.createElement(io,{popupVisible:!x&&r,popup:N,popupClassName:ne.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ia,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:s,placeholder:h,loading:i,bordered:m,allowClear:v,disabled:x,style:Object.assign({width:"100%"},p),title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const l=e.target;l.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,l),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:x,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),j.default.createElement(Il,S,j.default.createElement(vd,w)))}};oo.contextType=Ol,oo=Ge([Sr],oo);class so extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(oo,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{m(t,l),e.setViewValue(r,n)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}so.contextType=Ol;const{Search:uo}=u.Input;class co extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,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:n,echoRequest:l}=this.searchHelper;if(t||Oe("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||Oe("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&Oe("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;this.setState({loading:!0});try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.props.option;for(const l in this.alias){const a=Fa(e,this.alias[l]);t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])})},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const l in this.alias)l!==n&&t.SET_FIELDS_VALUE({[l]:Fa(e,this.alias[l])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])});const l=Fa(e,this.alias[n]);this.triggerChange(l);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 n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(){var e;if(null===this._prevValue)return;const t=this.getItemValue();this._prevValue!==t&&t!==(null===(e=this._record)||void 0===e?void 0:e[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=t}render(){var e;const{$$form:t}=this.context,{visible:n,loading:l}=this.state,{value:a=""}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:u={},placeholder:d=we("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:m,suffix:v,maxLength:b}=o,y={visible:n,title:we("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:g.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return t.isOnlyShow?j.default.createElement(ar,{value:a,bordered:c}):j.default.createElement(j.default.Fragment,null,j.default.createElement(uo,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:l,placeholder:d,style:u,prefix:m,suffix:v,maxLength:b,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())}}),j.default.createElement(Il,y,j.default.createElement(Ed,x)))}}co.contextType=Ol;class fo extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(co,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}fo.contextType=Ol;let po=class extends e.Component{constructor(e){var t;super(e),t=this,this.searchRef=j.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:l}=t.alias;t.setRecords(g.uniqBy([...t._records.filter((e=>n.includes(e[l]))),...e],l));const a=t.recordsToDict();t.setItemList(a),t.triggerChange(a.map((e=>e.value)));const{closed:r}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>null==r?void 0:r(t._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:l}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[l])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:l=[],clickOutside:a}=this.props;g.isEqual(g.intersection(n,l),l)||g.isEqual(l,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:n,valueKey:l}=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)||{},u="function"==typeof s?s():s||{},{value:d}=this.props;if(a&&!at(d)){this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:d})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=g.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==l&&(e[l]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==n&&(e[n]=e[u.textKey])})),a=a.filter((e=>d.includes(e[l])));const r=a.map((e=>({value:e[l],text:e[n]})));this.setRecords(a),this.setItemList(r),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,t,n;const{$$form:l}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:s}=this.props,{fieldName:d,options:c={},searchHelper:f={},style:p={},placeholder:h=we("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:v=!0,readOnly:y,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,S={visible:a,title:we("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${yr[l.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},w=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:l.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:g.merge({},f.initialValue),defaultSelectedKeys:s,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),T=o.filter((e=>null==s?void 0:s.includes(e.value))),N=j.default.createElement("ul",{className:"ant-dropdown-menu"},T.length?T.map((e=>j.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):j.default.createElement("li",{className:"ant-dropdown-menu-item"},we("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=dt("form-multiple-tree-table-helper"),{size:R}=l.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(n=(t=this.props).setOmitClassNames)||void 0===n||n.call(t,[`.${O}`]);const P=o.filter((e=>null==s?void 0:s.includes(e.value))).map((e=>e.text)).join(",");return l.isOnlyShow?j.default.createElement(ar,{value:P,bordered:m}):j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},j.default.createElement(io,{popupVisible:!x&&r,popup:N,popupClassName:ne.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ia,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:s,placeholder:h,loading:i,bordered:m,allowClear:v,disabled:x,style:Object.assign({width:"100%"},p),title:P,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const l=e.target;l.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,l),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:x,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),j.default.createElement(Il,S,j.default.createElement(Ed,w)))}};po.contextType=Ol,po=Ge([Sr],po);class ho extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(po,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{m(t,l),e.setViewValue(r,n)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}ho.contextType=Ol;const mo=new Array(2).fill("");class go extends e.Component{constructor(e){var t;super(e),t=this,this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:mo},this.getSearchHelper=ue.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||Oe("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||Oe("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(mo),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,l=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(l),this.setTextValue(l.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:n}=this.searchHelper,l=(null!=n?n:et)(t.state.formData);(null==l?void 0:l.then)?l.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==l&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:at(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:l=et,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=g.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),a(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!l(s))return i();this.setState({loading:!0});const e=yield t.fetch.api(s);if(nt((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=g.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return r(n)}}catch(e){this.setState({loading:!1})}i()}))))},this.resetSearchHelperValue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Ye(t,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,l=e.filter((e=>{var l;const a=null===(l=e[n])||void 0===l?void 0:l.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===l.length)return this.closeSearchHelper(l);this.openSearchHelper()}))},this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;g.isEqual(g.intersection(t,n),n)||g.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:l}=this.context,{fieldName:a}=this.props.option;if(!g.isEqual(l[a],this._ceho_data)&&(this._ceho_data=l[a],this.setItemList(l[a]),n.length)){const e=mo.map(((e,t)=>{var r,i;return null!==(i=null===(r=l[a].find((e=>e.value===n[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:n}=this.alias,{fetchApi:l,params:a={},formatter:r=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:u}=this.props;if(l&&!at(u)){this.setState({loading:!0});try{const o=yield l(r(Object.assign(Object.assign({},a),{keys:u})));if(200===o.code){let l=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,i))&&void 0!==e?e:[];l.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),l=l.filter((e=>u.includes(e[n]))).slice(0,2);const a=l.map((e=>({value:e[n],text:e[t]})));this.setRecords(l),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:n,loading:l,textValue:a}=this.state,{fieldName:r,options:i={},searchHelper:o={},placeholder:s=we("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:c,disabled:f}=this.props.option,{onlySelect:p=!0}=this.searchHelper||o,h={visible:n,title:we("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()}},m=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${r}`:"",initialValue:g.merge({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?j.default.createElement(ar,{value:a.join(" - "),bordered:d}):j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input.Group,null,j.default.createElement(u.Input,{value:a[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],allowClear:!1,bordered:d,readOnly:c,disabled:f,onBlur:e=>{var t,l;const{value:r}=e.target;this._is_change&&!n&&(r?a.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.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]]))}}),j.default.createElement(u.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}),j.default.createElement(u.Input.Search,{value:a[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],loading:l,bordered:d,allowClear:!0,readOnly:c,disabled:f,onBlur:e=>{var t,l;const{value:r}=e.target;this._is_change&&!n&&(r?a.every((e=>!!e))&&(null===(l=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===l?void 0:l.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()))}})),j.default.createElement(Il,h,j.default.createElement(Td,m)))}}go.contextType=Ol;class vo extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:s,extra:d,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(s),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(go,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,n,l)=>{h(t,l),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,c)),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},d)))))}}vo.contextType=Ol;const bo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:d,disabled:c}=e.option,{itemList:f=[]}=i,p=at(f)?l:f,h=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?j.default.createElement(ar,{value:h(n),bordered:s}):j.default.createElement(u.Checkbox.Group,{value:n,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,h(e))})(e)}},p.map((e=>j.default.createElement(u.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class yo extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n)try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(bo,{option:this.props.option,items:t,onValuesChange:(t,n)=>{h(t),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}yo.contextType=Ol;const xo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:s,disabled:d=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,h=e=>p?p[Math.ceil(e)-1]:e.toString();return j.default.createElement(u.Rate,{value:n,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:d||t.isOnlyShow,onChange:e=>{(e=>{null==l||l(e),a(e,h(e))})(e)}})};class Eo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(xo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Eo.contextType=Ol;const Co=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:s=!1,readOnly:d,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=at(f)?l:f,h=e=>{var t,n;return null!==(n=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return t.isOnlyShow?j.default.createElement(ar,{value:h(n),bordered:s}):j.default.createElement(u.Radio.Group,{value:n,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,h(e))})(t)}},p.map((e=>j.default.createElement(u.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class So 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n)try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=n.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,validateTrigger:f,rules:p=[],onChange:h=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(p)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Co,{option:this.props.option,items:t,onValuesChange:(t,n)=>{h(t),e.setViewValue(r,n)}}))),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}So.contextType=Ol;const wo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=wa,trueValue:p=Sa}=i;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Switch,{checked:n===p,style:o,disabled:d||t.isOnlyShow,checkedChildren:j.default.createElement(b.CheckOutlined,null),unCheckedChildren:j.default.createElement(b.CloseOutlined,null),onChange:e=>{(e=>{null==l||l(e),a(e,we(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?j.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class To extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option,{labelToSwitch:h}=i;return j.default.createElement(u.Form.Item,{label:h?" ":e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(wo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}To.contextType=Ol;const No=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},style:i={},placeholder:o=we("qm.form.inputPlaceholder"),bordered:s=!0,allowClear:d,readOnly:c,disabled:f,onBlur:p=Je,onEnter:h=Je}=e.option,{showCount:m,maxLength:g,autoSize:v}=r,b=Object.assign({},{minRows:1,maxRows:3},v);return j.default.createElement(u.Input.TextArea,{value:n,placeholder:o,style:i,maxLength:g,showCount:m,autoSize:b,bordered:s,allowClear:d,readOnly:c||t.isOnlyShow,disabled:f,onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),p(n)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;h(t)}},onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),a(e)})(t)}})};class Io extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(No,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Io.contextType=Ol;const Oo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.datePlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{dateType:h="date",format:m,disabledDate:g,minDateTime:v,maxDateTime:b,shortCuts:y=!0}=i,x=j.default.createRef(),E=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==l||l(e),a(e,C(e))},C=e=>_a(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=Ha(K.default().subtract(e,"day"),Ra[h]);"date"===h&&(t=t.slice(0,10)),E(t),x.current.blur(),x.current.focus()};return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:d}):j.default.createElement(je,{ref:x,style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,picker:Oa[h],format:m,bordered:d,showToday:!1,showTime:"datetime"===h&&{defaultValue:K.default("00:00:00","HH:mm:ss")},allowClear:c,disabled:p,inputReadOnly:f,disabledDate:null!=g?g:e=>((e,t)=>{let[n,l]=t;return n&&l?e.isBefore(n,"day")||e.isAfter(l,"day"):n?e.isBefore(n,"day"):!!l&&e.isAfter(l,"day")})(e,[v,b]),renderExtraFooter:y?()=>j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(0)},we("qm.form.datePickers")[0]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(1)},we("qm.form.datePickers")[1]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(7)},we("qm.form.datePickers")[2]),j.default.createElement(u.Tag,{color:"processing",onClick:()=>S(30)},we("qm.form.datePickers")[3])):void 0,value:La(n,Ra[h]),onChange:(e,t)=>{E(Ha(e,Ra[h]))}})};class Ro extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Oo,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ro.contextType=Ol;const ko=e=>[K.default().subtract(e,"day"),K.default()],Po=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f=t.isFormDisabled}=e.option,{dateType:p="date",format:h,disableds:m=[!1,!1],allowEmpty:g,disabledDate:v,minDateTime:b,maxDateTime:y,shortCuts:x=!0}=i,E={[we("qm.form.dateRangePickers")[0]]:ko(7),[we("qm.form.dateRangePickers")[1]]:ko(30),[we("qm.form.dateRangePickers")[2]]:ko(90),[we("qm.form.dateRangePickers")[3]]:ko(180)},C=e=>_a(e)?"":e.map((e=>["date","exactdate"].includes(p)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:C(n),bordered:u}):j.default.createElement(je.RangePicker,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,picker:Oa[p],format:h,bordered:u,showTime:"datetime"===p&&{defaultValue:[K.default("00:00:00","HH:mm:ss"),K.default("23:59:59","HH:mm:ss")]},allowClear:d,allowEmpty:g,disabled:f?[!0,!0]:m,inputReadOnly:c,disabledDate:null!=v?v:e=>((e,t)=>{let[n,l]=t;return n&&l?e.isBefore(n,"day")||e.isAfter(l,"day"):n?e.isBefore(n,"day"):!!l&&e.isAfter(l,"day")})(e,[b,y]),ranges:x?E:void 0,value:at(n)?null:[La(null==n?void 0:n[0],Ra[p]),La(null==n?void 0:n[1],Ra[p])],onChange:(e,t)=>{(e=>{"date"===p&&(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==l||l(e),a(e,C(e))})([Ha(null==e?void 0:e[0],Ra[p]),Ha(null==e?void 0:e[1],Ra[p])])}})};class Ao extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Po,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ao.contextType=Ol;const Lo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.timePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f}=e.option,{timeType:p="hour-minute-second",hourStep:h=1,minuteStep:m=1,secondStep:g=1}=i;return t.isOnlyShow?j.default.createElement(ar,{value:n,bordered:u}):j.default.createElement(Ve,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,bordered:u,showNow:!0,hourStep:h,minuteStep:m,secondStep:g,allowClear:d,disabled:f,inputReadOnly:c,format:ka[p],value:La(n,ka[p]),onChange:(e,t)=>{(e=>{const t=Ha(e,ka[p]);null==l||l(t),a(t)})(e)}})};class Ho extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Lo,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Ho.contextType=Ol;const _o=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:d=!0,readOnly:c,disabled:f=t.isFormDisabled}=e.option,{timeType:p="hour-minute-second",disableds:h=[!1,!1],allowEmpty:m,hourStep:g=1,minuteStep:v=1,secondStep:b=1}=i,y=e=>_a(e)?"":e.join(" - ");return t.isOnlyShow?j.default.createElement(ar,{value:y(n),bordered:u}):j.default.createElement(Ve.RangePicker,{style:Object.assign({width:"100%"},o),popupClassName:`form-popper__${r}`,bordered:u,showNow:!1,hourStep:g,minuteStep:v,secondStep:b,allowClear:d,allowEmpty:m,disabled:f?[!0,!0]:h,inputReadOnly:c,format:ka[p],value:at(n)?null:[La(null==n?void 0:n[0],ka[p]),La(null==n?void 0:n[1],ka[p])],onChange:(e,t)=>{(e=>{const t=[Ha(null==e?void 0:e[0],ka[p]),Ha(null==e?void 0:e[1],ka[p])];null==l||l(t),a(t,y(t))})(e)}})};class Fo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(_o,{option:this.props.option,onValuesChange:(t,n)=>{p(t),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Fo.contextType=Ol;class Do extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=ue.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:l,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(l||Oe("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)||Oe("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&Oe("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&Oe("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>{var e;const{$$form:t}=this.context;return null!==(e=t.state.other[this.valueKey])&&void 0!==e?e:t.state.formData[this.valueKey]},this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;yield this.props.waiting();const{fetchApi:t,params:n={},formatter:l=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},u="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},c=this.getItemValue();if(!t||at(c))return this._prevValue=void 0;try{const o=yield t(l(Object.assign(Object.assign({},n),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=g.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(u&&Da(e,this.alias,u),d&&$a(e,this.extras,d),this._record=e,this.setFieldsValue(e),this._prevValue=c,i){const t=Fa(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:n}=this.props.option;this._record=e;for(const l in this.alias){const a=Fa(e,this.alias[l]);t.SET_FIELDS_VALUE({[l]:a}),l===n&&t.setViewValue(n,a)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Fa(e,this.extras[n])})},this.fetchHandle=g.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:l}=this.props.option;for(const t in this.alias)t!==l&&n.SET_FIELDS_VALUE({[t]:Fa(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:Fa(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=Fa(e,this.alias[l]);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||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){var t,n,l,a,r,i,o;const s=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(l=e.option.request)||void 0===l?void 0:l.params),u=(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);if(g.isEqual(s,u)||this.getItemList(),null===this._prevValue)return;const d=this.getItemValue();this._prevValue!==d&&d!==(null===(o=this._record)||void 0===o?void 0:o[this.alias[this.valueKey]])&&this.getItemText(),this._prevValue=d}getItemList(e){var t;return Ye(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:l,params:a={},formatter:r=(e=>e),dataKey:i}=this.searchHelper.request||this.props.option.request||{};if(l){this.setState({loading:!0});try{const o=yield l(r(Object.assign(Object.assign({},a),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=g.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:n,itemList:l,inputText:a}=this.state,{value:r}=this.props,{fieldName:i,options:o={},style:s={},placeholder:d=we("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{listHeight:m=Ta}=o,{hideHeader:v,onlySelect:b=!0}=this.searchHelper||o,y=this.searchHelper.columns||[],x=dt("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=j.default.createElement(u.Spin,{spinning:n},l.length?j.default.createElement("table",{cellSpacing:0,cellPadding:0,className:ne.default("table")},!v&&j.default.createElement("thead",null,j.default.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>j.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),j.default.createElement("tbody",null,l.map(((e,t)=>j.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)))}},y.filter((e=>!e.hidden)).map((t=>j.default.createElement("td",{key:t.dataIndex},g.get(e,t.dataIndex))))))))):j.default.createElement(al,null));return j.default.createElement(xe.Consumer,null,(n=>{const o={[x]:!0,[`${x}--lg`]:"large"===(null==n?void 0:n.size),[`${x}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:r,bordered:c}):j.default.createElement(io,{action:h?[]:["click"],popupVisible:!h&&t,popup:C,popupClassName:ne.default(o,`form-popper__${i}`),popupStyle:{minWidth:E,maxHeight:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:d,allowClear:f,bordered:c,readOnly:p,disabled:h,style:Object.assign({width:"100%"},s),value:null!=a?a:r,title:r,onFocus:()=>{!l.length&&this.fetchHandle(r)},onBlur:e=>{b&&!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(l[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%l.length:(--t+l.length)%l.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),b?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}}))}))}}Do.contextType=Ol;class $o extends e.Component{constructor(e,t){let{$$form:n}=t;super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){Ie("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:l}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==l?void 0:l.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==l?void 0:l.searchHelper)||void 0===n?void 0:n.createFetchApi))return Oe("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 n=yield l.searchHelper.getServerConfig({searchHelperId:a});if(200===n.code){const t=za(Object.assign({},n.data,r),i,l.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(n.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:n,label:l,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:s=e.props.labelWidth,className:d,extra:c,buttonAfter:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(l),className:ne.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":it(s)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:r,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(l)}},j.default.createElement(Do,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m(t,arguments.length>1?arguments[1]:void 0),e.setViewValue(r,t)}}))),f&&j.default.createElement(u.Col,null,e.renderFormItemButton(r,f)),c&&j.default.createElement(u.Col,{flex:it(c.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}$o.contextType=Ol;class Mo extends e.Component{render(){var e;const{$$form:t}=this.context,{type:n,label:l,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:s}=t.state,{showLimit:d,remarkItems:c=[],onCollapse:f=Je}=o,p=[];if(c.length){const n=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],l=null!=d?d:n.length-1;n.slice(l+1).forEach((e=>{var n;const l=c.find((t=>t.fieldName===e.fieldName));if(!l)return;const a=l.showLabel?`${e.label}:`:"",r=null!==(n=t.getViewValue(e.fieldName))&&void 0!==n?n:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return j.default.createElement(u.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},j.default.createElement(ct,{id:a,label:l,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:s[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}Mo.contextType=Ol;const jo=(e,t,n,l)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:l}):e.children?Object.assign(Object.assign({},e),{children:jo(e.children,t,n,l)}):e)),qo=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,items:l,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{fieldName:s,options:d={},style:c={},placeholder:f=we("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,asyncLoad:m,readOnly:v,disabled:b}=e.option,{itemList:y,filterable:x=!0,listHeight:E=Ta,checkStrictly:C,checkStrategy:S="SHOW_CHILD",collapseTags:w,defaultExpandAll:T=!m,defaultExpandedKeys:N,openPyt:I=!0}=d,[O,R]=j.default.useState(at(y)?l:y);Vn((()=>{R(at(y)?l:y)}),[y,l]);const k=e=>{var t;return(null===(t=ja(O,e))||void 0===t?void 0:t.text)||""},P=e=>a?e.map((e=>k(e))).filter((e=>!!e)).join(","):k(e);return t.isOnlyShow?j.default.createElement(ar,{value:P(n),bordered:p}):j.default.createElement(u.TreeSelect,qe({fieldNames:{label:"text",value:"value",children:"children"},value:n,multiple:a,treeCheckable:a,treeCheckStrictly:C,showCheckedStrategy:u.TreeSelect[S],popupClassName:`form-popper__${s}`,placeholder:f,listHeight:E,style:c,loading:r,bordered:p,allowClear:h,disabled:b,treeDefaultExpandAll:T,treeDefaultExpandedKeys:N,showSearch:x,maxTagCount:w?"responsive":void 0,loadData:m?e=>{let{key:t,children:n}=e;return Ye(void 0,void 0,void 0,(function*(){var e;if(!m||n)return;const{fetchApi:l,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:u=(e=>e)}=m;if(l)try{const n=yield l(u(Object.assign(Object.assign({},a),{[o]:t})));if(200===n.code){const l=Array.isArray(n.data)?n.data:null!==(e=g.get(n.data,r))&&void 0!==e?e:[],a=jo(O,t,o,Ma(l,o,i));R(a),null==s||s(l)}}catch(e){}}))}:void 0,treeData:O},a?{title:P(n)}:null,{filterTreeNode:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(I?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,P(e),O)})(e)}}))};class Vo 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=Ma(n,r,i);this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(qo,{option:this.props.option,items:t,loading:n,multiple:this.props.multiple,onValuesChange:(t,n,l)=>{m(t,n,l),e.setViewValue(i,n)}}))),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Vo.contextType=Ol;const Ko=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,multiple:l,items:a}=e,{fieldName:r,options:i={},style:o={},placeholder:s=we("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{changeOnSelect:h,checkStrictly:m,checkStrategy:g="SHOW_PARENT",filterable:v=!0,openPyt:b=!0}=i,{itemList:y=[]}=i,x=at(y)?a:y,E=e=>at(e)?"":l?e.map((e=>qa(x,e).map((e=>e.text)).join("/"))).join(","):qa(x,e).map((e=>e.text)).join("/");return t.isOnlyShow?j.default.createElement(ar,{value:E(n),bordered:d}):j.default.createElement(u.Cascader,qe({value:(e=>at(e)?[]:l?e.map((e=>e.split(","))):e.split(","))(n),fieldNames:{label:"text",value:"value",children:"children"},options:x,multiple:l,maxTagCount:"responsive",changeOnSelect:h||m,showCheckedStrategy:u.Cascader[g],popupClassName:`form-popper__${r}`,placeholder:s,style:o,bordered:d,allowClear:c,disabled:p,showSearch:v&&{filter:(e,t)=>t.some((t=>{var n;const l=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",a=nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(b?`${l}|${a}`:l).toLowerCase().indexOf(e.toLowerCase())>=0}))}},l?{title:E(n)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:l}=e;null==n||n(t),l(t,E(t),x)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return l?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class zo 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:n,params:l={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(l);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[],l=Ma(n,r,i);this.setState({itemList:l},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const l=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(n=this.props.option.request)||void 0===n?void 0:n.params;g.isEqual(l,a)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:n}=this.state,{type:l,label:a,tooltip:r,fieldName:i,invisible:o,options:s={},labelWidth:d=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:h=[],onChange:m=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(a),className:ne.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":it(d)},required:e.getFormItemRequired(h)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},j.default.createElement(Ko,{option:this.props.option,multiple:t,items:n,onValuesChange:(t,n,l)=>{m(t,n,l),e.setViewValue(i,n)}}))),f&&j.default.createElement(u.Col,{flex:it(f.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}zo.contextType=Ol;const Bo=["110000","120000","310000","500000"],Wo=["810000","820000"],Uo=[{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"}],Go=[{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"}],Yo=e=>nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Xo=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Bo,...Wo].includes(e))):Object.keys(e[t])).map((l=>({l:Yo(e[t][l].slice(0,1)).toUpperCase(),n:e[t][l],c:l,p:t,children:Xo(e,l,n+1)})))},Qo=(e,t)=>t.map((t=>({l:Yo(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Zo extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this.scrollRef=j.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:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),se.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:Qo(ye.default,Bo)},{l:"Z2",n:"港澳",c:"",p:"",children:Qo(ye.default,Wo)}]}createProvince(){var e;return(null!==(e=Xo(ye.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Go.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Bo,...Wo].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return j.default.createElement(u.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}))}},j.default.createElement(u.Radio.Button,{value:"0"},we("qm.form.citySelectType.0")),j.default.createElement(u.Radio.Button,{value:"1"},we("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Uo:Go).map((t=>j.default.createElement("li",{key:t.value,className:ne.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return j.default.createElement(u.Select,{size:"small",placeholder:we("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>j.default.createElement(u.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,n)=>{var l;return j.default.createElement("div",{key:n},j.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),j.default.createElement("dd",null,null===(l=t.children)||void 0===l?void 0:l.map((t=>j.default.createElement("li",{key:t.c,className:ne.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:n}=this.props,{fieldName:l,options:a={},style:r={},placeholder:i=we("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:d,disabled:c}=this.props.option,f=dt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=this.createTextValue(n),m=j.default.createElement("div",{className:"container",style:Object.assign({},r)},j.default.createElement("div",{className:"city-drop"},j.default.createElement("div",{className:"city-drop-toper"},j.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),j.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),j.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),j.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},j.default.createElement("dl",null,this.renderCity(n)))));return j.default.createElement(xe.Consumer,null,(n=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==n?void 0:n.size),[`${f}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:h,bordered:o}):j.default.createElement(io,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:ne.default(a,`form-popper__${l}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,readOnly:d,disabled:c,style:Object.assign({width:"100%"},r),value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}}))}))}}Zo.contextType=Ol;class Jo extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(Zo,{option:this.props.option,onValuesChange:(t,n)=>{p(t,n),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Jo.contextType=Ol;const es=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:es(e,n)})))};class ts extends e.Component{constructor(e){super(e),this.searchRef=j.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=es(ye.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:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,l;return null===(l=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===l?void 0:l.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let l=0;l<t.length;l++){const a=ja(e,t[l]);if(a&&at(a.children)){this.isFetch&&this.getStreetList(t[l]);break}Array.isArray(null==a?void 0:a.children)&&(n[l+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Ye(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:l,formatter:a=(e=>e),dataKey:r,valueKey:i="value",textKey:o="text"}=n;if(l)try{const n=yield l(a({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=g.get(n.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,n)=>{var l;const a=(null===(l=t.find((t=>t.value===e[n])))||void 0===l?void 0:l.text)||`${we("qm.form.selectPlaceholder").replace("...","")}(${we("qm.form.regionSelectLabel")[n]})`;return j.default.createElement(Sl.TabPane,{key:n.toString(),tab:a},j.default.createElement("div",{className:"region-box"},t.map((t=>j.default.createElement("span",{key:t.value,className:ne.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[n]=t.value.toString(),e=e.slice(0,n+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(n+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(n+1)}))}},t.text)))))}));return t.length?j.default.createElement(Sl,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):j.default.createElement(al,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:n}=this.props,{fieldName:l,options:a={},style:r={},placeholder:i=we("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:s=!0,readOnly:d,disabled:c}=this.props.option,f=dt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=j.default.createElement("div",{className:"container"},this.renderTabs());let m=this.prevText;if(!t){const e=this.createTextValue(n);(""===e||e.split("/").every((e=>""!==e)))&&(m=e,this.prevText=m)}return j.default.createElement(xe.Consumer,null,(n=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==n?void 0:n.size),[`${f}--sm`]:"small"===(null==n?void 0:n.size)};return e.isOnlyShow?j.default.createElement(ar,{value:m,bordered:o}):j.default.createElement(io,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:ne.default(a,`form-popper__${l}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ia,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement(u.Input,{ref:this.searchRef,placeholder:i,allowClear:s,bordered:o,style:Object.assign({width:"100%"},r),readOnly:d,disabled:c,value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&nt((()=>this.initial()))}}))}))}}ts.contextType=Ol;class ns extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(ts,{option:this.props.option,onValuesChange:(t,n)=>{p(t,n),e.setViewValue(a,n)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ns.contextType=Ol;const ls=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i={},style:o={},disabled:s,readOnly:d}=e.option,{multiple:c=!0,maxCount:f=1,fileTypes:p,fileSize:h,fileDirection:m,onPreview:v,onRemove:y}=r,{action:x,headers:E,params:C,withCredentials:S=!1,dataKey:w="",downloadWithHeaders:T,fieldAliasMap:N,beforeUpload:I,button:O}=i,R="function"==typeof N?N():N||{};return j.default.createElement(Os,{name:"file",action:x,multiple:c,headers:E,data:C,withCredentials:S,downloadWithHeaders:T,beforeUpload:I,maxCount:f,fileTypes:p,fileSize:h,fileDirection:m,disabled:s,readOnly:t.isOnlyShow||d,button:O,showUploadList:{showDownloadIcon:!0,downloadIcon:j.default.createElement(b.DownloadOutlined,null)},fileList:n,onChange:e=>{let{file:t,fileList:n}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},l={};for(const a in R)l[a]=e[a]||(null===(t=n.data)||void 0===t?void 0:t[R[a]])||"";return e.response&&200!==n.code&&u.message.error(n.message||we("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},l),{url:e.url||(w?g.get(n.data,w):n.data)||"",status:e.status})}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(n)},onPreview:v,onRemove:y})};class as extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(ls,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}as.contextType=Ol;const rs=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i={},style:o={},disabled:s,readOnly:d}=e.option,{multiple:c=!0,maxCount:f=1,fixedSize:p,quality:h,openCropper:m,fileTypes:v,fileSize:b,onRemove:y}=r,{action:x,headers:E,params:C,withCredentials:S=!1,dataKey:w="",popupClassName:T,fieldAliasMap:N,beforeUpload:I}=i,O="function"==typeof N?N():N||{};return j.default.createElement(ks,{name:"file",action:x,multiple:c,headers:E,data:C,withCredentials:S,popupClassName:T,beforeUpload:I,maxCount:f,fixedSize:p,quality:h,openCropper:m,fileTypes:v,fileSize:b,disabled:s,readOnly:t.isOnlyShow||d,fileList:n,onChange:e=>{let{file:t,fileList:n}=e;(e=>{const t=e.map((e=>{var t;const n=e.response||{},l={};for(const a in O)l[a]=e[a]||(null===(t=n.data)||void 0===t?void 0:t[O[a]])||"";return e.response&&200!==n.code&&u.message.error(n.message||we("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},l),{url:e.url||(w?g.get(n.data,w):n.data)||"",status:e.status})}));null==l||l(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(n)},onRemove:y})};class is extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(rs,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}is.contextType=Ol;const os=e=>{const{$$form:t}=j.default.useContext(Ol),{value:n,onChange:l,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:u=t.isFormDisabled}=e.option,{tinymce:d,thresholdSize:c,onResizeEditor:f}=r;return j.default.createElement(Ns,{value:n,tinymce:d,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:u||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==l||l(e),a(e)})(e)}})};class ss extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:n,tooltip:l,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:s,extra:d,validateTrigger:c,rules:f=[],onChange:p=Je}=this.props.option;return j.default.createElement(u.Form.Item,{label:e.renderFormLabel(n),className:ne.default(s),tooltip:l,hidden:r,labelCol:{flex:e.verticalLayout?"initial":it(o)},required:e.getFormItemRequired(f)},j.default.createElement(u.Row,{wrap:!1,gutter:4},j.default.createElement(u.Col,{flex:"auto"},j.default.createElement(u.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(n)}},j.default.createElement(os,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),d&&j.default.createElement(u.Col,{flex:it(d.labelWidth||Ca)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}ss.contextType=Ol;class us extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=j.default.createRef(),this.formRef=j.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 n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=g.debounce(this.resizeObserveHandler,10),this.getFormItems=ue.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=ue.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{g.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,l;null===(l=(n=this.props).onValuesChange)||void 0===l||l.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,l;null===(l=(n=this.props).onFieldsChange)||void 0===l||l.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=e=>{let{values:t,errorFields:n}=e;var l,a;null===(a=(l=this.props).onFinishFailed)||void 0===a||a.call(l,n)},this.openValidateInfo=e=>{const t=j.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return j.default.createElement("li",{key:e.name[0],style:{color:"#f5222d"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));u.notification.error({message:we("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&se.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(){sl(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ul(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&&Oe("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const l in e)t.includes(l)||(n[l]=e[l]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>g.isPlainObject(e.extra))).forEach((n=>{var l;t[n.fieldName]=null!==(l=e[n.fieldName])&&void 0!==l?l:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>g.isPlainObject(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:l,options:a}=e;return t=null!=t?t:void 0,Na.includes(l)&&(t=null!=t?t:[]),"CHECKBOX"!==l&&"SWITCH"!==l||(t=null!==(n=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==n?n:wa),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=rt(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){this.setState({collapse:e},(()=>{var e,t;null===(t=(e=this.props).onCollapse)||void 0===t||t.call(e,this.state.collapse)}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,l,a,r;if(Va(e))return Ka(e);if(g.isPlainObject(e)){const{fieldName:i,label:o,options:s={}}=e;if(Va(o))return Ka(o);const{itemList:u=[]}=s,d=null!==(l=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([i])[i])&&void 0!==n?n:this._initialValues[i])&&void 0!==l?l:null===(a=u[0])||void 0===a?void 0:a.value;return(null===(r=u.find((e=>e.value===d)))||void 0===r?void 0:r.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let l=this.formItems.findIndex((e=>e===this.dividers[t+1]));l=l>-1?l:void 0,e.push(this.formItems.slice(n,l).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:n}=e;var l,a;if("DIVIDER"===t)return!0;const r=this.getBlockDerivedItems();for(let e=0,t=r.length;e<t;e++){const t=r[e],i=this.dividers.find((e=>e.fieldName===t[0].fieldName)),o=null!==(a=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==a?a:t.length-1;for(let e=1;e<t.length;e++){if(t[e].fieldName===n&&e>o)return this.state.expand[t[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const l in e){const a=e[l];if(_a(a)&&(e[l]=""),Array.isArray(a)&&a.forEach(((t,n)=>{_a(t)&&(e[l][n]="")})),l.includes("|")&&Array.isArray(a)){const[r,i]=l.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(n=a[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)at(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Ye(this,void 0,void 0,(function*(){const{authConfig:l}=this.props;if(!l)return;let a=te.default(l,["fetch"]);if(l.fetch){const{api:t,params:n,dataKey:r}=l.fetch;try{const l=yield t(n);200===l.code&&(a=null!==(e=r?g.get(l.data,r):l.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(a.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=a.fieldList.find((e=>e.dataIndex===t));if(n){const l=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=n;a||(e.noAuth=!0,l.noAuth=!0),r&&(e.disabled=!0,l.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},l.options=Object.assign({},l.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return j.default.createElement(fr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return j.default.createElement(hr,{option:e})}INPUT_NUMBER(e){return j.default.createElement(gr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return j.default.createElement(br,{option:e})}SEARCH_HELPER(e){return j.default.createElement(Cr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return j.default.createElement(so,{option:e})}TREE_TABLE_HELPER(e){return j.default.createElement(fo,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return j.default.createElement(ho,{option:e})}RANGE_SEARCH_HELPER(e){return j.default.createElement(vo,{option:e})}CHECKBOX(e){return j.default.createElement(ur,{option:e})}MULTIPLE_CHECKBOX(e){return j.default.createElement(yo,{option:e})}RATE(e){return j.default.createElement(Eo,{option:e})}RADIO(e){return j.default.createElement(So,{option:e})}SWITCH(e){return j.default.createElement(To,{option:e})}TEXT_AREA(e){return j.default.createElement(Io,{option:e})}DATE(e){return j.default.createElement(Ro,{option:e})}RANGE_DATE(e){return j.default.createElement(Ao,{option:e})}TIME(e){return j.default.createElement(Ho,{option:e})}RANGE_TIME(e){return j.default.createElement(Fo,{option:e})}SELECT(e){return j.default.createElement(or,{option:e})}MULTIPLE_SELECT(e){return j.default.createElement(or,{option:e,multiple:!0})}IMMEDIATE(e){return j.default.createElement($o,{option:e})}DIVIDER(e){return j.default.createElement(Mo,{option:e})}TREE_SELECT(e){return j.default.createElement(Vo,{option:e})}MULTIPLE_TREE_SELECT(e){return j.default.createElement(Vo,{option:e,multiple:!0})}CASCADER(e){return j.default.createElement(zo,{option:e})}MULTIPLE_CASCADER(e){return j.default.createElement(zo,{option:e,multiple:!0})}CITY_SELECT(e){return j.default.createElement(Jo,{option:e})}REGION_SELECT(e){return j.default.createElement(ns,{option:e})}UPLOAD_FILE(e){return j.default.createElement(as,{option:e})}UPLOAD_IMG(e){return j.default.createElement(is,{option:e})}TINYMCE(e){return j.default.createElement(ss,{option:e})}renderFormLabel(e){if(Va(e)||!g.isPlainObject(e))return e;const{type:t,fieldName:n,label:l,options:a={},onChange:r=Je}=e,{itemList:i=[]}=a;return"SELECT"===t?j.default.createElement(u.Form.Item,{name:n,noStyle:!0},j.default.createElement(ir,{option:e,items:i,loading:!1,onValuesChange:(e,t)=>r(e,t)})):"CHECKBOX"===t?j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{style:{paddingRight:5}},l),j.default.createElement(u.Form.Item,{name:n,noStyle:!0},j.default.createElement(sr,{option:e,onValuesChange:e=>r(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:n,style:l={},render:a}=e,{extra:r}=this.state;if(n)return j.default.createElement(u.Tooltip,{className:"extra-tooltip",title:r[t]},j.default.createElement(b.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t));return j.default.createElement("div",{className:"extra-text",title:a?"":r[t],style:l},j.default.createElement("span",{className:"extra-overflow-cut"},a?a(i,this):r[t]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),l="function"==typeof t?t(n):t;return this.isOnlyShow?null:l}renderFormItem(e){const{label:t,fieldName:n,invisible:l,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,rules:o=[],style:s={},render:d}=e;return at(this.state.formData)?null:j.default.createElement(u.Form.Item,{label:this.renderFormLabel(t),name:n,rules:o,tooltip:a,hidden:l,className:ne.default(r),style:Object.assign({width:"100%"},s),labelCol:{flex:this.verticalLayout?"initial":it(i)}},null==d?void 0:d(e,this))}createFormItem(e){return g.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(Oe("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:n,isFieldsDefine:l}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<n;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:n=1}=t,l=e+n;return i.push(l),l}),0),s=n>Math.ceil(o/e)?Math.ceil(o/e):n,d=[],c=a.map(((t,n)=>{let{selfCol:l=1}=t;const{type:a,fieldName:o}=t;l=l>=24||"DIVIDER"===a||"TINYMCE"===a?e:l;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[n]<s*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&d.push(i[n]),j.default.createElement(u.Col,{key:null!=o?o:n,className:o,span:l*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(rt(t)):null)}));return l&&"default"===t&&c.push(j.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:t,collapse:n}=this.state,{searchButtonCols:l,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=l||1,s=t-e%t-o;return a?j.default.createElement(u.Col,{key:"-",span:o*i,offset:s*i,style:{textAlign:"right"}},j.default.createElement(u.Space,{style:{marginBottom:12}},j.default.createElement(ot,{type:"primary",size:this.$size,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},we("qm.form.search")),j.default.createElement(ot,{size:this.$size,icon:j.default.createElement(b.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},we("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&j.default.createElement("a",{onClick:()=>this.setExpandHandle(!n)},n?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)," ",we(n?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:n}=this.props;if(this.isFilterType)return null;const l=24/e;return n&&"default"===t?j.default.createElement(u.Row,{gutter:0},j.default.createElement(u.Col,{key:"-",span:l},j.default.createElement(u.Form.Item,null,j.default.createElement(u.Space,{style:{marginBottom:12}},j.default.createElement(ot,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},we("qm.form.save")),j.default.createElement(ot,{size:this.$size,onClick:()=>this.RESET_FORM()},we("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:n}=this.props;return j.default.createElement(dr,{uniqueKey:e,items:t,fieldsChange:n})}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[n,l]=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:[we("qm.form.searchHelperTips")],warnings:[]})));n||a.length?t((n||[]).concat(a)):e(l)}))))}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 n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),l=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));l.length&&this.formRef.current.resetFields(l),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),l=t.filter((e=>!n.includes(e))),a={};return l.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){Oe("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:l,fieldsChange:a}=this.props,r=l.find((t=>t.fieldName===e));if(!r)return Oe("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!g.isPlainObject(t))return Oe("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(r.noAuth)return Oe("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||g.set(r,n,t[n]));n&&(a?a([...l]):Oe("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:n,disabled:l,labelWidth:a,labelAlign:r,labelWrap:i,customClass:o}=this.props,s=dt("form"),d={required:"${label}"+we("qm.form.requiredTips")},c={[s]:!0,[`${s}--lg`]:"large"===this.$size,[`${s}--sm`]:"small"===this.$size,[`${s}__only-show`]:this.isOnlyShow,[`${s}__compact`]:this.isCompactMode,[o]:!!o};return j.default.createElement("div",{ref:this.wrapperRef,className:ne.default(c,e),style:t},j.default.createElement(u.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:n,labelAlign:r,labelWrap:i,colon:!1,disabled:l,labelCol:{flex:this.verticalLayout?"initial":it(a)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},j.default.createElement(Ol.Provider,{value:this.provide},j.default.createElement(u.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}us.contextType=xe,us.propTypes=Pa,us.defaultProps=Aa;const ds={onActivate:V.func,onAddUndo:V.func,onBeforeAddUndo:V.func,onBeforeExecCommand:V.func,onBeforeGetContent:V.func,onBeforeRenderUI:V.func,onBeforeSetContent:V.func,onBeforePaste:V.func,onBlur:V.func,onChange:V.func,onClearUndos:V.func,onClick:V.func,onContextMenu:V.func,onCommentChange:V.func,onCopy:V.func,onCut:V.func,onDblclick:V.func,onDeactivate:V.func,onDirty:V.func,onDrag:V.func,onDragDrop:V.func,onDragEnd:V.func,onDragGesture:V.func,onDragOver:V.func,onDrop:V.func,onExecCommand:V.func,onFocus:V.func,onFocusIn:V.func,onFocusOut:V.func,onGetContent:V.func,onHide:V.func,onInit:V.func,onKeyDown:V.func,onKeyPress:V.func,onKeyUp:V.func,onLoadContent:V.func,onMouseDown:V.func,onMouseEnter:V.func,onMouseLeave:V.func,onMouseMove:V.func,onMouseOut:V.func,onMouseOver:V.func,onMouseUp:V.func,onNodeChange:V.func,onObjectResizeStart:V.func,onObjectResized:V.func,onObjectSelected:V.func,onPaste:V.func,onPostProcess:V.func,onPostRender:V.func,onPreProcess:V.func,onProgressState:V.func,onRedo:V.func,onRemove:V.func,onReset:V.func,onSaveContent:V.func,onSelectionChange:V.func,onSetAttrib:V.func,onSetContent:V.func,onShow:V.func,onSubmit:V.func,onUndo:V.func,onVisualAid:V.func,onSkinLoadError:V.func,onThemeLoadError:V.func,onModelLoadError:V.func,onPluginLoadError:V.func,onIconsLoadError:V.func,onLanguageLoadError:V.func},cs=Object.assign({apiKey:V.string,id:V.string,inline:V.bool,init:V.object,initialValue:V.string,onEditorChange:V.func,value:V.string,tagName:V.string,cloudChannel:V.string,plugins:V.oneOfType([V.string,V.array]),toolbar:V.oneOfType([V.string,V.array]),disabled:V.bool,textareaName:V.string,tinymceScriptSrc:V.string,rollback:V.oneOfType([V.number,V.oneOf([!1])]),scriptLoading:V.shape({async:V.bool,defer:V.bool,delay:V.number})},ds),fs=e=>"function"==typeof e,ps=e=>e in ds,hs=e=>e.substr(2),ms=(e,t,n,l,a)=>((e,t,n,l,a,r,i)=>{const o=Object.keys(a).filter(ps),s=Object.keys(r).filter(ps),u=o.filter((e=>void 0===r[e])),d=s.filter((e=>void 0===a[e]));u.forEach((e=>{const t=hs(e),l=i[t];n(t,l),delete i[t]})),d.forEach((n=>{const a=l(e,n),r=hs(n);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,n)=>l=>{var a;return null===(a=t(n))||void 0===a?void 0:a(l,e)}),t,n,l);let gs=0;const vs=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return gs++,e+"_"+n+gs+String(t)},bs=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),ys=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),xs=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Es=()=>({listeners:[],scriptId:vs("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),Cs=(()=>{let e=Es();return{load:(t,n,l,a,r,i)=>{const o=()=>((e,t,n,l,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=n,i.async=l,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,n,l,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=Es()}}})(),Ss=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class ws extends M.Component{constructor(e){var t,n,l,a;super(e),t=this,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=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;var n,l,a;const r=t.elementRef.current;if(!r)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(r)){if(0===e)setTimeout((()=>t.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>t.initialise(e+1)),100)}return}const i=Ss(t.view);if(!i)throw new Error("tinymce should have been loaded into global scope");const o=Object.assign(Object.assign({},t.props.init),{selector:void 0,target:r,readonly:t.props.disabled,inline:t.inline,plugins:(s=null===(n=t.props.init)||void 0===n?void 0:n.plugins,u=t.props.plugins,ys(s).concat(ys(u))),toolbar:null!==(l=t.props.toolbar)&&void 0!==l?l:null===(a=t.props.init)||void 0===a?void 0:a.toolbar,setup:e=>{t.editor=e,t.bindHandlers({}),t.inline&&!bs(r)&&e.once("PostRender",(n=>{e.setContent(t.getInitialValue(),{no_events:!0})})),t.props.init&&fs(t.props.init.setup)&&t.props.init.setup(e)},init_instance_callback:e=>{var n,l;const a=t.getInitialValue();t.currentContent=null!==(n=t.currentContent)&&void 0!==n?n:e.getContent(),t.currentContent!==a&&(t.currentContent=a,e.setContent(a),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const r=null!==(l=t.props.disabled)&&void 0!==l&&l;xs(t.editor,r?"readonly":"design"),t.props.init&&fs(t.props.init.init_instance_callback)&&t.props.init.init_instance_callback(e)}});var s,u;t.inline||(r.style.visibility=""),bs(r)&&(r.value=t.getInitialValue()),i.init(o)},this.id=this.props.id||vs("tiny-react"),this.elementRef=M.createRef(),this.inline=null!==(a=null!==(n=this.props.inline)&&void 0!==n?n:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==a&&a,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const l of[t,n])if(l)try{e.selection.moveToBookmark(l),this.valueCursor=l;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;xs(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,l,a,r;null!==Ss(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&Cs.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!==(l=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==l&&l,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,n;return(null===(n=null===(t=null===(e=Ss(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:e="div"}=this.props;return M.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return M.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){ms(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),l=t(this.props);!n&&l?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!l&&(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 Ts;ws.propTypes=cs,ws.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(Ts||(Ts={}));class Ns extends e.Component{constructor(){super(...arguments),this.defaultOption={height:400,plugins:"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",menubar:"file edit view insert format tools table help",toolbar:"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"}}render(){var e;const{size:t,className:n,style:l,tinymce:a={},upload:r={},thresholdSize:i=.5,tinymceScriptSrc:o,disabled:s,value:d,onResizeEditor:c,onChange:f}=this.props,p=this.context.global,h=this.context.locale,m=t||this.context.size||"",v=dt("tinymce"),b={[v]:!0,[`${v}--lg`]:"large"===m,[`${v}--sm`]:"small"===m},y={init:Object.assign(Object.assign({height:a.height||this.defaultOption.height,plugins:a.plugins||this.defaultOption.plugins,toolbar:a.toolbar||this.defaultOption.toolbar,menubar:a.menubar||this.defaultOption.menubar,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:Ts[h],skin:"tinymce-5"},te.default(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Ye(this,void 0,void 0,(function*(){const{action:n,headers:l,withCredentials:a,dataKey:o}=r,s=`data:image/jpeg;base64,${e.base64()}`,d=new FormData;d.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>i)try{const{data:e}=yield ie.default.post(n,d,{headers:l,withCredentials:a});if(200===e.code){const n=o?g.get(e.data,o):e.data;t(n)}}catch(e){u.message.error(we("qm.uploadCropper.uploadError"))}else t(s)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:l}=e.editorContainer;null==c||c({width:n,height:l},t)}))}}),value:d,disabled:s,tinymceScriptSrc:o||(null===(e=null==p?void 0:p.tinymce)||void 0===e?void 0:e.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==f||f(t.getContent(),t)}};return j.default.createElement("div",{className:ne.default(b,n),style:l},j.default.createElement(ws,y))}}Ns.contextType=xe,Ns.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Tinymce","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")}};class Is extends e.Component{constructor(){super(...arguments),this.imgRef=j.default.createRef()}componentDidMount(){const e=Ue(this.props,["className","style","src","alt","imgStyle"]),t={};for(const n in e)void 0!==this.props[n]&&(t[n]=this.props[n]);this.cropper=new de.default(this.imgRef.current,t)}componentWillUnmount(){this.destroy(),this.cropper=null}reset(){return this.cropper.reset()}clear(){return this.cropper.clear()}initCrop(){return this.cropper.crop()}replace(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.cropper.replace(e,t)}enable(){return this.cropper.enable()}disable(){return this.cropper.disable()}destroy(){return this.cropper.destroy()}move(e,t){return this.cropper.move(e,t)}moveTo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.moveTo(e,t)}relativeZoom(e,t){return this.cropper.zoom(e,t)}zoomTo(e,t){return this.cropper.zoomTo(e,t)}rotate(e){return this.cropper.rotate(e)}rotateTo(e){return this.cropper.rotateTo(e)}scaleX(e){return this.cropper.scaleX(e)}scaleY(e){return this.cropper.scaleY(e)}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.cropper.scale(e,t)}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.cropper.getData(e)}setData(e){return this.cropper.setData(e)}getContainerData(){return this.cropper.getContainerData()}getImageData(){return this.cropper.getImageData()}getCanvasData(){return this.cropper.getCanvasData()}setCanvasData(e){return this.cropper.setCanvasData(e)}getCropBoxData(){return this.cropper.getCropBoxData()}setCropBoxData(e){return this.cropper.setCropBoxData(e)}getCroppedCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.cropper.getCroppedCanvas(e)}setAspectRatio(e){return this.cropper.setAspectRatio(e)}setDragMode(e){return this.cropper.setDragMode(e)}render(){const{className:e,style:t,src:n,alt:l,imgStyle:a}=this.props,r={[dt("cropper")]:!0};return j.default.createElement("div",{className:ne.default(r,e),style:t},j.default.createElement("img",{ref:this.imgRef,src:n,alt:l,style:Object.assign({maxWidth:"100%"},a)}))}}Is.defaultProps={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};class Os extends e.Component{constructor(){super(...arguments),this.beforeUpload=(e,t)=>new Promise(((n,l)=>Ye(this,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:r,maxCount:i,fileList:o=[],beforeUpload:s}=this.props,d=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!r||e.size/1024/1024<r,f=!(i>1)||o.length<i,p=d&&c&&f;if(d||u.message.warning(we("qm.upload.tooltip",{type:a.join(",")})),c||u.message.warning(we("qm.upload.sizeLimit",{size:r})),f||u.message.warning(we("qm.upload.countLimit",{count:i})),!p)return p||u.Upload.LIST_IGNORE;if(s){const a=s(e,t);if(!0===a)return n(e);if(!1===a)return l("not upload");if(a&&"function"==typeof a.then)try{const e=yield a;n(e)}catch(e){l(e)}}else n(e)})))),this.doDownload=e=>Ye(this,void 0,void 0,(function*(){try{e.url&&(yield this.downloadFile(e.url,e.name))}catch(e){u.message.error(we("qm.download.error"))}}))}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}downloadFile(e,t){return Ye(this,void 0,void 0,(function*(){const n=this.props.downloadWithHeaders?{headers:this.props.headers}:null,l=yield ie.default(Object.assign(Object.assign({url:e},n),{responseType:"blob",timeout:0})),a=l.data,r=l.headers["content-disposition"],i=t||(r?r.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));vl(a,i)}))}render(){var e,t;const{fileList:n=[],button:l={},fileDirection:a,disabled:r,readOnly:i,className:o,onPreview:s,onChange:d}=this.props,c=dt("upload-file"),f={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}--horizontal`]:"horizontal"===a};return j.default.createElement(u.Upload,qe({className:ne.default(f,o)},te.default(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:r||i,onChange:d,onPreview:e=>Ye(this,void 0,void 0,(function*(){if("function"==typeof s)return s(e,(t=>this.doDownload(t||e)));r||(yield this.doDownload(e))})),onDownload:e=>Ye(this,void 0,void 0,(function*(){yield this.doDownload(e)}))}),this.props.children||i&&n.length?this.props.children:j.default.createElement(u.Button,{type:null!==(e=l.type)&&void 0!==e?e:"default",icon:null!==(t=l.icon)&&void 0!==t?t:j.default.createElement(b.UploadOutlined,null),disabled:r||i},l.text||we("qm.upload.text")))}}Os.contextType=xe,Os.defaultProps={name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}};class Rs extends e.Component{constructor(){super(...arguments),this.cropperRef=j.default.createRef(),this.state={src:""},this.confirmHandle=()=>Ye(this,void 0,void 0,(function*(){const{quality:e}=this.props,{type:t,name:n,uid:l}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((e=>Ye(this,void 0,void 0,(function*(){let a=new File([e],n,{type:t});Object.assign(a,{uid:l});const{fileTypes:r=[],fileSize:i}=this.props;if(!(!r.length||r.includes(a.name.slice(a.name.lastIndexOf(".")+1).toLowerCase())))return u.message.warning(we("qm.upload.tooltip",{type:r.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(a);const o=this.beforeUploadRef(a,[a]);if("boolean"==typeof o||o){if(!0===o)return this.resolveRef(a);if(!1===o)return this.rejectRef("not upload");if(o&&"function"==typeof o.then)try{const e=yield o,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(a=e),this.resolveRef(a)}catch(e){this.rejectRef(e)}}else Oe("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),t,e),yield tt(100),this.onClose()})),this.onOk=()=>{this.confirmHandle()},this.onClose=()=>{this.setSrc("")}}get previewSize(){const{fixedSize:e}=this.props;return{width:"380px",height:e?`calc(380px * ${e[1]/e[0]})`:"auto"}}setSrc(e){this.setState({src:e})}renderUpload(){const{children:e,beforeCrop:t}=this.props,n=Array.isArray(e)?e[0]:e;if(!n)return null;const l=n.props,{beforeUpload:a}=l,r=Ue(l,["beforeUpload"]);return this.beforeUploadRef=a,j.default.createElement(n.type,Object.assign(Object.assign({},r),{beforeUpload:(e,n)=>new Promise(((l,a)=>Ye(this,void 0,void 0,(function*(){const a=()=>l(u.Upload.LIST_IGNORE);if(t&&!(yield t(e,n)))return void a();this.fileRef=e,this.resolveRef=l,this.rejectRef=a;const r=new FileReader;r.onload=()=>{this.setSrc(r.result),r.onload=null},r.readAsDataURL(e)}))))}))}scaleHandle(e){this.cropperRef.current.relativeZoom(e,void 0)}rotateHandle(e){this.cropperRef.current.rotate(e)}renderCropper(){const{fixedSize:e}=this.props;return j.default.createElement("div",{className:"cropper-preview"},j.default.createElement("div",{className:"cropper-area"},j.default.createElement("div",{className:"img-cropper"},j.default.createElement(Is,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),j.default.createElement("div",{className:"actions"},j.default.createElement(u.Space,{size:"small"},j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},we("qm.uploadCropper.zoomIn")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},we("qm.uploadCropper.zoomOut")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},we("qm.uploadCropper.rotatePlus")),j.default.createElement(u.Button,{type:"primary",size:"middle",icon:j.default.createElement(b.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},we("qm.uploadCropper.rotateSubtract"))))),j.default.createElement("div",{className:"preview-area"},j.default.createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:t}=this.state,n=dt("cropper-preview");return j.default.createElement(j.default.Fragment,null,this.renderUpload(),t&&j.default.createElement(u.Modal,{open:!0,wrapClassName:ne.default(n,e),title:we("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}Rs.contextType=xe;class ks extends e.Component{constructor(){super(...arguments),this.state={previewVisible:!1,currentIndex:0},this.beforeUpload=(e,t)=>new Promise(((n,l)=>Ye(this,void 0,void 0,(function*(){const{fileTypes:a=[],fileSize:r,beforeUpload:i}=this.props,o=!a.length||a.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!r||e.size/1024/1024<r,d=o&&s;if(o||u.message.warning(we("qm.upload.tooltip",{type:a.join(",")})),s||u.message.warning(we("qm.upload.sizeLimit",{size:r})),!d)return d||u.Upload.LIST_IGNORE;if(i){const a=i(e,t);if(!0===a)return n(e);if(!1===a)return l("not upload");if(a&&"function"==typeof a.then)try{const e=yield a;n(e)}catch(e){l(e)}}else n(e)})))),this.handlePreview=e=>{var t;this.setState({currentIndex:(null===(t=this.props.fileList)||void 0===t?void 0:t.findIndex((t=>t.url===e.url)))||0,previewVisible:!0})}}get $size(){var e;return null!==(e=this.context.size)&&void 0!==e?e:""}get showUploadButton(){var e,t;const n=null!==(t=null===(e=this.props.fileList)||void 0===e?void 0:e.length)&&void 0!==t?t:0;return!this.props.maxCount||n<this.props.maxCount}render(){const{previewVisible:e,currentIndex:t}=this.state,{fileList:n=[],fixedSize:l,quality:a,fileTypes:r,fileSize:i,disabled:o,readOnly:s,className:d,popupClassName:c,openCropper:f,beforeCrop:p}=this.props,h=dt("upload-img"),m={[h]:!0,[`${h}--lg`]:"large"===this.$size,[`${h}--sm`]:"small"===this.$size},g=j.default.createElement(u.Upload,qe({className:ne.default(m,d)},te.default(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:o||s,onPreview:this.handlePreview}),!this.showUploadButton||s&&n.length?null:j.default.createElement("div",null,j.default.createElement(b.PlusOutlined,null),j.default.createElement("p",null,we("qm.uploadCropper.dragableText"))));return j.default.createElement(j.default.Fragment,null,f?j.default.createElement(Rs,{className:c,fixedSize:l,quality:a,fileTypes:r,fileSize:i,beforeCrop:p},g):g,j.default.createElement("div",{style:{display:"none"}},j.default.createElement(u.Image.PreviewGroup,{preview:{visible:e,current:t,rootClassName:c,onVisibleChange:e=>{this.setState({previewVisible:e})}}},n.map((e=>j.default.createElement(u.Image,{key:e.uid,src:e.url,alt:""}))))))}}ks.contextType=xe,ks.defaultProps={name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0};const Ps=(e,t,n)=>{let l;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[n]===t)))l=r[n];else{const e=Ps(r.children,t,n);e&&(l=e)}}return l},As=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&As(e.children,t),t(e)||e.children&&e.children.length))),Ls=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Ls(e.children,t)),t(e)&&n.push(e)})),n},Hs=(e,t)=>{let n=null;for(let l=0;l<e.length;l++){if(Array.isArray(e[l].children)&&(n=Hs(e[l].children,t)),n)return n;if(t(e[l]))return e[l]}return n},_s=(e,t,n,l)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:l}):e.children?Object.assign(Object.assign({},e),{children:_s(e.children,t,n,l)}):e)),Fs=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Fs(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},Ds=(e,t,n)=>{for(let l=0;l<e.length;l++){if(e[l][n]===t)return[t];if(Array.isArray(e[l].children)){const a=Ds(e[l].children,t,n);if(a)return[e[l][n],a].flat()}}},$s=(e,t)=>{var n;const l=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>l.push(...$s(e,t)))),l},Ms=j.default.forwardRef(((e,t)=>{const{className:n,style:l,filterable:a=!0,multiple:r,draggable:i,dataSource:o,fetch:s,asyncLoad:d,checkStrictly:c,checkStrategy:f="SHOW_CHILD",placeholder:p=we("qm.form.inputPlaceholder"),fieldsDefine:h,value:m,height:v,defaultSelectedKeys:y=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:C=!0,onSelectChange:S,onCheckChange:w,onDragStart:T,onDragChange:N,onExpand:I}=e,{size:O}=j.default.useContext(xe),R=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:O)&&void 0!==n?n:""}),[e.size,O]),k=(null==h?void 0:h.valueKey)||"value",P=(null==h?void 0:h.textKey)||"text";null==h||h.children;const A=j.default.useRef(null),L=dl(A),[H,_]=j.default.useState(v),[F,D]=j.default.useState(!1),$=cl((()=>{_(A.current.offsetHeight-Z.current.offsetHeight-10)}),5);Vn((()=>{v||$()}),[L.height]);const[M,q]=j.default.useState([]),[V,K]=j.default.useState({}),[z,B]=j.default.useState([]),[W,U]=j.default.useState([]),[G,Y]=j.default.useState(""),[X,Q]=j.default.useState(x),Z=j.default.useRef(null),J=j.default.useRef([]),ee=j.default.useRef([]);j.default.useEffect((()=>{Array.isArray(o)&&(te(o),B(le(o)),K({}))}),[o]),j.default.useEffect((()=>{ie()}),[]),Vn((()=>{ie()}),[null==s?void 0:s.params]),Vn((()=>{U(re())}),[V]),j.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],l=Hs(M,(t=>e===t[k]));l&&(Array.isArray(l.children)?l.children.push(...n):l.children=[...n],te([...M]))},REMOVE_RECORD:e=>{var t;const n=Ps(M,e,k);if(void 0===n&&M.find((t=>t[k]===e)))te(M.filter((t=>t[k]!==e)));else{const l=Hs(M,(e=>n===e[k]));if(!l)return;const a=null===(t=l.children)||void 0===t?void 0:t.findIndex((t=>e===t[k]));a>=0&&(l.children.splice(a,1),te([...M]))}},UPDATE_RECORD:(e,t)=>{const n=Hs(M,(t=>e===t[k]));n&&(g.merge(n,t),te([...M]))}})));const te=e=>{q(e),J.current=e,ee.current=Fs(e,k)},le=e=>{if(r)return y;const t=Ls(e,(e=>y.includes(e[P])));return 1===t.length?[t[0][k]]:[]},ae=e=>{var t;return(null===(t=Ds(M,e,k))||void 0===t?void 0:t.slice(0,-1))||[]},re=()=>{if(x)return ee.current;const e=[];return z.forEach((t=>{if(r){if("SHOW_ALL"===f&&!ee.current.includes(t)&&e.push(...ae(t)),"SHOW_CHILD"===f&&e.push(...ae(t)),"SHOW_PARENT"===f){const n=ja(M,t);if(n){const l=ae(t),a=$s(n,k);e.push(...l,...[t,...a].filter((e=>ee.current.includes(e))))}}}else e.push(...ae(t))})),[...new Set(e)]},ie=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!s)return;const{api:t,params:n,dataKey:l,afterFetch:a,callback:r}=s;try{D(!0);const i=yield t(n);if(200===i.code){let t=Array.isArray(i.data)?i.data:null!==(e=g.get(i.data,l))&&void 0!==e?e:[];t="function"==typeof a?yield a(t):t,te(t),B(le(t)),K({}),null==r||r(t)}}catch(e){}D(!1)})),oe=e=>`${e}|${nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=dt("search-tree"),ue={[se]:!0,[`${se}--lg`]:"large"===R,[`${se}--sm`]:"small"===R};return j.default.createElement("div",{ref:A,className:ne.default(ue,n),style:l},j.default.createElement("div",{ref:Z,className:"topper"},E&&j.default.createElement(u.Input.Search,{value:G,size:R,placeholder:p,allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=As(J.current,(t=>{if(!e)return!0;const n=t[P]||"";return-1!==oe(n).indexOf(e)}));Y(e),q(t),x||e?U(Fs(t,k)):K({})})(e.target.value)}),C&&j.default.createElement("a",{className:"trigger",onClick:()=>{Q(!X),U(X?[]:ee.current)}},X?j.default.createElement(b.UpOutlined,null):j.default.createElement(b.DownOutlined,null)," ",we(X?"qm.form.collect":"qm.form.spread"))),j.default.createElement(rl,{spinning:F},j.default.createElement(u.Tree,{fieldNames:{title:P,key:k,children:"children"},multiple:r,draggable:i,blockNode:i,checkable:r,selectable:!r,height:H,disabled:e.disabled,checkStrictly:c,selectedKeys:null!=m?m:z,checkedKeys:null!=m?m:z,expandedKeys:W,treeData:M,loadData:d?e=>{let{key:t,children:n}=e;return Ye(void 0,void 0,void 0,(function*(){var e;if(!s||n)return;const{api:l,params:a,dataKey:r,formatter:i=(e=>e),afterFetch:o}=s;try{const n=yield l(i(Object.assign(Object.assign({},a),{[k]:t})));if(200===n.code){let l=Array.isArray(n.data)?n.data:null!==(e=g.get(n.data,r))&&void 0!==e?e:[];l="function"==typeof o?yield o(l):l;const a=_s(J.current,t,k,l);te(a)}}catch(e){}}))}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!G)return!1;const t=e[P]||"";return-1!==oe(t).indexOf(G)},onDragStart:T,onDragEnter:e=>{U(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,l=e.node.pos.split("-"),a=e.dropPosition-Number(l[l.length-1]),r=(e,t,n)=>{for(let l=0;l<e.length;l++){if(e[l][k]===t)return n(e[l],l,e);e[l].children&&r(e[l].children,t,n)}},i=[...M];let o;if(r(i,n,((e,t,n)=>{n.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,n=[];r(i,t,((t,l,a)=>{n=a,e=l})),-1===a?n.splice(e,0,o):n.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));te(i)},onDragEnd:e=>{null==N||N(e,M)},onExpand:(e,t)=>{at(e)&&Q(!1),ee.current.every((t=>e.includes(t)))&&Q(!0),U(e),null==I||I(e,t)},onSelect:e=>{B(e);const t=Ls(J.current,(t=>e.includes(g.get(t,k))));null==S||S(r?t:t[0])},onCheck:e=>{c&&(e=e.checked),B(e),"SHOW_CHILD"===f&&(e=e.filter((e=>!ee.current.includes(e)))),"SHOW_PARENT"===f&&(e=e.filter(((e,t,n)=>!n.includes(Ps(M,e,k)))));const t=Ls(J.current,(t=>e.includes(g.get(t,k))));null==w||w(r?t:t[0])}})))}));Ms.displayName="QmSearchTree";const js=e.createContext(void 0),qs={dataIndex:q.default.string.isRequired,title:q.default.string.isRequired,description:q.default.string,colSpan:q.default.number,width:q.default.number,minWidth:q.default.number,fixed:q.default.oneOf(["left","right"]),align:q.default.oneOf(["left","center","right"]),theadAlign:q.default.oneOf(["left","center","right"]),printFixed:q.default.bool,hidden:q.default.bool,noAuth:q.default.bool,noFixed:q.default.bool,ellipsis:q.default.bool,className:q.default.string,theadClassName:q.default.string,children:q.default.array,sorter:q.default.oneOfType([q.default.bool,q.default.func]),filter:q.default.shape({type:q.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:q.default.arrayOf(q.default.shape({text:q.default.string,value:q.default.oneOfType([q.default.string,q.default.number])})),style:q.default.object}),precision:q.default.number,displayPrecision:q.default.number,formatType:q.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:q.default.bool,canCopy:q.default.bool,editRender:q.default.func,dictItems:q.default.arrayOf(q.default.shape({text:q.default.string,value:q.default.oneOfType([q.default.string,q.default.number])})),summation:q.default.shape({sumBySelection:q.default.bool,displayWhenNotSelect:q.default.bool,dataKey:q.default.string,unit:q.default.string,render:q.default.func}),groupSummary:q.default.shape({dataKey:q.default.string,unit:q.default.string,render:q.default.func}),shouldCellUpdate:q.default.func,headRender:q.default.func,render:q.default.func};q.default.arrayOf(q.default.shape(qs)).isRequired,q.default.func,q.default.array,q.default.oneOfType([q.default.string,q.default.func]).isRequired,q.default.number,q.default.bool,q.default.bool,q.default.shape({api:q.default.func.isRequired,params:q.default.object.isRequired,formatter:q.default.func,beforeFetch:q.default.func,afterFetch:q.default.func,stopToFirst:q.default.bool,dataKey:q.default.string,callback:q.default.func}),q.default.bool,q.default.bool,q.default.string,q.default.string,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.oneOfType([q.default.object,q.default.func]),q.default.oneOfType([q.default.object,q.default.func]),q.default.array,q.default.func,q.default.bool,q.default.bool,q.default.object,q.default.object,q.default.shape({type:q.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:q.default.array,selectedRowKeys:q.default.array,hideSelectAll:q.default.bool,checkStrictly:q.default.bool,filterable:q.default.bool,selectByClickRow:q.default.bool,selectFirstRowOnChange:q.default.bool,clearableAfterFetched:q.default.bool,selectAllOnCurrentPage:q.default.bool,fetchSelectedRows:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),fetchAllRowKeys:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),disabled:q.default.func,onChange:q.default.func,onSelect:q.default.func,onSelectAll:q.default.func}),q.default.shape({currentRowKey:q.default.oneOfType([q.default.number,q.default.string]),disabled:q.default.func,onChange:q.default.func}),q.default.shape({virtual:q.default.bool,expandIconColumn:q.default.string}),q.default.shape({defaultExpandAllRows:q.default.bool,defaultExpandedRowKeys:q.default.array,expandedRowKeys:q.default.array,hideExpandAll:q.default.bool,rowExpandable:q.default.func,expandedRowClassName:q.default.string,expandedRowRender:q.default.func,onExpand:q.default.func,onChange:q.default.func}),q.default.shape({groupItems:q.default.arrayOf(q.default.shape({dataIndex:q.default.string.isRequired,titleIndex:q.default.string,color:q.default.string,backgroundColor:q.default.string})),fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),onChange:q.default.func}),q.default.func,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.shape({current:q.default.number,pageSize:q.default.number,pageSizeOptions:q.default.array,showSizeChanger:q.default.bool,showQuickJumper:q.default.bool}),q.default.shape({fileName:q.default.string,fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object}),beforeExport:q.default.func,cellStyle:q.default.bool,hideIcon:q.default.bool}),q.default.shape({showLogo:q.default.bool}),q.default.shape({fetch:q.default.shape({api:q.default.func.isRequired,params:q.default.object,dataKey:q.default.string}),fieldList:q.default.arrayOf(q.default.object)}),q.default.shape({position:q.default.oneOf(["top","bottom"]),hideAlert:q.default.bool,hideClearButton:q.default.bool}),q.default.oneOf(["left","right"]),q.default.func,q.default.func,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.bool,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func,q.default.func;const Vs=10,Ks="1",zs="0",Bs="YYYY-MM-DD",Ws="YYYY-MM-DD HH:mm:ss",Us="YYYYMMDDHHmmss",Gs={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 Ys;!function(e){e.left="flex-start",e.right="flex-end"}(Ys||(Ys={}));let Xs=[];const Qs={getFocusInstance:function(){var e;return null!==(e=Xs[0])&&void 0!==e?e:null},getInstance:function(e){var t;return null!==(t=Xs.find((t=>t.id===e)))&&void 0!==t?t:null},focus:function(e){const t=this.getInstance(e);t&&0!==Xs.findIndex((e=>e===t))&&(this.deregister(e),Xs=[t,...Xs])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Xs=[{id:e,vm:t},...Xs])},deregister:function(e){e&&(Xs=Xs.filter((t=>t.id!==e)))}};class Zs{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=[]},this.destroy=()=>{for(const e in this)this[e]=null}}}const Js={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:150,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored"};let eu;const tu=()=>{var e;if(Xe)return 0;if(void 0!==eu)return eu;const t=document.createElement("div");t.className="qm-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const l=document.createElement("div");l.style.width="100%",t.appendChild(l);const a=l.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),eu=n-a,eu},nu=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=nu(t.children)),t})),lu=(e,t)=>{const{fetch:n,columns:l,height:a,minHeight:r,maxHeight:i,border:o=!0,rowSelection:s,summation:u,expandable:d,treeConfig:c,webPagination:f,scrollPagination:p,dragMergeCell:h,showSuperSearch:m,showFastSearch:g,showGroupSummary:v,showTableImport:b,showClipboard:y,showSelectCollection:x,footRender:E}=e,{tableRef:C,tableFullData:S,tableData:w,selectionKeys:T,sorter:N,filters:I,superFilters:O,pagination:R}=t,{selectionRows:k,summaries:P}=C.current,{expandIconColumn:A=""}=c||{},L=e=>{const t=(e=>{const t=[],n=[],l=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?n.push(r):l.push(r)}return[...t,...l,...n]})(nu(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Js.selectionColumn,title:"radio"===t?we("qm.table.config.selectionText"):"",width:Js.selectionColumnWidth,fixed:"left",type:t}})(s),l=(null==(a=d)?void 0:a.expandedRowRender)?{dataIndex:Js.expandableColumn,title:"",width:Js.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return n&&t.unshift(n),l&&t.unshift(l),zl(t)},H=j.default.useMemo((()=>!!(null==n?void 0:n.api)),[null==n?void 0:n.api]),_=j.default.useMemo((()=>!H&&!!f),[H,f]),F=j.default.useMemo((()=>H&&!!p),[H,p]),D=j.default.useMemo((()=>(H||_)&&!F),[H,_,F]),$=j.default.useMemo((()=>!!(a||r||i)),[a,r,i]),M=j.default.useMemo((()=>L(l)),[l]),q=j.default.useMemo((()=>Kl(M)),[M]),V=j.default.useMemo((()=>q.filter((e=>"function"==typeof e.editRender))),[q]),K=j.default.useMemo((()=>q.filter((e=>!!e.summation))),[q]),z=j.default.useMemo((()=>q.filter((e=>"left"===e.fixed))),[q]),B=j.default.useMemo((()=>q.filter((e=>"right"===e.fixed))),[q]),W=j.default.useMemo((()=>{var e,t;const n=q.filter((e=>![Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(e.dataIndex)));return A&&n.some((e=>e.dataIndex===A))?A:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[q,A]),U=j.default.useMemo((()=>K.length>0),[K]),G=j.default.useMemo((()=>!!E||U),[E,U]),Y=j.default.useMemo((()=>Jl(M).length>1),[M]),X=j.default.useMemo((()=>o||Y),[o,Y]),Q=j.default.useMemo((()=>q.some((e=>e.sorter))),[q]),Z=j.default.useMemo((()=>q.some((e=>e.filter))),[q]),J=j.default.useMemo((()=>K.some((e=>!!e.summation.dataKey))),[K]),ee=j.default.useMemo((()=>!H&&!!b),[H,b]),te=j.default.useMemo((()=>!!y&&V.length>0),[y,V]),ne=j.default.useMemo((()=>!!x&&"checkbox"===(null==s?void 0:s.type)),[x,s]),le=j.default.useMemo((()=>!!m&&Z),[m,Z]),ae=j.default.useMemo((()=>!H&&!!g&&Z),[H,g,Z]),re=j.default.useMemo((()=>!!v&&q.some((e=>!!e.groupSummary))),[q]),ie=j.default.useMemo((()=>{var e;return!!(null===(e=null==u?void 0:u.groupItems)||void 0===e?void 0:e.length)}),[u]),oe=j.default.useMemo((()=>!!h&&!H&&!f),[h,H,f]),se=j.default.useMemo((()=>S.some((e=>Array.isArray(e.children)))),[S]),ue=j.default.useMemo((()=>!w.length),[w]),de=j.default.useMemo((()=>(()=>{const e={};return K.forEach((t=>{const{dataIndex:n,precision:l,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,u=ie?ha(C.current.tableFullData):C.current.tableFullData,d=!k.length&&!!o;let c=(!i||d?u:k).reduce(((e,t)=>{if(null==t?void 0:t[Js.summaryIgnore])return e;const l=la(t,n);return ia(l)?e.plus(l):e}),new ce.default(0));!Object.keys(P).includes(n)||i&&!d||(c=new ce.default(la(P,n))),aa(e,n,c.toNumber());let f=l>=0?c.toFixed(l):c.toString();a>=0&&""!==f&&(f=sa(f,a)),f=oa(f),aa(e,`${n}_text`,s?`${f} ${s}`:f)})),[e]})()),[w,T,P]),fe=j.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(K)),[K]),pe=j.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(N),l=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[l,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{n.push({type:a,bracketLeft:"",fieldName:l,expression:e,value:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(I,O),a=t?{[Js.sorterFieldName]:t}:null,r=l.length?{[Js.filterFieldName]:l}:null,i=fe?{[Js.groupSummary.summaryFieldName]:fe,usedJH:1}:null,o=null!==(e=null==n?void 0:n.params)&&void 0!==e?e:null,s={[Js.currentPageName]:R.current,[Js.pageSizeName]:R.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==n?void 0:n.params,R.current,R.pageSize,N,I,O,fe]);return{isFetch:H,isWebPagination:_,isScrollPagination:F,showPagination:D,shouldUpdateHeight:$,tableColumns:M,flattenColumns:q,editableColumns:V,summationColumns:K,leftFixedColumns:z,rightFixedColumns:B,treeExpandIndex:W,showSummary:U,showFooter:G,isHeadGroup:Y,bordered:X,isHeadSorter:Q,isHeadFilter:Z,isServiceSummation:J,isSelectCollection:ne,isTableImport:ee,isTableClipboard:te,isSuperSearch:le,isFastSearch:ae,isGroupSummary:re,isGroupSubtotal:ie,isDragMergeCell:oe,isTreeTable:se,isTableEmpty:ue,summationRows:de,fetchParams:pe}};function au(e){const t=M.useRef();t.current=e;const n=M.useCallback((function(){for(var e,n=arguments.length,l=new Array(n),a=0;a<n;a++)l[a]=arguments[a];return null===(e=t.current)||void 0===e?void 0:e.call(t,...l)}),[]);return n}const ru=(e,t)=>{const n=M.useRef(!0);M.useLayoutEffect((()=>e(n.current)),t),M.useLayoutEffect((()=>(n.current=!1,()=>{n.current=!0})),[])};function iu(e,t){ru((t=>{if(!t)return e()}),t)}const ou=(e,t)=>{const{rowKey:n,dataSource:l,summation:a,fetch:r,initialSorter:i,initialFilter:o,rowSelection:s,expandable:u,treeConfig:d,authConfig:c,ignorePageIndex:f,columnsChange:p,onChange:h,onDataChange:m,onDataLoad:v,onScrollEnd:b,onFetchError:y}=e,{getRowKey:x,tableRef:E,tableElementRef:C,tableBodyRef:S,$size:w,tableColumns:T,flattenColumns:N,tableFullData:I,pagination:O,layout:R,filters:k,sorter:P,superFilters:A,fetchParams:L,selectionKeys:H,rowExpandedKeys:_,highlightKey:F,summationColumns:D,shouldUpdateHeight:$,isFetch:M,isTreeTable:q,isWebPagination:V,isScrollPagination:K,isServiceSummation:z,isGroupSubtotal:B,doLayout:W,setTableData:U,setTableFlatColumns:G,setTableFullData:Y,setTableOriginData:X,setAllTableData:Q,setDeriveRowKeys:Z,setPagination:J,setSpinning:ee,setSorter:ne,setFilters:le,setSuperFilters:ae,setSelectionKeys:re,setRowExpandedKeys:ie,setHighlightKey:oe,setSelectionRows:se,setScrollXLoad:ue,setScrollYLoad:de,setScrollXStore:ce,setScrollYStore:fe,computeVirtualX:pe,computeVirtualY:he,setFieldAuth:me,setResizeState:ge,setSummaries:ve,setPermission:be,setRecordsMap:ye,resetTableScroll:xe,clearElementStore:Ee,clearRecordsMap:Ce}=t,{store:Se}=E.current,we=dl(C),Te=j.default.useRef(Object.assign({},L)),Ne=j.default.useRef(new Map),Ie=j.default.useRef(!1);Vn((()=>{W(),He(),E.current.scrollXLoad&&Fe()}),[T,w,R.tableAutoHeight]),iu((()=>{Re()}),[we]),Vn((()=>{xt(),Et(),Ct(),M||(V&&ct(),rt(l)),i&&ne(i),o&&le(o)}),[l,null==r?void 0:r.params]),Vn((()=>{const e=Ze(L,Te.current);e||M&&(null==s?void 0:s.clearableAfterFetched)&&St(),!e&&L[Js.currentPageName]>1&&!(null==r?void 0:r.stopToFirst)?ct():M&&nt(),Te.current=L}),[L]),Vn((()=>{V&&gt(),K||xe(),Ge()}),[O.current,O.pageSize]),Vn((()=>{M||Pe(I.length),W()}),[I]),Vn((()=>{q&&(null==d?void 0:d.virtual)&&(ft(),gt())}),[_]);const Re=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:n}=E.current,{height:l}=n,{width:a,height:r}=we,i=r!==l;W(),e&&Fe(),i&&$&&t&&gt(),ge(Object.assign({},n,{width:a,height:r}))},ke=()=>{F&&S.current.setClickedValues([F,""]),"radio"===(null==s?void 0:s.type)&&H.length&&S.current.setClickedValues([H[0],""])},Pe=e=>{e!==O.total&&J((t=>Object.assign({},t,{total:e})))},Ae=e=>{Ie.current=e},Le=cl((e=>{st(),null==b||b(e)})),He=()=>{ue(N.length>Js.virtualScrollX)},_e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollXStore:t}=E.current,{startIndex:n,endIndex:l,offsetSize:a}=t,{toVisibleIndex:r,visibleSize:i}=pe(e,R.tableWidth),o=Math.max(0,r-1-a),s=r+i+a;(r<=n||r>=l-i-1)&&(n===o&&l===s||(ce(Object.assign({},t,{startIndex:o,endIndex:s})),Fe()))},Fe=()=>{De(),$e()},De=()=>{const{scrollXLoad:e,scrollXStore:t}=E.current;if(!e)return;const n=[],l=[],a=[];for(let e=0;e<N.length;e++){const r=N[e];r.fixed?"left"===r.fixed?n.push(r):a.push(r):e>=t.startIndex&&e<t.endIndex&&l.push(r)}G([...n,...l,...a])},$e=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:n}=E.current,{tableBodyWidth:l,gutterWidth:a}=R;if(!n)return;const r=`${N.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,i=`${scrollY?l-a:l}px`;e.$tableBody.style.marginLeft=r,e.$tableXspace.style.width=i},Me=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=E.current,{startIndex:n,endIndex:l,offsetSize:a,visibleSize:r,rowHeight:i}=t,{toVisibleIndex:o}=he(e,i),s=Math.max(0,o-1-a),u=o+r+a;(o<=n||o>=l-r-1)&&(n===s&&l===u||(fe(Object.assign({},t,{startIndex:s,endIndex:u})),gt()))},je=e=>B?qe(Ve(e,0)):e,qe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...qe(e.children)),delete e.children,t.push(e)})),t},Ve=(e,t)=>{var l;const r=null===(l=a.groupItems)||void 0===l?void 0:l[t];if(!r)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return ga(e,[r.dataIndex]).map((e=>{const l={children:Ve(e,t+1),_group:r.dataIndex};return"function"!=typeof n&&aa(l,n.toString(),ca()),r.titleIndex&&aa(l,r.titleIndex,la(e[0],r.titleIndex)),aa(l,r.dataIndex,la(e[0],r.dataIndex)),D.forEach((e=>{var t;const{dataIndex:n}=e,a=null===(t=l.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Js.summaryIgnore])return e;const l=Number(la(t,n));return Number.isNaN(l)?e:e+l}),0);aa(l,n,a)})),l}))},Ke=e=>{re(e),se((e=>{const{selectionRows:t,allTableData:n,recordsMap:l}=E.current;if(M)return[...t.filter((t=>e.includes(x(t,t.index)))),...n.filter((n=>{const l=x(n,n.index);return e.includes(l)&&-1===t.findIndex((e=>x(e,e.index)===l))}))];const a=[];for(let t=0,n=e.length;t<n;t++){const n=e[t];l.has(n)&&a.push(l.get(n))}return a})(e))},ze=e=>{const{type:t,checkStrictly:n=!0}=s||{},l=Array.isArray(e)?e:H;let a=[];return E.current.treeTable&&!n&&l.forEach((e=>{a.push(...((e,t)=>{var n;const{disabled:l}=s||{},{deriveRowKeys:a,recordsMap:r}=E.current,i=Ql(a,e);let o=[];if(!i)return o;const u=We((null==i?void 0:i.children)||[]);return o=[...new Set([...t,...u])],l&&(o=o.filter((e=>!r.has(e)||!l(r.get(e))))),((null===(n=ba(a,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ql(a,e),l=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=l?[...o,e]:o.filter((t=>t!==e))})),o})(e,l))})),a="radio"===t?l.slice(0,1):[...new Set([...l,...a])],a},Be=e=>{const{allRowKeys:t,flattenRowKeys:n}=E.current,{defaultExpandAllRows:l,expandedRowRender:a}=u||{},r=Array.isArray(e)?e:_;if(E.current.treeTable){a&&Oe("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...H];F&&e.unshift(F);let i=[];return e.forEach((e=>{const t=ba(E.current.deriveRowKeys,e)||[];i.push(...t.length>1?t.slice(0,-1).reverse():t)})),i=l?t:[...new Set([...r,...i])],i.filter((e=>!n.includes(e)))}return u?l?t.slice(0):[...r]:[]},We=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...We(e[n].children)),t.push(e[n].rowKey);return t},Ue=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Ue(e.children,t)),e.rowKey===t&&e.parentRowKey&&n.push(e.parentRowKey)})),n.length&&n.push(...Ue(e,n[n.length-1])),n},Ge=cl((()=>{null==h||h(O,Qe(k),Xe(P),A,{currentDataSource:ht()})})),Xe=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},Qe=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[l,a]=n.split("|");t[`${l}|${a}`]=e[n]}return t},Ze=(e,t)=>{const n=Object.keys(na(e,t));return 1===n.length&&(n.includes(Js.currentPageName)||n.includes(Js.pageSizeName))},Je=()=>Ye(void 0,void 0,void 0,(function*(){var t;if(!c)return;let n=te.default(c,["fetch"]);if(c.fetch){const{api:e,params:l,dataKey:a}=c.fetch;try{const r=yield e(l);200===r.code&&(n=null!==(t=a?g.get(r.data,a):r.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:l=1}=n;be((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!l})))}if(Array.isArray(n.fieldList)){const{originColumns:t}=E.current,l=Wl(e.columns,(e=>{const{dataIndex:l}=e,a=n.fieldList.find((e=>e.dataIndex===l));if(a){const{visible:n=1,disabled:r,secretName:i}=a,o=Ul(t,l);me(l,{visible:n,disabled:r,secretName:i}),n||(e.noAuth=!0,o.noAuth=!0),i&&(e.formatType=`secret-${i}`,o.formatType=`secret-${i}`)}}));null==p||p(l)}})),tt=au((()=>Ye(void 0,void 0,void 0,(function*(){var e,t,n;if(!r)return;const{formatter:l=(e=>e),beforeFetch:i=et,afterFetch:o,callback:s}=r;if(!i(L))return;const u=!!(null===(e=null==a?void 0:a.fetch)||void 0===e?void 0:e.api);ee(!0);try{const[e,i]=u?yield Promise.all([r.api(l(L)),a.fetch.api(l(L))]):[yield r.api(l(L))];if(E.current.unMounted)return;if(u?200===e.code&&200===i.code:200===e.code){const l=null!==(t=r.dataKey)&&void 0!==t?t:Js.dataKey;let a=null!==(n=g.get(e.data,l))&&void 0!==n?n:[];a="function"==typeof o?yield o(a):a;const u=g.get(e.data,l.replace(/[^.]+$/,Js.totalKey))||a.length||0,d=Math.max(Math.ceil(u/O.pageSize),1);if(L[Js.currentPageName]>d)return ut(Object.assign(Object.assign({},O),{current:d}));rt(Ie.current?E.current.tableFullData.concat(a):a),Pe(u),it((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==y||y(e)}var d,c;d=r,c="stopToFirst",Object.prototype.hasOwnProperty.call(d,c)&&(r.stopToFirst=!1),ee(!1),Ae(!1)})))),nt=cl(tt),lt=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=lt(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:n}=O;return!M||K?e:(t-1)*n+e})(t)),e))),rt=e=>{const t=je(lt(e));vt(t),bt(t),yt(),Ke(ze()),ie(Be()),ot(),null==v||v(t)},it=e=>{var t,n,l;if(!z)return;const r=null!==(n=null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:Js.summationKey,i=null!==(l=r?g.get(e,r):e)&&void 0!==l?l:{},o={};D.filter((e=>!!e.summation.dataKey)).forEach((e=>{aa(o,e.dataIndex,Number(la(i,e.summation.dataKey)))})),ve(o)},ot=()=>{const{type:e,selectFirstRowOnChange:t}=s||{};if("radio"===e&&t){const e=ht();if(e.length){const t=x(e[0],e[0].index);Ke([t])}else Ke([])}},st=()=>{if(!K)return;const e=dt();Ie.current||O.current>=e||(Ae(!0),ut(Object.assign(Object.assign({},O),{current:O.current+1})))},ut=e=>{let{current:t,pageSize:n}=e;J((e=>Object.assign({},e,{current:t,pageSize:n})))},dt=()=>{const{pageSize:e,total:t}=O;return Math.ceil(t/e)||1},ct=()=>{ut(Object.assign({},O,{current:1}))},ft=()=>{if(!E.current.treeTable||!(null==d?void 0:d.virtual))return;const e=pt(E.current.deriveRowKeys,(()=>{const{allTableData:e,allRowKeys:t}=E.current,{rowExpandable:n}=u||{},l=[];return"function"==typeof n&&e.forEach(((e,a)=>!n(e)&&l.push(t[a]))),l.length?_.filter((e=>!l.includes(e))):_})());Ne.current.clear(),e.forEach(((e,t)=>Ne.current.set(e,t)))},pt=(e,t)=>{const n=[];return e.forEach((e=>{if(e.children&&n.push(...pt(e.children,t)),void 0===e.parentRowKey)n.push(e.rowKey);else if(t.includes(e.parentRowKey)){e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1))&&n.push(e.rowKey)}})),n},ht=()=>V?(()=>{const{current:e,pageSize:t}=O;return E.current.tableFullData.slice((e-1)*t,e*t)})():E.current.tableFullData,mt=e=>{const{scrollYLoad:t,scrollYStore:n}=E.current;U(t?e.slice(n.startIndex,n.endIndex):e)},gt=()=>{let e=ht();E.current.treeTable&&(null==d?void 0:d.virtual)&&(e=(e=>{const{allTableData:t,allRowKeys:n}=E.current,l=[];for(let e=0,a=n.length;e<a;e++){const a=n[e];Ne.current.has(a)&&l.push(t[e])}return l})()),de(e.length>Js.virtualScrollY),(e=>{const{elementStore:t,scrollYStore:n,scrollYLoad:l}=E.current,{startIndex:a,rowHeight:r}=n;if(!l)return;const i=`translateY(${Math.max(0,a*r)+"px"})`,o=e.length*r+"px";t.$tableBody.style.transform=i,t.$tableYspace.style.height=o})(e),mt(e)},vt=e=>{Y(e),Q(e),Z(e),ft(),gt()},bt=e=>{X(e)},yt=()=>{const{allTableData:e}=E.current;Ce(),e.forEach((e=>ye(x(e,e.index),e)))},xt=()=>{ne({})},Et=()=>{le({})},Ct=()=>{ae([])},St=()=>{Ke([])};return{initialTable:()=>{Je(),ke(),He(),M?tt():rt(l)},checkDataIndex:()=>{const e=N.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&Oe("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:vt,getTableData:tt,handleTableData:mt,createTableData:rt,createGroupData:je,createSelectionKeys:ze,createRowExpandedKeys:Be,setSelectionKeysEffect:Ke,findParentRowKeys:Ue,getAllChildRowKeys:We,doFieldValidate:(e,t,n,l)=>{if(!Array.isArray(e))return Oe("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Se.removeFromRequired({x:n,y:l}),Se.removeFromValidate({x:n,y:l}),e.forEach((e=>{var a;e.required&&at(t)&&Se.addToRequired({x:n,y:l,text:e.message}),"function"!=typeof e.validator||(null===(a=e.validator)||void 0===a?void 0:a.call(e,t))||Se.addToValidate({x:n,y:l,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:l,removed:a}=Se.state,r=g.intersection(n,a),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:n.filter((e=>!r.includes(e))),updated:l.filter((e=>![...g.intersection(l,n),...g.intersection(l,a)].includes(e))),removed:a.filter((e=>!r.includes(e)))}},dataChange:()=>{null==m||m(E.current.tableFullData)},tableChange:Ge,toLastPage:()=>{const e=dt();O.current!==e&&ut(Object.assign({},O,{current:e}))},toFirstPage:ct,getPageCount:dt,pagerChangeHandle:ut,triggerScrollXEvent:e=>{_e(e)},triggerScrollYEvent:e=>{Me(e)},scrollBottomDebouncer:Le,clearTableSorter:xt,clearTableFilter:Et,clearSuperFilters:Ct,clearRowSelection:St,clearRowHighlight:()=>{oe("")},clearTableLog:()=>{Se.clearAllLog()},destroy:()=>{Ee(),Se.destroy(),Qs.deregister(E.current.uid)}}},su=(e,t)=>{const{height:n,minHeight:l,maxHeight:a,ellipsis:r,showHeader:i,spanMethod:o}=e,{getRowKey:s,tableRef:u,$size:d,tableColumns:c,flattenColumns:f,leftFixedColumns:p,layout:h,scrollX:m,scrollY:v,tableData:b,showFooter:y,showPagination:x,isWebPagination:E,isFullScreen:C,setLayout:S,setScrollX:w,setScrollY:T,setElementStore:N,setScrollXStore:I,setScrollYStore:O,setShouldToTop:R}=t,k=j.default.useRef(v),P=j.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=h,r={};return l&&Object.assign(r,{minHeight:`${ta(l)}px`}),a&&Object.assign(r,{maxHeight:`${ta(a)}px`}),C?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${e}px`}):n?Object.assign(Object.assign({},r),{height:"auto"!==n?`${ta(n)}px`:`${t}px`}):r}),[n,a,l,C,h]),A=()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=u.current;if(!e.$table.offsetParent)return;const l=e.$table.offsetHeight,a=i?e.$header.offsetHeight:h.headerHeight,r=y?e.$footer.offsetHeight:h.footerHeight,o=l-a-r,s=e.$tableBody.offsetHeight,d=t||s>o;let c=0;if(C){const t=e.$toper?e.$toper.offsetHeight+Vs:0,l=e.$pager?e.$pager.offsetHeight+Vs:0;c=n.winHeight-t-l-20}(t||o!==h.viewportHeight)&&_(o),k.current=d,T(d),S((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:o,tableBodyHeight:s,tableFullHeight:c})))},L=e=>{const{scrollXStore:t,isIE:n,scrollBarRef:l}=u.current,a=l.current.scrollLeft,{toVisibleIndex:r,visibleSize:i}=H(a,e),o=n?5:0,s=Math.max(0,r-1-o),d=Math.max(r+i+o,t.endIndex);I(Object.assign({},t,{visibleSize:i,offsetSize:o,startIndex:s,endIndex:d}))},H=(e,t)=>{const n=e+t;let l=-1,a=0,r=0;for(let t=0,i=f.length;t<i;t++){const i=f[t];if(a+=i.width||i.renderWidth,-1===l&&e<a&&(l=t),l>=0&&(r++,a>n))break}return{toVisibleIndex:Math.max(0,l),visibleSize:Math.max(8,r)}},_=e=>{const{scrollBarRef:t,scrollYStore:n,isIE:l}=u.current,a=t.current.scrollTop,{rowHeight:r}=n,{toVisibleIndex:i}=F(a,r),o=Math.max(8,Math.ceil(e/r)+2),s=l?5:0,d=Math.max(0,i-1-s),c=Math.max(i+o+s,n.endIndex);O(Object.assign({},n,{visibleSize:o,offsetSize:s,startIndex:d,endIndex:c}))},F=(e,t)=>{const n=Math.floor(e/t);return{toVisibleIndex:Math.max(0,n)}},D=(e,t)=>{const{elementStore:n,scrollYStore:l,allTableData:a}=u.current,r=n.$tableBody.parentNode.parentNode;if(void 0!==t&&t>=0)r.scrollTop=t*l.rowHeight;else{const t=(E?Zl(b):a).findIndex((t=>e===s(t,t.index)));r.scrollTop=(t<0?0:t)*l.rowHeight}};return{createElementStore:e=>{Object.keys(e).forEach((t=>{N(t,e[t])}))},tableStyles:P,getSpan:(e,t,n,l,a)=>{let r=1,i=1;if("function"==typeof o){const s=o({row:e,column:t,rowIndex:n,columnIndex:l,tableData:a});Array.isArray(s)?(r=s[0],i=s[1]):g.isPlainObject(s)&&(r=s.rowSpan,i=s.colSpan)}const{mergeCells:s}=u.current;if(s.length>0){const e=s.find((e=>e.row===n&&e.col===l));e&&(r=e.rowSpan,i=e.colSpan)}return{rowSpan:r,colSpan:i}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Gl(Ul(c,e)).dataIndex);let t=0;for(let n=0;n<f.length;n++){const l=f[n];if(l.dataIndex===e)break;t+=ta(l.width||l.renderWidth||0)}return t},getStickyRight:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Yl(Ul(c,e)).dataIndex);let t=0;for(let n=f.length-1;n>=0;n--){const l=f[n];if(l.dataIndex===e)break;t+=ta(l.width||l.renderWidth||0)}return t},scrollXToColumn:(e,t)=>{const{elementStore:n}=u.current,l=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const a=p.map((e=>e.width||e.renderWidth||Js.defaultColumnWidth)).reduce(((e,t)=>e+t),0);n.$tableBody.parentNode.parentNode.scrollLeft=n.$tableBody.querySelectorAll("tbody > tr > td")[l].offsetLeft-a},scrollYToRecord:D,rowInViewport:e=>{const{elementStore:t,scrollYStore:n}=u.current,{viewportHeight:l,gutterWidth:a}=h,r=e*n.rowHeight,i=t.$tableBody.parentNode.parentNode;return!(r<i.scrollTop||r+n.rowHeight>i.scrollTop+(m?l-a:l))},calcTableHeight:()=>{if("auto"!==n)return;const{elementStore:e,resizeState:t}=u.current,l=t.winHeight-e.$table.getBoundingClientRect().top-(x?yr["small"!==d?"middle":d]+Vs:0)-Vs;S((e=>Object.assign({},e,{tableAutoHeight:l})))},resetTableScroll:()=>{const{shouldToTop:e}=u.current;e&&D("",0),R(!0)},computeVirtualX:H,computeVirtualY:F,doLayout:()=>{r?A():nt((()=>A())),(()=>{const{elementStore:e,scrollXLoad:t}=u.current,n=e.$table.clientWidth,l=k.current?h.gutterWidth:0,{defaultColumnWidth:a}=Js,r=[];let i=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,i+=e.width):(e.renderWidth=void 0,r.push(e))})),r.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||a)),0);if(e<=n-l){w(!1);const t=n-l-e;if(1===r.length)r[0].renderWidth=(r[0].minWidth||a)+t;else{const e=t/r.reduce(((e,t)=>e+(t.minWidth||a)),0);let n=0;r.forEach(((t,l)=>{if(0===l)return;const r=Math.floor((t.minWidth||a)*e);n+=r,t.renderWidth=(t.minWidth||a)+r})),r[0].renderWidth=(r[0].minWidth||a)+t-n}}else w(!0),r.forEach((e=>{e.renderWidth=e.minWidth||a}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else i=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||a)),0),w(i>n),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:i})));S((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&L(n)})()}}},uu=(e,t)=>{const{columns:n,summation:l,rowSelection:a,expandable:r,rowHighlight:i,mergeCells:o=[]}=e,{tableRef:s,topElementRef:u,tableElementRef:d,tableBodyRef:c,$size:f,scrollX:p,pagination:h,selectionKeys:m,rowExpandedKeys:v,highlightKey:b,summationRows:y,showSummary:x,isWebPagination:E,isScrollPagination:C,isTreeTable:S,checkDataIndex:w,toLastPage:T,toFirstPage:N,getPageCount:I,setHandleState:O,scrollYToRecord:R,setSelectionKeysEffect:k,setOriginColumns:P,setRowExpandedKeys:A,setHighlightKey:L,setResizeState:H,setMergeCells:_,setPingRight:F,setUnMounted:D,setHandleChange:$,calcTableHeight:M,createSelectionKeys:q,createRowExpandedKeys:V,createElementStore:K,triggerScrollYEvent:z,initialTable:B,destroy:W}=t,{elementStore:U,handleState:G,scrollYLoad:Y}=s.current,X=j.default.useRef(y);Vn((()=>{if(!a)return;const{onChange:e}=a;"radio"===a.type&&c.current.setClickedValues(m.length?[m[0],""]:[]),s.current.isHandleChange&&(null==e||e(m,s.current.selectionRows)),$(!0)}),[m]),Vn((()=>{if(!r)return;const{allTableData:e,allRowKeys:t}=s.current,{onChange:n}=r;null==n||n(v,v.map((n=>e[t.findIndex((e=>e===n))])))}),[v]),Vn((()=>{var e,t;const{allTableData:n,allRowKeys:l}=s.current;S&&A(V()),i&&(c.current.setClickedValues(b?[b,""]:[]),null===(e=i.onChange)||void 0===e||e.call(i,b,null!==(t=n[l.findIndex((e=>e===b))])&&void 0!==t?t:null))}),[b]),Vn((()=>{var e;g.isEqual(y,X.current)||(X.current=y,x&&l&&(null===(e=l.onChange)||void 0===e||e.call(l,y)))}),[y]),Vn((()=>{const e=q(a.selectedRowKeys);g.isEqual(e,m)||(k(e),S&&A(V()))}),[null==a?void 0:a.selectedRowKeys]),Vn((()=>{const e=V(r.expandedRowKeys);g.isEqual(e,v)||A(e)}),[null==r?void 0:r.expandedRowKeys]),Vn((()=>{const{currentRowKey:e}=i;e!==b&&L(null!=e?e:"")}),[null==i?void 0:i.currentRowKey]),Vn((()=>{const{insert:e,remove:t}=G;e&&(E&&("after"===e?T():N()),R("","after"===e?1e5:0)),t&&h.current>I()&&T(),(e||t)&&O({insert:null,remove:!1})}),[h.total]),Vn((()=>{Y&&z(U.$tableBody.parentNode.parentNode.scrollTop)}),[Y]),Vn((()=>{F(p)}),[p]),Vn((()=>{M()}),[f]),Vn((()=>{_(o),c.current.forceUpdate()}),[o]),Vn((()=>{Y&&(e.height||e.maxHeight||Oe("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||Oe("Table","必须设置组件参数 `ellipsis`")),C&&(e.height||e.maxHeight||Oe("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[Y,C]);const Q=()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(H(Object.assign({},e,{winHeight:n})),M())};j.default.useEffect((()=>(K({$toper:u.current,$table:d.current}),P(rt(n)),B(),_(o),window.addEventListener("resize",Q,!1),M(),w(),()=>{W(),window.removeEventListener("resize",Q),D(!0)})),[])},du=e=>{const{total:t}=e,{tableRef:n,selectionKeys:l,isHeadSorter:a,isHeadFilter:r,isTreeTable:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:u,clearRowSelection:d,clearRowHighlight:c}=j.default.useContext(js),{infoBarConfig:f,rowSelection:p,rowHighlight:h}=n.current.props,{allTableData:m,invalidRowKeys:g}=n.current,{hideAlert:v,hideClearButton:y}=f||{},x=j.default.useMemo((()=>!v),[v]),E=j.default.useMemo((()=>!y&&!!(a||r||p||h)),[y,a,r,p,h]),C={[`${dt("table")}__alert`]:!0};return x?j.default.createElement("div",{className:ne.default(C)},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.InfoCircleFilled,null)),j.default.createElement("span",null,we("qm.table.alert.total",{total:i?m.length:t}),p?`,${we("qm.table.alert.selected",{total:Math.max(l.length-g.length,0)})}`:""),E&&j.default.createElement("em",{onClick:()=>{s(),u(),d(),c(),nt((()=>o()))}},we("qm.table.alert.clear"))):null},cu=j.default.forwardRef(((e,t)=>{const{isFullScreen:n,open:l=!0}=e,{setFullScreen:a}=j.default.useContext(js),r=()=>{a(!n)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table");return l?j.default.createElement("span",{className:`${i}-full-screen`,title:we(n?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},n?j.default.createElement(b.FullscreenExitOutlined,null):j.default.createElement(b.FullscreenOutlined,null))):null}));cu.displayName="FullScreen";const fu=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{getTableData:l}=j.default.useContext(js),a=()=>{l()};j.default.useImperativeHandle(t,(()=>({clickHandle:a})));const r=dt("table");return n?j.default.createElement("span",{className:`${r}-reload`,title:we("qm.table.refresh.text"),onClick:()=>a()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.ReloadOutlined,null))):null}));fu.displayName="Reload";const pu=()=>{const e={dateFormat:e=>{const t=e?K.default(e).format(Bs):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?K.default(e).format(Ws):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?K.default(e).format(Ws.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>ia(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>oa(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,l)=>{var a,r,i,o;const{dictItems:s,precision:u,displayPrecision:d,formatType:c,editRender:f}=n,p=s||(null===(a=null==f?void 0:f(l,n))||void 0===a?void 0:a.items)||[];let h=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)&&(h=t.map((e=>{var t,n;return null!==(n=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),u>=0&&""!==h&&(h=ia(h)?new ce.default(h).toFixed(u):h),d>=0&&""!==h&&(h=sa(h,d)),c){const t=e[`${lt(c)}Format`];t?h=t(h):Oe("Table","字段的格式化类型 `formatType` 配置不正确")}return h},n=e=>Qe(e)?fa(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,l,a,r)=>{const i=la(e,l.dataIndex),o=l.render?l.render(i,e,l,a,r):t(i,l,e);return n(o)}}},hu=j.default.forwardRef(((e,t)=>{var n,l,a,r;const{tableColumns:i,open:o=!0}=e,{global:s}=j.default.useContext(xe),{tableRef:u,flattenColumns:d,summationRows:c,showSummary:f,getSpan:p}=j.default.useContext(js),{tablePrint:h,showHeader:m}=u.current.props,{getTitleFromCellValue:v}=pu(),y=null!==(l=null===(n=null==s?void 0:s.print)||void 0===n?void 0:n.leftLogo)&&void 0!==l?l:"",x=null!==(r=null===(a=null==s?void 0:s.print)||void 0===a?void 0:a.rightLogo)&&void 0!==r?r:"",E=!(!y&&!x),C=j.default.useMemo((()=>rt(Xl(i,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn]))),[i]),S=j.default.useMemo((()=>rt(Xl(d,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn]))),[d]),w=j.default.useMemo((()=>rt(i.filter((e=>e.printFixed)))),[i]),T=e=>{const t=Object.assign({},va(C,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?T(t):t},N=(e,t)=>g.map(g.groupBy(g.flatten(e),t),g.spread((function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return g.mergeWith(...n,((e,n)=>{if(Array.isArray(e))return N(e.concat(n),t)}))}))),I=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(T(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:N(n,"dataIndex")[0]})))(n),t.push(Jl(n))})),t},O=()=>{const{allTableData:e}=u.current,t=(e=>{const t=[];let n=[],l=0,a=0;for(;a<e.length;){const r=e[a];l+=r.width||r.renderWidth||r.minWidth||Js.defaultColumnWidth,l<=Js.printWidth?(n.push(r),a===e.length-1&&t.push(n),a++):a>0?(e.splice(0,a),w.length&&e.unshift(...w),t.push(n),n=[],l=0,a=0):(r.width=Js.printWidth,n.push(r),t.push(n),a++)}return t})([...S]),n=I(t);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 a=0;a<t.length;a++)l+=R(n[a],t[a],e),l+='<div class="page-break"></div>';return l+"</body></html>"},R=(e,t,n)=>{const{showLogo:l=!0}=h;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((e=>{let{width:t,minWidth:n,renderWidth:l}=e;return`<col style="width:${t||l||n||Js.defaultColumnWidth}px">`})).join("")}</colgroup>`,m&&(a+=["<thead>",l&&E?`<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">',y?`<img src="${y}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',x?`<img src="${x}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${pa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(a+=`<tbody>${n.map((e=>`<tr>${t.map(((t,l)=>{const{rowSpan:a,colSpan:r}=p(e,t,e.index,l,n);return a&&r?`<td rowspan="${a}" colspan="${r}">${v(e,t,e.index,l)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&c.length&&(a+=["<tfoot>",c.map((e=>`<tr>${t.map(((t,l)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(n):la(e,`${a}_text`);return`<td>${0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},k=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:l,isDownload:a}=e,r=`${n}.${l}`;if(window.Blob){const e=new Blob([t],{type:`text/${l}`});if(!a)return Promise.resolve({type:l,content:t,blob:e});vl(e,r)}})({filename:"print",type:"html",isDownload:!1},O()))||void 0===e||e.then((e=>{let{content:t,blob:n}=e,l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),u.current.isIE?(l.contentDocument.write(t),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(n))}))};j.default.useImperativeHandle(t,(()=>({clickHandle:k})));const P=dt("table");return o?j.default.createElement("span",{className:`${P}-print`,title:we("qm.table.print.text"),onClick:()=>k()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.PrinterOutlined,null))):null}));hu.displayName="TablePrint";const mu="606060",gu="thin",vu="d4d4d4",bu=(e,t)=>{t&&(e.height=Math.floor(.75*t))},yu=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},xu=()=>({top:{style:gu,color:{argb:vu}},left:{style:gu,color:{argb:vu}},bottom:{style:gu,color:{argb:vu}},right:{style:gu,color:{argb:vu}}}),Eu=e=>{const{children:t}=e;return t&&t.length?Eu(t[0]):e},Cu=e=>{const{precision:t,formatType:n}=e,l=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:l?`0${l}%`:"0%"}:"finance"===n?{numFmt:l?`#,##0${l}`:"#,##0"}:l?{numFmt:`0${l}`}:null},Su=()=>{const{tableRef:e,getSpan:t,showSummary:n,isHeadGroup:l}=j.default.useContext(js),{spanMethod:a,showHeader:r}=e.current.props,i=(e,t)=>{var n,l,a;return null!==(a=null!==(l=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==l?l:t)&&void 0!==a?a:""};return{exportXLSX:(i,o,s,u)=>Ye(void 0,void 0,void 0,(function*(){const{columns:d,footSummation:c}=i,{scrollYStore:{rowHeight:f}}=e.current,p=Kl(d),h=Jl(d),m=[],g=[],v=[],b=[];let y=0;const x={};p.forEach((e=>{const{dataIndex:t,width:n,minWidth:l,renderWidth:a}=e;x[t]=pa(e.title),v.push({key:t,width:(n||a||l||Js.defaultColumnWidth)/8})})),r&&(l?h.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:l,rowSpan:a}=e,r=Eu(e),i=p.findIndex((e=>{let{dataIndex:t}=e;return t===r.dataIndex}));n[r.dataIndex]=pa(e.title),0!==l&&(l>1||a>1)&&b.push({s:{r:t,c:i},e:{r:t+a-1,c:i+l-1}})})),m.push(n)})):(p.forEach(((e,t)=>{const{colSpan:n,rowSpan:l}=e;(n>1||l>1)&&b.push({s:{r:y,c:t},e:{r:y+l-1,c:t+n-1}})})),m.push(x)),y+=m.length);const E=o.map(((e,n)=>{const l={};return p.forEach(((r,i)=>{if("function"==typeof a){const{rowSpan:l,colSpan:a}=t(e,r,n,i,o);(a>1||l>1)&&b.push({s:{r:n+y,c:i},e:{r:n+y+l-1,c:i+a-1}})}const s=["percent","finance"].includes(r.formatType);l[r.dataIndex]=s?la(e,r.dataIndex):u(e,n,r,i)})),l}));y+=E.length,n&&c&&s(p,o).forEach(((e,t)=>{const n={};p.forEach(((t,l)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(o):la(e,a);n[a]=0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i})),g.push(n)}));const{sheetName:C,useStyle:S}=i,w=new ve.default.Workbook,T=w.addWorksheet(C);T.columns=v,r&&T.addRows(m).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l,theadAlign:a}=n;yu(e,a||l),S&&Object.assign(e,{font:{bold:!0,color:{argb:mu}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:xu()})}))})),T.addRows(E).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l}=n;yu(e,l),Object.assign(e,Cu(n)),S&&Object.assign(e,{font:{color:{argb:mu}},border:xu()})}))})),n&&c&&T.addRows(g).forEach((e=>{S&&bu(e,f),e.eachCell((e=>{const t=T.getColumn(e.col),n=Ul(d,t.key),{align:l}=n;yu(e,l),Object.assign(e,Cu(n)),S&&Object.assign(e,{font:{color:{argb:mu}},border:xu()})}))})),b.forEach((e=>{let{s:t,e:n}=e;T.mergeCells(t.r+1,t.c+1,n.r+1,n.c+1)}));const N=yield w.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),l=-1!==e.indexOf('"');return l&&(t=t.replace(/"/g,'""')),(n||l)&&(t='"'+t+'"'),t},l="\ufeff"+(e=>{let t,l,a,r,i="";for(t=0;t<e.rows.length;t+=1){for(a=e.rows[t],l=0;l<a.cells.length;l+=1)r=a.cells[l],i=i+(l?",":"")+n(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,n)=>{t=t||"",n=n||512;const l=window.atob(e),a=[];let r;for(r=0;r<l.length;r+=n){const e=l.slice(r,r+n),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=l,window.btoa(unescape(encodeURIComponent(a)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:l}=e,a=Kl(n),r=new FileReader;r.onerror=()=>{u.message.error(we("qm.table.import.error"))},r.onload=e=>{const n=a.map((e=>pa(e.title))),l=new ve.default.Workbook,r=e.target;r?l.xlsx.load(r.result).then((e=>{const l=e.worksheets[0];if(l){const e=l.getSheetValues(),r=e.findIndex((e=>e&&e.length>0)),o=e[r],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,o);if(s){const l=e.slice(r+1).map((e=>{const t={};e.forEach(((e,n)=>{var l;let a=e;Array.isArray(null==a?void 0:a.richText)&&(a=a.richText.map((e=>e.text)).join("")),g.isPlainObject(a)&&"text"in a&&(a=a.text),g.isDate(a)&&(a=da(a,Ws)),(null==a?void 0:a.formula)&&(a=null!==(l=a.result)&&void 0!==l?l:a.value),t[o[n]]=a}));const l={};return n.forEach(((e,n)=>{var r;const{dataIndex:o,dictItems:s}=a[n];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>i(s,e))).filter((e=>""!==e)):t[e]=i(s,t[e])),aa(l,o,t[e])})),l}));null==t||t(l)}else u.message.error(we("qm.table.import.error"))}else u.message.error(we("qm.table.import.error"))})):u.message.error(we("qm.table.import.error"))},r.readAsArrayBuffer(l)}}},wu=e=>{const{fileType:t,onChange:n}=e;let l,a;const r=dt("table"),i=e=>{const t=e.name,n=t.lastIndexOf("."),l=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:l}},o=()=>Ye(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return l||(l=document.createElement("form"),a=document.createElement("input"),l.className=`${r}--file-form`,a.name="file",a.type="file",l.appendChild(a),document.body.appendChild(l)),new Promise(((e,n)=>{const r=!t.type;a.multiple=!!t.multiple,a.accept=r?"":`.${t.type}`,a.onchange=o=>{const{files:s}=o.target,d=s[0];let c="";if(!r)for(let e=0;e<s.length;e++){const{type:n}=i(s[e]);if(t.type!==n){c=n;break}}c?(u.message.warning(we("qm.upload.notType",{type:c})),n()):e(d),document.body.removeChild(l),l=null,a=null},l.reset(),a.click()}))})({type:t});null==n||n(e.name,e)}catch(e){}}));return j.default.createElement(ot,{onClick:()=>o()},we("qm.upload.text"))},Tu=e=>{const{columns:t,onClose:n}=e,{tableRef:l,createTableData:a,dataChange:r}=j.default.useContext(js),{beforeTableImport:i}=l.current.props,{importXLSX:o}=Su(),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState(!0),h=e=>e.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))),[m,g]=j.default.useState([{type:"INPUT",label:we("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:n}=t.GET_FIELDS_VALUE(["fileName"]);return j.default.createElement(j.default.Fragment,null,n?j.default.createElement("span",null,n):j.default.createElement(wu,{fileType:t.state.formData.fileType,onChange:(e,n)=>{t.SET_FIELDS_VALUE({fileName:e,file:n}),n&&p(!1)}}))}},{type:"SELECT",label:we("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:we("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:we("qm.table.import.fillText"),value:"fill"},{text:we("qm.table.import.addText"),value:"add"},{text:we("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{m.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,g([...m])}},{type:"INPUT_NUMBER",label:we("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:l.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),v=dt("table");return j.default.createElement("div",{className:`${v}-import__setting`},j.default.createElement(us,{ref:s,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:m,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:d,disabled:f,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,d]=yield s.current.GET_FORM_DATA();e||(c(!0),o({columns:h(t),file:d.file},(e=>Ye(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:o}=l.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof i)try{e=yield i(e)}catch(e){}if("fill"===d.importType&&a(e),"add"===d.importType&&a([...t,...e]),"insert"===d.importType){const{tableFullData:t}=l.current,n=d.posIndex,r=t.slice(0,n).concat(e).concat(t.slice(n));a(r)}e.forEach((e=>{o.addToInserted(e)})),r(),u.message.success(we("qm.table.import.success",{total:e.length})),c(!1),n()})))))}))},we("qm.table.import.text"))))},Nu=j.default.forwardRef(((e,t)=>{const{tableColumns:n,open:l=!0}=e,[a,r]=j.default.useState(!1),i=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:i})));const o={[`${dt("table")}-import`]:!0},s={visible:a,title:we("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement("span",{className:ne.default(o),title:we("qm.table.import.textNoSpace"),onClick:()=>i()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.ImportOutlined,null))),j.default.createElement(Il,s,j.default.createElement(Tu,{columns:n,onClose:()=>r(!1)})))}));Nu.displayName="TableImport";const Iu=e=>{const{columns:t,onChange:n}=e,{$size:l}=j.default.useContext(js),a=j.default.useRef([]),[r,i]=j.default.useState(!1),[o,s]=j.default.useState(t);Vn((()=>{c()}),[o]),j.default.useEffect((()=>{d()}),[t]);const d=()=>{const e=[];t.forEach(((n,l)=>{const a=n.colSpan;a>1&&t.slice(l+1,l+a).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(t.slice(l,l+a))})),a.current=e},c=()=>{const e=[];o.forEach((t=>{const{colSpan:n,dataIndex:l}=t;if(0===n)return;if(1===n)return e.push(t);const r=a.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(l)));if(-1===r)return e.push(t);e.push(...a.current[r].map(((e,n)=>{let{dataIndex:l}=e;const a=o.find((e=>e.dataIndex===l));return n>0&&void 0!==t.hidden&&(a.hidden=t.hidden),a})))})),null==n||n(e)},f=dt("table"),p={[`${f}__popper`]:!0,"column-filter__popper":!0,[`${f}--lg`]:"large"===l,[`${f}--sm`]:"small"===l},h=[`${f}-column-filter`,{selected:r}];return j.default.createElement(io,{action:["click"],popupVisible:r,popup:j.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},j.default.createElement("div",{className:"main"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:o,setList:e=>{const t=e.map((e=>e.dataIndex)),n=o.map((e=>e.dataIndex));g.isEqual(t,n)||s(Ea(e))}},o.map((e=>((e,t)=>{const{colSpan:n}=e;if(0===n)return j.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const l=["svgicon","handle",`${t}-handle`];return j.default.createElement("li",{key:e.dataIndex,className:"item"},j.default.createElement(u.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,s([...o])}}),j.default.createElement("i",{className:ne.default(l),title:we("qm.table.columnFilter.draggable")},j.default.createElement(b.HolderOutlined,null)),j.default.createElement("span",{className:"text"},pa(e.title)))})(e,"main")))))),popupClassName:ne.default(p),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{i(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},j.default.createElement("span",{className:ne.default(h),title:we("qm.table.columnFilter.text")},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.SettingOutlined,null)),j.default.createElement("span",null,we("qm.table.columnFilter.text"))))},Ou=e=>{const{defaultValue:t,onClose:n,onOk:l}=e,{tableRef:a,selectionKeys:r,pagination:i,showSummary:o}=j.default.useContext(js),{rowSelection:s}=a.current.props,u=j.default.useRef(null),[d,c]=j.default.useState(!1),f=j.default.useMemo((()=>Object.assign({},{fileName:`${K.default().format(Us)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:r.length?"selected":"all","startIndex|endIndex":[1,i.total],footSummation:o?1:0,useStyle:0},t,{columns:rt(t.columns||[])})),[]),[p,h]=j.default.useState([{type:"INPUT",label:we("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:we("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:we("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:we("qm.table.export.all"),value:"all"},{text:we("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==s?void 0:s.type)},{text:we("qm.table.export.custom"),value:"custom"}]},onChange:e=>{p.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,h([...p])}},options:{min:1},disabled:!0},{type:"INPUT",label:we("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>j.default.createElement(Iu,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:we("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!o,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:we("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),m=dt("table");return j.default.createElement("div",{className:`${m}-export__setting`},j.default.createElement(us,{ref:u,initialValues:f,items:p,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:d,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();if(!e){c(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);l(t),yield tt(1e3),c(!1),n()}}))},we("qm.table.export.text"))))},Ru=j.default.forwardRef(((e,t)=>{var n;const{tableColumns:l,open:a=!0}=e,{global:r}=j.default.useContext(xe),{tableRef:i,flattenColumns:o,pagination:s,fetchParams:d,isFetch:c,isGroupSubtotal:f,showSummary:p,getSpan:h}=j.default.useContext(js),{exportExcel:m,fetch:v,showHeader:y}=i.current.props,{getTitleFromCellValue:x}=pu(),[E,C]=j.default.useState(!1),[S,w]=j.default.useState(!1),T=j.default.useMemo((()=>{var e;return!!(null===(e=null==m?void 0:m.fetch)||void 0===e?void 0:e.api)}),[m]),N=j.default.useMemo((()=>!s.total||S),[s.total,S]),I=j.default.useMemo((()=>Xl(l,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn])),[l]),O=j.default.useMemo((()=>Xl(o,[Js.expandableColumn,Js.selectionColumn,Js.operationColumn])),[o]),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.map(((e,l)=>{const a=Object.assign(Object.assign({},e),{index:l,pageIndex:l}),r=t?`${t}-${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=n,Array.isArray(e.children)&&(a.children=R(e.children,r,n+1)),O.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&aa(a,t,la(a,t))})),a}))},k=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:l}=e,a=(f?ha(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Js.summaryIgnore])return e;const n=Number(la(t,l));return Number.isNaN(n)?e:e+n}),0);aa(n,l,a)})),[n]},P=(e,t,n,l)=>{const{precision:a,formatType:r}=n;let i=x(e,n,t,l);return a>=0&&!r&&""!==i&&(i=Number(i)),i},{exportXLSX:A,exportCSV:L}=Su(),H=e=>Ye(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:l=(e=>e),afterFetch:a,dataKey:r}=v;let i=[];try{w(!0);const o=yield n(Object.assign(Object.assign({},l(d)),{[Js.currentPageName]:1,[Js.pageSizeName]:null!=e?e:s.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=g.get(o.data,r))&&void 0!==t?t:[];e="function"==typeof a?yield a(e):e,i=Zl(R(e))}}catch(e){}return w(!1),i})),_=e=>{var t;const n=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},F=(e,t)=>{const{columns:n,footSummation:l}=e,a=Jl(n),r=Kl(n);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${r.map((e=>{let{width:t,minWidth:n,renderWidth:l}=e;return`<col style="width:${t||l||n||Js.defaultColumnWidth}px">`})).join("")}</colgroup>`,y&&(i+=["<thead>",a.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${pa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${t.map((e=>`<tr>${r.map(((n,l)=>{const{rowSpan:a,colSpan:r}=h(e,n,e.index,l,t);return a&&r?`<td rowspan="${a}" colspan="${r}">${P(e,e.index,n,l)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),p&&l&&(i+=["<tfoot>",k(r,t).map((e=>`<tr>${r.map(((n,l)=>{const{dataIndex:a,summation:r}=n,i=(null==r?void 0:r.render)?r.render(t):la(e,a);return`<td>${0===l&&""===i?we("qm.table.config.summaryText"):Qe(i)?fa(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},D=null!==(n=null==m?void 0:m.fileName)&&void 0!==n?n:`${K.default().format(Us)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),M=()=>{if(N)return u.message.warning(we("qm.table.export.warnText"));var e;T?(e=D,Ye(void 0,void 0,void 0,(function*(){w(!0);try{const{api:t,params:n}=m.fetch,l=yield t(Object.assign(Object.assign(Object.assign({columns:O.map((e=>{const{title:t,dataIndex:n,hidden:l}=e,{type:a}=e.filter||{};return{title:t,dataIndex:n,type:a,hidden:l}}))},d),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Js.currentPageName]:void 0,[Js.pageSizeName]:void 0}));l.data&&(vl(l.data,e),_(e))}catch(e){}w(!1)}))):C(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:M})));const q={[`${dt("table")}-export`]:!0},V={visible:E,title:we("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},z={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:I,useStyle:(null==m?void 0:m.cellStyle)?1:0};return j.default.createElement(j.default.Fragment,null,a&&j.default.createElement("span",{className:ne.default(q),title:we("qm.table.export.textNoSpace"),onClick:()=>M()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.DownloadOutlined,null))),j.default.createElement(Il,V,j.default.createElement(Ou,{defaultValue:z,onClose:()=>C(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:zl(e.columns)}),Ye(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:l,startIndex:a=1,endIndex:r}=t,{allTableData:o,selectionRows:s}=i.current;let u=[];if(c?("all"===l&&(u=yield H()),"custom"===l&&(u=yield H(r),u=u.slice(a-1))):("all"===l&&(u=o.slice(0)),"custom"===l&&(u=o.slice(a-1,r||void 0))),"selected"===l&&(u=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==m?void 0:m.beforeExport))try{u=null==m?void 0:m.beforeExport(u)}catch(e){}if("xlsx"===n){const n=yield A(t,u,k,P);vl(n,`${e}.xlsx`),_(`${e}.xlsx`)}if("csv"===n){const n=L(t,F(t,u));vl(n,`${e}.csv`),_(`${e}.csv`)}}))}})))}));Ru.displayName="TableExport";const ku=e=>{const{columns:t,onClose:n}=e,{tableRef:l,tableBodyRef:a,dataChange:r}=j.default.useContext(js),{beforeClipboard:i}=l.current.props,o=j.default.useRef(null),[s,d]=j.default.useState([{type:"INPUT_NUMBER",label:we("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:we("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:pa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:we("qm.table.clipboard.content"),fieldName:"content",placeholder:we("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[c,f]=j.default.useState(!1),p=dt("table");return j.default.createElement("div",{className:`${p}-clipboard__setting`},j.default.createElement("h3",{className:"info"},we("qm.table.clipboard.supportText")),j.default.createElement(us,{ref:o,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:s,cols:1,labelWidth:100}),j.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"}},j.default.createElement(ot,{onClick:()=>n(),style:{marginRight:8}},we("qm.table.export.closeButton")),j.default.createElement(ot,{type:"primary",loading:c,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;const[s,d]=yield o.current.GET_FORM_DATA();if(s)return;const{tableFullData:c,store:p}=l.current;f(!0);const h=d.content.trim().replace(/(\r|\n)$/,"");let m=h.replace(/"[^"]+"/g,"^");((null===(e=h.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{m=m.replace(/\^/,e)}));let g=m.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof i)try{g=yield i(g,g[0].map(((e,n)=>t[d.colIndex+n].dataIndex)))}catch(s){}g.forEach(((e,n)=>{e.forEach(((e,a)=>{var r,i;const o=c[d.rowIndex-1+n],s=t[d.colIndex+a];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(r=e.extra)||void 0===r?void 0:r.disabled)||(null===(i=l.current.fieldAuth[s.dataIndex])||void 0===i?void 0:i.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(aa(o,s.dataIndex,e),p.addToUpdated(o))}}))})),a.current.forceUpdate(),r(),u.message.success(we("qm.table.clipboard.success",{total:g.length})),f(!1),n()}))},we("qm.table.clipboard.text"))))},Pu=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{flattenColumns:l}=j.default.useContext(js),[a,r]=j.default.useState(!1),i=j.default.useMemo((()=>(e=>e.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))))(l)),[l]),o=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={[`${dt("table")}-clipboard`]:!0},u={visible:a,title:we("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:ne.default(s),title:we("qm.table.clipboard.textNoSpace"),onClick:()=>o()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.CopyOutlined,null))),j.default.createElement(Il,u,j.default.createElement(ku,{columns:i,onClose:()=>r(!1)})))}));Pu.displayName="TableClipboard";const Au=e=>{const{columns:t,onClose:n}=e,{tableRef:l,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=j.default.useContext(js),{rowKey:o}=l.current.props,s=j.default.useRef(null),u=dl(s),d=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=d(e.children)),n})),[c,f]=j.default.useState([{title:we("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...d(t.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))))]),[p]=j.default.useState(l.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})))),[h,m]=j.default.useState(300),g=cl((()=>{const e=s.current;m(e.offsetHeight-2*yr[a]-30)}),5);return Vn((()=>{g()}),[u.width]),j.default.createElement("div",{ref:s,style:{height:"100%"}},j.default.createElement(gd,{size:a,columns:c,dataSource:p,rowKey:o,height:h,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=>f(e)}),j.default.createElement("div",{style:{height:10}}),j.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"}},j.default.createElement(ot,{onClick:()=>n()},we("qm.table.selectCollection.closeButton"))))},Lu=j.default.forwardRef(((e,t)=>{const{columns:n,open:l=!0}=e,{tableRef:a,getRowKey:r,selectionKeys:i,isFetch:o,isTableEmpty:s,setSelectionKeysEffect:u,setSelectionRows:d}=j.default.useContext(js),{rowSelection:c}=a.current.props,[f,p]=j.default.useState(!1),h=j.default.useRef(!1);Vn((()=>{!h.current&&m()}),[s]);const m=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=c;if(o&&t)try{const l=yield t.api(Object.assign({},{selectedKeys:i},t.params));if(200===l.code){let a=Array.isArray(l.data)?l.data:null!==(e=g.get(l.data,t.dataKey))&&void 0!==e?e:[];a=a.filter((e=>!n(e))),u(a.map(((e,t)=>r(e,t)))),d(a),h.current=!0}}catch(e){}})),v=()=>{p(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:v})));const y=dt("table"),x={visible:f,title:we("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>p(!1)};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement("span",{className:`${y}-select-collection`,title:we("qm.table.selectCollection.text"),onClick:()=>v()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.CheckSquareOutlined,null))),j.default.createElement(Il,x,j.default.createElement(Au,{columns:n,onClose:()=>p(!1)})))}));Lu.displayName="SelectCollection";const Hu=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,getRowKey:a,$size:r,flattenColumns:i,pagination:o,setPagination:s,scrollYToRecord:d,setHighlightKey:c,setShouldToTop:f,isTreeTable:p,isWebPagination:h}=j.default.useContext(js),{uniqueKey:m}=l.current.props,v=j.default.useRef(null),y=j.default.useRef(null),x=j.default.useRef([]),E=j.default.useRef(""),C=j.default.useRef(-1),S=j.default.useRef("stop");Vn((()=>{const{current:e,pageSize:t}=o,n=l.current.tableFullData.slice((e-1)*t,e*t),r=Zl(n).findIndex((e=>a(e,e.index)===E.current));d("",r)}),[o.current]);const w=e=>{let t;switch(e){case"text":case"textarea":default:t="INPUT";break;case"number":t="INPUT_NUMBER";break;case"date":t="DATE";break;case"checkbox":case"radio":t="SELECT"}return t},T=e=>e.filter((e=>null==e?void 0:e.dataIndex)).map((e=>{var t;return{type:w(e.filter.type),fieldName:e.dataIndex,label:pa(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:null!==(t=e.dictItems)&&void 0!==t?t:[]},onChange:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA(),[n,l]=yield y.current.GET_FORM_DATA(),a=g.omitBy(Object.assign({},t,l),at);R(a)}))}})),N={case:0,fullchar:0},I=j.default.useMemo((()=>i.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[i]),[O,R]=j.default.useState({}),[k,P]=j.default.useState(N),[A]=j.default.useState(T([I[0]])),[L]=j.default.useState(T(I.slice(1))),[H,_]=j.default.useState(0),F=j.default.useMemo((()=>!Object.keys(O).length),[O]);Vn((()=>{S.current="ready"}),[O,k]);const D=e=>{P(Object.assign({},k,e))},$=(e,t,n)=>new Promise(((l,a)=>{u.Modal.confirm({title:we("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),l()},onCancel:()=>{n(),l()}})})),M=e=>Ye(void 0,void 0,void 0,(function*(){if(!Object.keys(O).length)return u.Modal.warning({title:we("qm.button.confirmPrompt"),content:we("qm.table.fastSearch.queryCondition")});if("ready"===S.current&&(S.current="stop",x.current=(e=>{const{allTableData:t}=l.current,n=[];for(let l=0,r=t.length;l<r;l++){const r=t[l];let i=!0;for(const t in e){const{type:n}=I.find((e=>e.dataIndex===t)).filter;let l=la(r,t),o=!0;if("text"===n||"textarea"===n?o=new RegExp(k.fullchar?`^${e[t]}$`:e[t],k.case?"":"i").test(l):(l="string"==typeof(a=l)&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(a)?l.slice(0,10):l,o=l==e[t]),!o){i=!1;break}}i&&n.push(r)}var a;return n})(O),_(x.current.length)),!x.current.length)return c(""),u.Modal.warning({title:we("qm.button.confirmPrompt"),content:we("qm.table.fastSearch.notMatch")});"next"===e&&(C.current=C.current<0?0:C.current+1,C.current>x.current.length-1&&(yield $(we("qm.table.fastSearch.toTheEnd"),(()=>C.current=0),(()=>C.current=x.current.length-1)))),"prev"===e&&(C.current=C.current<0?x.current.length-1:C.current-1,C.current<0&&(yield $(we("qm.table.fastSearch.toStart"),(()=>C.current=x.current.length-1),(()=>C.current=0))));const t=x.current[C.current],n=a(t,t.index);let r=t.index;if(p&&h){const e=ba(l.current.deriveRowKeys,n)[0];r=l.current.tableFullData.findIndex((t=>a(t,t.index)===e))}((e,t)=>{if(E.current=e,h){const{pageSize:e}=o,n=Math.ceil((t+1)/e);f(!1),s(Object.assign({},o,{current:n}))}else d(e)})(n,r),c(n)})),q=()=>{v.current.RESET_FORM(),y.current.RESET_FORM()},V=j.default.useMemo((()=>m?`fastSearch_${m}`:""),[m]),[K,z]=j.default.useState([]),[B,W]=j.default.useState(""),[U,G]=j.default.useState("");Vn((()=>{if(U){const{filters:e,config:t}=K.find((e=>e.value===U)).list;v.current.SET_FIELDS_VALUE(te.default(e,L.map((e=>e.fieldName)))),y.current.SET_FIELDS_VALUE(te.default(e,A.map((e=>e.fieldName)))),R(e),P(t)}else q(),R({}),P(N)}),[U]),j.default.useEffect((()=>{Y()}),[]);const Y=()=>Ye(void 0,void 0,void 0,(function*(){if(!V)return;let e=yield ge.default.getItem(V);e||(e=yield X(V),Array.isArray(e)&&(yield ge.default.setItem(V,e))),Array.isArray(e)&&e.length&&(z(e),G(e[0].value))})),X=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),Q=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),Z=dt("table");return j.default.createElement("div",{className:`${Z}-fast-search__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{className:"top"},j.default.createElement("div",{className:"container"},j.default.createElement(Sl,{defaultActiveKey:"1",size:"small",tabBarExtraContent:j.default.createElement("span",null,we("qm.table.alert.total",{total:H}))},j.default.createElement(Sl.TabPane,{tab:we("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},j.default.createElement(us,{ref:v,items:A,cols:1,labelWidth:110})),j.default.createElement(Sl.TabPane,{tab:we("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},j.default.createElement(us,{ref:y,items:L,cols:1,labelWidth:110})))),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:r,value:B,placeholder:we("qm.table.highSearch.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;W(t)}}),j.default.createElement(ot,{type:"primary",disabled:!B||F,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!V)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...K,{text:B,value:e,list:{filters:O,config:k}}];z(t),G(e),W(""),yield ge.default.setItem(V,t),yield Q(V,t)}))},we("qm.table.highSearch.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[r]}px`}},j.default.createElement("span",null,we("qm.table.fastSearch.savedSetting"))),j.default.createElement("ul",null,K.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===U}),title:e.text,onClick:()=>{return t=e.value,void G(t!==U?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=K.filter((e=>e.value!==n));z(e),n===U&&G(""),yield ge.default.setItem(V,e),yield Q(V,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!K.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.default.createElement("div",{className:"bottom"},j.default.createElement("div",null,j.default.createElement(u.Checkbox,{checked:!!k.case,onChange:e=>D({case:e.target.checked})},we("qm.table.fastSearch.matchCase")),j.default.createElement(u.Checkbox,{checked:!!k.fullchar,onChange:e=>D({fullchar:e.target.checked})},we("qm.table.fastSearch.matchFullchar"))),j.default.createElement("div",null,j.default.createElement(ot,{onClick:()=>q()},we("qm.table.fastSearch.clear"))))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${yr[r]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.fastSearch.closeButton")),j.default.createElement(ot,{type:"primary",style:{marginRight:8},onClick:()=>M("prev")},we("qm.table.fastSearch.queryPrev")),j.default.createElement(ot,{type:"primary",onClick:()=>M("next")},we("qm.table.fastSearch.queryNext"))))},_u=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,{$size:l}=j.default.useContext(js),[a,r]=j.default.useState(!1),i=()=>{r(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:i})));const o=dt("table"),s={visible:a,title:we("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${yr[l]+20}px`},onClose:()=>r(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${o}-super-search`,title:we("qm.table.fastSearch.text"),onClick:()=>i()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.MonitorOutlined,null))),j.default.createElement(Il,s,j.default.createElement(Hu,{onClose:()=>r(!1)})))}));_u.displayName="FastSearch";const Fu=e=>{const{columns:t,group:n,summary:l}=e,{tableRef:a,$size:r,pagination:i,fetchParams:o,isFetch:s}=j.default.useContext(js),{fetch:u}=a.current.props,d=e=>{var n;const l=t.find((t=>t.dataIndex===e));return{title:l.title,precision:l.precision,dictItems:null!==(n=l.dictItems)&&void 0!==n?n:[]}},c=n.map((e=>Object.assign({dataIndex:e.group},d(e.group)))),f=l.map((e=>e.summary===Js.groupSummary.total.value?{dataIndex:e.summary,title:Js.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},d(e.summary)),{formula:e.formula}))),p=j.default.useMemo((()=>Object.assign({},o,{[Js.sorterFieldName]:void 0,[Js.groupSummary.summaryFieldName]:l.map((e=>`${e.formula}|${e.summary}`)).join(","),[Js.groupSummary.groupbyFieldName]:n.map((e=>e.group)).join(","),usedJH:2,[Js.currentPageName]:1})),[o,n,l]),[h,m]=j.default.useState(((e,n)=>[{title:we("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...n.map((e=>{var n;const l=null===(n=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===n?void 0:n.groupSummary;let a=l?{summation:l}:null;return e.dataIndex===Js.groupSummary.total.value&&(a={dataIndex:Js.groupSummary.recordTotalIndex,summation:{render:()=>i.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(c,f)),[v]=j.default.useState(s?[]:(e=>{const t=ga(e,n.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};h.forEach((n=>{const{dataIndex:l}=n;"index"!==l&&aa(t,l,la(e[0],l))})),l.forEach((n=>{const l=n.summary!==Js.groupSummary.total.value?n.summary:Js.groupSummary.recordTotalIndex,a=n.formula;"count"===a&&aa(t,l,e.length),"sum"===a&&aa(t,l,g.sumBy(e,l)),"max"===a&&aa(t,l,g.maxBy(e,l)[l]),"min"===a&&aa(t,l,g.minBy(e,l)[l]),"avg"===a&&aa(t,l,(g.sumBy(e,l)/e.length).toFixed(2))})),a.push(t)})),a})(a.current.tableFullData)),b=Object.assign(Object.assign({size:r,height:400},s?{fetch:{api:u.api,params:p,dataKey:null==u?void 0:u.dataKey}}:{dataSource:v}),{columns:h,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${K.default().format(Us)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>m(e)});return j.default.createElement(gd,b)},Du=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,$size:a,flattenColumns:r}=j.default.useContext(js),{uniqueKey:i}=l.current.props,o=j.default.useRef(null),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState([]),[h,m]=j.default.useState(""),[g,v]=j.default.useState("");Vn((()=>{if(g){const{group:e,summary:t}=f.find((e=>e.value===g)).list;T(e),R(t)}else{const e=H();T((null==e?void 0:e.group)||[]),R((null==e?void 0:e.summary)||[])}}),[g]),j.default.useEffect((()=>{_()}),[]);const y=j.default.useMemo((()=>i?`summary_${i}`:""),[i]),x=j.default.useMemo((()=>r.filter((e=>![Js.expandableColumn,Js.selectionColumn,"index","pageIndex",Js.operationColumn].includes(e.dataIndex)))),[r]),E=x.filter((e=>!e.groupSummary)).map((e=>({text:pa(e.title),value:e.dataIndex}))),C=[Js.groupSummary.total,...x.filter((e=>!!e.groupSummary)).map((e=>({text:pa(e.title),value:e.dataIndex})))],S=[{text:we("qm.table.groupSummary.sumText"),value:"sum"},{text:we("qm.table.groupSummary.maxText"),value:"max"},{text:we("qm.table.groupSummary.minText"),value:"min"},{text:we("qm.table.groupSummary.avgText"),value:"avg"},{text:we("qm.table.groupSummary.countText"),value:"count"}],[w,T]=j.default.useState([]),[N,I]=j.default.useState([{title:we("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{o.current.REMOVE_RECORDS(t)}},we("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:we("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:E.map((e=>Object.assign(Object.assign({},e),{disabled:w.findIndex((t=>t.group===e.value))>-1})))})}]),[O,R]=j.default.useState([]),[k,P]=j.default.useState([{title:we("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(t)}},we("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:we("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>Object.assign(Object.assign({},e),{disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:we("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Js.groupSummary.total.value?S.slice(S.length-1):S})}]),A=j.default.useMemo((()=>{const e=w.length&&w.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[w,O]),L=()=>{y&&sessionStorage.setItem(y,JSON.stringify({group:w.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}))},H=()=>{if(!y)return;const e=sessionStorage.getItem(y);return e?JSON.parse(e):null},_=()=>Ye(void 0,void 0,void 0,(function*(){if(!y)return;const e=H();if(e){const{group:t,summary:n}=e;T(t),R(n)}let t=yield ge.default.getItem(y);t||(t=yield F(y),Array.isArray(t)&&(yield ge.default.setItem(y,t))),Array.isArray(t)&&t.length&&(p(t),!e&&v(t[0].value))})),F=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),$=dt("table"),M={visible:d,title:we("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>c(!1)};return j.default.createElement("div",{className:`${$}-group-summary__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{style:{width:"30%"}},j.default.createElement(gd,{ref:o,size:a,columns:N,dataSource:w,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>I(e),onDataChange:e=>{T(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{o.current.INSERT_RECORDS({})},style:{marginRight:0}}))),j.default.createElement("div",{className:"container line"},j.default.createElement(gd,{ref:s,size:a,columns:k,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{R(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:a,value:h,placeholder:we("qm.table.groupSummary.configText"),disabled:A,onChange:e=>{const{value:t}=e.target;m(t)}}),j.default.createElement(ot,{type:"primary",disabled:!h||A,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!y)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...f,{text:h,value:e,list:{group:w.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];p(t),v(e),m(""),yield ge.default.setItem(y,t),yield D(y,t)}))},we("qm.table.groupSummary.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[a]}px`}},j.default.createElement("span",null,we("qm.table.groupSummary.savedSetting"))),j.default.createElement("ul",null,f.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===g}),title:e.text,onClick:()=>{return t=e.value,void v(t!==g?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=f.filter((e=>e.value!==n));p(e),n===g&&v(""),yield ge.default.setItem(y,e),yield D(y,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!f.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.default.createElement(Il,M,j.default.createElement(Fu,{columns:x,group:w,summary:O})),j.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"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.groupSummary.closeButton")),j.default.createElement(ot,{type:"primary",disabled:A,onClick:()=>(L(),void c(!0))},we("qm.table.groupSummary.confirmButton"))))},$u=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,[l,a]=j.default.useState(!1),r=()=>{a(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table"),o={visible:l,title:we("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${i}-group-summary`,title:we("qm.table.groupSummary.text"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.PieChartOutlined,null))),j.default.createElement(Il,o,j.default.createElement(Du,{onClose:()=>a(!1)})))}));$u.displayName="GroupSummary";const Mu=e=>{const{onClose:t}=e,{global:n}=j.default.useContext(xe),{tableRef:l,$size:a,flattenColumns:r,setSuperFilters:i,clearTableFilter:o}=j.default.useContext(js),{uniqueKey:s}=l.current.props,d=j.default.useRef(null),[c,f]=j.default.useState([]),[p,h]=j.default.useState([]),[m,g]=j.default.useState(""),[v,y]=j.default.useState("");Vn((()=>{f(v?p.find((e=>e.value===v)).list:H()||[])}),[v]),j.default.useEffect((()=>{_()}),[]);const x=j.default.useMemo((()=>s?`superSearch_${s}`:""),[s]),E=j.default.useMemo((()=>r.filter((e=>!!e.filter))),[r]),C=ma(c),S=j.default.useMemo((()=>!(C&&ql(C))),[C]),w=j.default.useMemo((()=>!!c.length&&S),[c,S]),T=[{value:"and",text:we("qm.table.highSearch.andText")},{value:"or",text:we("qm.table.highSearch.orText")}],N=r.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:pa(e.title)}))),I=e=>["in","nin"].includes(e),O=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},R=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:we("qm.table.highSearch.gtText")},{value:"<",text:we("qm.table.highSearch.ltText")},{value:">=",text:we("qm.table.highSearch.gteText")},{value:"<=",text:we("qm.table.highSearch.lteText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:we("qm.table.highSearch.inText")},{value:"nin",text:we("qm.table.highSearch.ninText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:we("qm.table.highSearch.likeText")},{value:"==",text:we("qm.table.highSearch.eqText")},{value:"!=",text:we("qm.table.highSearch.neqText")}]}return t},[k,P]=j.default.useState([{title:we("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>j.default.createElement("div",null,j.default.createElement(ot,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(t)}},we("qm.table.highSearch.removeText")))},{title:we("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>j.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:we("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:N,rules:[{required:!0,message:we("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,l;const a=Object.values(t)[0],r=null===(n=E.find((e=>e.dataIndex===a)))||void 0===n?void 0:n.filter.type,i=R(r);e.fieldType=r,e.expression=a?null===(l=i[0])||void 0===l?void 0:l.value:"",e.condition=I(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:we("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:we("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=E.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:R(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=I(e.expression)?[]:""}}}},{title:we("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,l;const a=E.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(l=null!==(n=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==a?void 0:a.dictItems)&&void 0!==l?l:[];return{type:O(r,I(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:we("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>j.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:we("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:T,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),A=()=>{o(),i(c.map((e=>te.default(e,["index","pageIndex"])))),L(),t()},L=()=>{x&&sessionStorage.setItem(x,JSON.stringify(c.filter((e=>!!e.fieldName))))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},_=()=>Ye(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();e&&f(e);let t=yield ge.default.getItem(x);t||(t=yield F(x),Array.isArray(t)&&(yield ge.default.setItem(x,t))),Array.isArray(t)&&t.length&&(h(t),!e&&y(t[0].value))})),F=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==n?void 0:n.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),D=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),$=dt("table");return j.default.createElement("div",{className:`${$}-super-search__setting`},j.default.createElement("div",{className:"main"},j.default.createElement("div",{className:"container"},j.default.createElement(gd,{ref:d,size:a,columns:k,dataSource:c,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),f([...c]))},onDataChange:e=>{f(e)}},j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.PlusOutlined,null),onClick:()=>{d.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Js.highSearch.showSQL&&C&&j.default.createElement("code",{className:"lang-js"},C)),j.default.createElement("div",{className:"saved line"},j.default.createElement("div",{className:"form-wrap"},j.default.createElement(u.Input,{size:a,value:m,placeholder:we("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;g(t)}}),j.default.createElement(ot,{type:"primary",disabled:!m||S,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!x)return Oe("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ca(),t=[...p,{text:m,value:e,list:c.filter((e=>!!e.fieldName))}];h(t),y(e),g(""),yield ge.default.setItem(x,t),yield D(x,t)}))},we("qm.table.highSearch.saveButton"))),j.default.createElement("div",{className:"card-wrap"},j.default.createElement("h5",{style:{height:`${Js.rowHeightMaps[a]}px`}},j.default.createElement("span",null,we("qm.table.highSearch.savedSetting"))),j.default.createElement("ul",null,p.map((e=>j.default.createElement("li",{key:e.value,className:ne.default({selected:e.value===v}),title:e.text,onClick:()=>{return t=e.value,void y(t!==v?t:"");var t}},j.default.createElement("span",{className:"title"},e.text),j.default.createElement("i",{className:"svgicon close",title:we("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Ye(void 0,void 0,void 0,(function*(){if(!n)return;const e=p.filter((e=>e.value!==n));h(e),n===v&&y(""),yield ge.default.setItem(x,e),yield D(x,e)}))}},j.default.createElement(b.CloseCircleOutlined,null))))),!p.length&&j.default.createElement("div",{style:{padding:Vs}},j.default.createElement(al,null)))))),j.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"}},j.default.createElement(ot,{onClick:()=>t(),style:{marginRight:8}},we("qm.table.highSearch.closeButton")),j.default.createElement(ot,{type:"primary",disabled:w,onClick:()=>A()},we("qm.table.highSearch.searchButton"))))},ju=j.default.forwardRef(((e,t)=>{const{open:n=!0}=e,[l,a]=j.default.useState(!1),r=()=>{a(!0)};j.default.useImperativeHandle(t,(()=>({clickHandle:r})));const i=dt("table"),o={visible:l,title:we("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return j.default.createElement(j.default.Fragment,null,n&&j.default.createElement("span",{className:`${i}-super-search`,title:we("qm.table.highSearch.text"),onClick:()=>r()},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.FunnelPlotOutlined,null))),j.default.createElement(Il,o,j.default.createElement(Mu,{onClose:()=>a(!1)})))}));ju.displayName="SuperSearch";const qu=j.default.forwardRef(((e,t)=>{const{tableColumns:n,showFullScreen:l,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:s,showCollection:d,showFastSearch:c,showSuperSearch:f,showGroupSummary:p,showToolBox:h}=e,{global:m}=j.default.useContext(xe),{tableRef:g,isFullScreen:v,$size:y}=j.default.useContext(js),{uniqueKey:x,exportExcel:E}=g.current.props,C=j.default.useRef(null),S=j.default.useRef(null),w=j.default.useRef(null),T=j.default.useRef(null),N=j.default.useRef(null),I=j.default.useRef(null),O=j.default.useRef(null),R=j.default.useRef(null),k=j.default.useRef(null),P=j.default.useRef(null),A=j.default.useRef(!1),L=j.default.useMemo((()=>x?`toolBox_${x}`:""),[x]),[H,_]=j.default.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),F={fullScreen:l,reload:a,print:r,import:i,export:o&&!(null==E?void 0:E.hideIcon),clipboard:s,collection:d,fastSearch:c,superSearch:f,groupSummary:p},[D,$]=j.default.useState(!1);Vn((()=>{A.current&&(q(),A.current=!1)}),[H]),j.default.useEffect((()=>{M()}),[]),j.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!N.current)return Oe("Table","执行导出需要配置 `exportExcel` 参数");N.current.clickHandle()}})));const M=()=>{if(!L||!h)return;const e=JSON.parse(localStorage.getItem(L));e||V(L).then((e=>{e&&(_(Object.assign({},H,e)),localStorage.setItem(L,JSON.stringify(e)))})).catch((()=>{})),e&&_(Object.assign({},H,e))},q=()=>{if(!L||!h)return;const e={};for(const t in H)H[t]&&(e[t]=H[t]);localStorage.setItem(L,JSON.stringify(e)),K(L,e)},V=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==m?void 0:m.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),K=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==m?void 0:m.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),z=e=>Ye(void 0,void 0,void 0,(function*(){$(!1),yield tt(100),e.current.clickHandle()})),B=(e,t)=>{A.current=!0,_(Object.assign({},H,{[t]:e}))},W=dt("table"),U={"top-toolbox__popper":!0,[`${W}--lg`]:"large"===y,[`${W}--sm`]:"small"===y};return j.default.createElement(j.default.Fragment,null,l&&j.default.createElement(cu,{ref:C,isFullScreen:v,open:!h||H.fullScreen}),a&&j.default.createElement(fu,{ref:S,open:!h||H.reload}),r&&j.default.createElement(hu,{ref:w,tableColumns:n,open:!h||H.print}),i&&j.default.createElement(Nu,{ref:T,tableColumns:n,open:!h||H.import}),o&&j.default.createElement(Ru,{ref:N,tableColumns:n,open:(!h||H.export)&&!(null==E?void 0:E.hideIcon)}),s&&j.default.createElement(Pu,{ref:I,open:!h||H.clipboard}),d&&j.default.createElement(Lu,{ref:O,columns:n,open:!h||H.collection}),c&&j.default.createElement(_u,{ref:R,open:!h||H.fastSearch}),p&&j.default.createElement($u,{ref:k,open:!h||H.groupSummary}),f&&j.default.createElement(ju,{ref:P,open:!h||H.superSearch}),h&&j.default.createElement(u.Dropdown,{open:D,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.fullScreen,style:{marginRight:6},onChange:e=>B(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.screen.full"))),onClick:()=>z(C)},{key:"reload",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.reload,style:{marginRight:6},onChange:e=>B(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.refresh.text"))),onClick:()=>z(S)},{key:"print",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.print,style:{marginRight:6},onChange:e=>B(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.print.text"))),onClick:()=>z(w)},{key:"import",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.import,style:{marginRight:6},onChange:e=>B(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.import.textNoSpace"))),onClick:()=>z(T)},{key:"export",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.export,style:{marginRight:6},onChange:e=>B(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.export.textNoSpace"))),onClick:()=>z(N)},{key:"clipboard",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.clipboard,style:{marginRight:6},onChange:e=>B(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.clipboard.textNoSpace"))),onClick:()=>z(I)},{key:"collection",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.collection,style:{marginRight:6},onChange:e=>B(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.selectCollection.text"))),onClick:()=>z(O)},{key:"fastSearch",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.fastSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.fastSearch.text"))),onClick:()=>z(R)},{key:"groupSummary",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.groupSummary,style:{marginRight:6},onChange:e=>B(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.groupSummary.text"))),onClick:()=>z(k)},{key:"superSearch",label:j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Checkbox,{checked:H.superSearch,style:{marginRight:6},onChange:e=>B(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),j.default.createElement("span",null,we("qm.table.highSearch.text"))),onClick:()=>z(P)}];return j.default.createElement(u.Menu,{items:e.filter((e=>F[e.key]))})})(),overlayClassName:ne.default(U),overlayStyle:{minWidth:120},onOpenChange:e=>{$(e)}},j.default.createElement("span",{className:`${W}-toolbox`,title:we("qm.table.toolbox.text")},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.AppstoreAddOutlined,null)))))}));qu.displayName="ToolBox";const Vu=(e,t)=>e.map((e=>(e.children&&(e.children=Vu(e.children,t)),t(e)))),Ku=j.default.forwardRef(((e,t)=>{const{columns:n}=e,{global:l}=j.default.useContext(xe),{tableRef:a,$size:r}=j.default.useContext(js),{showColumnDefine:i,uniqueKey:o,onlyShowIcon:s,columnsChange:d}=a.current.props,c=j.default.useRef([]),f=e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)),p=e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)),h=e=>e.filter((e=>!e.noAuth&&!e.fixed)),[m,v]=j.default.useState(!1),[y,x]=j.default.useState(f(n)),[E,C]=j.default.useState(p(n)),[S,w]=j.default.useState(h(n)),T=j.default.useMemo((()=>o?`table_${o}`:""),[o]),N=j.default.useMemo((()=>[...y,...S,...E]),[y,S,E]);Vn((()=>{L(n),P(n),R(n)}),[n]),j.default.useLayoutEffect((()=>{k()}),[]),j.default.useImperativeHandle(t,(()=>({initialHandler:k})));const I=()=>{if(!T)return;const e=JSON.parse(localStorage.getItem(T));var t;if(e||(t=T,Ye(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(T,JSON.stringify(e)),k()):(null==l?void 0:l.getComponentConfigApi)&&R(n)})).catch((()=>{})),!e)return;return g.xor(Bl(e).map((e=>e.dataIndex)),Bl(n).map((e=>e.dataIndex))).length>0?Vu(n,(t=>{const n=Ul(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Vu(e,(e=>{const t=Ul(n,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},O=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=O(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)})),R=e=>{if(!T)return;const t=O(e),n=JSON.parse(localStorage.getItem(T));var r,i;a.current.columnsDefined&&!g.isEqual(t,n)&&(localStorage.setItem(T,JSON.stringify(t)),r=T,i=t,Ye(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},k=()=>{const e=I();e&&(null==d||d(e))},P=e=>{const t=f(e),n=p(e),l=h(e);return x(t),C(n),w(l),[...t,...l,...n]},L=e=>{const t=[];e.filter((e=>!e.noAuth)).forEach(((n,l)=>{const a=n.colSpan;a>1&&e.slice(l+1,l+a).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(l,l+a))})),c.current=t},H=()=>{const e=t=>t.map((t=>{const l=Ul(n,t.dataIndex)||rt(t);return t.children&&(l.children=e(t.children)),Object.assign(l,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==d||d(e(a.current.originColumns))},_=()=>{const e=[];N.forEach((t=>{const{colSpan:n,dataIndex:l}=t;if(0===n)return;if(1===n)return e.push(t);const a=c.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(l)));if(-1===a)return e.push(t);e.push(...c.current[a].map(((e,n)=>{let{dataIndex:l}=e;const a=N.find((e=>e.dataIndex===l));return n>0&&(void 0!==t.hidden&&(a.hidden=t.hidden),void 0!==t.fixed?a.fixed=t.fixed:a.fixed&&delete a.fixed),a})))})),n.forEach(((t,n)=>{t.noAuth&&e.findIndex((e=>e.dataIndex===t.dataIndex))<0&&e.splice(n,0,t)})),null==d||d(e)},F=(e,t)=>{if(e.noFixed)return;t?e.fixed=t:delete e.fixed;const l=P(n);null==d||d(l)},D=(e,t)=>{var n;const{colSpan:l,noFixed:a}=e;if(0===l)return j.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const r=pa(e.title),i=["svgicon","handle",`${t}-handle`],o=j.default.createElement("li",{key:e.dataIndex,className:"item"},j.default.createElement(u.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,_()}}),j.default.createElement("i",{className:ne.default(i),title:we("qm.table.columnFilter.draggable")},j.default.createElement(b.HolderOutlined,null)),j.default.createElement("span",{className:"text",title:r},r),"main"===t?j.default.createElement("span",{className:ne.default("fixed",a?"disabled":"")},j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.fixedLeft"),onClick:()=>F(e,"left")},j.default.createElement(b.StepBackwardOutlined,null)),j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.fixedRight"),onClick:()=>F(e,"right")},j.default.createElement(b.StepForwardOutlined,null))):"sub"!==t?j.default.createElement("span",{className:ne.default("fixed",a?"disabled":"")},j.default.createElement("i",{className:"svgicon",title:we("qm.table.columnFilter.cancelFixed"),onClick:()=>F(e)},j.default.createElement(b.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(n=e.children)||void 0===n?void 0:n.length)?j.default.createElement(u.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:$(e.children,e.dataIndex)},o):o},$=(e,t)=>j.default.createElement("div",{className:"column-filter--wrap"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:l=>{const a=l.map((e=>e.dataIndex)),r=e.map((e=>e.dataIndex));g.isEqual(a,r)||((e,t)=>{Ul(n,t).children=e,null==d||d([...n])})(Ea(l),t)}},e.map((e=>D(e,"sub"))))),M=dt("table"),q={[`${M}__popper`]:!0,"column-filter__popper":!0,[`${M}--lg`]:"large"===r,[`${M}--sm`]:"small"===r},V=[`${M}-column-filter`,{selected:m}];return i?j.default.createElement(io,{action:["click"],popupVisible:m,popup:j.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},j.default.createElement("div",{className:"reset"},j.default.createElement(ot,{type:"text",size:"small",onClick:H},we("qm.table.columnFilter.reset"))),j.default.createElement("div",{className:"left"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));g.isEqual(t,n)||x(Ea(e))},onEnd:()=>_()},y.map((e=>D(e,"left"))))),j.default.createElement("div",{className:"divider"}),j.default.createElement("div",{className:"main"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:S,setList:e=>{const t=e.map((e=>e.dataIndex)),n=S.map((e=>e.dataIndex));g.isEqual(t,n)||w(Ea(e))},onEnd:()=>_()},S.map((e=>D(e,"main"))))),j.default.createElement("div",{className:"divider"}),j.default.createElement("div",{className:"right"},j.default.createElement(A.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:E,setList:e=>{const t=e.map((e=>e.dataIndex)),n=E.map((e=>e.dataIndex));g.isEqual(t,n)||C(Ea(e))},onEnd:()=>_()},E.map((e=>D(e,"right")))))),popupClassName:ne.default(q),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{v(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},j.default.createElement("span",{className:ne.default(V),title:s?we("qm.table.columnFilter.text"):void 0},j.default.createElement("i",{className:"svgicon icon"},j.default.createElement(b.SettingOutlined,null)),!s&&j.default.createElement("span",null,we("qm.table.columnFilter.text")))):null}));Ku.displayName="ColumnFilter";const zu=()=>j.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Bu=e=>{const{column:t,filters:n}=e,{$size:l,setFilters:a,clearSuperFilters:r}=j.default.useContext(js),i=j.default.useRef(null),o=j.default.useRef(null),s=j.default.useRef(null),[d,c]=j.default.useState(!1),[f,p]=j.default.useState(!1),[h,m]=j.default.useState({}),v=j.default.useMemo((()=>{const{dataIndex:e,filter:n}=t;return`${e}|${n.type}`}),[t]),b=j.default.useMemo((()=>{let e=!1;for(const t in n[v])if(!at(n[v][t])||f){e=!0;break}return e}),[v,n,f]);j.default.useEffect((()=>{d&&setTimeout((()=>y()),50)}),[d]),j.default.useEffect((()=>{var e;g.isEqual(h[v],n[v])||m({[v]:n[v]||{}}),p(""===(null===(e=n[v])||void 0===e?void 0:e["=="]))}),[n]);const y=()=>{switch(t.filter.type){case"text":i.current.focus();break;case"number":o.current.focus();break;case"textarea":s.current.focus()}},x=e=>{e&&m(e),r(),a((e=>{for(const t in e){for(const n in e[t])if(at(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},n),h),e))),c(!1)},E={text:e=>{var t,n;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input,{ref:i,size:l,placeholder:we("qm.table.filter.searchText",{text:pa(e.title)}),style:{width:"180px"},value:null!==(n=null===(t=h[v])||void 0===t?void 0:t.like)&&void 0!==n?n:"",disabled:f,onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&x()}}),j.default.createElement("div",{style:{marginTop:8}},j.default.createElement(u.Checkbox,{checked:f,onChange:e=>{const{checked:t}=e.target,n=t?"":null;m((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),p(t)}},we("qm.table.filter.nullValue"))))},textarea:e=>{var t,n;return j.default.createElement(j.default.Fragment,null,j.default.createElement(u.Input.TextArea,{ref:s,size:l,placeholder:we("qm.table.filter.searchAreaText",{text:pa(e.title)}),style:{width:"220px"},value:null!==(n=null===(t=h[v])||void 0===t?void 0:t.likes)&&void 0!==n?n:"",disabled:f,onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),x())}}),j.default.createElement("div",{style:{marginTop:8}},j.default.createElement(u.Checkbox,{checked:f,onChange:e=>{const{checked:t}=e.target,n=t?"":null;m((e=>Object.assign({},e,{[v]:{"==":n,like:null}}))),p(t)}},we("qm.table.filter.nullValue"))))},number:e=>{const t=e=>{var t,n;return{value:null!==(n=null===(t=h[v])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:l,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||m((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return j.default.createElement("ul",null,j.default.createElement("li",null,j.default.createElement("span",null,"> "),j.default.createElement(u.InputNumber,qe({ref:o},t(">"),{placeholder:we("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"< "),j.default.createElement(u.InputNumber,qe({},t("<"),{placeholder:we("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"= "),j.default.createElement(u.InputNumber,qe({},t("=="),{placeholder:we("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"!="),j.default.createElement(u.InputNumber,qe({},t("!="),{placeholder:we("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>{var t;return{value:ua(null===(t=h[v])||void 0===t?void 0:t[e],Bs),format:Bs,size:l,onChange:t=>{m((n=>Object.assign({},n,{[v]:Object.assign({},n[v],{[e]:da(t,Bs)})})))},onKeyDown:e=>{13===e.keyCode&&x()}}};return j.default.createElement("ul",null,j.default.createElement("li",null,j.default.createElement("span",null,"> "),j.default.createElement(je,qe({},t(">"),{placeholder:we("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"< "),j.default.createElement(je,qe({},t("<"),{placeholder:we("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"= "),j.default.createElement(je,qe({},t("=="),{placeholder:we("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),j.default.createElement("li",null,j.default.createElement("span",null,"!="),j.default.createElement(je,qe({},t("!="),{placeholder:we("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("ul",null,j.default.createElement(u.Radio.Group,{style:{width:"100%"},value:null===(t=h[v])||void 0===t?void 0:t["=="],onChange:e=>{const{value:t}=e.target;m((e=>Object.assign({},e,{[v]:{"==":t}})))}},a.map((e=>j.default.createElement("li",{key:e.value},j.default.createElement(u.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("ul",null,j.default.createElement(u.Checkbox.Group,{style:{width:"100%"},value:null===(t=h[v])||void 0===t?void 0:t.in,onChange:e=>{m((t=>Object.assign({},t,{[v]:{in:e}})))}},a.map((e=>j.default.createElement("li",{key:e.value},j.default.createElement(u.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var t;const{filter:n,dictItems:l=[]}=e,a=n.items||l;return j.default.createElement("div",{style:Object.assign({height:200},n.style)},j.default.createElement(Ms,{multiple:!0,value:(null===(t=h[v])||void 0===t?void 0:t.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));m((e=>Object.assign({},e,{[v]:{in:t}})))}}))}},C=()=>j.default.createElement(u.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},j.default.createElement(ot,{size:l,onClick:()=>{x({[v]:{}})}},we("qm.table.filter.reset")),j.default.createElement(ot,{type:"primary",size:l,onClick:()=>x()},we("qm.table.filter.search"))),S=dt("table"),w={"head-filter__popper":!0,[`${S}--lg`]:"large"===l,[`${S}--sm`]:"small"===l},T=["cell--filter",{selected:d,actived:b}];return j.default.createElement(io,{action:["click"],popupVisible:d,popup:(()=>{const e=t.filter.type,n=E[e];return n?j.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},j.default.createElement("div",null,n(t)),C()):(Oe("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:ne.default(w),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{c(e)},builtinPlacements:Gs,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},j.default.createElement("div",{className:ne.default(T),title:we("qm.table.filter.text"),onClick:e=>e.stopPropagation()},j.default.createElement("span",{className:"svgicon icon"},j.default.createElement(zu,null))))},Wu=e=>{const{column:t}=e,{tableRef:n,bordered:l}=j.default.useContext(js),{columns:a,resizable:r,columnsChange:i=Je}=n.current.props,o=j.default.useMemo((()=>Yl(t)),[t]),s={resizable:!0,"is--line":r&&!l};return j.default.createElement("div",{className:ne.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:l}=n.current,r=l.$resizableBar,s=t.offsetWidth/2,u=e.clientX,d=ea(t,l.$table).left-l.$tableBody.parentNode.parentNode.scrollLeft+s;l.$table.classList.add("c--resize"),r.style.left=`${d}px`,r.style.display="block";const c=o.width||o.renderWidth;let f=c;return document.onmousemove=function(e){if("number"!=typeof c)return;const t=e.clientX-u,n=c+t;n<(o.minWidth||Js.defaultColumnWidth)||(f=Math.floor(n),r.style.left=`${t+d}px`)},document.onmouseup=function(){l.$table.classList.remove("c--resize"),r.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof f&&(Ul(a,o.dataIndex).width=f,i([...a]))},!1}})},Uu=e=>{const{selectionKeys:t}=e,{tableRef:n,getRowKey:l,pagination:a,fetchParams:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:s,isFetch:d,isWebPagination:c}=j.default.useContext(js),{rowSelection:f}=n.current.props,{fetchAllRowKeys:p,selectAllOnCurrentPage:h,filterable:m,onSelectAll:v}=f,y=j.default.useRef([]),x=j.default.useMemo((()=>d&&!!p),[d,p]),E=j.default.useMemo((()=>!x&&!!h),[x,h]),C=j.default.useMemo((()=>(null==m||m)&&!E),[m,E]),S=()=>{const{tableFullData:e}=n.current,{current:t,pageSize:l}=a;return c?e.slice((t-1)*l,t*l):e},w=(()=>{const{allTableData:e,allRowKeys:t,selectionRows:a}=n.current,{disabled:r}=f;if(x)return y.current.length?y.current:g.union(t,a.map((e=>l(e,e.index))));if(!E)return r?t.filter(((t,n)=>!r(e[n]))):t;const i=r?S().filter((e=>!r(e))).map((e=>l(e,e.index))):S().map((e=>l(e,e.index)));return g.union(i,a.map((e=>l(e,e.index))))})(),T=t.filter((e=>!w.includes(e))),N=t.length-T.length,I=N>0&&N<w.length,O=!!N&&N===w.length;o(T);const R=()=>Ye(void 0,void 0,void 0,(function*(){var e;const t=p;let n=[];s(!0);try{const a=yield t.api(r);if(200===a.code){n=Array.isArray(a.data)?a.data:null!==(e=g.get(a.data,t.dataKey))&&void 0!==e?e:[];const{disabled:r}=f;r&&(n=g.xor(n,S().filter((e=>r(e))).map((e=>l(e,e.index))))),y.current=n}}catch(e){}return s(!1),n})),k=e=>Ye(void 0,void 0,void 0,(function*(){let t=[];t=x?e?yield R():[]:e?w.slice(0):[],t=[...new Set([...t,...T])],i(t),null==v||v(e,t)})),P=()=>{const e=[{key:1,label:we("qm.table.selection.all"),onClick:()=>{k(!0)}},{key:2,label:we("qm.table.selection.invert"),onClick:()=>Ye(void 0,void 0,void 0,(function*(){let e=[];e=x?g.xor(t,yield R()):g.xor(t,w),e=[...new Set([...e,...T])],i(e)}))},{key:3,label:we("qm.table.selection.clear"),onClick:()=>{k(!1)}}];return j.default.createElement(u.Menu,{items:e})};return j.default.createElement("div",{className:"cell--selection"},j.default.createElement(u.Checkbox,{checked:O,indeterminate:I,disabled:!w.length,onChange:e=>k(e.target.checked)}),C&&j.default.createElement(u.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>P()},j.default.createElement(b.DownOutlined,{className:"svgicon icon"})),E&&j.default.createElement(u.Tooltip,{placement:"top",title:we("qm.table.selection.currentPage")},j.default.createElement(b.InfoCircleOutlined,{className:"info"})))},Gu=e=>{const{style:t}=e,{tableRef:n,isTreeTable:l,setRowExpandedKeys:a}=j.default.useContext(js),{expandable:r}=n.current.props,[i,o]=j.default.useState((null==r?void 0:r.defaultExpandAllRows)||!1);Vn((()=>{const{allRowKeys:e,flattenRowKeys:t}=n.current;a(i?e.filter((e=>!(l&&t.includes(e)))):[])}),[i]);const s={[`${dt("expand")}--icon`]:!0,expanded:i,collapsed:!i};return j.default.createElement("span",{className:ne.default(s),title:"",onClick:e=>{e.stopPropagation(),o(!i)},style:t})},Yu=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Xu=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),Qu=e=>{const{tableColumns:t,sorter:n,filters:l}=e,{tableRef:a,layout:r,scrollY:i,flattenColumns:o,superFilters:s,selectionKeys:d,rightFixedColumns:c,treeExpandIndex:f,isFetch:p,isTreeTable:h,isGroupSubtotal:m,tableChange:v,setSorter:y,setElementStore:x,resetTableScroll:E,getStickyLeft:C,getStickyRight:S,createGroupData:w,createTableFullData:T}=j.default.useContext(js),{ellipsis:N,resizable:I,multipleSort:O,rowSelection:R,expandable:k}=a.current.props,[P,A]=Js.sortDirections,{tableOriginData:L}=a.current,H=j.default.useRef(null),_=j.default.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),F=j.default.useMemo((()=>!p),[p]),D=j.default.useMemo((()=>!p),[p]),$=j.default.useMemo((()=>!(null==k?void 0:k.hideExpandAll)),[k]),M=j.default.useMemo((()=>!!R&&(p?!(!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys):!R.hideSelectAll)),[p,R]);Vn((()=>{U(),v(),E()}),[n]),Vn((()=>{X(),v(),E()}),[l]),Vn((()=>{X(),v(),E()}),[s]),j.default.useEffect((()=>{q(),!at(n)&&nt((()=>U())),!at(l)&&nt((()=>X()))}),[]);const q=()=>{x("$header",H.current)},V=(e,t,l)=>{var o,s,u;const{isIE:d}=a.current,{gutterWidth:c}=r,{dataIndex:f,colSpan:p,rowSpan:h,fixed:m,align:g,theadAlign:v,theadClassName:b="",sorter:y,filter:x,required:E,headRender:w}=e;if(0===p)return null;const T=v||g,O=["header--column",{"col--ellipsis":null!==(o=e.ellipsis)&&void 0!==o?o:N,"col--center":"center"===T,"col--right":"right"===T,"column--required":!!E,"column-has-sorter":y,"column-has-filter":x,"column--sort":!!n[f],"cell-fix-left":!d&&"left"===m,"cell-fix-right":!d&&"right"===m,"cell-fix-left-last":!d&&"left"===m&&!(null===(s=l[t+1])||void 0===s?void 0:s.fixed),"cell-fix-right-first":!d&&"right"===m&&!(null===(u=l[t-1])||void 0===u?void 0:u.fixed),[b]:!!b}],R=d?null:{left:"left"===m?`${C(f)}px`:"",right:"right"===m?`${S(f)+(i?c:0)}px`:""},k=I&&![Js.expandableColumn,Js.selectionColumn].includes(f);return j.default.createElement("th",{key:f,className:ne.default(O),colSpan:p,rowSpan:h,style:Object.assign({},R),onClick:t=>W(t,e)},j.default.createElement("div",{className:"cell--wrapper"},w?j.default.createElement("div",{className:"cell--text cell"},w(e,a.current.tableFullData)):j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{className:"cell--text"},K(e)),x?B(e):null)),k&&j.default.createElement(Wu,{column:e}))},K=e=>{const{dataIndex:t,type:l,sorter:a,title:r,description:i}=e;if(t===Js.selectionColumn&&"checkbox"===l){if("checkbox"===l)return j.default.createElement("div",{className:"cell"},M?j.default.createElement(Uu,{selectionKeys:d}):we("qm.table.config.selectionText"));if("radio"===l)return j.default.createElement("div",{className:"cell"},r)}const o=[];return o.push(j.default.createElement("div",{key:0,className:"cell",title:pa(r)},h&&t===f&&$?j.default.createElement(Gu,null):null,t===Js.expandableColumn&&$?j.default.createElement(Gu,null):r)),i&&o.push(j.default.createElement(u.Tooltip,{key:1,placement:"top",title:i},j.default.createElement(b.InfoCircleOutlined,{className:"tip"}))),a&&o.push(z(n[t])),o},z=e=>{const t=["svgicon cell--sorter__asc",{actived:e===P}],n=["svgicon cell--sorter__desc",{actived:e===A}];return j.default.createElement("div",{key:2,className:"cell--sorter",title:we("qm.table.sorter.text")},j.default.createElement("span",{className:ne.default(t)},j.default.createElement(Yu,null)),j.default.createElement("span",{className:ne.default(n)},j.default.createElement(Xu,null)))},B=e=>j.default.createElement(Bu,{column:e,filters:l}),W=(e,t)=>{const{sorter:l,dataIndex:a}=t;if(l){const e=n[a],t=e?e===A?null:A:P;O?(delete n[a],y(Object.assign({},n,{[a]:t}))):y(Object.assign({},{[a]:t}))}},U=()=>{F&&G()},G=e=>{const t=g.pickBy(n,(e=>null!==e));for(const e in t){const n=o.find((t=>t.dataIndex===e));n?Y(n,t[e]):delete t[e]}e||Object.keys(t).length||Y({dataIndex:"index"},P)},Y=(e,t)=>{const{tableFullData:n}=a.current,{dataIndex:l,sorter:r}=e,i=(e,n)=>{const a=la(e,l),r=la(n,l);return Number.isNaN(a-r)?t===P?a.toString().localeCompare(r.toString()):r.toString().localeCompare(a.toString()):t===P?a-r:r-a},o=m?w(ha(n).sort("function"==typeof r?r:i)):n.sort("function"==typeof r?r:i).slice(0);T(o)},X=()=>{D&&Q()},Q=()=>{const e=s.length?ma(s):ma(l),t=""!==e?m?w(Vl(ha(L),e,_)):Vl(L,e,_):L;T(t),G(!0)},Z=Jl(t),J=dt("table"),{tableBodyWidth:ee}=r;return j.default.createElement("div",{ref:H,className:`${J}--header-wrapper`},j.default.createElement("table",{className:`${J}--header`,cellSpacing:"0",cellPadding:"0",style:{width:ee?`${ee}px`:""}},(()=>{const{gutterWidth:e}=r;return j.default.createElement("colgroup",null,o.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})})),i&&j.default.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),j.default.createElement("thead",null,(e=>{const{isIE:t}=a.current,n=["gutter",{"cell-fix-right":!!c.length}],l=t?null:{right:c.length?0:""};return e.map(((e,t)=>j.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,n)=>V(t,n,e))),i&&j.default.createElement("th",{className:ne.default(n),style:Object.assign({},l)}))))})(Z))))},Zu=j.default.createContext([]);function Ju(e,t){const[n,l]=M.useState(!1);return M.useEffect((()=>{let n;const a=e.current,r=e=>{n=e},i=e=>{((e,n)=>{const r=e.target,i=null==n?void 0:n.target,o=!r||!i,s=(null==a?void 0:a.contains(r))||(null==a?void 0:a.contains(i)),u=a===r,d=(null==t?void 0:t.map((e=>Array.from(document.querySelectorAll(e)))).flat())||[],c=d.some((e=>null==e?void 0:e.contains(r)))||d.includes(i);l(!(o||s||u||c))})(e,n)};return a&&(Kn(document,"mousedown",r),Kn(document,"mouseup",i)),()=>{a&&(zn(document,"mousedown",r),zn(document,"mouseup",i))}}),[e]),n}function ed(){const[,e]=M.useReducer((e=>e+1),0);return e}function td(){const{locale:e}=M.useContext(xe);return{t:we,$locale:e}}const nd=e=>{const{selectionKeys:t,column:n,record:l,rowKey:a}=e,{tableRef:r,isTreeTable:i,getAllChildRowKeys:o}=j.default.useContext(js),{rowSelection:s}=r.current.props,d=j.default.useMemo((()=>n.type||""),[n.type]),c=e=>{var n,l;const a=null===(n=s.checkStrictly)||void 0===n||n;if(!i||a)return!1;const u=Ql(r.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let l=!1,a=!1;for(const t of e)if(n.has(t)?l=!0:a=!0,l&&a)break;return l&&a})(o(null!==(l=null==u?void 0:u.children)&&void 0!==l?l:[]),t)};return"radio"===d?(()=>{const e=s.disabled,n=null==e?void 0:e(l),r=!n&&t[0]===a;return j.default.createElement(u.Radio,{checked:r,disabled:n})})():(()=>{const e=s.disabled,n=null==e?void 0:e(l),r=!!t.includes(a);return j.default.createElement(u.Checkbox,{checked:r,indeterminate:c(a),disabled:n})})()},ld=e=>{const{record:t,rowKey:n,style:l}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=j.default.useContext(js),{expandable:o={}}=a.current.props,[s]=j.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),u=j.default.useMemo((()=>r.includes(n)),[r,n]);Vn((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,u,t)}),[u]);const d={[`${dt("expand")}--icon`]:!0,expanded:u,collapsed:!u,disabled:s};return j.default.createElement("span",{className:ne.default(d),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=u?r.filter((e=>e!==n)):[...r,n];i(t)},style:l})},ad=j.default.forwardRef(((e,t)=>{const{size:n,defaultValue:l,value:a,min:r,max:i,prefix:o,suffix:s,placeholder:d,maxLength:c,precision:f,stringMode:p,allowClear:h,readOnly:m,disabled:g,formatter:v=(e=>e.toString()),parser:b=(e=>e),onFocus:y}=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 ce.default(t).toFixed(f)),t},E=void 0!==a,[C,S]=j.default.useState(null!=l?l:""),w=v(E?a:C),T=b(w);Vn((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,T)}),[C]);return j.default.createElement(u.Input,{ref:t,size:n,value:w,maxLength:c,prefix:o,suffix:s,placeholder:d,allowClear:h,readOnly:m,disabled:g,onChange:t=>{const n=b(t.target.value);let l=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===f&&n.includes(".")&&(l=!1),r>=0&&n.startsWith("-")&&(l=!1),l){if(!p&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):S(t)})(n)}},onFocus:y,onBlur:()=>{var t;const n=x(T);null===(t=e.onBlur)||void 0===t||t.call(e,n,T)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(T),T))}})}));ad.displayName="InputNumber";const{Search:rd}=u.Input,id=j.default.forwardRef(((e,t)=>{var n,l,a,r,i,o;const{column:s,record:d,rowKey:c,columnKey:f}=e,{tableRef:p,tableBodyRef:h,$size:m,flattenColumns:v,updateTableData:y,doFieldValidate:x,dataChange:E}=j.default.useContext(js),C=j.default.useContext(Zu),S=ed(),{store:w,fieldAuth:T}=p.current,N=(null===(n=s.editRender)||void 0===n?void 0:n.call(s,d,s))||{},I=j.default.useRef(null),O=j.default.useRef(null),R=j.default.useRef(null),k=j.default.useRef(null),P=j.default.useRef(null),A=j.default.useRef(!1),L=j.default.useRef({}),H=j.default.useRef({}),_=j.default.useRef([]),[F,D]=j.default.useState(!1),[$,M]=j.default.useState(!1),[q,V]=j.default.useState(!1),[K,z]=j.default.useState(N.items||[]),[B,W]=j.default.useState(),U=(N.editable||g.isEqual(C,[c,f]))&&!N.disabled&&!(null===(l=T[f])||void 0===l?void 0:l.disabled),G=`${c}|${f}`,Y=2===C.length?`${C[0]}|${C[1]}`:"",X=![...w.state.required,...w.state.validate].some((e=>{let{x:t,y:n}=e;return t===c&&n===f})),Q=(null===(a=w.state.required.find((e=>{let{x:t,y:n}=e;return t===c&&n===f})))||void 0===a?void 0:a.text)||"",Z=(null===(r=w.state.validate.find((e=>{let{x:t,y:n}=e;return t===c&&n===f})))||void 0===r?void 0:r.text)||"",J=w.state.edited.some((e=>{let{x:t,y:n}=e;return t===c&&n===f})),ee=U||!X||F||q||$,te=!!(null===(i=N.helper)||void 0===i?void 0:i.combinedDataIndex)&&("search-helper"===N.type||"tree-helper"===N.type),le=null===(o=N.type)||void 0===o?void 0:o.endsWith("multiple");j.default.useEffect((()=>{ee&&Y===G&&oe()}),[C]),j.default.useLayoutEffect((()=>{const{items:e}=N;le&&e&&ie(e.map((e=>({[H.current.valueKey]:e.value,[H.current.textKey]:e.text}))))}),[]);const ae=()=>{y(),E()},re=(e,t)=>{D(e),null==t||t()},ie=e=>{_.current=e},oe=()=>{var e,t,n,l;const{type:a}=N;switch(a){case"text":null===(e=O.current)||void 0===e||e.focus();break;case"number":null===(t=R.current)||void 0===t||t.select();break;case"search-helper":null===(n=k.current)||void 0===n||n.focus();break;case"tree-helper":null===(l=P.current)||void 0===l||l.focus()}};j.default.useImperativeHandle(t,(()=>({focus:oe})));const se=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},ue=(e,t,n)=>{const{cornerSign:l=!0}=N.extra||{};w.addToUpdated(e),l&&w.addToEdited({x:t,y:n})},de=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",fe={text:(e,t,n)=>{const{dataIndex:l}=t,{type:a,extra:r={},rules:i=[],onInput:o,onChange:s,onEnter:d,onBlur:p}=N,h=la(e,l),g=Object.assign({},{minRows:1,maxRows:4},r.autoSize),v=n?{rows:g.minRows,autoSize:g}:null,b=r.password?u.Input.Password:n?u.Input.TextArea:u.Input;return j.default.createElement(b,qe({ref:O,size:m,value:h,maxLength:r.maxLength,showCount:r.showCount},v,{autoComplete:r.password?"new-password":"off",placeholder:r.placeholder||we("qm.table.editable.inputPlaceholder"),allowClear:r.allowClear,readOnly:r.readOnly,disabled:r.disabled,suffix:r.suffix,onChange:t=>{var n;const a=null!==(n=t.target.value)&&void 0!==n?n:"";aa(e,l,a),x(i,a,c,f),S(),null==o||o({[G]:a}),A.current=!0},onFocus:()=>M(!0),onBlur:t=>{var n;M(!1);const l=null!==(n=t.target.value)&&void 0!==n?n:"";A.current&&(A.current=!1,ue(e,c,f),null==s||s({[G]:l},e),null==p||p({[G]:l},e),ae())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==d||d({[G]:l},e)}},onKeyDown:e=>{n&&13===e.keyCode&&!e.shiftKey&&d&&e.preventDefault()}}))},textarea:(e,t)=>fe.text(e,t,!0),number:(e,t)=>{var n;const{dataIndex:l,precision:a,formatType:r}=t,{type:i,extra:o={},rules:s=[],onInput:u,onChange:d,onEnter:p,onBlur:h}=N,g=la(e,l);let v,b;return"finance"===r&&(v=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"===r&&(v=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ce.default(e).times(100).toNumber()}`,b=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ce.default(e).times(.01).toString()),j.default.createElement(ad,{ref:R,size:m,value:g,min:o.min,max:o.max,precision:a,stringMode:o.stringMode,prefix:o.prefix,suffix:null!==(n=o.suffix)&&void 0!==n?n:"percent"===r?"%":void 0,placeholder:o.placeholder||we("qm.table.editable.inputPlaceholder"),maxLength:o.maxLength,allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,formatter:v,parser:b,onChange:t=>{aa(e,l,t),x(s,t,c,f),S(),null==u||u({[G]:t}),A.current=!0},onFocus:()=>M(!0),onBlur:(t,n)=>{if(M(!1),!A.current)return;A.current=!1;let a=o.stringMode?t:de(t);"percent"===r&&"."===n.charAt(n.length-1)&&(a=Number(t)/100),aa(e,l,a),ue(e,c,f),null==d||d({[G]:a},e),null==h||h({[G]:a},e),ae()},onEnter:(t,n)=>{let l=o.stringMode?t:de(t);"percent"===r&&"."===n.charAt(n.length-1)&&(l=Number(t)/100),null==p||p({[G]:l},e)}})},select:(e,t,n)=>{var l;const{dataIndex:a,dictItems:r=[]}=t,{type:i,extra:o={},rules:s=[],items:d,onChange:h,onEnter:g}=N;p.current;const v=d||r,b=la(e,a);let y=b;return j.default.createElement(u.Select,{mode:n?"multiple":void 0,size:m,popupClassName:"table-editable__popper",value:b||void 0,placeholder:o.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,listHeight:o.listHeight,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},showSearch:null===(l=o.filterable)||void 0===l||l,filterOption:(e,t)=>{var n;const l=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${l}|${nr.parse(l).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{aa(e,a,t),x(s,t,c,f),ue(e,c,f),null==h||h({[G]:t},e),ae()},onSelect:e=>{y=e},onInputKeyDown:t=>{13===t.keyCode&&nt((()=>null==g?void 0:g({[G]:y},e)))}},v.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>fe.select(e,t,!0),date:(e,t,n)=>{var l;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onChange:s}=N,u=n||"exactdate",d=la(e,a);return j.default.createElement(je,{size:m,popupClassName:"table-editable__popper",value:null!==(l=ua(d,Ra[u]))&&void 0!==l?l:void 0,picker:Oa[u],format:i.format,showTime:"datetime"===u,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=i;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:i.placeholder,allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:t=>{const n=da(t,Ra[u]);aa(e,a,n),x(o,n,c,f),ue(e,c,f),null==s||s({[G]:n},e),ae()}})},datetime:(e,t)=>fe.date(e,t,"datetime"),month:(e,t)=>fe.date(e,t,"month"),year:(e,t)=>fe.date(e,t,"year"),time:(e,t)=>{var n;const{dataIndex:l}=t,{type:a,extra:r={},rules:i=[],onChange:o}=N,s="HH:mm:ss",u=la(e,l);return j.default.createElement(Ve,{size:m,popupClassName:"table-editable__popper",value:null!==(n=ua(u,s))&&void 0!==n?n:void 0,format:r.format||s,placeholder:r.placeholder,allowClear:r.allowClear,disabled:r.disabled,style:{width:"100%"},onChange:t=>{const n=da(t,s);aa(e,l,n),x(i,n,c,f),ue(e,c,f),null==o||o({[G]:n},e),ae()}})},checkbox:(e,t)=>{const{dataIndex:n}=t,{type:l,extra:a={},rules:r=[],onChange:i}=N,{trueValue:o=Ks,falseValue:s=zs,disabled:d}=a,p=la(e,n);return j.default.createElement(u.Checkbox,{checked:p===o,disabled:d,onChange:t=>{const l=t.target.checked?o:s;aa(e,n,l),x(r,l,c,f),ue(e,c,f),null==i||i({[G]:l},e),ae()}})},switch:(e,t)=>{const{dataIndex:n}=t,{type:l,extra:a={},rules:r=[],onChange:i}=N,{trueValue:o=Ks,falseValue:s=zs,disabled:d}=a,p=la(e,n);return j.default.createElement(u.Switch,{checked:p===o,disabled:d,onChange:t=>{const l=t?o:s;aa(e,n,l),x(r,l,c,f),ue(e,c,f),null==i||i({[G]:l},e),ae()}})},"search-helper":(e,t)=>{var n;const{dataIndex:l,precision:a}=t,{type:r,extra:i={},rules:o=[],helper:s={},onInput:u,onChange:d,onEnter:p}=N,h=ra(e,te?s.combinedDataIndex:l),b=s.fieldAliasMap;b||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const y="function"==typeof b?b():b||{};Object.keys(y).includes(l)||Oe("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(s.combinedDataIndex.split("|").every((e=>Object.keys(y).includes(e)))||Oe("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),y[l].includes("|")&&Oe("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=e=>{const{filterAliasMap:t}=s,n=""!==e?e:void 0,a=("function"==typeof t?t():t)||[],r={[l]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(g.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},C=e=>{const{autoQueryAssign:t=!0}=s;t&&(L.current=E(e)),D(!0)},S=(n,l)=>{const{beforeOpen:a}=s,r=(null!=a?a:et)({[G]:h},e,t);(null==r?void 0:r.then)?r.then((()=>{C(n),null==l||l()})).catch((()=>{})):!1!==r&&(C(n),null==l||l())},w=e=>{const t={};for(const n in y){const a=y[n];n!==l&&(t[n]=ra(e,a))}const n=y[l]?ra(e,y[l]):"";O(n,t);const{closed:a}=s;re(!1,(()=>se(I.current))),oe(),null==a||a(e)},T=()=>{const{onlySelect:e=!0}=s;A.current&&O(e?"":h),re(!1,(()=>se(I.current)))},O=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var r;if(g.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],a=v.find((e=>e.dataIndex===t));if(a){aa(e,t,l,a.precision);const n=null===(r=a.editRender)||void 0===r?void 0:r.call(a,e,a);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t)}else aa(e,t,l)}te&&!t&&((e,t,n,l)=>{if(!t.includes("|"))return aa(e,t,n,l);const a=n.split("|")||[];t.split("|").forEach(((t,n)=>{var l;t&&aa(e,t,null===(l=a[n])||void 0===l?void 0:l.trim())}))})(e,s.combinedDataIndex,""),aa(e,l,t,a),x(o,t,c,f),ue(e,c,f),null==d||d({[G]:t},e),ae(),L.current={},A.current=!1,W(void 0)},R={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{T()}},P=Object.assign(Object.assign({},s),{size:m,initialValue:Object.assign({},L.current,s.initialValue),onClose:e=>{e?w(e):T()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement(rd,{ref:k,value:null!=B?B:h,placeholder:i.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=s;if(A.current&&!F)return n&&a&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=s,{beforeFetch:l=et}=t.fetch;return new Promise(((a,r)=>Ye(void 0,void 0,void 0,(function*(){var i;const o=g.merge({},t.fetch.params,Object.assign(Object.assign({},n),E(e)),{currentPage:1,pageSize:500});if(!l(o))return r();V(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(i=g.get(e.data,t.fetch.dataKey))&&void 0!==i?i:[];a(n)}else r()}catch(e){r(e)}finally{nt((()=>V(!1)))}}))))})(n).then((e=>function(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter((t=>ra(t,y[l]).toString().includes(e)));if(1===t.length)return w(t[0]);S(e)}(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==u||u({[G]:t}),A.current=!0,W(t)},onKeyUp:t=>{var n;if(13===t.keyCode){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==p||p({[G]:l},e)}},onDoubleClick:e=>{const{value:t}=e.target;S(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&S(e)}}),j.default.createElement(Il,R,j.default.createElement(vd,P)))},"search-helper-multiple":(e,t)=>{var n;const{dataIndex:l}=t,{type:a,items:r=[],extra:i={},rules:o=[],helper:s={},onInput:d,onChange:p,onEnter:h}=N,v=la(e,l),y=s.fieldAliasMap;y||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof y?y():y||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||Oe("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=E;const C=n=>{const{beforeOpen:l}=s,a=(null!=l?l:et)({[G]:v},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},S=()=>{re(!1,(()=>se(I.current)))},w=t=>{aa(e,l,t),x(o,t,c,f),ue(e,c,f),null==p||p({[G]:t},e,_.current),ae()},T={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},s),{size:m,multiple:!0,initialValue:g.merge({},s.initialValue),defaultSelectedKeys:v,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:l}=E;ie(g.uniqBy([..._.current.filter((e=>t.includes(e[l]))),...e],l));const a=_.current.map((e=>({text:e[n],value:e[l]}))),i=g.uniqBy([...a,...r],"value").filter((e=>t.includes(e.value)));z(i),w(i.map((e=>e.value)));const{closed:o}=s;re(!1,(()=>se(I.current))),null==o||o(_.current)})(e,t):S()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},j.default.createElement(u.Select,{mode:"multiple",open:!1,value:v,placeholder:i.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==h||h({[G]:v},e))},onDoubleClick:()=>{i.disabled||C()},onChange:e=>{const{valueKey:t}=E;ie(_.current.filter((n=>e.includes(n[t])))),w(e)}},K.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text)))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{C()}})))),j.default.createElement(Il,T,j.default.createElement(vd,O)))},"tree-helper":(e,t)=>{var n,l;const{dataIndex:a,precision:r}=t,{type:i,extra:o={},rules:s=[],helper:u={},onChange:d,onEnter:p}=N,h=ra(e,te?u.combinedDataIndex:a),b=u.fieldAliasMap;b||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const y="function"==typeof b?b():b||{};Object.keys(y).includes(a)||Oe("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(u.combinedDataIndex.split("|").every((e=>Object.keys(y).includes(e)))||Oe("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),y[a].includes("|")&&Oe("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const E=n=>{const{beforeOpen:l}=u,a=(null!=l?l:et)({[G]:h},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},C=()=>{re(!1,(()=>se(I.current)))},S=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;var l;if(g.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const a=n[t],r=v.find((e=>e.dataIndex===t));if(r){aa(e,t,a,r.precision);const n=null===(l=r.editRender)||void 0===l?void 0:l.call(r,e,r);n&&Array.isArray(n.rules)&&x(n.rules,a,c,t)}else aa(e,t,a)}aa(e,a,t,r),x(s,t,c,f),ue(e,c,f),null==d||d({[G]:t},e),ae()},w={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=u.width)&&void 0!==n?n:"30%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{C()}},T=Object.assign(Object.assign({},u),{defaultSelectedKeys:[h],size:m,onClose:e=>{e?(e=>{const t={};for(const n in y){const l=y[n];n!==a&&(t[n]=ra(e,l))}const n=y[a]?ra(e,y[a]):"";S(n,t);const{closed:l}=u;re(!1,(()=>se(I.current))),oe(),null==l||l(e)})(e):C()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement(rd,{ref:P,value:h,allowClear:null===(l=o.allowClear)||void 0===l||l,readOnly:o.readOnly,disabled:o.disabled,placeholder:o.placeholder||we("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{var n;if(13===t.keyCode){const l=null!==(n=t.target.value)&&void 0!==n?n:"";null==p||p({[G]:l},e)}},onDoubleClick:()=>{E()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?E():S(""))}}),j.default.createElement(Il,w,j.default.createElement(Cd,T)))},"tree-helper-multiple":(e,t)=>{var n;const{dataIndex:l}=t,{type:a,extra:r={},items:i=[],rules:o=[],helper:s={},onInput:d,onChange:p,onEnter:h}=N,v=la(e,l),y=s.fieldAliasMap;y||Oe("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof y?y():y||{};Object.keys(E).includes("valueKey")&&Object.keys(E).includes("textKey")||Oe("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),H.current=E;const C=n=>{const{beforeOpen:l}=s,a=(null!=l?l:et)({[G]:v},e,t);(null==a?void 0:a.then)?a.then((()=>{D(!0),null==n||n()})).catch((()=>{})):!1!==a&&(D(!0),null==n||n())},S=()=>{re(!1,(()=>se(I.current)))},w=t=>{aa(e,l,t),x(o,t,c,f),ue(e,c,f),null==p||p({[G]:t},e,_.current),ae()},T={visible:F,title:we("qm.searchHelper.text"),width:null!==(n=s.width)&&void 0!==n?n:"60%",loading:!1,stopMouseDownEvent:!0,bodyStyle:{paddingBottom:`${yr[m]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},s),{size:m,multiple:!0,initialValue:g.merge({},s.initialValue),defaultSelectedKeys:v,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=E;ie(e);const l=_.current.map((e=>({text:e[t],value:e[n]})));z(l),w(l.map((e=>e.value)));const{closed:a}=s;re(!1,(()=>se(I.current))),null==a||a(_.current)})(e):S()}});return j.default.createElement(j.default.Fragment,null,j.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},j.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},j.default.createElement(u.Select,{mode:"multiple",open:!1,value:v,placeholder:r.placeholder||we("qm.table.editable.selectPlaceholder"),allowClear:r.allowClear,maxTagCount:r.collapseTags?"responsive":void 0,maxTagTextLength:r.maxTagTextLength,disabled:r.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&(null==h||h({[G]:v},e))},onDoubleClick:()=>{r.disabled||C()},onChange:e=>{const{valueKey:t}=E;ie(_.current.filter((n=>e.includes(n[t])))),w(e)}},K.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text)))),j.default.createElement("span",{className:"ant-input-group-addon"},j.default.createElement(u.Button,{className:"ant-input-search-button",disabled:r.disabled,icon:j.default.createElement(b.SearchOutlined,null),onClick:()=>{C()}})))),j.default.createElement(Il,T,j.default.createElement(Cd,O)))}};return j.default.createElement(j.default.Fragment,null,ee?(()=>{const{type:e}=N,t=fe[e];if(!t)return Oe("Table","单元格编辑的类型 `type` 配置不正确"),null;const n=["cell--edit",{"is-error":!X}];return j.default.createElement("div",{ref:I,className:ne.default(n)},t(d,s),!X&&j.default.createElement("div",{className:"cell-error"},Q||Z))})():(()=>{const{extra:t={}}=N;return j.default.createElement("span",{style:{color:t.disabledColor}},e.children)})(),J&&j.default.createElement("i",{className:"cell--sign"}))}));id.displayName="CellEdit";const od=function(e){if(!j.default.isValidElement(e))return null;for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return j.default.cloneElement(e,...n)},sd=e=>{const{text:t,options:n,showMessage:l=!0,onCopy:a}=e;return od(e.children,{onClick:r=>{const i=j.default.Children.only(e.children),o=fe.default(t,n);null==a||a(t,o),o&&l&&u.message.success(we("qm.clipboard.success")),i&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(r)}})};sd.displayName="QmCopyToClipboard";const ud=j.default.forwardRef(((e,t)=>{const{column:n,row:l,rowIndex:a,columnIndex:r,rowKey:i,depth:o,showTitle:s}=e,{tableRef:u,selectionKeys:d,treeExpandIndex:c,updateMark:f,isTreeTable:p}=j.default.useContext(js),{treeConfig:h}=u.current.props,{dataIndex:m,canCopy:v,render:y,editRender:x,shouldCellUpdate:E}=n,{t:C}=td(),{renderText:S,getTitleFromCellNode:w}=pu(),T=j.default.useRef(null),[N,I]=function(e,t,n){const l=M.useRef({});return"value"in l.current&&!n(l.current.condition,t)||(l.current.value=e(),l.current.condition=t),l.current.value}((()=>{const e=la(l,m),o=y?y(e,l,n,a,r):S(e,n,l);return[o,x?j.default.createElement(id,{ref:t,column:n,record:l,rowKey:i,columnKey:m},o):null]}),[f,rt(l),y,x],((e,t)=>{if(E){const[,n]=e,[,l]=t;return E(l,n)}return!g.isEqual(e,t)}));j.default.useEffect((()=>{if([Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(m))return;const e=T.current.parentNode;s?e.title=w(N):e.removeAttribute("title")}),[s,N]);const O=e=>Array.isArray(e.children);return j.default.createElement("div",{ref:T,className:"cell"},(()=>{if(m===Js.expandableColumn)return j.default.createElement(ld,{record:l,rowKey:i});if(m===Js.selectionColumn)return j.default.createElement(nd,{selectionKeys:d,column:n,record:l,rowKey:i});if(I)return I;if(p&&m===c)return j.default.createElement(j.default.Fragment,null,(e=(null==h?void 0:h.virtual)?l._level:o)?j.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*Js.treeTable.textIndent+"px"}}):null,j.default.createElement(ld,{key:"expand",record:l,rowKey:i,style:O(l)?{}:{visibility:"hidden"}}),N);var e;if(v){const e=w(N);return j.default.createElement("div",{className:"cell--copy"},j.default.createElement("span",{className:"text"},N),e&&j.default.createElement(sd,{text:e},j.default.createElement(b.CopyOutlined,{className:"icon",title:C("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return N})())}));ud.displayName="Cell";const dd=j.default.forwardRef(((e,t)=>{const{tableFlatColumns:n,tableData:l}=e,{getRowKey:a,tableRef:r,flattenColumns:i,editableColumns:o,leftFixedColumns:s,rightFixedColumns:u,sorter:d,layout:c,showFooter:f,scrollX:p,scrollY:h,selectionKeys:m,rowExpandedKeys:v,highlightKey:b,isPingLeft:y,isPingRight:x,isTableEmpty:E,isTreeTable:C,isGroupSubtotal:S,isWebPagination:w,isDragMergeCell:T,setElementStore:N,createTableFullData:I,setSelectionKeysEffect:O,setHighlightKey:R,getStickyLeft:k,getStickyRight:P,scrollXToColumn:L,scrollYToRecord:H,rowInViewport:_,dataChange:F,setPingLeft:D,setPingRight:$,setFullScreen:M,findParentRowKeys:q,getAllChildRowKeys:V,triggerScrollXEvent:K,triggerScrollYEvent:z,scrollBottomDebouncer:B}=j.default.useContext(js),{height:W,minHeight:U,maxHeight:G,rowHeight:Y,rowSelection:X,rowHighlight:Q,treeConfig:Z,expandable:J,stripe:ee,summation:te,rowStyle:le,cellStyle:ae,spanMethod:re,nativeScrollBar:ie,ellipsis:se,showHeader:ue,rowDraggable:de,onRowClick:ce,onRowDblclick:fe,onRowContextmenu:pe,onRowEnter:he}=r.current.props,me=j.default.useRef(null),ge=j.default.useRef({}),ve=j.default.useRef(null),be=j.default.useRef(null),ye=j.default.useRef({prevST:0,prevSL:0}),{dragStart:xe,renderDragPanel:Ee,closeDragPanel:Ce}=(()=>{const{tableRef:e,layout:t,flattenColumns:n,isDragMergeCell:l}=j.default.useContext(js),{mergeCells:a=[],onMergeChange:r}=e.current.props,[i,o]=j.default.useState(!1),s=j.default.useRef(null),u=j.default.useRef(null),d=j.default.useRef({x:0,y:0,disX:0,disY:0}),c=dt("table");Vn((()=>{l||y()}),[l]);const f=()=>{y(),Gn(s.current,{display:"none"})},p=e=>{const t=[];for(let n=0;n<e.rowSpan;n++)for(let l=0;l<e.colSpan;l++)t.push([e.row+n,e.col+l]);return t},h=()=>{d.current={x:0,y:0,disX:0,disY:0},u.current&&!x(u.current)||(u.current=null,f()),o(!0),document.removeEventListener("mousemove",m)},m=e=>{const{pageX:n,pageY:l}=e,{x:a,y:r,disX:i,disY:o}=d.current;let u=i,c=o,f=n-a,p=l-r;return f<0&&(f=Math.abs(f),u=i-f,Gn(s.current,{left:`${u}px`})),p<0&&(p=Math.abs(p),c=o-p,Gn(s.current,{top:`${c+t.headerHeight}px`})),Gn(s.current,{width:`${f}px`,height:`${p}px`}),v(u,c,f,p),!1},v=cl(((t,l,a,r)=>{const{allTableData:i,scrollYStore:o}=e.current;let s=-1,d=-1,c=-1,f=-1;for(let e=0;e<i.length;e++)l>o.rowHeight*e&&l<o.rowHeight*(e+1)&&(s=e),l+r>o.rowHeight*e&&l+r<o.rowHeight*(e+1)&&(d=e);let p=0;for(let e=0;e<n.length;e++)t>p&&t<p+E(n[e])&&(c=e),t+a>p&&t+a<p+E(n[e])&&(f=e),p+=E(n[e]);const h={row:s,col:c,rowSpan:d-s+1,colSpan:f-c+1};g.isEqual(u,h)||(u.current=h,b(s,d,c,f))}),5),b=(t,n,l,a)=>{const{elementStore:r,scrollYStore:i}=e.current,o=r.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<o.length;e++){const r=o[e].children;for(let o=0;o<r.length;o++)if(r[o].classList.remove("selected"),(t!==n||l!==a)&&e+i.startIndex>=t&&e+i.startIndex<=n){const e=Number(r[o].getAttribute("colspan")),t=Number(r[o].getAttribute("data-index")),n=e>1?t+e-1:t;n>=l&&n<=a&&r[o].classList.add("selected")}}},y=()=>{const{elementStore:t}=e.current,n=t.$tableBody.querySelectorAll("tbody > tr");for(let e=0;e<n.length;e++){const t=n[e].children;for(let e=0;e<t.length;e++)t[e].classList.remove("selected")}},x=e=>1===e.rowSpan&&1===e.colSpan,E=e=>e.width||e.renderWidth||e.minWidth||Js.defaultColumnWidth;return{dragStart:n=>{const{pageX:l,pageY:a}=n,{elementStore:r}=e.current,{x:i,y:c}=Qn(r.$table),{scrollLeft:f,scrollTop:p}=r.$tableBody.parentNode.parentNode;u.current=null,d.current={x:l,y:a,disX:l+f-i,disY:a+p-(c+t.headerHeight)},Gn(s.current,{width:0,height:0,left:l-i+"px",top:a-c+"px",display:"block"}),y(),o(!1),document.addEventListener("mousemove",m,{passive:!0}),document.addEventListener("mouseup",h,{passive:!0,once:!0})},renderDragPanel:()=>j.default.createElement("div",{ref:s,className:`${c}--merge-cell`,onMouseDown:e=>e.stopPropagation()},i&&j.default.createElement(j.default.Fragment,null,j.default.createElement(ot,{size:"small",className:"btn cancel",onClick:()=>{if(u.current&&!x(u.current)){const e=p(u.current),t=a.findIndex((t=>{const n=p(t);return g.intersectionWith(n,e,g.isEqual).length===n.length}));-1!==t&&(null==r||r(a.filter(((e,n)=>n!==t))))}f()}},we("qm.table.mergeCell.cancel")),j.default.createElement(ot,{size:"small",type:"primary",className:"btn confirm",onClick:()=>{if(u.current&&!x(u.current)){const e=p(u.current);let t=!1;for(let n=0;n<a.length;n++)g.intersectionWith(p(a[n]),e,g.isEqual).length&&(t=!0);t||null==r||r([...a,u.current])}f()}},we("qm.table.mergeCell.confirm")))),closeDragPanel:f}})(),Se=r.current.scrollXLoad?n:i,Te=j.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:l,tableAutoHeight:a}=c,r={};return E&&Object.assign(r,{minHeight:"100px"}),U&&Object.assign(r,{minHeight:ta(U)-e-n+"px"}),G&&Object.assign(r,{maxHeight:ta(G)-e-n+"px"}),W||l||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[W,G,U,E,c]),Ne=j.default.useMemo((()=>{const{scrollYStore:e}=r.current,{viewportHeight:t,gutterWidth:n}=c;return Math.floor((p?t-n:t)/e.rowHeight)}),[c,p]),[Ie,Oe]=j.default.useState([]),Re=ed(),ke=Ju(me,[".table-editable__popper"]);j.default.useImperativeHandle(t,(()=>({setClickedValues:_e,createFocus:Le,forceUpdate:Re}))),Vn((()=>{ke&&(_e([]),T&&Ce())}),[ke]),Vn((()=>{Ie.length&&Qs.focus(r.current.uid)}),[Ie]),j.default.useEffect((()=>{Ae();const e=oe.default(document,"keydown",Pe);return()=>e.remove()}),[]);const Pe=au((e=>{var t,n,i,s,u,d,c;const{keyCode:f}=e;if(r.current.uid===(null===(t=Qs.getFocusInstance())||void 0===t?void 0:t.id)&&(27===f&&(_e([]),R(""),M(!1)),Ie.length&&(Jn(document.activeElement,me.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===f&&("radio"===(null==X?void 0:X.type)||Q)){const t=null!==(s=null!==(i=m[0])&&void 0!==i?i:b)&&void 0!==s?s:null,n=null!==(u=l.find((e=>a(e,e.index)===t)))&&void 0!==u?u:null;n&&(null==he||he(n,e))}if(38===f||40===f){Wn(e);const{allTableData:t}=r.current,n=w?Zl(l):t,i=n.length;let o=n.findIndex((e=>a(e,e.index)===Ie[0]));const s=38===f?(--o+i)%i:++o%i,u=n[s],p=a(u,u.index);"radio"!==(null==X?void 0:X.type)||(null===(d=X.disabled)||void 0===d?void 0:d.call(X,u))||O([p]),Q&&!(null===(c=Q.disabled)||void 0===c?void 0:c.call(Q,u))&&R(p),_(s)||(38===f&&H(p,s),40===f&&H(p,Ne>s+1?0:s+1-Ne)),_e([p,Ie[1]])}if(9===f){if(Wn(e),!o.length)return _e([]);const t=o.length;let n=o.findIndex((e=>e.dataIndex===Ie[1]));const l=++n%t,a=o[l].dataIndex;_e([Ie[0],a]),L(a)}}})),Ae=()=>{N("$tableBody",me.current),N("$tableXspace",ve.current),N("$tableYspace",be.current)},Le=(e,t)=>{var n;null===(n=ge.current[`${e}-${t}`])||void 0===n||n.focus()},He=(e,t,n)=>{var l,r;const{dataIndex:i}=n;if([Js.expandableColumn,Js.operationColumn].includes(i))return;const o=a(t,t.index);_e([o,i]);const s=null===(l=n.editRender)||void 0===l?void 0:l.call(n,t,n),u=s&&!s.disabled,{type:d,selectByClickRow:c=!0,disabled:f=Je}=X||{};!d||f(t)||u||(c||i===Js.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:l=!0,onSelect:a}=X||{};if("radio"===n&&O([e]),"checkbox"===n){const n=!m.includes(e),r=C&&!l?De(e,m,n):Fe(e,m,n);O(r),null==a||a(n,t,r)}})(o,t),[Js.selectionColumn].includes(i)||(!Q||(null===(r=Q.disabled)||void 0===r?void 0:r.call(Q,t))||u||R(o),null==ce||ce(t,n,e))},_e=e=>{g.isEqual(e,Ie)||Oe(e)},Fe=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),De=(e,t,n)=>{var l;const{disabled:a}=X||{},{deriveRowKeys:i,recordsMap:o}=r.current,s=Ql(i,e);let u=[];const d=V((null==s?void 0:s.children)||[]);u=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t))),a&&(u=u.filter((e=>!o.has(e)||!a(o.get(e)))));return((null===(l=ba(i,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=Ql(i,e),l=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>u.includes(e.rowKey)));u=l?[...u,e]:u.filter((t=>t!==e))})),u},$e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];return e.forEach((e=>{const l=e.index,r=a(e,e.index);if(n.push(Me(e,l,r,t)),null==J?void 0:J.expandedRowRender){const{expandedRowClassName:t,rowExpandable:a=et}=J;v.includes(r)&&a(e)&&n.push(j.default.createElement("tr",{key:`expand_${r}`,className:"body--row-expanded"},j.default.createElement("td",{colSpan:Se.length,className:"body--column",style:{paddingLeft:X?2*Js.selectionColumnWidth:Js.selectionColumnWidth}},j.default.createElement("div",{className:ne.default("cell",t)},J.expandedRowRender(e,l)))))}if(!(null==Z?void 0:Z.virtual)&&(e=>Array.isArray(e.children))(e)){const l="function"!=typeof(null==J?void 0:J.rowExpandable)||J.rowExpandable(e);v.includes(r)&&l&&n.push(...$e(e.children,t+1))}})),n},Me=function(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=["body--row",Object.assign({"body--row-striped":ee&&t%2!=0,"body--row-selected":m.includes(n),"body--row-current":b===n},S?ze(e._group):null)];return j.default.createElement("tr",{key:n,className:ne.default(a)},Se.map(((a,r)=>je(a,r,e,t,n,l))))},je=(e,t,n,l,a,i)=>{var o,c,f;const{isIE:p}=r.current,{dataIndex:h,fixed:m,align:g,className:v="",editRender:b}=e,{rowSpan:y,colSpan:x}=Ve(n,e,l,t);if(!y||!x)return null;const E=null!==(o=e.ellipsis)&&void 0!==o?o:se,C=!p&&"left"===m,w=!p&&"right"===m,T=["body--column",{"col--ellipsis":E,"col--center":"center"===g,"col--right":"right"===g,"column--sort":!!d[h],"cell-fix-left":C,"cell-fix-right":w,"cell-fix-left-last":C&&(null===(c=s[s.length-1])||void 0===c?void 0:c.dataIndex)===h,"cell-fix-right-first":w&&(null===(f=u[0])||void 0===f?void 0:f.dataIndex)===h,[v]:!!v}],N=p?null:{left:C?`${k(h)}px`:"",right:w?`${P(h)}px`:""},I=le?"function"==typeof le?le(n,l):le:null,O=ae?"function"==typeof ae?ae(n,e,l,t):ae:null,R=S?Ke(n._group):null,A=Object.assign({},N,Y?{height:Y}:null,R,I,O);if(b){const{extra:t}=b(n,e)||{};(null==t?void 0:t.disabledBackgroundColor)&&Object.assign(A,{backgroundColor:null==t?void 0:t.disabledBackgroundColor})}return j.default.createElement("td",{key:h,rowSpan:y>1?y:void 0,colSpan:x>1?x:void 0,"data-index":t,className:ne.default(T),style:A,onClick:t=>He(t,n,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:l}=n;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(l)||null==fe||fe(t,n,e)})(t,n,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:l}=n;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(l)||null==pe||pe(t,n,e)})(t,n,e)},j.default.createElement(ud,{ref:e=>ge.current[`${a}-${h}`]=e,row:n,column:e,rowIndex:l,columnIndex:t,rowKey:a,depth:i,showTitle:E}))},Ve=(e,t,n,a)=>{let i=1,o=1;if("function"==typeof re){const r=re({row:e,column:t,rowIndex:n,columnIndex:a,tableData:l});if(Array.isArray(r)?(i=r[0],o=r[1]):g.isPlainObject(r)&&(i=r.rowSpan,o=r.colSpan),e===l[0]&&0===i){i=1;for(let e=1;e<l.length;e++){const{rowSpan:n}=Ve(l[e],t,l[e].index,a);if(n>0)break;i++}}}const{mergeCells:s}=r.current;if(s.length>0){const e=s.find((e=>e.row===n&&e.col===a));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}},Ke=e=>{var t;const{backgroundColor:n,color:l}=null!==(t=te.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:l}},ze=e=>{const t=te.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Be=dt("table"),We=T?{onMouseDown:xe}:null;return j.default.createElement(j.default.Fragment,null,j.default.createElement(gl,{ref:r.current.scrollBarRef,wrapClassName:`${Be}--body-wrapper`,wrapStyle:Te,native:ie,onScroll:e=>{const{elementStore:t,scrollXLoad:n,scrollYLoad:l}=r.current,{prevST:a,prevSL:i}=ye.current,o=h?c.gutterWidth:0,{scrollTop:s,scrollLeft:u}=e;if(u!==i){ue&&(t.$header.scrollLeft=u),f&&(t.$footer.scrollLeft=u);const e=u>0,n=Math.ceil(u)+c.tableWidth<c.tableBodyWidth+o;y!==e&&D(e),x!==n&&$(n)}if(l&&s!==a&&z(s),n&&u!==i&&K(u),h&&s!==a){const n=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+c.viewportHeight-o>=n&&B({type:"scroll",target:e,preventDefault:Je,stopPropagation:Je})}ye.current.prevST=s,ye.current.prevSL=u}},j.default.createElement("div",{ref:be,className:"body--y-space"}),j.default.createElement("div",{ref:ve,className:"body--x-space",style:{width:h?c.tableBodyWidth-c.gutterWidth:c.tableBodyWidth}}),j.default.createElement(Zu.Provider,{value:Ie},j.default.createElement("table",qe({ref:me,className:`${Be}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0"},We,{style:{width:0}}),j.default.createElement("colgroup",null,Se.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})}))),de?j.default.createElement(A.ReactSortable,{itemKey:e=>a(e,e.index),tag:"tbody",animation:200,list:l,setList:e=>{const t=e.map((e=>a(e,e.index))),n=l.map((e=>a(e,e.index)));if(g.isEqual(t,n))return;const i=Ea(e),o=[];r.current.tableFullData.forEach((e=>{l.includes(e)?o.push(i.shift()):o.push(e)})),I(o),F()}},l.map((e=>Me(e,e.index,a(e,e.index))))):j.default.createElement("tbody",null,$e(l))))),T&&Ee())}));dd.displayName="TableBody";const cd=e=>{const{summationRows:t}=e,{tableRef:n,sorter:l,layout:a,scrollY:r,flattenColumns:i,leftFixedColumns:o,rightFixedColumns:s,setElementStore:u,getStickyLeft:d,getStickyRight:c}=j.default.useContext(js),{footRender:f}=n.current.props,p=j.default.useRef(null);j.default.useEffect((()=>{h()}),[]);const h=()=>{u("$footer",p.current)},m=(e,t,i)=>{var u,f;const{isIE:p}=n.current,{gutterWidth:h}=a,{dataIndex:m,fixed:g,align:v,summation:b}=e,y=["footer--column","col--ellipsis",{"col--center":"center"===v,"col--right":"right"===v,"column--sort":!!l[m],"cell-fix-left":!p&&"left"===g,"cell-fix-right":!p&&"right"===g,"cell-fix-left-last":!p&&"left"===g&&(null===(u=o[o.length-1])||void 0===u?void 0:u.dataIndex)===m,"cell-fix-right-first":!p&&"right"===g&&(null===(f=s[0])||void 0===f?void 0:f.dataIndex)===m}],x=p?null:{left:"left"===g?`${d(m)}px`:"",right:"right"===g?`${c(m)+(r?h:0)}px`:""},E=(null==b?void 0:b.render)?b.render(n.current.tableFullData):la(t,`${m}_text`),C=0===i&&""===E?we("qm.table.config.summaryText"):E;return j.default.createElement("td",{key:m,title:C,className:ne.default(y),style:Object.assign({},x)},j.default.createElement("div",{className:"cell"},C))},g=dt("table"),{tableBodyWidth:v}=a;return j.default.createElement("div",{ref:p,className:`${g}--footer-wrapper`},f?f(i,n.current.tableFullData):j.default.createElement("table",{className:`${g}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:v?`${v}px`:""}},(()=>{const{gutterWidth:e}=a;return j.default.createElement("colgroup",null,i.map((e=>{const{dataIndex:t,width:n,renderWidth:l}=e;return j.default.createElement("col",{key:t,style:{width:`${n||l}px`,minWidth:`${n||l}px`}})})),r&&j.default.createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),j.default.createElement("tfoot",null,(()=>{const{isIE:e}=n.current,l=["gutter",{"cell-fix-right":!!s.length}],a=e?null:{right:s.length?0:""};return t.map(((e,t)=>j.default.createElement("tr",{key:t,className:"footer--row"},i.map(((t,n)=>m(t,e,n))),r&&j.default.createElement("td",{className:ne.default(l),style:Object.assign({},a)}))))})())))};var fd;!function(e){e.small="small",e.middle="default",e.large="default"}(fd||(fd={}));const pd=e=>{var t,n,l,a;const{current:r,pageSize:i,total:o,onChange:s}=e,{global:d}=j.default.useContext(xe),{tableRef:c,$size:f,setElementStore:p}=j.default.useContext(js),{uniqueKey:h,paginationConfig:m,infoBarConfig:g}=c.current.props,v=j.default.useRef(null),b=j.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);j.default.useEffect((()=>{y(),S()}),[]);const y=()=>{p("$pager",v.current)},x=null!==(t=null==m?void 0:m.showSizeChanger)&&void 0!==t?t:Js.pagination.showSizeChanger,E=null!==(n=null==m?void 0:m.showQuickJumper)&&void 0!==n?n:Js.pagination.showQuickJumper,C=(null==m?void 0:m.pageSizeOptions)||(null===(a=null===(l=null==d?void 0:d.table)||void 0===l?void 0:l.pagination)||void 0===a?void 0:a.pageSizeOptions)||Js.pagination.pageSizeOptions,S=()=>Ye(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield w(b);e&&e!==i&&(s(r,e),localStorage.setItem(b,e.toString()))})),w=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),N={[`${dt("table")}-pager`]:!0};return j.default.createElement("div",{ref:v,className:ne.default(N)},j.default.createElement("div",{className:"pager-alert"},"bottom"===(null==g?void 0:g.position)&&j.default.createElement(du,{total:o})),j.default.createElement(u.Pagination,{size:fd[f],showSizeChanger:x,showQuickJumper:E,pageSizeOptions:C,current:r,pageSize:i,total:o,onChange:(e,t)=>{s(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},hd=()=>{const{layout:e}=j.default.useContext(js),t=j.default.useMemo((()=>{const{headerHeight:t,viewportHeight:n}=e;return{top:`${t}px`,height:`${n}px`}}),[e]),n=dt("table");return j.default.createElement("div",{className:`${n}--empty`,style:t},j.default.createElement(al,null))},md=()=>{const{setElementStore:e}=j.default.useContext(js),t=j.default.useRef(null);j.default.useEffect((()=>{n()}),[]);const n=()=>{e("$resizableBar",t.current)},l=dt("table");return j.default.createElement("div",{ref:t,className:`${l}--resizable-bar`})},gd=j.default.forwardRef(((e,t)=>{const{rowKey:n,columns:l,loading:a,resizable:r,customClass:i,tablePrint:o,exportExcel:s,infoBarConfig:u,topSpaceAlign:d,showTableInfo:c,showFullScreen:f,showRefresh:p,showToolBox:h,showHeader:m}=e,{size:v}=j.default.useContext(xe),b=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:v)&&void 0!==n?n:""}),[e.size,v]),y=j.default.useRef(null),x=j.default.useRef(null),E=j.default.useRef(null),C=j.default.useRef(null),S=j.default.useRef(null),w=j.default.useCallback(((e,t)=>{const l="function"==typeof n?n(e,t):e[n];return void 0===l?(Oe("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l}),[n]),{tableRef:T,tableFullData:N,setElementStore:I,setOriginColumns:O,setTableFullData:R,setTableOriginData:k,setAllTableData:P,setDeriveRowKeys:A,setInvalidRowKeys:L,setFieldAuth:H,setMergeCells:_,setColumnsDefined:F,setScrollXStore:D,setScrollYStore:$,setScrollXLoad:M,setScrollYLoad:q,setResizeState:V,setHandleState:K,setSummaries:z,setSelectionRows:B,setShouldToTop:W,setRecordsMap:U,setUnMounted:G,setHandleChange:Y,clearElementStore:X,clearRecordsMap:Q}=((e,t)=>{let{getRowKey:n,$size:l}=t;const{rowHeight:a,dynamicThead:r}=e,i=j.default.useRef({props:e,uid:ca(),elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},mergeCells:[],columnsDefined:!r,scrollBarRef:j.default.createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:a||Js.rowHeightMaps[l]},store:new Zs,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},treeTable:!1,scrollXLoad:!1,scrollYLoad:!1,shouldToTop:!0,selectionRows:[],recordsMap:new Map,unMounted:!1,isHandleChange:!0,isIE:!Xe&&/MSIE|Trident/.test(navigator.userAgent)});var o;o=e,i.current.props=o;const s=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return e.map((e=>{const i=n(e,e.index),o=l?`${l}#${i}`:`${i}`,u=a?`${a}-${e.index+1}`:`${e.index+1}`,d={level:r,rowKey:i,rowKeyPath:o,indexPath:u};return e.indexPath=u,e._level=r,e.children&&(d.children=s(e.children,i,o,u,r+1)),t?Object.assign({},d,{parentRowKey:t}):d}))},u=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...u(e.children)):t.push(e.rowKey)})),t};return Object.assign(Object.assign({tableRef:i},i.current),{setElementStore:(e,t)=>{i.current.elementStore[e]=t},setOriginColumns:e=>{i.current.originColumns=e},setTableFullData:e=>{i.current.tableFullData=e},setTableOriginData:e=>{i.current.tableOriginData=e},setAllTableData:e=>{const t=Zl(e);i.current.allTableData=t,i.current.allRowKeys=t.map((e=>n(e,e.index)))},setDeriveRowKeys:e=>{const t=i.current.tableFullData.some((e=>Array.isArray(e.children)));i.current.treeTable=t,i.current.deriveRowKeys=t?s(e,""):[],i.current.flattenRowKeys=t?u(i.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{i.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{i.current.fieldAuth[e]=t},setMergeCells:e=>{const t=[];e.forEach((e=>{t.push(e);for(let n=1;n<e.colSpan;n++)for(let l=0;l<e.rowSpan;l++)t.push({row:e.row+l,col:e.col+n,rowSpan:0,colSpan:0});for(let n=1;n<e.rowSpan;n++)for(let l=0;l<e.colSpan;l++)t.push({row:e.row+n,col:e.col+l,rowSpan:0,colSpan:0})})),i.current.mergeCells=t},setColumnsDefined:e=>{i.current.columnsDefined=e},setScrollXStore:e=>{i.current.scrollXStore=e},setScrollYStore:e=>{i.current.scrollYStore=e},setResizeState:e=>{i.current.resizeState=e},setHandleState:e=>{i.current.handleState=e},setSummaries:e=>{i.current.summaries=e},setScrollXLoad:e=>{i.current.scrollXLoad=e},setScrollYLoad:e=>{i.current.scrollYLoad=e},setShouldToTop:e=>{i.current.shouldToTop=e},setSelectionRows:e=>{i.current.selectionRows=e},setRecordsMap:(e,t)=>{i.current.recordsMap.set(e,t)},setUnMounted:e=>{i.current.unMounted=e},setHandleChange:e=>{i.current.isHandleChange=e},clearElementStore:()=>{for(const e in i.current.elementStore)i.current.elementStore[e]=null},clearRecordsMap:()=>{i.current.recordsMap.clear()}})})(e,{getRowKey:w,$size:b}),{tableData:Z,setTableData:J,tableFlatColumns:ee,setTableFlatColumns:te,filters:le,setFilters:ae,sorter:re,setSorter:ie,superFilters:oe,setSuperFilters:se,pagination:ue,setPagination:de,selectionKeys:ce,setSelectionKeys:fe,rowExpandedKeys:pe,setRowExpandedKeys:he,highlightKey:me,setHighlightKey:ge,updateMark:ve,forceUpdate:be,layout:ye,setLayout:Ee,permission:Ce,setPermission:Se,spinning:we,setSpinning:Te,scrollX:Ne,setScrollX:Ie,scrollY:Re,setScrollY:ke,isPingLeft:Pe,setPingLeft:Ae,isPingRight:Le,setPingRight:He,isFullScreen:_e,setFullScreen:Fe,updateTableData:De}=(e=>{var t,n,l,a,r,i,o,s,u,d,c;const{uniqueKey:f,nativeScrollBar:p,initialSorter:h={},initialFilter:m={},paginationConfig:v,rowSelection:b,expandable:y,rowHighlight:x}=e,{global:E}=j.default.useContext(xe),C={current:null!==(t=null==v?void 0:v.current)&&void 0!==t?t:Js.pagination.current,pageSize:null!==(i=null!==(l=null!==(n=(()=>{if(f)return Number(localStorage.getItem(`tablePager_${f}`))||void 0})())&&void 0!==n?n:null==v?void 0:v.pageSize)&&void 0!==l?l: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:Js.pagination.pageSize,total:0},S=null!==(s=null!==(o=null==b?void 0:b.selectedRowKeys)&&void 0!==o?o:null==b?void 0:b.defaultSelectedRowKeys)&&void 0!==s?s:[],w=null!==(d=null!==(u=null==y?void 0:y.expandedRowKeys)&&void 0!==u?u:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==d?d:[],[T,N]=j.default.useState([]),[I,O]=j.default.useState([]),[R,k]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),m),[P,A]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),h),[L,H]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),[]),[_,F]=j.default.useState(C),[D,$]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),S),[M,q]=j.default.useReducer(((e,t)=>g.isEqual(e,t)?e:t),w),[V,K]=j.default.useState(null!==(c=null==x?void 0:x.currentRowKey)&&void 0!==c?c:""),[z,B]=j.default.useReducer((e=>e+1),0),[W,U]=j.default.useState({gutterWidth:p?tu():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[G,Y]=j.default.useState({export:!0,import:!0,print:!0}),[X,Q]=j.default.useState(!1),[Z,J]=j.default.useState(!1),[ee,te]=j.default.useState(!1),[ne,le]=j.default.useState(!1),[ae,re]=j.default.useState(!1),[ie,oe]=j.default.useState(!1);return{tableData:T,setTableData:N,tableFlatColumns:I,setTableFlatColumns:O,filters:R,setFilters:k,sorter:P,setSorter:A,superFilters:L,setSuperFilters:H,pagination:_,setPagination:F,selectionKeys:D,setSelectionKeys:$,rowExpandedKeys:M,setRowExpandedKeys:q,highlightKey:V,setHighlightKey:K,updateMark:z,forceUpdate:B,layout:W,permission:G,setPermission:Y,setLayout:U,spinning:X,setSpinning:Q,scrollX:Z,setScrollX:J,scrollY:ee,setScrollY:te,isPingLeft:ne,setPingLeft:le,isPingRight:ae,setPingRight:re,isFullScreen:ie,setFullScreen:oe,updateTableData:()=>{N([...T])}}})(e),{isFetch:$e,isWebPagination:Me,isScrollPagination:je,showPagination:Ve,shouldUpdateHeight:Ke,tableColumns:ze,flattenColumns:Be,editableColumns:We,summationColumns:Ue,leftFixedColumns:Ge,rightFixedColumns:Qe,treeExpandIndex:Ze,showSummary:Je,showFooter:et,isHeadGroup:tt,bordered:nt,isHeadSorter:lt,isHeadFilter:at,isServiceSummation:rt,isSelectCollection:it,isTableImport:ot,isTableClipboard:st,isSuperSearch:ut,isFastSearch:ct,isGroupSummary:ft,isGroupSubtotal:pt,isDragMergeCell:ht,isTreeTable:mt,isTableEmpty:gt,summationRows:vt,fetchParams:bt}=lu(e,{getRowKey:w,tableRef:T,tableFullData:N,tableData:Z,sorter:re,filters:le,superFilters:oe,selectionKeys:ce,pagination:ue}),{createElementStore:yt,tableStyles:xt,getSpan:Et,getStickyLeft:Ct,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Tt,rowInViewport:Nt,calcTableHeight:It,resetTableScroll:Ot,computeVirtualX:Rt,computeVirtualY:kt,doLayout:Pt}=su(e,{getRowKey:w,tableRef:T,$size:b,tableColumns:ze,flattenColumns:Be,leftFixedColumns:Ge,layout:ye,scrollX:Ne,scrollY:Re,tableData:Z,showFooter:et,showPagination:Ve,isWebPagination:Me,isFullScreen:_e,setLayout:Ee,setScrollX:Ie,setScrollY:ke,setElementStore:I,setScrollXStore:D,setScrollYStore:$,setShouldToTop:W}),{initialTable:At,checkDataIndex:Lt,createTableFullData:Ht,getTableData:_t,handleTableData:Ft,createTableData:Dt,createGroupData:$t,createSelectionKeys:Mt,createRowExpandedKeys:jt,setSelectionKeysEffect:qt,findParentRowKeys:Vt,getAllChildRowKeys:Kt,doFieldValidate:zt,getTableLog:Bt,dataChange:Wt,tableChange:Ut,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,pagerChangeHandle:Qt,triggerScrollXEvent:Zt,triggerScrollYEvent:Jt,scrollBottomDebouncer:en,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearRowSelection:an,clearRowHighlight:rn,clearTableLog:on,destroy:sn}=ou(e,{getRowKey:w,tableRef:T,tableElementRef:x,tableBodyRef:E,$size:b,tableColumns:ze,flattenColumns:Be,tableFullData:N,pagination:ue,layout:ye,filters:le,sorter:re,superFilters:oe,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,summationColumns:Ue,shouldUpdateHeight:Ke,isFetch:$e,isTreeTable:mt,isWebPagination:Me,isScrollPagination:je,isServiceSummation:rt,isGroupSubtotal:pt,doLayout:Pt,setTableData:J,setTableFlatColumns:te,setTableFullData:R,setTableOriginData:k,setAllTableData:P,setDeriveRowKeys:A,setPagination:de,setSpinning:Te,setSorter:ie,setFilters:ae,setSuperFilters:se,setSelectionKeys:fe,setRowExpandedKeys:he,setHighlightKey:ge,setSelectionRows:B,setScrollXLoad:M,setScrollYLoad:q,setScrollXStore:D,setScrollYStore:$,computeVirtualX:Rt,computeVirtualY:kt,setFieldAuth:H,setResizeState:V,setSummaries:z,setPermission:Se,setRecordsMap:U,resetTableScroll:Ot,clearElementStore:X,clearRecordsMap:Q});uu(e,{tableRef:T,topElementRef:y,tableElementRef:x,tableBodyRef:E,$size:b,scrollX:Ne,pagination:ue,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,showSummary:Je,summationRows:vt,isWebPagination:Me,isScrollPagination:je,isTreeTable:mt,checkDataIndex:Lt,toLastPage:Gt,toFirstPage:Yt,getPageCount:Xt,setHandleState:K,scrollYToRecord:Tt,setOriginColumns:O,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ge,setResizeState:V,setMergeCells:_,setPingRight:He,setUnMounted:G,setHandleChange:Y,calcTableHeight:It,createSelectionKeys:Mt,createRowExpandedKeys:jt,createElementStore:yt,triggerScrollYEvent:Jt,initialTable:At,destroy:sn});const un=j.default.useMemo((()=>({getRowKey:w,tableRef:T,tableBodyRef:E,$size:b,flattenColumns:Be,editableColumns:We,leftFixedColumns:Ge,rightFixedColumns:Qe,treeExpandIndex:Ze,sorter:re,filters:le,superFilters:oe,layout:ye,bordered:nt,showFooter:et,showSummary:Je,summationRows:vt,scrollX:Ne,scrollY:Re,pagination:ue,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,updateMark:ve,isFetch:$e,isPingLeft:Pe,isPingRight:Le,isHeadSorter:lt,isHeadFilter:at,isFullScreen:_e,isTableEmpty:gt,isHeadGroup:tt,isTreeTable:mt,isGroupSubtotal:pt,isWebPagination:Me,isDragMergeCell:ht,dataChange:Wt,tableChange:Ut,getTableData:_t,setElementStore:I,createTableFullData:Ht,updateTableData:De,setSorter:ie,setFilters:ae,setSuperFilters:se,setHighlightKey:ge,setRowExpandedKeys:he,setSelectionRows:B,setSelectionKeysEffect:qt,setInvalidRowKeys:L,getSpan:Et,getStickyLeft:Ct,getStickyRight:St,scrollXToColumn:wt,scrollYToRecord:Tt,rowInViewport:Nt,setPagination:de,setPingLeft:Ae,setPingRight:He,setSpinning:Te,setFullScreen:Fe,setShouldToTop:W,doFieldValidate:zt,createTableData:Dt,createGroupData:$t,findParentRowKeys:Vt,getAllChildRowKeys:Kt,triggerScrollXEvent:Zt,triggerScrollYEvent:Jt,scrollBottomDebouncer:en,resetTableScroll:Ot,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearRowSelection:an,clearRowHighlight:rn})),[b,Be,We,Ge,Qe,Ze,re,le,oe,ye,nt,et,Je,vt,Ne,Re,ue,bt,ce,pe,me,ve,$e,Pe,Le,lt,at,_e,gt,tt,mt,pt,Me,ht]);((e,t)=>{const{getRowKey:n,tableRef:l,toolBoxRef:a,tableBodyRef:r,columnFilterRef:i,flattenColumns:o,editableColumns:s,pagination:u,fetchParams:d,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,isFetch:h,dataChange:m,getTableData:v,handleTableData:b,createTableData:y,createTableFullData:x,calcTableHeight:E,scrollXToColumn:C,scrollYToRecord:S,doFieldValidate:w,setTableOriginData:T,setHandleState:N,setColumnsDefined:I,setSelectionKeysEffect:O,setRowExpandedKeys:R,setHighlightKey:k,setSelectionRows:P,setOriginColumns:A,setHandleChange:L,forceUpdate:H,getTableLog:_,clearRowSelection:F,clearRowHighlight:D,clearTableSorter:$,clearTableFilter:M,clearSuperFilters:q,clearTableLog:V}=t,{columns:K,columnsChange:z}=l.current.props,B=(e,t,l)=>e.filter((e=>{const a=n(e,e.index);e.children&&(e.children=B(e.children,t,l));const r=t.includes(a);return r&&(null==l||l(e,a)),!r}));j.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{E()},DO_REFRESH:e=>Ye(void 0,void 0,void 0,(function*(){h&&(yield v(),null==e||e())})),GET_LOG:()=>_(),GET_FETCH_PARAMS:()=>{const e={};for(const t in d)Object.keys(u).includes(t)||(e[t]=d[t]);return e},CLEAR_TABLE_DATA:()=>{h||(F(),D(),$(),M(),q(),V(),y([]))},CLEAR_LOG:()=>{V()},CREATE_FOCUS:(e,t)=>{r.current.createFocus(e,t)},FORCE_UPDATE:()=>{H()},DO_EXPORT:()=>{a.current.exportHandle()},SCROLL_TO_RECORD:e=>{S(e)},SCROLL_TO_COLUMN:e=>{C(e)},SET_SELECTION:function(e){!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&!g.isEqual(e,c)&&L(!1),O(e)},SET_HIGHLIGHT:e=>{k(e)},SET_EXPANDABLE:e=>{R(e)},SET_SELECTION_ROWS:e=>{P(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{A(e),I(!0),i.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const l=Ul(K,e);if(!l)return Oe("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!g.isPlainObject(t))return Oe("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(l.noAuth)return Oe("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&g.set(l,e,t[e]);n&&(z?z([...K]):Oe("Table","需要设置 `columnsChange` 参数"),H())},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:r}=l.current,i=(Array.isArray(e)?e:[e]).filter((e=>g.isPlainObject(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:n}=t;[Js.expandableColumn,Js.selectionColumn,Js.operationColumn].includes(n)||aa(e,n,la(e,n))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),u=void 0===(null==t?void 0:t.parentRowKey),d=r;if(u)s?d.unshift(...i):d.push(...i);else{const e=ya(r,(e=>t.parentRowKey===n(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}y(d),u&&N(Object.assign({},l.current.handleState,{insert:s?"before":"after"})),H(),m()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=l.current,r=(Array.isArray(e)?e:[e]).map((e=>g.isPlainObject(e)?n(e,e.index):e));if(!r.length)return;let i=!1;const o=B(a,r,((e,n)=>{t.addToRemoved(e),s.forEach((l=>{const{dataIndex:a,editRender:r}=l,i=null==r?void 0:r(e,l);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:n,y:a}),t.removeFromValidate({x:n,y:a}),t.removeFromEdited({x:n,y:a}))})),i=!0}));i&&(x(o),O(c.filter((e=>!r.includes(e)))),r.includes(p)&&D(),R(f.filter((e=>!r.includes(e)))),N(Object.assign({},l.current.handleState,{remove:!0})),m(),setTimeout((()=>{T(B(l.current.tableOriginData,r))})))},VALIDATE_FIELDS:(e,t)=>{l.current.allTableData.forEach((l=>{s.forEach((a=>{const{dataIndex:r,editRender:i}=a,o=null==i?void 0:i(l,a);if(!o)return;const s=n(l,l.index);if(e&&!e.includes(s))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:d}=o;!d&&u.length&&w(u,la(l,r),s,r)}))}));const{required:a,validate:r}=_(),i=[...a,...r];return i.length&&S(i[0].rowKey),H(),{required:a,validate:r}}})))})(t,{getRowKey:w,tableRef:T,toolBoxRef:C,tableBodyRef:E,columnFilterRef:S,flattenColumns:Be,editableColumns:We,pagination:ue,fetchParams:bt,selectionKeys:ce,rowExpandedKeys:pe,highlightKey:me,isFetch:$e,dataChange:Wt,getTableData:_t,handleTableData:Ft,createTableData:Dt,createTableFullData:Ht,calcTableHeight:It,scrollXToColumn:wt,scrollYToRecord:Tt,doFieldValidate:zt,setTableOriginData:k,setHandleState:K,setColumnsDefined:F,setSelectionKeysEffect:qt,setRowExpandedKeys:he,setHighlightKey:ge,setSelectionRows:B,setOriginColumns:O,setHandleChange:Y,forceUpdate:be,getTableLog:Bt,clearRowSelection:an,clearRowHighlight:rn,clearTableSorter:tn,clearTableFilter:nn,clearSuperFilters:ln,clearTableLog:on}),j.default.useEffect((()=>{Qs.register(T.current.uid,null!=t?t:{current:null})}),[]);const dn=dt("table"),cn={[`${dn}--wrapper`]:!0,[`${dn}--lg`]:"large"===b,[`${dn}--sm`]:"small"===b,[`${dn}--maximize`]:_e,[i]:!!i},fn={[dn]:!0,"is--border":nt,"is--fixed":Ge.length||Qe.length,"is--sortable":lt,"is--filterable":at,"is--head-group":tt,"is--merge-cell":ht,"is--ping-left":Pe,"is--ping-right":Le};return j.default.createElement(js.Provider,{value:un},j.default.createElement("div",{className:ne.default(cn)},c&&j.default.createElement("div",{ref:y,className:`${dn}-top`},j.default.createElement("div",{className:`${dn}-top__space`},"bottom"!==(null==u?void 0:u.position)&&j.default.createElement(du,{total:ue.total}),j.default.createElement("div",{className:`${dn}-top__space-slot`,style:{justifyContent:Ys[d]}},e.children)),j.default.createElement("div",{className:`${dn}-top__actions`},j.default.createElement(qu,{ref:C,showFullScreen:f,showReload:p&&$e,showPrint:Ce.print&&!!o,showImport:Ce.import&&ot,showExport:Ce.export&&!!s,showClipboard:st,showCollection:it,showFastSearch:ct,showSuperSearch:ut,showGroupSummary:ft,showToolBox:h,tableColumns:ze}),j.default.createElement(Ku,{ref:S,columns:l}))),j.default.createElement(rl,{spinning:null!=a?a:we},j.default.createElement("div",{ref:x,className:ne.default(fn),style:xt},j.default.createElement("div",{className:`${dn}--main-wrapper`},m&&j.default.createElement(Qu,{tableColumns:ze,sorter:re,filters:le}),j.default.createElement(dd,{ref:E,tableFlatColumns:ee,tableData:Z}),et&&j.default.createElement(cd,{summationRows:vt})),nt&&j.default.createElement("div",{className:`${dn}--border-line`}),gt&&j.default.createElement(hd,null),r&&j.default.createElement(md,null))),Ve&&j.default.createElement(pd,qe({},ue,{onChange:(e,t)=>Qt({current:e,pageSize:t})}))))}));gd.defaultProps={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},gd.displayName="QmTable";const vd=e=>{var t;const{uniqueKey:n,multiple:l,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},className:u,style:d,onClose:c}=e,{size:f}=j.default.useContext(xe),p=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:f)&&void 0!==n?n:""}),[e.size,f]),h=j.default.useRef(null),m=j.default.useRef(null),v=j.default.useRef(null),b=dl(h),[y,x]=j.default.useState(s),[E,C]=j.default.useState(),[S,w]=j.default.useState(i),[T,N]=j.default.useState(!1),[I,O]=j.default.useState(300),[R,k]=j.default.useState(o),[P,A]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[L,H]=j.default.useState(g.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[_,F]=j.default.useState([]),D=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*yr[p]-30)},$=cl(D,5);Vn((()=>{$()}),[b.width]),Vn((()=>{g.isEqual(o,R)||k(o)}),[o]),j.default.useEffect((()=>{M()}),[L]),j.default.useEffect((()=>{r&&v.current.SET_SELECTION_ROWS(r)}),[r]),j.default.useEffect((()=>{var e;a&&(null===(e=m.current)||void 0===e||e.SET_FIELDS_VALUE(a))}),[]);const M=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=y;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=et}=n;if(i(L)){N(!0);try{const t=yield a(L);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,r))&&void 0!==e?e:[];l||(w([]),yield tt(0)),F(n)}}catch(e){}N(!1)}})),q=e=>{l||(C(e),c(e))},V=e=>{H(Object.assign({},L,e))},K={[`${dt("search-helper")}--wrapper`]:!0},z=y.webPagination?{dataSource:_,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},y.fetch),{params:L})};return j.default.createElement("div",{ref:h,className:ne.default(K,u),style:d},j.default.createElement("div",{className:"form-wrap"},R.length?j.default.createElement(us,{ref:m,items:R,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>D(),onFinish:e=>V(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield m.current.GET_FORM_DATA();e||V(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:v,uniqueKey:n,height:I,columns:P,rowKey:y.rowKey||"pageIndex"},z,{rowSelection:{type:l?"checkbox":"radio",clearableAfterFetched:!l,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:S,onChange:(e,t)=>{w(e),C(l?t:t[0])}},paginationConfig:y.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[p]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>c(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!E,onClick:()=>c(E,l?S:void 0)},we("qm.dialog.confirm"))))};vd.displayName="SearchHelper";const bd=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...bd(e.children)),e.children&&t.push(e.value)})),t},yd=(e,t)=>{let n=null;for(let l=0;l<e.length;l++){if(Array.isArray(e[l].children)&&(n=yd(e[l].children,t)),n)return n;if(t(e[l]))return e[l]}return n},xd=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&xd(e.children,t),t(e)||e.children&&e.children.length))),Ed=e=>{var t;const{uniqueKey:n,multiple:l,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},tree:d={},className:c,style:f,onClose:p}=e,{size:h}=j.default.useContext(xe),m=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:h)&&void 0!==n?n:""}),[e.size,h]),v=j.default.useRef(null),b=j.default.useRef(null),y=j.default.useRef(null),x=dl(v),[E,C]=j.default.useState(s),[S,w]=j.default.useState(),[T,N]=j.default.useState(i),[I,O]=j.default.useState(!1),[R,k]=j.default.useState(300),[P,A]=j.default.useState(300),[L,H]=j.default.useState(o),[_,F]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[D,$]=j.default.useState(g.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[M,q]=j.default.useState([]),V=()=>{const e=v.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*yr[m]-30)},K=cl(V,5);Vn((()=>{K()}),[x.width]),Vn((()=>{g.isEqual(o,L)||H(o)}),[o]),j.default.useEffect((()=>{z()}),[D]),j.default.useEffect((()=>{r&&y.current.SET_SELECTION_ROWS(r)}),[r]),j.default.useEffect((()=>{var e;a&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(a)),te()}),[]);const z=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=E;if(!t||!(null==n?void 0:n.api))return;const{api:a,dataKey:r,beforeFetch:i=et}=n;if(i(D)){O(!0);try{const t=yield a(D);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,r))&&void 0!==e?e:[];l||(N([]),yield tt(0)),q(n)}}catch(e){}O(!1)}})),B=e=>{l||(w(e),p(e))},W=e=>{$(Object.assign({},D,e))},[U,G]=j.default.useState([]),[Y,X]=j.default.useState([]),[Q,Z]=j.default.useState(""),J=j.default.useRef(U),ee=j.default.useRef([]);Vn((()=>{X(bd(U))}),[U]);const te=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:l,valueKey:a="value",textKey:r="text"}=d.fetch;try{const i=yield t(n);if(200===i.code){const t=Array.isArray(i.data)?i.data:null!==(e=g.get(i.data,l))&&void 0!==e?e:[],n=Ma(t,a,r);G(n),J.current=n,ee.current=t}}catch(e){}})),le=e=>`${e}|${nr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ae={[`${dt("tree-table-helper")}--wrapper`]:!0},re=E.webPagination?{dataSource:M,loading:I,webPagination:!0}:{fetch:Object.assign(Object.assign({},E.fetch),{params:D})};return j.default.createElement("div",{ref:v,className:ne.default(ae,c),style:f},j.default.createElement(nl,{defaultValue:200,style:{height:"100%"}},j.default.createElement(nl.Pane,{min:100,style:{overflowY:"auto"}},j.default.createElement(u.Input.Search,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:we("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=xd(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==le(n).indexOf(e)}));Z(e),G(t)})(e.target.value)}),j.default.createElement(u.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:Y,treeData:U,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==le(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return Oe("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const l in t)n[l]=g.get(e,t[l]);W(n)})(yd(ee.current,(n=>g.get(n,t)===e[0]))||{})}})),j.default.createElement(nl.Pane,{className:"split-pane"},j.default.createElement("div",{className:"form-wrap"},L.length?j.default.createElement(us,{ref:b,items:L,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>H(e),onCollapse:()=>V(),onFinish:e=>W(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||W(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:y,uniqueKey:n,height:P,columns:_,rowKey:E.rowKey||"pageIndex"},re,{rowSelection:{type:l?"checkbox":"radio",clearableAfterFetched:!l,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{N(e),w(l?t:t[0])}},paginationConfig:E.paginationConfig,columnsChange:e=>F(e),onRowDblclick:B,onRowEnter:B}))))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>p(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!S,onClick:()=>p(S,l?T:void 0)},we("qm.dialog.confirm"))))};Ed.displayName="TreeTableHelper";const Cd=e=>{var t,n,l;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:u}=e,{size:d}=j.default.useContext(xe),c=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:d)&&void 0!==n?n:""}),[e.size,d]),[f,p]=j.default.useState(),[h]=j.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),m={[`${dt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},te.default(r.fetch,["params","valueKey","textKey"])),{params:h}):void 0;return j.default.createElement("div",{className:ne.default(m,o),style:s},j.default.createElement(Ms,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(n=r.fetch)||void 0===n?void 0:n.valueKey,textKey:null===(l=r.fetch)||void 0===l?void 0:l.textKey},asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[c]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>u(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!f,onClick:()=>u(f)},we("qm.dialog.confirm"))))};Cd.displayName="TreeHelper";const Sd="_startSign",wd="_endSign",Td=e=>{var t;const{uniqueKey:n,initialValue:l,filters:a=[],table:r={},onClose:i}=e,{size:o}=j.default.useContext(xe),s=j.default.useMemo((()=>{var t,n;return null!==(n=null!==(t=e.size)&&void 0!==t?t:o)&&void 0!==n?n:""}),[e.size,o]),d=j.default.useRef(null),c=j.default.useRef(null),f=j.default.useRef(null),p=dl(d),[h,m]=j.default.useState(r),[v,y]=j.default.useState(!1),[x,E]=j.default.useState([]),[C,S]=j.default.useState(300),[w,T]=j.default.useState(a),[N,I]=j.default.useState((e=>[{title:we("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>j.default.createElement("span",null,e+1)},{title:we("qm.form.rangeSearchHelper")[0],dataIndex:Sd,width:80,align:"right",render:(e,t)=>j.default.createElement("span",{className:"icon-sign"},e)},...e||(r.columns||[]),{title:we("qm.form.rangeSearchHelper")[1],dataIndex:wd,fixed:"right",width:80,render:(e,t)=>j.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=j.default.useState(g.merge({},null===(t=r.fetch)||void 0===t?void 0:t.params,l)),[k,P]=j.default.useState([]),A=j.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),L=j.default.useMemo((()=>2===A.length&&A.every((e=>void 0!==e))),[A]),H=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*yr[s]-30)},_=cl(H,5);Vn((()=>{_()}),[p.width]),Vn((()=>{g.isEqual(a,w)||T(a)}),[a]),j.default.useEffect((()=>{F()}),[O]);const F=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:l,dataKey:a,beforeFetch:r=et}=n;if(r(O)){y(!0);try{const t=yield l(O);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=g.get(t.data,a))&&void 0!==e?e:[];P(n)}}catch(e){}y(!1)}})),D=(e,t)=>{delete e[t]},$=()=>{x.forEach((e=>{e&&(D(e,Sd),D(e,wd))})),E([])},M=e=>{$(),R(Object.assign({},O,e))},q=dt("range-helper"),V=h.webPagination?{dataSource:k,loading:v,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return j.default.createElement("div",{ref:d,className:`${q}--wrapper`},j.default.createElement("div",{className:"form-wrap"},w.length?j.default.createElement(us,{ref:c,items:w,initialValues:l,uniqueKey:n,formType:"search",isAutoFocus:!1,fieldsChange:e=>T(e),onCollapse:()=>H(),onFinish:e=>M(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||M(t)}))}):null),j.default.createElement("div",null,j.default.createElement(gd,qe({ref:f,height:C,columns:N,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=A[0]&&e.pageIndex<=A[1]?{backgroundColor:"#f5f5f5"}:{}},V,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[Sd,wd].includes(n)&&(n===Sd&&(e[n]?(D(e,n),E([void 0,x[1]])):e.pageIndex>A[1]?u.message.warning(we("qm.searchHelper.rangeStartTip")):(x[0]&&D(x[0],n),e[n]="[",E([e,x[1]]))),n===wd&&(e[n]?(D(e,n),E([x[0],void 0])):e.pageIndex<A[0]?u.message.warning(we("qm.searchHelper.rangeEndTip")):(x[1]&&D(x[1],n),e[n]="]",E([x[0],e]))),f.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===A[0]&&(e[Sd]="["),e.pageIndex===A[1]&&(e[wd]="]")}))}}),j.default.createElement(ot,{type:"primary",icon:j.default.createElement(b.ClearOutlined,null),title:we("qm.table.alert.clear"),onClick:()=>$()}))),j.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${yr[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},j.default.createElement(ot,{onClick:()=>i(null),style:{marginRight:8}},we("qm.dialog.cancel")),j.default.createElement(ot,{type:"primary",disabled:!L,onClick:()=>i(x.map((e=>(e=>{const t={};for(const n in e)[Sd,wd].includes(n)||(t[n]=e[n]);return t})(e))))},we("qm.dialog.confirm"))))};Td.displayName="RangeTableHelper";const Nd=e=>null!=e;function Id(e,t,n,l){const[a,r]=j.default.useState(void 0);j.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=j.default.useState(null),s=au((()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:l,right:a,bottom:r,left:i}=e.getBoundingClientRect();return l>=0&&i>=0&&a<=t&&r<=n})(a)&&t&&a.scrollIntoView(l);const{left:e,top:n,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:n,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)}));j.default.useLayoutEffect((()=>(s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)})),[a,t,s]);return[j.default.useMemo((()=>{if(!i)return i;const e=(null==n?void 0:n.offset)||6,t=(null==n?void 0:n.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,n]),a]}function Od(e){return void 0!==e}function Rd(e,t){const{defaultValue:n,value:l,onChange:a,postState:r}=t||{},[i,o]=M.useState((()=>Od(l)?l:Od(n)?"function"==typeof n?n():n:"function"==typeof e?e():e)),s=Od(l)?l:i,u=r?r(s):s,d=au(a),[c,f]=M.useState([s]);iu((()=>{const e=c[0];i!==e&&d(i,e)}),[c]),iu((()=>{Od(l)||o(l)}),[l]);return[u,au((e=>{o(e),f([s])}))]}const kd=8;const Pd={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"]}},Ad={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"]}},Ld=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Hd(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:l,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(Pd).forEach((e=>{const u=l&&Ad[e]||Pd[e],d=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,Ld.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,l=t>12?t+2:12;return{arrowOffsetHorizontal:l,arrowOffsetVertical:n?kd:l}}({contentRadius:r,limitVerticalRadius:!0});if(l)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-c.arrowOffsetHorizontal-o;break;case"leftBottom":case"rightBottom":d.offset[1]=c.arrowOffsetHorizontal+o}d.overflow=function(e,t,n,l){if(!1===l)return{adjustX:!1,adjustY:!1};const a=l&&"object"==typeof l?l:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+n,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+n,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,n),i&&(d.htmlRegion="visibleFirst")})),s}var _d={},Fd={exports:{}},Dd={exports:{}};!function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Dd),function(e){var t=Dd.exports.default;function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,l=new WeakMap;return(n=function(e){return e?l:t})(e)}e.exports=function(e,l){if(!l&&e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return{default:e};var a=n(l);if(a&&a.has(e))return a.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,a&&a.set(e,r),r},e.exports.__esModule=!0,e.exports.default=e.exports}(Fd);var $d,Md={exports:{}};($d=Md).exports=function(e){return e&&e.__esModule?e:{default:e}},$d.exports.__esModule=!0,$d.exports.default=$d.exports;var jd={exports:{}},qd={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(qd);var Vd={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var l,a,r,i,o=[],s=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(l=r.call(n)).done)&&(o.push(l.value),o.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(Vd);var Kd={exports:{}},zd={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l},e.exports.__esModule=!0,e.exports.default=e.exports}(zd),function(e){var t=zd.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Kd);var Bd={exports:{}};!function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports}(Bd),function(e){var t=qd.exports,n=Vd.exports,l=Kd.exports,a=Bd.exports;e.exports=function(e,r){return t(e)||n(e,r)||l(e,r)||a()},e.exports.__esModule=!0,e.exports.default=e.exports}(jd);var Wd={exports:{}},Ud={exports:{}},Gd={exports:{}},Yd={exports:{}};!function(e){var t=Dd.exports.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var a=l.call(e,n||"default");if("object"!==t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Yd),function(e){var t=Dd.exports.default,n=Yd.exports;e.exports=function(e){var l=n(e,"string");return"symbol"===t(l)?l:String(l)},e.exports.__esModule=!0,e.exports.default=e.exports}(Gd),function(e){var t=Gd.exports;e.exports=function(e,n,l){return(n=t(n))in e?Object.defineProperty(e,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[n]=l,e},e.exports.__esModule=!0,e.exports.default=e.exports}(Ud),function(e){var t=Ud.exports;function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}e.exports=function(e){for(var l=1;l<arguments.length;l++){var a=null!=arguments[l]?arguments[l]:{};l%2?n(Object(a),!0).forEach((function(n){t(e,n,a[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Wd);var Xd=Fd.exports.default,Qd=Md.exports.default;Object.defineProperty(_d,"__esModule",{value:!0});var Zd=_d.default=function(e){var t=tc.useState("ssr-id"),n=(0,Jd.default)(t,2),l=n[0],a=n[1],r=(0,ec.default)({},tc).useId,i=null==r?void 0:r();if(tc.useEffect((function(){if(!r){var e=nc;nc+=1,a("rc_unique_".concat(e))}}),[]),e)return e;return i||l};_d.resetUuid=function(){nc=0};var Jd=Qd(jd.exports),ec=Qd(Wd.exports),tc=Xd(j.default);var nc=0;const lc={fill:"transparent",pointerEvents:"auto"},ac=e=>{const{prefixCls:t,rootClassName:n,pos:l,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:u}=e,d=`${t}-mask-${Zd()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return j.default.createElement(pe.default,{open:o,autoLock:!0},j.default.createElement("div",{className:ne.default(`${t}-mask`,n),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:u,pointerEvents:"none"},r)},a?j.default.createElement("svg",{style:{width:"100%",height:"100%"}},j.default.createElement("defs",null,j.default.createElement("mask",{id:d},j.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),l&&j.default.createElement("rect",{x:l.left,y:l.top,rx:l.radius,width:l.width,height:l.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),j.default.createElement("rect",qe({},l?null:lc,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${d})`})),l&&j.default.createElement(j.default.Fragment,null,j.default.createElement("rect",qe({},lc,{x:"0",y:"0",width:"100%",height:`${l.top}px`})),j.default.createElement("rect",qe({},lc,{x:"0",y:"0",width:l.left,height:"100%"})),j.default.createElement("rect",qe({},lc,{x:"0",y:l.top+l.height,width:"100%",height:`calc(100vh - ${l.top+l.height}px)`})),j.default.createElement("rect",qe({},lc,{x:l.left+l.width,y:"0",width:`calc(100vw - ${l.left+l.width}px)`,height:"100%"})))):null))},rc=e=>{const{prefixCls:t,zIndex:n,open:l,onPause:a,onPlay:r}=e,[i,o]=Rd(void 0,{value:l,postState:e=>null==e||e}),s=j.default.useRef(null),u=j.default.useRef(!1),d=au((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));j.default.useEffect((()=>{const e=oe.default(document,"keyup",d);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{u.current?u.current=!1:(o(!i),i?null==a||a():null==r||r())};return j.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:n+1},onMouseDown:e=>{c(e);const t=s.current,n=t.offsetWidth,l=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-Qn(t).x,o=e.clientY-Qn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,d=e.clientY-o;s<0&&(s=0),s>a-n-1&&(s=a-n-1),d<0&&(d=0),d>r-l-1&&(d=r-l-1),Gn(t,{left:`${s}px`,top:`${d}px`}),u.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?j.default.createElement(b.PauseOutlined,null):j.default.createElement(b.CaretRightOutlined,null))},ic=e=>{const{prefixCls:t,current:n,total:l=0,cover:a,title:r,description:i,helper:o={},type:s,zIndex:d,onClose:c,onPrev:f,onNext:p,onFinish:h,className:m,indicatorsRender:g}=e,{t:v}=td(),y="primary"!==s?"primary":"default",x=au((e=>{w(e),40===e.keyCode&&(n<l-1?null==p||p():null==h||h()),38===e.keyCode&&n>0&&(null==f||f())}));j.default.useEffect((()=>{const e=oe.default(document,"keyup",x);return()=>e.remove()}),[]);const E=Nd(a)?j.default.createElement("div",{className:`${t}-cover`},a):null,C=Nd(i)?j.default.createElement("div",{className:`${t}-description`},i):null;let S;S=g?g(n,l):[...Array.from({length:l}).keys()].map(((e,l)=>j.default.createElement("span",{key:e,className:ne.default(l===n&&`${t}-indicator-active`,`${t}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return j.default.createElement("div",{className:ne.default(`${t}-content`,m)},j.default.createElement("div",{className:`${t}-inner`},j.default.createElement(b.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&j.default.createElement(u.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:o.content,title:o.title},j.default.createElement(b.QuestionCircleOutlined,{className:ne.default(`${t}-close`,"help-icon")})),E,j.default.createElement("div",{className:`${t}-header`},j.default.createElement("div",{className:`${t}-title`},r)),C,j.default.createElement("div",{className:`${t}-footer`},l>1&&j.default.createElement("div",{className:`${t}-indicators`},S),j.default.createElement(ut,{className:`${t}-buttons`},0!==n?j.default.createElement(ot,{className:`${t}-prev-btn`,size:"small",onMouseDown:w,onClick:f},v("qm.tour.prevStep")):null,n===l-1?j.default.createElement(ot,{className:`${t}-finish-btn`,type:y,size:"small",onClick:h},v("qm.tour.finish")):j.default.createElement(ot,{className:`${t}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:p},v("qm.tour.nextStep"))))))},oc=e=>{const{current:t,renderPanel:n}=e;return j.default.createElement(j.default.Fragment,null,"function"==typeof n?n(e,t):j.default.createElement(ic,e))},sc={left:"50%",top:"50%",width:1,height:1},uc=j.default.forwardRef(((e,t)=>{const{steps:n=[],defaultCurrent:l,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:u="default",mask:d=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:h,placement:m,helper:g,zIndex:v,renderPanel:b,indicatorsRender:y,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,S=Ue(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),w=j.default.useRef(),[T,N]=Rd(0,{value:a,defaultValue:l}),[I,O]=Rd(void 0,{value:s,postState:e=>!(T<0||T>=n.length)&&(null!=e&&e)}),[R,k]=Rd(1051,{value:v,defaultValue:v}),[P,A]=j.default.useState(),L=j.default.useRef(I);j.default.useLayoutEffect((()=>{I&&!L.current&&N(0),L.current=I,A(I)}),[I]),j.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:H,type:_,placement:F,trigger:D,delay:$,style:M,arrow:q,className:V,mask:K,scrollIntoViewOptions:z,zIndex:B,action:W}=n[T]||{},U=B||R,G=_||u,Y=I&&(null!=K?K:d),X=null!=z?z:C,[Q,Z]=Id(H,!!s,x,X),J=((e,t,n)=>{var l;return null!==(l=null!=n?n:t)&&void 0!==l?l:null===e?"center":"bottom"})(Z,m,F),ee=!!Z&&(void 0===q?c:q),te="object"==typeof ee&&ee.pointAtCenter;j.default.useLayoutEffect((()=>{var e;null===(e=w.current)||void 0===e||e.forceAlign()}),[te,T]),Vn((()=>{I&&(re(),null==W||W(Z,T))}),[I,Z]);const le=e=>{N(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(T)},re=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var l;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Un(l=n,"display")||"hidden"===Un(l,"visibility")||"0"===Un(l,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ye(void 0,void 0,void 0,(function*(){if(!D||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,l=Z.offsetHeight,[a,r]=[e+n/2,t+l/2],i=new MouseEvent(D,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield tt(null!=$?$:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,ue=Object.assign({},h,M),de=dt("tour"),ce=[{[`${de}-primary`]:"primary"===G},p,V],fe=Hd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return j.default.createElement(j.default.Fragment,null,j.default.createElement(ac,{zIndex:U,prefixCls:de,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:P,animated:E,rootClassName:p}),j.default.createElement(he.default,qe({ref:w},S,{zIndex:U,builtinPlacements:fe,popupStyle:ue,popupPlacement:J,popupVisible:P,popupClassName:ne.default(ce),prefixCls:de,popup:()=>j.default.createElement(oc,qe({key:"content",arrow:ee,prefixCls:de,total:n.length,helper:g,renderPanel:b,indicatorsRender:y,onPrev:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),le(T-1)})),onNext:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),le(T+1)})),onClose:ae,current:T,onFinish:()=>{ae(),null==o||o()}},Object.assign({},n[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),j.default.createElement(pe.default,{open:P,autoLock:!0},j.default.createElement("div",{className:ne.default(p,`${de}-target-placeholder`),style:Object.assign(Object.assign({},Q||sc),{position:"fixed",pointerEvents:"none"})}))),f&&j.default.createElement(pe.default,{open:I},j.default.createElement(rc,{zIndex:U,prefixCls:de,onPause:()=>A(!1),onPlay:()=>A(!0)})))}));uc.displayName="QmTour";const dc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],cc=e=>({_s:e,status:dc[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),fc=e=>e?6:5,pc=(e,t,n,l,a)=>{clearTimeout(l.current);const r=cc(e);t(r),n.current=r,null==a||a({current:r})},hc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enter:n=!0,exit:l=!0,preEnter:a,preExit:r,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:u,onStateChange:d}=t||{},[c,f]=e.useState((()=>cc(o?2:fc(s)))),p=e.useRef(c),h=e.useRef(),[m,v]=(e=>g.isPlainObject(e)?[e.enter,e.exit]:[e,e])(i),b=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return fc(t)}})(p.current._s,u);e&&pc(e,f,p,h,d)}),[d,u]),y=e.useCallback((e=>{const t=e=>{switch(pc(e,f,p,h,d),e){case 1:m>=0&&(h.current=setTimeout(b,m));break;case 4:v>=0&&(h.current=setTimeout(b,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(n?a?0:1:2):i&&t(l?r?3:4:fc(u))}),[b,d,n,l,a,r,m,v,u]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[c,y,b]},mc=e=>{const{name:t,in:n,timeout:l,preEnter:a=!0,preExit:r}=e,[i,o]=hc({timeout:l,preEnter:a,preExit:r,initialEntered:n});return iu((()=>{o()}),[n]),j.default.createElement(j.default.Fragment,null,j.default.Children.map(e.children,(e=>j.default.isValidElement(e)?od(e,{className:ne.default(e.props.className,t,i.status)}):e)))};var gc={previewWidth:1100,defaultDistance:.45,logoHeight:60};const vc=e.createContext(void 0);var bc=null;function yc(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),l=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!n&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(l){if((l=l[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){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 xc(e,t){var n;try{var l=navigator.userAgent,a=!!l.match(/MSIE/i)||!!l.match(/Trident/i);if(yc()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void u.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&l.match(/x64/i);if(e||t?n=a?e:t:bc?n=bc:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),bc=n),!n||!n.VERSION)return l.indexOf("Chrome"),l.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&yc(),n}catch(e){u.message.error("getLodop 出错:"+e)}}yc();const Ec=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:l}=window.screen;if(n&&l)t[0]=n,t[1]=l;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Cc=j.default.forwardRef(((e,t)=>{const{templateRender:n,directPrint:l}=e,{global:a}=j.default.useContext(xe),{$$preview:r}=j.default.useContext(vc),{state:i,isWindowsPrinter:o,pageSize:s}=r,u=j.default.useRef(null),d=j.default.useRef({}),c=j.default.useRef([]),f=j.default.useRef([]),p=j.default.useRef([]),[h,m]=j.default.useState(!0);j.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:P,DIRECT_PRINT:A}))),Vn((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),j.default.useEffect((()=>{d.current.templateEl=u.current.querySelector(".origin-template").children[0],d.current.previewEl=u.current.querySelector(".workspace")}),[]);const g=j.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*gc.defaultDistance+10*gc.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=j.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*gc.defaultDistance+10*gc.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),b=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Ec(g-10*(e.left-gc.defaultDistance)-10*(e.right-gc.defaultDistance))}),[i,g]),y=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Ec(v-10*(e.top-gc.defaultDistance)-10*(e.bottom-gc.defaultDistance))}),[i,v]),x=i.form.scale,E=j.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:Ec(10*e.left),right:Ec(10*e.right),top:Ec(10*e.top),bottom:Ec(10*e.bottom)}}),[i]),C=j.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:n,top:l,bottom:a}=E,r=b+t+n,o=gc.previewWidth-r<=0?0:(gc.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let u=0;return x>1&&(u=s>o?-1*o:-1*s),x<1&&(u=r-2*s>gc.previewWidth?0:o>0?s:(gc.previewWidth-(r-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":y+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${l}px`,paddingBottom:`${a}px`,transform:`translateX(${u}px) scale(${x})`,opacity:h?0:1}}),[i,h,E,x,y,b]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const S=()=>{var e,t,n,l;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!==(l=null===(n=null==a?void 0:a.print)||void 0===n?void 0:n.rightLogo)&&void 0!==l?l:"";return[`<tr style="height: ${gc.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("")},w=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=w().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=d.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},N=()=>{const e=d.current.templateEl.children[0].children,t=[],n=[];for(let l=0;l<e.length;l++){if("template-cols"===e[l].getAttribute("type"))continue;const a=e[l].clientHeight;e[l].style.height=a+"px",n.push(a),t.push(e[l].outerHTML)}f.current=n,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:n}}=i;if(l)return p.current.push([w(),S(),...c.current]);const a=t.fixedLogo?y-gc.logoHeight:y;let o=[];if(p.current=[],"stylus"===n)p.current.push([w(),...t.fixedLogo?[S()]:[],...c.current]);else{let e=0;for(let n=0,l=f.current.length;n<l;n++){const r=c.current[n],i=f.current[n];t.fixedLogo||0!==n||(e+=gc.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([w(),...t.fixedLogo?[S()]:[],...o]),o=[],e=0,n-=1),n===l-1&&o.length&&p.current.push([w(),...t.fixedLogo?[S()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,S());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:n}=i;let l=`<table cellspacing="0" cellpadding="0" border="0" class="${d.current.templateEl.className}">`;l+=null!==(t=null===(e=p.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",l+="</table>",d.current.previewEl.innerHTML=l,d.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${d.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>"+S()+w()+e.join("")+"</table>"},P=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=d.current.templateEl)||void 0===e?void 0:e.tagName))return L();d.current.previewEl.innerHTML||(T(),yield tt(0),N(),I(),m(!1))})),A=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=d.current.templateEl)||void 0===e?void 0:e.tagName))return L();T(),yield tt(0),N(),I(),m(!1),r.doPrint(R()),yield tt(0),r.doClose()})),L=()=>{Oe("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},H={[dt("print-container")]:!0,"no-visible":l};return j.default.createElement("div",{ref:u,className:ne.default(H)},j.default.createElement(rl,{wrapperClassName:"spin",spinning:h,tip:"Loading..."},j.default.createElement("div",{className:"preview"},j.default.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==n?void 0:n()),j.default.createElement("div",{className:"workspace",style:C}))))}));Cc.displayName="Container";class Sc extends e.Component{constructor(){super(...arguments),this.formRef=j.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:we("qm.print.setPanel.printParameter")},{type:"SELECT",label:we("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:we("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:we("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:we("qm.print.setPanel.vertical"),value:"vertical"},{text:we("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:we("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:we("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:we("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:we("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:we("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:gc.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:we("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:we("qm.print.setPanel.sizeUnit"),disright:we("qm.print.setPanel.sizeUnit"),distop:we("qm.print.setPanel.sizeUnit"),disbottom:we("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 j.default.createElement(j.default.Fragment,null,j.default.createElement(us,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),j.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"}},j.default.createElement(ot,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},we("qm.dialog.close")),j.default.createElement(ot,{type:"primary",onClick:()=>this.confirmHandle()},we("qm.dialog.confirm"))))}}Sc.contextType=xe;class wc extends e.Component{constructor(){var e,t,n;super(...arguments),this.provide={$$preview:this},this.containRef=j.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:gc.defaultDistance,right:gc.defaultDistance,top:gc.defaultDistance,bottom:gc.defaultDistance},pageSize:"210*297",direction:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.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 ge.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,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const n=this.context.global,l=null==n?void 0:n.saveComponentConfigApi;if(l)try{yield l({[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=xc();if(!t)return;const{uniqueKey:n,closeAfterPrint:l}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:d}=gc,{left:c,right:f,top:p,bottom:h}=a.distance;t.PRINT_INIT(null!=n?n: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*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-d)+"mm",10*(c-d)+"mm",`RightMargin: ${10*(f-d)}mm`,`BottomMargin: ${"stylus"!==i?10*(h-d):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?l&&this.doClose():u.message.error(we("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=xc();if(!t)return;const{uniqueKey:n,closeAfterPrint:l}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?l&&this.doClose():u.message.error(we("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(`${K.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:we("qm.print.laserPrinter"),value:"laser"},{text:we("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=xc(),t=[{text:we("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let l=0;l<n;l++)t.push({text:e.GET_PRINTER_NAME(l),value:l})}catch(e){Oe("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 n=yield ge.default.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),g.isPlainObject(n)&&(yield ge.default.setItem(this.printerKey,n))),g.isPlainObject(n)&&Object.keys(n).length&&g.merge(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:n,form:l,currentPage:a,totalPage:r,printPage:i}=this.state,o=dt("print-preview"),s={visible:n,title:we("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[o]:!0};return e?j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{className:ne.default(d)},j.default.createElement("div",{className:"outer"},j.default.createElement("div",{className:"header"},j.default.createElement("span",null,we("qm.print.printer"),":",j.default.createElement(u.Select,{value:l.printerName,onChange:e=>{this.setState((t=>g.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",null,we("qm.print.type"),":",j.default.createElement(u.Select,{value:l.printerType,onChange:e=>{this.setState((t=>g.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>j.default.createElement(u.Select.Option,{key:e.value,value:e.value},e.text))))),j.default.createElement("span",null,we("qm.print.copies"),":",j.default.createElement(u.InputNumber,{value:l.copies,min:1,precision:0,onChange:e=>{this.setState((t=>g.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),j.default.createElement("span",null,we("qm.print.printPage.0"),j.default.createElement(u.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"}}),we("qm.print.printPage.1")),j.default.createElement("span",null,j.default.createElement(u.Pagination,{size:"small",current:a,pageSize:1,total:r,onChange:this.pageChangeHandle})),j.default.createElement("span",null,j.default.createElement(ot,{type:"text",icon:j.default.createElement(b.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},we("qm.print.setting"))),j.default.createElement("span",null,j.default.createElement(ot,{type:"text",icon:j.default.createElement(b.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},we("qm.print.export"))),j.default.createElement("span",null,j.default.createElement(ot,{icon:j.default.createElement(b.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},we("qm.print.print")))),j.default.createElement("div",{className:"main"},j.default.createElement(vc.Provider,{value:this.provide},j.default.createElement(Cc,{ref:this.containRef,templateRender:t,directPrint:!1}))),j.default.createElement("div",{className:"footer"},j.default.createElement("span",null,we("qm.print.scale"),":",j.default.createElement(u.Slider,{value:l.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>g.merge({},t,{form:{scale:e}})))}}),j.default.createElement("em",{className:"scale-text"},`${Math.floor(100*l.scale)}%`)),j.default.createElement("span",null,we("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),j.default.createElement("span",null,we("qm.print.pageNumber"),":",we("qm.print.pagination",{currentPage:a,totalPage:r}))))),j.default.createElement(Il,s,j.default.createElement(Sc,{setting:l.setting,onChange:e=>{this.setState((t=>g.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):j.default.createElement(vc.Provider,{value:this.provide},j.default.createElement(Cc,{ref:this.containRef,templateRender:t,directPrint:!0}))}}wc.contextType=xe;class Tc extends e.Component{constructor(){super(...arguments),this.previewRef=j.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 n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:n,defaultConfig:l,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:we("qm.print.preview"),width:`${gc.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:n,defaultConfig:l,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?j.default.createElement(Il,i,j.default.createElement(wc,o)):e?j.default.createElement(wc,o):null},this.DO_PRINT=()=>Ye(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield tt(0),this.setState({visible:!0}),yield tt(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:n,type:l,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:l,shape:r,icon:n,loading:e,disabled:a,click:this.clickHandle};return j.default.createElement(j.default.Fragment,null,this.props.children&&j.default.createElement(ot,i,this.props.children),this.createRender())}}function Nc(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Ic(e){const t=Nc(e);return t?t.frameElement:null}function Oc(e){const t=Pc(e);return Rc([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Rc(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 kc(e,t){const n=Ic(e);if(n&&n!==t){const l=[e.getBoundingClientRect()];let a=n,r=!1;for(;a;){const e=Oc(a);if(l.push(e),a=Ic(a),r)break;a&&Nc(a)===t&&(r=!0)}return Rc(l)}return e.getBoundingClientRect()}function Pc(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)}}Tc.propTypes={size:(e,t,n)=>{if(!ke(e[t]||""))return Ie("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:q.default.elementType},Tc.defaultProps={preview:!0,type:"primary",icon:j.default.createElement(b.PrinterOutlined,null)},Tc.contextType=xe;const Ac=Object.assign;class Lc{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=Dc.border,this.padding.style.borderColor=Dc.padding,this.content.style.backgroundColor=Dc.background,Ac(this.node.style,{borderColor:Dc.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){Fc(t,"margin",this.node),Fc(t,"border",this.border),Fc(t,"padding",this.padding),Ac(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"}),Ac(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Hc{constructor(e,t){this.tip=e.createElement("div"),Ac(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),Ac(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),Ac(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),l=function(e,t,n){const l=Math.max(n.height,20),a=Math.max(n.width,60),r=5;let i;i=e.top+e.height+l<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-l<=t.top+t.height?e.top-l-r<t.top+r?t.top+r:e.top-l-r:t.top+t.height-l-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:n.width,height:n.height});Ac(this.tip.style,l.style)}}class _c{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Hc(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new Lc(this.window.document,this.container));const l={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=kc(e,this.window),a=Pc(e);l.top=Math.min(l.top,n.top-a.marginTop),l.right=Math.max(l.right,n.left+n.width+a.marginRight),l.bottom=Math.max(l.bottom,n.top+n.height+a.marginBottom),l.left=Math.min(l.left,n.left-a.marginLeft);this.rects[t].update(n,a)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,l.right-l.left,l.bottom-l.top);const a=kc(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:l.top,left:l.left,height:l.bottom-l.top,width:l.right-l.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Fc(e,t,n){Ac(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const Dc={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 $c=null,Mc=null;function jc(){null!=window.document&&($c=null,null!==Mc&&(Mc.remove(),Mc=null))}class qc{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=>Jn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,jc();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,l,a;n=[t],l=null,a=!1,null!=window.document?(null!==$c&&clearTimeout($c),null!=n&&(null===Mc&&(Mc=new _c),Mc.inspect(n,l),a&&($c=setTimeout((()=>jc()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=g.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 n=e;const l=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,l=Array.from(n.classList).reverse();e<l.length;e++)t.test(l[e])&&n.classList.remove(l[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),l=n.className.trim();if(t.filter((e=>e.className.includes(l))).length<=1){if(l){const t=l.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&l.unshift(e),n=n.parentElement}return l.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(){jc(),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 Vc(e){return document.querySelector(e)}const Kc=e=>{const{action:t,onConfirm:n,onCancel:l,onFinish:a}=e,{t:r}=td();return j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),j.default.createElement(ut,{style:{width:"100%",justifyContent:"flex-end"}},j.default.createElement(ot,{size:"small",onClick:()=>null==l?void 0:l()},r("qm.guideTracker.closeButton")),j.default.createElement(ot,{size:"small",onClick:()=>null==n?void 0:n()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),j.default.createElement(ot,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},zc={left:"50%",top:"50%",width:1,height:1},Bc=j.default.forwardRef(((e,t)=>{const{open:n,current:l,defaultCurrent:a,steps:r=[],placement:i="bottom",control:o=!0,overlayClassName:s,overlayStyle:d,destroyOnHide:c,contentRender:f,zIndex:p,helper:h={},selectFilter:m=(e=>e),onSelect:v,onChange:y,onClose:x,onFinish:E}=e,{t:C}=td(),S=j.default.useRef(),w=j.default.useRef(r.length),[T,N]=Rd(0,{value:l,defaultValue:a}),[I,O]=Rd(void 0,{value:n,postState:e=>null!=e&&e}),[R,k]=Rd(1051,{value:p,defaultValue:p}),[P,L]=j.default.useState({}),[H,_]=j.default.useState(!1),[F,D]=j.default.useState(I),[$,M]=j.default.useState(!1),[q,V]=Id(P.node,!!n),[K,z]=j.default.useState(22),B=j.default.useRef(!1),W=j.default.useMemo((()=>T>=r.length?"add":"edit"),[T,r]),U=j.default.useMemo((()=>`${T+1} / ${r.length}`),[T,r]);j.default.useLayoutEffect((()=>{S.current=new qc({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=m(t),L({id:ca(),node:e,path:t}),N(w.current),_(!0),Y(),null==v||v(t,e)}})}),[]),j.default.useEffect((()=>(I?G():Y(),I?setTimeout((()=>D(!0)),16):D(!1),()=>{Y()})),[I]),j.default.useEffect((()=>{w.current=r.length}),[r]);const G=()=>{S.current.startHandle()},Y=()=>{S.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};j.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),GET_CURRENT_STEP:()=>({current:T,selector:P.path})})));const Q=dt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],J=Hd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return j.default.createElement(j.default.Fragment,null,j.default.createElement(he.default,{zIndex:R,builtinPlacements:J,popupPlacement:i,popupVisible:I&&H,popupClassName:ne.default(Z,s),popupStyle:d,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return j.default.createElement("div",{className:`${Q}-content`},j.default.createElement("div",{className:`${Q}-inner`},j.default.createElement(b.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(T),e()}}),j.default.createElement(u.Dropdown,{open:$,trigger:["click"],dropdownRender:()=>r.length?j.default.createElement("div",{className:"ant-dropdown-menu step-list"},j.default.createElement(A.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.id)),n=r.map((e=>e.id));if(g.isEqual(t,n))return;const l=t.findIndex((e=>e===P.id)),a=-1!==l?l:T;N(a),null==y||y(Ea(e),a)}},r.map(((e,t)=>j.default.createElement("li",{key:t,className:ne.default("item",{actived:e.id===P.id})},j.default.createElement(b.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),j.default.createElement("span",{className:"box"},j.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==T&&(L({id:e.id,node:Vc(e.selector),path:e.selector}),N(t),z(22===K?K+1:K-1),null==y||y(r,t))}},e.title),j.default.createElement(u.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const n=r.filter((t=>t.id!==e.id)),l=t===T;let a=t<=T?T-1:T;if(a=a<0?0:a,a=a>n.length?n.length:a,l&&n[a]){const{id:e,selector:t}=n[a];L({id:e,node:Vc(t),path:t})}N(a),null==y||y(n,a)}},j.default.createElement(b.CloseOutlined,{className:"close-icon"})))))))):j.default.createElement(j.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>M(e)},j.default.createElement(b.MenuOutlined,{className:ne.default(`${Q}-close`,"menu-icon"),style:{width:K}})),h.content&&j.default.createElement(u.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:h.content,title:h.title},j.default.createElement(b.QuestionCircleOutlined,{className:ne.default(`${Q}-close`,"help-icon")})),j.default.createElement("div",{className:"panel-label"},j.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),j.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),f?f({id:P.id,selector:P.path,actionStatus:W,DO_CLOSE:e},T):j.default.createElement(Kc,{action:W,onConfirm:()=>{null==y||y("add"===W?[...r,{id:P.id,selector:P.path,title:"Guide Title"}]:[...r],T),e()},onCancel:()=>{null==x||x(T),e()},onFinish:()=>{e(),null==x||x(T),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:c},j.default.createElement(pe.default,{open:I&&H,autoLock:!0},j.default.createElement("div",{className:ne.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},q||zc),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),o&&j.default.createElement(pe.default,{open:F},j.default.createElement(rc,{zIndex:R,prefixCls:Q,onPause:()=>{B.current=H,_(!1),Y()},onPlay:()=>{B.current?_(!0):G()}})))}));Bc.displayName="QmGuideTracker";const Wc=e=>{var t,n,l,a,r,i,o,s;const{content:u,image:d,width:c,height:f,font:p={},gap:h=[100,100],offset:m=[50,50],rotate:g=-22,zIndex:v=9,alpha:b=1,antiTamper:y=!0,grayscale:x,className:E,style:C}=e,S=j.default.useRef(null),w=j.default.useRef(new Map),T=null!==(t=p.fontSize)&&void 0!==t?t:16,N=null!==(n=p.fontWeight)&&void 0!==n?n:"normal",I=null!==(l=p.fontStyle)&&void 0!==l?l:"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",P=Array.isArray(u)?u:[u],A=h[0],L=h[1],H=A/2,_=L/2,F=null!==(o=m[0])&&void 0!==o?o:H,D=null!==(s=m[1])&&void 0!==s?s:_,$=j.default.useMemo((()=>{const e=F-H,t=D-_;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}}),[H,_,F,D,v]),q=(e,t)=>{var n;if(S.current){const l=w.current.get(S.current);l&&(S.current.contains(l)&&S.current.removeChild(l),w.current.delete(S.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((e=>{let[t,n]=e;return`${l=t,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${n}`;var l})).join(";"))(Object.assign(Object.assign({},$),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=S.current)||void 0===n||n.append(a),w.current.set(S.current,a)}},V=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[l,a]=(e=>{let t=120,n=64;if(!d&&e.measureText){e.font=`${T}px ${O}`;const l=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...l)),n=T*P.length+3*(P.length-1)}return[null!=c?c:t,null!=f?f:n]})(t),r=l*n,i=a*n,o=(A+l)*n,s=(L+a)*n,u=A/2*n,p=L/2*n,h=o/2,m=s/2,v=2*(A+l);e.width=2*o,e.height=2*s,t.globalAlpha=b,t.save(),t.translate(h,m),t.rotate(Math.PI/180*g),t.translate(-h,-m);const y=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:l}=n;for(let e=0;e<l.length;e+=4){const t=(l[e]+l[e+1]+l[e+2])/3;l[e]=t,l[e+1]=t,l[e+2]=t}t.putImageData(n,0,0)})(e),q(e.toDataURL(),v)},E=()=>{const e=Number(T)*n;t.font=`${I} normal ${N} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),P.forEach(((l,a)=>{t.fillText(null!=l?l:"",u,p+a*(e+3*n))})),y()};if(d){const e=new Image;e.onload=()=>{t.drawImage(e,u,p,r,i),y()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=d}else E()},K=e=>Array.from(w.current.values()).includes(e);j.default.useEffect((()=>{V()}),[u,d,c,f,p,h,m,g,v,b,y,x]),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=window&&"MutationObserver"in window,a=M.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};M.useEffect((()=>(r(),l&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,n)),()=>r())),[e])}(S,(e=>{if(y)for(const t of e){const e=Array.from(t.removedNodes).some((e=>K(e))),n="attributes"===t.type&&K(t.target);if(e||n){V();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=dt("watermark");return j.default.createElement("div",{ref:S,className:ne.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},Uc=new Map,Gc=new WeakMap;let Yc,Xc=0;function Qc(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Gc.has(n)||(Xc+=1,Gc.set(n,Xc.toString())),Gc.get(n)):"0"):e[t]}`;var n})).toString()}function Zc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yc;if(void 0===window.IntersectionObserver&&void 0!==l){const a=e.getBoundingClientRect();return t(l,{isIntersecting:l,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=Qc(e);let n=Uc.get(t);if(!n){const l=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var n;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(n=l.get(t.target))||void 0===n||n.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:r,elements:l},Uc.set(t,n)}return n}(n),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(),Uc.delete(a))}}const Jc=e=>{const{forceRender:t,height:n,placeholder:l=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:u}=function(){let{root:e,rootMargin:t,threshold:n,triggerOnce:l,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var u;const[d,c]=j.default.useState(null),[f,p]=j.default.useState({inView:!1,entry:void 0}),h=j.default.useRef(s);j.default.useEffect((()=>{if(i||!d)return;let s;return s=Zc(d,((e,t)=>{var n;p({inView:e,entry:t}),null===(n=h.current)||void 0===n||n.call(h,e,t),t.isIntersecting&&l&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:n,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(n)?n.toString():n,d,e,t,l,i,r,a,o]);const m=null===(u=f.entry)||void 0===u?void 0:u.target,g=j.default.useRef();d||!m||l||i||g.current===m||(g.current=m,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}));j.default.useEffect((()=>{n||Oe("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const d={[dt("lazy-load")]:!0};return j.default.createElement("div",{ref:o,className:ne.default(d,r),style:i},t||s?e.children:j.default.createElement("div",{className:"placeholder",style:{height:n}},l))};class ef{constructor(e,t,n,l){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=l||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 tf{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,l=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new tf(e[1],n,l,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const l=e.x-t.x,a=e.y-t.y,r=t.x-n.x,i=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,u=(t.x+n.x)/2,d=(t.y+n.y)/2,c=Math.sqrt(l*l+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),h=u+(o-u)*p,m=d+(s-d)*p,g=t.x-h,v=t.y-m;return{c1:new ef(o+g,s+v),c2:new ef(u+g,d+v)}}constructor(e,t,n,l,a,r){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=l,this.startWidth=a,this.endWidth=r}length(){let e,t,n=0;for(let l=0;l<=10;l+=1){const a=l/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(l>0){const l=r-e,a=i-t;n+=Math.sqrt(l*l+a*a)}e=r,t=i}return n}point(e,t,n,l,a){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*l*(1-e)*e*e+a*e*e*e}}class nf{constructor(e,t){var n=this;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.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(navigator.userAgent),this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{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.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",this.isMobile&&("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)=>"touches"in e?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:"touches"in e?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n._drawingStroke)return;if(0===n._data.length)return void n._strokeBegin(e);const l=n._createPoint(e.x,e.y,e.pressure),a=n._data[n._data.length-1],r=a.points,i=r.length>0&&r[r.length-1],o=!!i&&l.distanceTo(i)<=n.minDistance,s=n._getPointGroupOptions(a);if(!i||!i||!o){const e=n._addPoint(l,s);t&&(i?e&&n._drawCurve(e,s):n._drawDot(l,s)),r.push({time:l.time,x:l.x,y:l.y,pressure:l.pressure})}},this._strokeEnd=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n._drawingStroke&&(t&&n._strokeUpdate(e),n._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,l=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,l),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,l=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<a;n+=1){const r=n/a,i=r*r,o=i*r,s=1-r,u=s*s,d=u*s;let c=d*e.startPoint.x;c+=3*u*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=d*e.startPoint.y;f+=3*u*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*l,t.maxWidth);this._drawCurveSegment(c,f,p)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const l=this.ctx;l.moveTo(e,t),l.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const l=this.canvas.getBoundingClientRect();return new ef(e-l.left,t-l.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),l=tf.fromPoints(n,e);return n.shift(),l}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const l=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(l,n),r={end:a,start:this._lastWidth};return this._lastVelocity=l,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:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,l-t,a-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(l,t),i=Math.min(a,n),o=.5*(Math.max(l,t)-r),s=.5*(Math.max(a,n)-i),u=r+o,d=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(u,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:l,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(n-a,t-l)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),u=15*Math.sin(i),d=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(l,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(l,a);const f=l+s,p=a+u;this.ctx.lineTo(f,p);const h=l+d,m=a+c;this.ctx.lineTo(h,m),this.ctx.lineTo(l,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const l=e.width,a=e.data,r=[];return r[0]=a[4*(n*l+t)],r[1]=a[4*(n*l+t)+1],r[2]=a[4*(n*l+t)+2],r[3]=a[4*(n*l+t)+3],r},this.setAxisColor=(e,t,n,l)=>{const a=e.width,r=e.data;r[4*(n*a+t)]=l[0],r[4*(n*a+t)+1]=l[1],r[4*(n*a+t)+2]=l[2],r[4*(n*a+t)+3]=l[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=l.width,r=l.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=this.getAxisColor(l,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(l,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,n)}this.ctx.putImageData(l,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const l=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,n+a*l+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(e),this.textInput.focus())},this.setInputStyle=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.textInput.style.left=t+"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=n-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:t,y:n}},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,this.backgroundColor?(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)):1!==this.ratio&&t.scale(this.ratio,this.ratio),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n.canvas.width===n.width)return n.canvas.toDataURL(e,t);const l=document.createElement("canvas");l.width=n.width,l.height=n.height;return l.getContext("2d").drawImage(n.canvas,0,0,l.width,l.height),l.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;return n.toDataURL("image/jpeg",e)},this.destroy=()=>{this.removeListener();for(const e in this)this[e]=null},this.initial(e,t)}initial(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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.backgroundColor=t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this._strokeMoveUpdate=this.throttle?function(e){let t,n,l,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,r=0,i=null;const o=()=>{r=Date.now(),i=null,t=e.apply(n,l),i||(n=null,l=[])};return function(){const s=Date.now(),u=a-(s-r);n=this;for(var d=arguments.length,c=new Array(d),f=0;f<d;f++)c[f]=arguments[f];return l=c,u<=0||u>a?(i&&(clearTimeout(i),i=null),r=s,t=e.apply(n,l),i||(n=null,l=[])):i||(i=window.setTimeout(o,u)),t}}(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()}}nf.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],l=window.atob(t[1]),a=l.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=l.charCodeAt(e);return new Blob([r],{type:n})},nf.canvasToDataURL=e=>e.toDataURL("image/png",1),nf.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const lf=()=>j.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),af=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),rf=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),of=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),sf=()=>j.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},j.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"})),uf=j.default.forwardRef(((e,t)=>{const{open:n,width:l,height:a,imageName:r,penColor:i,minWidth:o,maxWidth:s,backgroundColor:d,className:c,style:f,onOk:p,onCancel:h}=e,{t:m}=td(),g=j.default.useRef(),v=j.default.useRef(null),y=j.default.useRef(null),x=j.default.useRef(null),E=[2,4,6],C=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[w,T]=Rd(void 0,{value:n,postState:e=>null!=e&&e}),N=j.default.useMemo((()=>!!e.children),[e.children]),[I,O]=j.default.useState(N?"square":"line"),[R,k]=j.default.useState(E[0]),[P,A]=j.default.useState(N?S[0]:S[4]),[L,H]=j.default.useState(C[1]),[_,F]=j.default.useState("bottomLeft"),[D,$]=j.default.useState(!1),[M,q]=j.default.useState(!1);j.default.useEffect((()=>{var e,t;const n={width:null!=l?l:null===(e=y.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=y.current)||void 0===t?void 0:t.offsetHeight,maxWidth:R,mode:I,penColor:P,fontSize:L,backgroundColor:d,openSmooth:!N};return n.openSmooth&&Object.assign(n,{penColor:i,minWidth:o,maxWidth:s}),g.current=new nf(v.current,n),()=>g.current.destroy()}),[]);const V=e=>{var t,n;const[r,i]=[null!=l?l:null===(t=y.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(n=y.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=g.current;let u=!1;r&&r!==o&&(g.current.width=r,u=!0),i&&i!==s&&(g.current.height=i,u=!0),(u||e)&&g.current.update()};Vn((()=>{N&&w&&V()}),[w,N]),Vn((()=>{g.current.setDrawMode(I)}),[I]),Vn((()=>{g.current.setLineWidth(R)}),[R]),Vn((()=>{g.current.setPenColor(P)}),[P]),Vn((()=>{g.current.setFontSize(L)}),[L]);const z=()=>Ye(void 0,void 0,void 0,(function*(){const e=N?y.current.parentNode:v.current;if(e)try{const t=yield me.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===x.current||e.classList.contains("spinning")});return nf.canvasToDataURL(t)}catch(e){Oe("Signature","生成合成图片失败!")}})),B=()=>{g.current.clear(),null==h||h()};j.default.useImperativeHandle(t,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>g.current.clear(),IS_EMPTY:()=>g.current.isEmpty(),UPDATE:V,GET_DATE_URL:z})));const W=e=>{e&&F((()=>{const e=x.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},U=e=>j.default.createElement("div",{className:ne.default("ant-dropdown-menu","content")},"text"!==e?j.default.createElement("div",{className:"lineWidth"},E.map((e=>j.default.createElement("span",{key:e,className:ne.default("dot",`s${e}`,{active:e===R}),onClick:()=>k(e)})))):j.default.createElement("div",{className:"fontSize"},j.default.createElement(u.Select,{size:"small",value:L,options:C.map((e=>({value:e,label:e.toString()}))),onChange:e=>H(e)})),j.default.createElement("span",{className:"divider"}),j.default.createElement("div",{className:"penColor"},S.map((e=>j.default.createElement("span",{key:e,className:ne.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},j.default.createElement(b.CheckOutlined,{className:"icon"})))))),G=dt("signature"),Y={[G]:!0,"is-annotation":N},X=l?Object.assign(Object.assign({},f),{width:l}):f;return j.default.createElement("div",{className:ne.default(Y,c),style:X},N&&j.default.createElement(j.default.Fragment,null,j.default.createElement("div",{ref:y,className:"content"},e.children),M&&j.default.createElement(rl,{spinning:!0,className:"spinning"})),j.default.createElement("div",{className:ne.default("signature",{show:w})},j.default.createElement("canvas",{ref:v,className:I}),N&&j.default.createElement("div",{ref:x,className:"signature__tool-bar"},j.default.createElement("div",{className:"wrapper"},j.default.createElement("div",{className:ne.default("actions",{hidden:D})},j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("square")},j.default.createElement(b.BorderOutlined,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("round")},j.default.createElement(lf,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("arrow")},j.default.createElement(rf,null))),j.default.createElement(u.Dropdown,{dropdownRender:U,overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("line")},j.default.createElement(b.EditOutlined,null))),j.default.createElement(u.Dropdown,{dropdownRender:()=>U("text"),overlayClassName:`${G}__popper`,placement:_,trigger:["click"],onOpenChange:W},j.default.createElement("button",{className:"btn",onClick:()=>O("text")},j.default.createElement(af,null))),j.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){yield Ye(void 0,void 0,void 0,(function*(){q(!0);const e=yield z();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):K.default().format(Us);vl(nf.dataURLToBlob(e),`${t}.png`)}q(!1)})),B()}))},j.default.createElement(b.DownloadOutlined,null)),j.default.createElement("button",{className:"btn",onClick:()=>O("eraser")},j.default.createElement(of,null)),j.default.createElement("button",{className:"btn",onClick:()=>g.current.undo()},j.default.createElement(sf,null)),j.default.createElement("button",{className:"btn",onClick:()=>g.current.clear()},j.default.createElement(b.ClearOutlined,null)),j.default.createElement("span",{className:"divider"}),j.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},j.default.createElement(b.CloseOutlined,null)),j.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){q(!0),yield tt(10);const e=yield z();q(!1),B(),null==p||p(e)}))},j.default.createElement(b.CheckOutlined,null))),j.default.createElement("button",{className:"btn btn-fold",title:m(D?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!D)},D?j.default.createElement(b.LeftOutlined,null):j.default.createElement(b.RightOutlined,null))))))}));uf.displayName="QmSignature";const df="1.9.6";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return u.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return u.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return u.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return u.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return u.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return u.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return u.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return u.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return u.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return u.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return u.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return u.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return u.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return u.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return u.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return u.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return u.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return u.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return u.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return u.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return u.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return u.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return u.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return u.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return u.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return u.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return u.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return u.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return u.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return u.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return u.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return u.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return u.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return u.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return u.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return u.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return u.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return u.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return u.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return u.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return u.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return u.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return u.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return u.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return u.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return u.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return u.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return u.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return u.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return u.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return u.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return u.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return u.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return u.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return u.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return u.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return u.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return u.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return u.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return u.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return u.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return u.notification}}),exports.Calendar=Me,exports.DatePicker=je,exports.DcpAnchor=El,exports.DcpButton=ot,exports.DcpCollapse=jn,exports.DcpConfigProvider=We,exports.DcpCopyToClipboard=sd,exports.DcpCountup=ll,exports.DcpCropper=Is,exports.DcpDivider=ct,exports.DcpDownload=bl,exports.DcpDrawer=wl,exports.DcpEmpty=al,exports.DcpForm=us,exports.DcpGuideTracker=Bc,exports.DcpLazyLoad=Jc,exports.DcpModal=Il,exports.DcpPrint=Tc,exports.DcpRangeTableHelper=Td,exports.DcpScrollbar=gl,exports.DcpSearchHelper=vd,exports.DcpSearchTree=Ms,exports.DcpSignature=uf,exports.DcpSpace=ut,exports.DcpSpin=rl,exports.DcpSplit=nl,exports.DcpTable=gd,exports.DcpTabs=Sl,exports.DcpTinymce=Ns,exports.DcpTour=uc,exports.DcpTransition=mc,exports.DcpTreeHelper=Cd,exports.DcpTreeTableHelper=Ed,exports.DcpUploadFile=Os,exports.DcpUploadImg=ks,exports.DcpWatermark=Wc,exports.QmAnchor=El,exports.QmButton=ot,exports.QmCollapse=jn,exports.QmConfigProvider=We,exports.QmCopyToClipboard=sd,exports.QmCountup=ll,exports.QmCropper=Is,exports.QmDivider=ct,exports.QmDownload=bl,exports.QmDrawer=wl,exports.QmEmpty=al,exports.QmForm=us,exports.QmGuideTracker=Bc,exports.QmLazyLoad=Jc,exports.QmModal=Il,exports.QmPrint=Tc,exports.QmRangeTableHelper=Td,exports.QmScrollbar=gl,exports.QmSearchHelper=vd,exports.QmSearchTree=Ms,exports.QmSignature=uf,exports.QmSpace=ut,exports.QmSpin=rl,exports.QmSplit=nl,exports.QmTable=gd,exports.QmTabs=Sl,exports.QmTinymce=Ns,exports.QmTour=uc,exports.QmTransition=mc,exports.QmTreeHelper=Cd,exports.QmTreeTableHelper=Ed,exports.QmUploadFile=Os,exports.QmUploadImg=ks,exports.QmWatermark=Wc,exports.TimePicker=Ve,exports.pinyin=nr,exports.version=df;