@jiaozhiye/qm-design-react 1.9.29 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/table/style/area-select.less +24 -24
- package/package.json +1 -1
package/lib/index.full.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("QmDesign",["react"],t):"object"==typeof exports?exports.QmDesign=t(require("react")):e.QmDesign=t(e.React)}("undefined"!=typeof self?self:this,(e=>(()=>{"use strict";var t={442:t=>{t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{Affix:()=>L.Affix,Alert:()=>L.Alert,Anchor:()=>L.Anchor,AutoComplete:()=>L.AutoComplete,Avatar:()=>L.Avatar,BackTop:()=>L.BackTop,Badge:()=>L.Badge,Breadcrumb:()=>L.Breadcrumb,Button:()=>L.Button,Calendar:()=>$,Card:()=>L.Card,Carousel:()=>L.Carousel,Cascader:()=>L.Cascader,Checkbox:()=>L.Checkbox,Col:()=>L.Col,Collapse:()=>L.Collapse,Comment:()=>L.Comment,ConfigProvider:()=>L.ConfigProvider,DatePicker:()=>j,DcpAnchor:()=>nr,DcpButton:()=>be,DcpCollapse:()=>$e,DcpConfigProvider:()=>ee,DcpCopyToClipboard:()=>qc,DcpCountup:()=>ut,DcpCropper:()=>vl,DcpDivider:()=>Re,DcpDownload:()=>Ut,DcpDrawer:()=>hr,DcpEmpty:()=>ft,DcpForm:()=>Go,DcpGuideTracker:()=>Pu,DcpLazyLoad:()=>Fu,DcpModal:()=>Er,DcpPrint:()=>ou,DcpRangeTableHelper:()=>yd,DcpScrollbar:()=>Ht,DcpSearchHelper:()=>ad,DcpSearchTree:()=>Dl,DcpSignature:()=>Xu,DcpSpace:()=>Ee,DcpSpin:()=>xt,DcpSplit:()=>at,DcpTable:()=>rd,DcpTabs:()=>cr,DcpTinymce:()=>ml,DcpTour:()=>$d,DcpTransition:()=>Vd,DcpTreeHelper:()=>hd,DcpTreeTableHelper:()=>ud,DcpUploadFile:()=>xl,DcpUploadImg:()=>Nl,DcpWatermark:()=>Ou,Descriptions:()=>L.Descriptions,Divider:()=>L.Divider,Drawer:()=>L.Drawer,Dropdown:()=>L.Dropdown,Empty:()=>L.Empty,Form:()=>L.Form,Grid:()=>L.Grid,Image:()=>L.Image,Input:()=>L.Input,InputNumber:()=>L.InputNumber,Layout:()=>L.Layout,List:()=>L.List,Mentions:()=>L.Mentions,Menu:()=>L.Menu,Modal:()=>L.Modal,PageHeader:()=>L.PageHeader,Pagination:()=>L.Pagination,Popconfirm:()=>L.Popconfirm,Popover:()=>L.Popover,Progress:()=>L.Progress,QmAnchor:()=>nr,QmButton:()=>be,QmCollapse:()=>$e,QmConfigProvider:()=>ee,QmCopyToClipboard:()=>qc,QmCountup:()=>ut,QmCropper:()=>vl,QmDivider:()=>Re,QmDownload:()=>Ut,QmDrawer:()=>hr,QmEmpty:()=>ft,QmForm:()=>Go,QmGuideTracker:()=>Pu,QmLazyLoad:()=>Fu,QmModal:()=>Er,QmPrint:()=>ou,QmRangeTableHelper:()=>yd,QmScrollbar:()=>Ht,QmSearchHelper:()=>ad,QmSearchTree:()=>Dl,QmSignature:()=>Xu,QmSpace:()=>Ee,QmSpin:()=>xt,QmSplit:()=>at,QmTable:()=>rd,QmTabs:()=>cr,QmTinymce:()=>ml,QmTour:()=>$d,QmTransition:()=>Vd,QmTreeHelper:()=>hd,QmTreeTableHelper:()=>ud,QmUploadFile:()=>xl,QmUploadImg:()=>Nl,QmWatermark:()=>Ou,Radio:()=>L.Radio,Rate:()=>L.Rate,Result:()=>L.Result,Row:()=>L.Row,Segmented:()=>L.Segmented,Select:()=>L.Select,Skeleton:()=>L.Skeleton,Slider:()=>L.Slider,Space:()=>L.Space,Spin:()=>L.Spin,Statistic:()=>L.Statistic,Steps:()=>L.Steps,Switch:()=>L.Switch,Table:()=>L.Table,Tabs:()=>L.Tabs,Tag:()=>L.Tag,TimePicker:()=>B,Timeline:()=>L.Timeline,Tooltip:()=>L.Tooltip,Transfer:()=>L.Transfer,Tree:()=>L.Tree,TreeSelect:()=>L.TreeSelect,Typography:()=>L.Typography,Upload:()=>L.Upload,message:()=>L.message,notification:()=>L.notification,pinyin:()=>ei,version:()=>Qu});var a=n(442),o=n.n(a);const l=require("prop-types");var s=n.n(l);const c=(0,a.createContext)({locale:"zh-cn",size:"middle"}),d=require("dayjs");var u=n.n(d);const p={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:"点击上传",remove:"删除文件"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",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:"查找下一个"}}}};require("dayjs/locale/zh-cn");let h=p;function m(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,r)=>t[r])):e}const f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const[n,i]=t;let a;const o=n.split(".");let l=h;for(let e=0,t=o.length;e<t;e++){if(a=l[o[e]],e===t-1)return m(a,i);if(!a)return"";l=a}return""},g=e=>{h=e||h,h.name&&u().locale(h.name)};class b extends Error{constructor(e){super(e),this.name="QmDesignError"}}function y(e,t){throw new b(`[${e}] ${t}`)}function v(e,t){console.warn(new b(`[${e}] ${t}`))}const x=e=>["","small","middle","large"].includes(e),E=require("dayjs/plugin/localeData");var S=n.n(E);const w=require("dayjs/plugin/advancedFormat");var C=n.n(w);const T=require("dayjs/plugin/customParseFormat");var I=n.n(T);const N=require("dayjs/plugin/quarterOfYear");var R=n.n(N);const P=require("dayjs/plugin/weekOfYear");var O=n.n(P);const k=require("dayjs/plugin/weekday");var A=n.n(k);u().extend(S()),u().extend(C()),u().extend(I()),u().extend(R()),u().extend(O()),u().extend(A());const L=require("antd"),_=require("rc-picker/es/generate/dayjs");var F=n.n(_);const H=require("antd/es/calendar/generateCalendar");var D=n.n(H);require("antd/es/calendar/style");const $=D()(F()),q=require("antd/es/date-picker/generatePicker");var M=n.n(q);require("antd/es/date-picker/style/index");const j=M()(F());function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(this,arguments)}const V=a.forwardRef(((e,t)=>a.createElement(j,K({},e,{picker:"time",mode:void 0,ref:t}))));V.displayName="TimePicker";const z=a.forwardRef(((e,t)=>a.createElement(j.RangePicker,K({},e,{picker:"time",mode:void 0,ref:t}))));z.displayName="RangePicker",V.RangePicker=z;const B=V,U={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",remove:"Delete files"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",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"}}}},W=require("antd/es/locale/zh_CN");var G=n.n(W);const Y=require("antd/es/locale/en_GB");var X=n.n(Y);function Q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Z={[U.name]:{qm:U,antd:X()},[p.name]:{qm:p,antd:G()}};class J extends a.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},g(Object.assign({},Z,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:r,size:n}=t.value,{locale:i,size:a,global:o}=e;return i!==r&&g(Object.assign({},Z,o.langPackage)[i].qm),i!==r||a!==n?{value:Object.assign({},t.value,{locale:i,size:a})}:null}render(){const{global:e}=this.props,{value:t}=this.state,r=Object.assign({},Z,e.langPackage);return o().createElement(c.Provider,{value:t},o().createElement(L.ConfigProvider,{locale:r[t.locale].antd,componentSize:t.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}Q(J,"propTypes",{locale:s().string,size:(e,t,r)=>{if(!x(e[t]||""))return y("Divider","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},theme:s().string,global:s().object}),Q(J,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const ee=J,te=require("lodash-es"),re="undefined"==typeof window,ne=e=>o().isValidElement(e),ie=e=>ne(e)&&e.type===o().Fragment,ae=()=>{},oe=()=>!0,le=async e=>new Promise((t=>setTimeout(t,e))),se=e=>{Promise.resolve().then(e)},ce=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),de=e=>!!(!e&&0!==e||(0,te.isArray)(e)&&!e.length||(0,te.isPlainObject)(e)&&!Object.keys(e).length),ue=(e,t)=>{const r={...e};for(const e of t)delete r[e];return r},pe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if((0,te.isPlainObject)(e)||(0,te.isArray)(e)){const r=Array.isArray(e),n=r?[]:{};if(t.get(e))return e;t.set(e,n);const i=r?void 0:Object.keys(e);return function(e,t){let r=-1;const n=e.length;for(;++r<n;)t(e[r],r)}(i||e,((r,a)=>{i&&(a=r),n[a]=pe(e[a],t)})),n}return e},he=e=>(0,te.isNumber)(e)?`${e}px`:e.toString();function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},me.apply(this,arguments)}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ge extends a.Component{constructor(){super(...arguments),fe(this,"context",void 0),fe(this,"state",{isLoading:!1}),fe(this,"clickHandle",(async e=>{this.setState({isLoading:!0});try{await(this.props.click?.(e))}catch(e){v("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:t,authConfig:r,click:n,confirm:i}=this.props,{isLoading:a}=this.state,l=e||this.context.size||"",s=(0,te.isFunction)(n)?{onClick:this.clickHandle}:null,c={...ue(this.props,["authConfig","click","confirm"]),size:l,loading:a||t||!1,...s};if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return i?o().createElement(L.Popconfirm,{title:i.title||f("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{i.onConfirm?.(),c.onClick?.(e)},onCancel:e=>{i.onCancel?.(e)}},o().createElement(L.Button,me({},c,{onClick:ae}),this.props.children)):o().createElement(L.Button,c,this.props.children)}}fe(ge,"propTypes",{click:s().func,confirm:s().shape({title:s().node,onConfirm:s().func,onCancel:s().func})}),fe(ge,"contextType",c);const be=ge;function ye(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve=function(e){return e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small",e}(ve||{});class xe extends a.Component{constructor(){super(...arguments),ye(this,"context",void 0)}render(){const{size:e}=this.props,t=e||this.context.size||"",r=(0,te.isNumber)(e)?e:ve[e||t||"default"],n={...this.props,size:r};return o().createElement(L.Space,n,this.props.children)}}ye(xe,"contextType",c);const Ee=xe,Se=require("classnames");var we=n.n(Se);const Ce=e=>`qm-${e}`,Te=require("@ant-design/icons");function Ie(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ne extends a.Component{constructor(){super(...arguments),Ie(this,"context",void 0),Ie(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=ae}=this.props;t(!e)}))}render(){const{size:e,label:t,extra:r,collapse:n,bordered:i,disabled:a,id:l,className:s,style:c}=this.props,d=e||this.context.size||"",u=Ce("divider"),p={[u]:!0,[`${u}-borderless`]:!i,[`${u}--lg`]:"large"===d,[`${u}--sm`]:"small"===d};return o().createElement("div",{id:l,className:we()(p,s),style:c},o().createElement("span",{className:we()(`${u}__title`)},t),o().createElement("div",{className:we()(`${u}__extra`)},r),void 0!==n&&o().createElement(L.Button,{type:"link",className:we()(`${u}__collapse`),disabled:a,onClick:this.clickHandle},f(n?"qm.divider.collect":"qm.divider.spread"),n?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)))}}Ie(Ne,"contextType",c),Ie(Ne,"propTypes",{label:s().string,size:(e,t,r)=>{if(!x(e[t]||""))return y("Divider","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},extra:s().oneOfType([s().element,s().string]),collapse:s().bool,bordered:s().bool}),Ie(Ne,"defaultProps",{bordered:!0});const Re=Ne,Pe=()=>({height:0,opacity:0}),Oe=(e,t)=>"height"===t.propertyName,ke={motionName:"rc-collapse-motion",onEnterStart:Pe,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:Pe,onEnterEnd:Oe,onLeaveEnd:Oe,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},Ae=require("rc-motion");var Le=n.n(Ae);const _e=o().forwardRef(((e,t)=>{const{forceRender:r,className:n,style:i,boxStyle:a,isActive:l}=e,[s,c]=o().useState(l||r);if(o().useEffect((()=>{(r||l)&&c(!0)}),[r,l]),!s)return null;const d=Ce("collapse");return o().createElement("div",{ref:t,className:we()(`${d}-content`,{[`${d}-content-active`]:l,[`${d}-content-inactive`]:!l},n),style:i},o().createElement("div",{className:`${d}-content-box`,style:a},e.children))}));_e.displayName="PanelContent";const Fe=_e;function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},He.apply(this,arguments)}const De=e=>{const{defaultActive:t,label:r,extra:n,className:i,style:a,containerStyle:l,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[h,m]=o().useState(!!t),f=Ce("collapse"),g=we()({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},i);return o().createElement("div",{className:g,style:a},o().createElement(Re,{label:r,extra:n,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),p?.(e)}}),o().createElement(Le(),He({visible:h},ke,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),((t,r)=>{let{className:n,style:i}=t;return o().createElement(Fe,{ref:r,prefixCls:f,className:n,style:i,boxStyle:l,isActive:h,forceRender:d},e.children)})))};De.displayName="QmCollapse";const $e=De,qe=o().createContext(void 0);function Me(e,t){((t,r)=>{const n=a.useRef(!0);a.useEffect((()=>(t=>{if(!t)return e()})(n.current)),r),a.useEffect((()=>(n.current=!1,()=>{n.current=!0})),[])})(0,t)}const je=(e,t,r)=>{e&&t&&r&&e.addEventListener(t,r,!1)},Ke=(e,t,r)=>{e&&t&&r&&e.removeEventListener(t,r,!1)},Ve=e=>e.preventDefault(),ze=(e,t)=>{if(re||!e||!t)return null;"float"===(t=ce(t))&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const n=window.getComputedStyle(e);return n?n[t]:""}catch(r){return e.style[t]}},Be=(e,t,r)=>{!re&&e&&t&&((0,te.isPlainObject)(t)?Object.keys(t).forEach((r=>{Be(e,r,t[r])})):(t=ce(t),e.style[t]=r))},Ue=e=>{let t=0,r=e;for(;r;)t+=r.offsetTop,r=r.offsetParent;return t},We=(e,t)=>Math.abs(Ue(e)-Ue(t)),Ge=e=>{let t=0,r=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,r+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:r}},Ye=(e,t)=>{let r=e;for(;r;){if(r.classList?.contains(t))return r;r=r.parentNode}return null},Xe=(e,t)=>{if(re||!e||!t)return!1;let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1},Qe=e=>Math.pow(e,3),Ze=e=>e<.5?Qe(2*e)/2:1-Qe(2*(1-e))/2,Je=e=>{const{minValues:t,onDragChange:r,onDragging:n}=e,{splitRef:i,direction:a}=o().useContext(qe),l=o().useRef(re?null:document.onselectstart),s=o().useMemo((()=>"horizontal"===a),[a]),c=o().useMemo((()=>s?"X":"Y"),[s]),d=o().useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),u=e=>{d.current=Object.assign({},d.current,e)},p=e=>{if(1!==e.buttons)return h();const r=e[`page${c}`]-d.current[`start${c}`],i=[t[0],d.current[`containerSize${c}`]-t[1]];let a=d.current[`firstElementSize${c}`]+r;a=Math.max(i[0],a),a=Math.min(i[1],a),n(a)},h=()=>{u({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),Ke(document,"mousemove",p),Ke(document,"mouseup",h),m()},m=()=>{document.onselectstart!==l.current&&(document.onselectstart=l.current)},g=Ce("split"),b={[`${g}__resize-bar`]:!0,vertical:"vertical"===a,horizontal:"horizontal"===a};return o().createElement("div",{className:we()(b),title:f("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=i.current,n=t.children[0];u({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),je(document,"mousemove",p),je(document,"mouseup",h),r(!0),l.current=document.onselectstart,document.onselectstart=()=>!1}})};Je.displayName="ResizeBar";const et=Je,tt=o().forwardRef(((e,t)=>{const{offset:r,className:n,style:i}=e,{direction:a,dragging:l}=o().useContext(qe),s="vertical"===a?"height":"width",c=Ce("split-pane"),d={[c]:!0,isLocked:l,horizontal:"horizontal"===a,vertical:"vertical"===a,[n]:!!n},u=void 0!==r?{[s]:he(r)}:{flex:1,[s]:0};return o().createElement("div",{ref:t,className:we()(d),style:{...u,...i}},e.children)}));tt.displayName="QmSplitPane";const rt=tt;function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nt.apply(this,arguments)}const it=e=>{const{direction:t="horizontal",defaultValue:r="50%",uniqueKey:n,className:i,style:a,onDragStart:l,onDrag:s=ae,onDragEnd:d}=e,{global:u}=o().useContext(c),p=o().useRef(null),h=o().useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,f=e=>Number.parseInt(e,10),g=e=>{const t=Number.parseInt(e.props?.min||0);return t>=0?t:0},b=o().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=o().useState(!1),[x,E]=o().useState(m(r));Me((()=>{y?l?.(f(x)):(d?.(f(x)),localStorage.setItem(b,x),C(b,x))}),[y]),o().useEffect((()=>{S()}),[]);const S=()=>{if(!b)return;const e=localStorage.getItem(b);e?E(m(e)):w(b).then((e=>{localStorage.setItem(b,m(e||r)),S()})).catch((()=>{}))},w=async e=>{const t=u?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},C=async(e,t)=>{const r=u?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}},T=o().useMemo((()=>({splitRef:p,direction:t,dragging:y})),[t,y]),I=[];o().Children.map(e.children,(e=>{ne(e)&&!ie(e)&&"QmSplitPane"===e.type?.displayName&&I.push(e)}));const[N,R]=I,P=o().useMemo((()=>[g(N),g(R)]),[N,R]),O=Ce("split"),k={[O]:!0,vertical:"vertical"===t};return o().createElement(qe.Provider,{value:T},o().createElement("div",{ref:p,className:we()(k,i),style:a},o().createElement(rt,nt({},N.props,{ref:h,offset:x})),o().createElement(et,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{E(`${e}px`),s(e)}}),o().createElement(rt,R.props)))};it.Pane=rt,it.displayName="QmSplit";const at=it,ot=require("react-countup");var lt=n.n(ot);function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},st.apply(this,arguments)}function ct(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class dt extends a.Component{constructor(){super(...arguments),ct(this,"context",void 0)}render(){const{size:e,className:t,style:r}=this.props,n=e||this.context.size||"",i=Ce("countup"),a={[i]:!0,[`${i}--lg`]:"large"===n,[`${i}--sm`]:"small"===n};return o().createElement(lt(),st({},this.props,{className:we()(a,t),style:r}),this.props.children)}}ct(dt,"defaultProps",{duration:2}),ct(dt,"contextType",c);const ut=dt;function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pt.apply(this,arguments)}function ht(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class mt extends a.Component{constructor(){super(...arguments),ht(this,"context",void 0)}render(){const{size:e,className:t}=this.props,r=e||this.context.size||"",n=Ce("empty"),i={...this.props,image:L.Empty.PRESENTED_IMAGE_SIMPLE},a={[n]:!0,[`${n}--lg`]:"large"===r,[`${n}--sm`]:"small"===r};return o().createElement(L.Empty,pt({},i,{className:we()(a,t)}))}}ht(mt,"contextType",c),ht(mt,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")}});const ft=mt;class gt extends a.Component{render(){const{fullHeight:e,className:t,style:r={}}=this.props,n=Ce("spin"),i={[`${n}-full-height`]:e},a={wrapperClassName:we()(i,t),...ue(this.props,["fullHeight"]),style:{...r,maxHeight:"none"}};return o().createElement(L.Spin,a,this.props.children)}}var bt,yt,vt;bt=gt,vt={tip:"Loading...",fullHeight:!1},(yt=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(yt="defaultProps"))in bt?Object.defineProperty(bt,yt,{value:vt,enumerable:!0,configurable:!0,writable:!0}):bt[yt]=vt;const xt=gt,Et=o().createContext(void 0),St=require("resize-observer-polyfill");var wt=n.n(St);const Ct=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},Tt=function(e,t){!re&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(wt())(Ct),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},It=function(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||e.__ro__?.disconnect())};function Nt(e){const[t,r]=a.useState({width:0,height:0});return a.useLayoutEffect((()=>{const t=e.current,n=e=>{const{width:t,height:n}=e.contentRect;r({width:t,height:n})};return t&&Tt(t,n),()=>{t&&It(t,n)}}),[e]),t}const Rt=(e,t)=>{const r=a.useRef(!0);a.useLayoutEffect((()=>e(r.current)),t),a.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function Pt(e,t){Rt((t=>{if(!t)return e()}),t)}function Ot(e,t){var r=this;const n=a.useRef(null);a.useEffect((()=>()=>{clearTimeout(n.current),n.current=null}),[]);const i=a.useCallback((function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];n.current&&clearTimeout(n.current),n.current=setTimeout((()=>e.apply(r,a)),t)}),[e,t]);return i}const kt=6,At={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"}},Lt=e=>{const{thumb:t,always:r,className:n,barSize:i=kt,direction:a="vertical",onDrag:l=ae}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=o().useContext(Et),u=At[a],p=o().useRef(t),h=o().useRef(null),m=o().useRef(null),f=o().useRef({}),g=o().useRef(!1),b=o().useRef(!1),y=o().useRef(re?null:document.onselectstart),[v,x]=o().useState(!1);o().useLayoutEffect((()=>{p.current=t}),[t]),o().useEffect((()=>{const e=c.current;return je(e,"mousemove",C),je(e,"mouseleave",T),()=>{w(),Ke(document,"mouseup",S),Ke(e,"mousemove",C),Ke(e,"mouseleave",T)}}),[]);const E=e=>{if(!h.current||!m.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const r=100*(-1*(h.current.getBoundingClientRect()[u.direction]-e[u.client])-(m.current[u.offset]-t))/h.current[u.offset];d.current[u.scroll]=r*d.current[u.scrollSize]/100,l(!0)},S=()=>{g.current=!1,f.current={[u.axis]:0},Ke(document,"mousemove",E),Ke(document,"mouseup",S),w(),b.current&&x(!1),l(!1)},w=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},C=()=>{b.current=!1,x(!!p.current.size)},T=()=>{b.current=!0,x(g.current)},I=Ce("scrollbar"),N={[`${I}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},R={[u.reverse]:i},P={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return o().createElement(Vd,{name:"fade",in:r||s||v,timeout:300},o().createElement("div",{ref:h,className:we()(N,n),style:R},o().createElement("div",{ref:m,className:`${I}__thumb`,style:P,onMouseDown:e=>{e.stopPropagation(),je(document,"mousemove",E),je(document,"mouseup",S),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},_t=20,Ft=o().forwardRef(((e,t)=>{const{wrapClassName:r,wrapStyle:n,barWidth:i,always:a,native:l,showTopScrollbar:s,minSize:c=_t,onScroll:d}=e,u=o().useRef(null),p=o().useRef(null),h=o().useRef(null),[m,f]=o().useState({size:0,offset:0,ratio:1}),[g,b]=o().useState({size:0,offset:0,ratio:1}),[y,x]=o().useState(!1),E=Nt(u),S=Nt(h);Pt((()=>{!l&&w()}),[S.width,S.height,E.width,E.height]);const w=Ot((()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,r=e**2/p.current.scrollHeight,n=t**2/p.current.scrollWidth,i=Math.max(r,c),a=Math.max(n,c),o=r/(e-r)/(i/(e-i)),l=n/(t-n)/(a/(t-a)),s=i+4<e?i:0,d=a+4<t?a:0,u=100*p.current.scrollTop/e*o,h=100*p.current.scrollLeft/t*l;f(Object.assign({},m,{size:d,ratio:l,offset:h})),b(Object.assign({},g,{size:s,ratio:o,offset:u}))}),5),C=e=>{x(e)},T=(e,t)=>{(0,te.isNumber)(e)?t?((e,t)=>{const r=Date.now(),n=e.scrollTop,i=window.requestAnimationFrame,a=()=>{const o=(Date.now()-r)/500;o<1?(e.scrollTop=n+(t-n)*Ze(o),i(a)):e.scrollTop=t};i(a)})(p.current,e):p.current.scrollTop=e:v("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},I=(e,t)=>{(0,te.isNumber)(e)?t?((e,t)=>{const r=Date.now(),n=e.scrollLeft,i=window.requestAnimationFrame,a=()=>{const o=(Date.now()-r)/500;o<1?(e.scrollLeft=n+(t-n)*Ze(o),i(a)):e.scrollLeft=t};i(a)})(p.current,e):p.current.scrollLeft=e:v("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};o().useImperativeHandle(t,(()=>({container:u.current,scrollTop:p.current?.scrollTop||0,scrollLeft:p.current?.scrollLeft||0,SET_SCROLL_TOP:T,SET_SCROLL_LEFT:I})));const N=o().useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),R=Ce("scrollbar"),P={[`${R}__wrap`]:!0,[`${R}__wrap--hidden`]:!l};return o().createElement("div",{ref:u,className:we()(R,e.className),style:e.style},o().createElement("div",{ref:p,className:we()(P,r),style:n,onScroll:e=>{const{scrollTop:t,scrollLeft:r}=e.target;!l&&(()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,r=100*p.current.scrollTop/e*g.ratio,n=100*p.current.scrollLeft/t*m.ratio;f(Object.assign({},m,{offset:n})),b(Object.assign({},g,{offset:r}))})(),d?.({scrollTop:t,scrollLeft:r})}},o().createElement("div",{ref:h,className:`${R}__view`},e.children)),!l&&o().createElement(Et.Provider,{value:N},s&&o().createElement(Lt,{className:"top",direction:"horizontal",thumb:m,barSize:i,always:a,onDrag:C}),o().createElement(Lt,{direction:"horizontal",thumb:m,barSize:i,always:a,onDrag:C}),o().createElement(Lt,{direction:"vertical",thumb:g,barSize:i,always:a,onDrag:C})))}));Ft.displayName="QmScrollbar";const Ht=Ft,Dt=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const r=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=r,n.download=decodeURI(t),n.click(),n=null}};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(this,arguments)}function qt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt=async(e,t)=>{let{fileName:r,headers:n,params:i}=t;const a=i?new URLSearchParams(i).toString():"",o=a?e.includes("?")?"&":"?":"",l=await fetch(e+`${o+a}`,{method:"GET",headers:n});if(!l.ok)throw new Error(f("qm.download.error"));const s=await l.blob(),c=l.headers.get("content-disposition"),d=r||(c?c.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Dt(s,d)};class jt extends a.Component{constructor(){super(...arguments),qt(this,"context",void 0),qt(this,"beforeUpload",((e,t)=>new Promise((async(r,n)=>{const{fileTypes:i=[],fileSize:a,maxCount:o,fileList:l=[],beforeUpload:s}=this.props,c=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),d=!a||e.size/1024/1024<a,u=!(o>1)||l.length<o,p=c&&d&&u;if(c||L.message.warning(f("qm.upload.tooltip",{type:i.join(",")})),d||L.message.warning(f("qm.upload.sizeLimit",{size:a})),u||L.message.warning(f("qm.upload.countLimit",{count:o})),!p)return L.Upload.LIST_IGNORE;if(s){const i=s(e,t);if(!0===i)return r(e);if(!1===i)return n("not upload");if(i&&"function"==typeof i.then)try{r(await i)}catch(e){n(e)}}else r(e)})))),qt(this,"doDownload",(async e=>{const{downloadWithHeaders:t,headers:r}=this.props;try{e.url&&await Mt(e.url,{fileName:e.name,...t?{headers:r}:null})}catch(e){L.message.error(f("qm.download.error"))}}))}get $size(){return this.context.size??""}render(){const{fileList:e=[],button:t={},fileDirection:r,disabled:n,readOnly:i,className:a,onPreview:l,onChange:s}=this.props,c=Ce("upload-file"),d={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}--horizontal`]:"horizontal"===r};return o().createElement(L.Upload,$t({className:we()(d,a)},ue(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:n||i,onChange:s,onPreview:async e=>{if("function"==typeof l)return l(e,(t=>this.doDownload(t||e)));n||await this.doDownload(e)},onDownload:async e=>{await this.doDownload(e)}}),this.props.children||i&&e.length?this.props.children:o().createElement(L.Button,{type:t.type??"default",icon:t.icon??o().createElement(Te.UploadOutlined,null),disabled:n||i},t.text||f("qm.upload.text")))}}qt(jt,"contextType",c),qt(jt,"defaultProps",{name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}});const Kt=jt;function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vt.apply(this,arguments)}function zt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Bt extends a.Component{constructor(){super(...arguments),zt(this,"context",void 0),zt(this,"state",{loading:!1}),zt(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{const{action:e,fileName:t,headers:r,params:n,beforeDownload:i=oe}=this.props,a=(0,te.isString)(e)?e:await this.getActionUrl();if(!a)return v("Download","参数 `action` 有误!");if(!i(a))return;await Mt(a,{fileName:t,headers:r,params:n}),await le(100),this.props.onSuccess?.(),L.message.success(f("qm.download.success"))}catch(e){this.props.onError?.(e),L.message.error(f("qm.download.error"))}this.setState({loading:!1})}))}async getActionUrl(){const e=this.props.action;if(e.api)try{const t=await e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}render(){const{size:e}=this.props,{loading:t}=this.state,r=e||this.context.size||"",n=ue(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return o().createElement(L.Button,Vt({},n,{size:r,loading:t,onClick:this.downloadHandle}),this.props.children)}}zt(Bt,"propTypes",{action:s().oneOfType([s().string,s().shape({api:s().func.isRequired,params:s().object})]),size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},fileName:s().string,headers:s().object,withCredentials:s().bool,params:s().object,beforeDownload:s().func,onSuccess:s().func,onError:s().func}),zt(Bt,"defaultProps",{icon:o().createElement(Te.DownloadOutlined,null),children:f("qm.download.text"),withCredentials:!1}),zt(Bt,"contextType",c);const Ut=Bt,Wt=require("add-dom-event-listener");var Gt=n.n(Wt);const Yt=require("scroll-into-view-if-needed");var Xt=n.n(Yt);class Qt extends a.Component{renderLabel(){const{activeKey:e,labels:t,onTabClick:r}=this.props;return t.map(((t,n)=>{const i={item:!0,actived:n===e};return o().createElement("div",{key:n,className:we()(i),onClick:e=>r(n,e)},o().createElement("span",null,t))}))}render(){return o().createElement(o().Fragment,null,this.renderLabel())}}const Zt=Qt;class Jt extends a.Component{render(){const{label:e,showDivider:t,className:r,style:n}=this.props,i=Ce("anchor-item"),a={[i]:!0};return o().createElement("div",{className:we()(a,r),style:n},t&&o().createElement(Re,{label:e,style:{marginBottom:10}}),this.props.children)}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Jt,"displayName","QmAnchorItem");const er=Jt;function tr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class rr extends a.Component{get __is_conf(){return!!this.props.labelList?.length}constructor(e){super(e),tr(this,"context",void 0),tr(this,"currentState","ready"),tr(this,"itemsTotal",void 0),tr(this,"timer",void 0),tr(this,"scrollEvent",void 0),tr(this,"scrollRef",(0,a.createRef)()),tr(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),tr(this,"onTabClickHandle",(e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),Xt()(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),tr(this,"SCROLL_TO_ITEM",(e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)})),this.state={activeKey:e.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=Gt()(this.scrollRef.current,"scroll",(0,te.throttle)(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=We(this.getTargetElement(e),this.scrollRef.current))}createDistances(){const{labelList:e=[]}=this.props;return(this.__is_conf?e.map((e=>document.getElementById(e.id))):Array.from(this.scrollRef.current?.children||[])).map((e=>We(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),r=this.createDistances();let n=-1;for(let e=0;e<r.length;e++){const i=r[e],a=r[e+1]||1e4;t>=i-1&&t<a&&(n=e)}return n}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:r,tabPosition:n,labelList:i=[],onTabClick:a,className:l,style:s}=this.props,c=t||this.context.size||"",d=Ce("anchor"),u={[d]:!0,[`${d}-left`]:"left"===n,[`${d}-top`]:"top"===n,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c},p=[];o().Children.map(this.props.children,(e=>{ne(e)&&!ie(e)&&"QmAnchorItem"===e.type?.displayName&&p.push(e)}));const h=this.__is_conf?i.map((e=>e.label)):p.map((e=>e.props.label)),m=this.__is_conf?i.map((e=>e.id)):p.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=h.length,o().createElement("div",{className:we()(u,l),style:s},o().createElement("div",{className:we()("anchor-nav"),style:{width:r?he(r):""}},o().createElement(Zt,{activeKey:e,labels:h,onTabClick:(e,t)=>{this.onTabClickHandle(e),a?.({label:h[e],id:m[e]},t)}})),o().createElement("div",{ref:this.scrollRef,className:we()("anchor-container")},this.__is_conf?this.props.children:p))}}tr(rr,"Item",er),tr(rr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},labelWidth:(e,t,r)=>{if("number"!=typeof(n=e[t])&&void 0!==n&&!["px","rem","em","vw","vh","%"].some((e=>n.endsWith(e)))&&!n.startsWith("calc"))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.");var n},labelList:s().arrayOf(s().shape({id:s().string,label:s().string}))}),tr(rr,"defaultProps",{tabPosition:"left"}),tr(rr,"contextType",c);const nr=rr;class ir extends a.Component{render(){return o().createElement(L.Tabs.TabPane,this.props,this.props.children)}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(ir,"displayName","QmTabPane");const ar=ir;function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},or.apply(this,arguments)}function lr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class sr extends a.Component{constructor(){super(...arguments),lr(this,"context",void 0)}render(){const{items:e,size:t,tabPosition:r,tabBarGutter:n,className:i,authConfig:a}=this.props,l=t||this.context.size||"",s=Ce("tabs"),c={[s]:!0,[`${s}--lg`]:"large"===l,[`${s}--sm`]:"small"===l},d={...ue(this.props,["items","authConfig"]),size:l,tabBarGutter:n??(["top","bottom"].includes(r)?30:0)},u=[];o().Children.map(this.props.children,(e=>{ne(e)&&!ie(e)&&"QmTabPane"===e.type?.displayName&&u.push(e)}));const p=e?[...e]:u.map((e=>{let{key:t,props:r}=e;return{key:t,label:r.tab,disabled:r.disabled,closable:r.closable,forceRender:r.forceRender,children:r.children}}));if(a){const{fieldList:e=[]}=a||{};for(let t=0;t<p.length;t++){const r=p[t],n=e.find((e=>e.dataIndex===r.key)),{visible:i=1,disabled:a}=n||{};i?a&&(r.disabled=!0):(p.splice(t,1),t--)}}return o().createElement(L.Tabs,or({},d,{items:p,className:we()(c,i)}))}}lr(sr,"TabPane",ar),lr(sr,"contextType",c),lr(sr,"defaultProps",{tabPosition:"top"});const cr=sr;function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dr.apply(this,arguments)}function ur(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class pr extends a.Component{constructor(){super(...arguments),ur(this,"context",void 0),ur(this,"titleRef",o().createRef()),ur(this,"$drawer",null),ur(this,"opened",!1),ur(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),ur(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;e?(this.opened=!0,(0,te.isUndefined)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(this.props.onClosed?.(),this.setState({fullscreen:!1}))})),ur(this,"toggleHandle",(()=>{this.$drawer=Ye(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{this.props.onFullChange?.(this.state.fullscreen)}))})),ur(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),ur(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:r,open:n,loading:i,destroyOnClose:a}=this.props,o=n??r,l=e.open??e.visible,{fullscreen:s}=this.state;o&&o!==l&&(!a&&this.opened||(0,te.isUndefined)(i)&&this.setState({spinning:!0})),this.$drawer&&s!==t.fullscreen&&Be(this.$drawer,s?{width:"100%"}:{width:he(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:t,showHeader:r,showFullScreen:n}=this.props;return o().createElement(o().Fragment,null,o().createElement("span",{ref:this.titleRef,className:we()("text")},r&&t),n&&o().createElement("button",{type:"button",className:we()("full-screen"),onClick:this.toggleHandle},o().createElement(e?Te.FullscreenExitOutlined:Te.FullscreenOutlined)))}render(){const{spinning:e,sloading:t}=this.state,{visible:r,open:n,size:i,className:a,loading:l,showHeader:s,maskClosable:c,onClose:d}=this.props,u=this.context.global,p=i||this.context.size||"",h=Ce("drawer"),m={[h]:!0,"no-header":!s,[`${h}--lg`]:"large"===p,[`${h}--sm`]:"small"===p};return o().createElement(L.Drawer,dr({},ue(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:n??r,maskClosable:c??u?.maskClosable??!1,className:we()(m,a),title:this.renderTitle(),footer:null,onClose:d,afterOpenChange:this.afterVisibleChange}),this.props.children,(l||t||e)&&o().createElement(xt,{spinning:!0,className:we()("spinning")}))}}ur(pr,"contextType",c),ur(pr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Drawer","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},spinning:s().bool}),ur(pr,"defaultProps",{width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null});const hr=pr,mr=require("react-draggable");var fr=n.n(mr);function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gr.apply(this,arguments)}function br(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yr="10vh";var vr=function(e){return e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none",e}(vr||{});class xr extends a.Component{constructor(){super(...arguments),br(this,"context",void 0),br(this,"draggleRef",o().createRef()),br(this,"opened",!1),br(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),br(this,"onStart",((e,t)=>{const{clientWidth:r,clientHeight:n}=window.document.documentElement,i=this.draggleRef.current.getBoundingClientRect();i&&this.setState({bounds:{left:-i.left+t.x,right:r-(i.right-t.x)-1,top:-i.top+t.y,bottom:n-(i.bottom-t.y)-1}})})),br(this,"toggleHandle",(e=>{const t=Ye(e.target,"ant-modal");if(!t)return;const r=t.querySelector(".ant-modal-body"),{width:n,height:i,showHeader:a}=this.props,{fullscreen:o}=this.state;o?(Be(t,{width:he(n||"60%"),height:"auto",top:yr}),Be(r,{height:i?he(i):this.defaultHeight,maxHeight:"auto"===i?this.defaultHeight:""})):(Be(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Be(r,{height:`calc(100vh - ${vr[a?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{this.props.onFullChange?.(this.state.fullscreen)}))})),br(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;e?.(),this.setState({fullscreen:!1})})),br(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),br(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${yr} - ${yr} - ${vr[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){const{visible:r,open:n,loading:i,destroyOnClose:a}=this.props,o=n??r,l=e.open??e.visible,{fullscreen:s}=this.state;if(o&&o!==l){if(!a&&this.opened||(0,te.isUndefined)(i)&&this.setState({spinning:!0}),!a&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,te.isUndefined)(i)&&this.setState({spinning:!1})}),400)}s!==t.fullscreen&&(s?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:t}=this.state,{title:r,showHeader:n,showFullScreen:i}=this.props;return o().createElement("div",{onMouseOver:()=>{t&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},o().createElement("span",{className:we()("text")},n&&r),i&&o().createElement("button",{type:"button",className:we()("full-screen"),onClick:this.toggleHandle},o().createElement(e?Te.FullscreenExitOutlined:Te.FullscreenOutlined)))}render(){const{spinning:e,sloading:t,fullscreen:r,disabled:n,bounds:i,position:a}=this.state,{visible:l,open:s,height:c,className:d,loading:u,draggable:p,showHeader:h,maskClosable:m,bodyStyle:f,onClose:g}=this.props,b=this.context.global,y=Ce("modal"),v={height:c?he(c):this.defaultHeight,maxHeight:"auto"===c?this.defaultHeight:"",overflow:"auto"},x={[y]:!0,"no-header":!h,[`${y}--lg`]:"large"===this.$size,[`${y}--sm`]:"small"===this.$size};return o().createElement(L.Modal,gr({},ue(this.props,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:s??l,maskClosable:m??b?.maskClosable??!1,className:we()(x,d),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},v,f),onCancel:g,afterClose:this.afterVisibleChange,modalRender:e=>o().createElement(fr(),{nodeRef:this.draggleRef,bounds:i,position:a,disabled:!p||n||r,onStart:(e,t)=>this.onStart(e,t)},o().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(u||t||e)&&o().createElement(xt,{spinning:!0,className:we()("spinning")}))}}br(xr,"contextType",c),br(xr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Modal","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},spinning:s().bool}),br(xr,"defaultProps",{width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:yr}});const Er=xr,Sr=require("memoize-one");var wr=n.n(Sr);const Cr=(0,a.createContext)(void 0),Tr=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],Ir={operations:function(e){const t=e.split(" "),r=[];let n=0;r[n]=[];for(let e=0;e<t.length;e++)Tr.includes(t[e])?(r[n]=r[n].join(" "),n++,r[n]=[]):r[n].push(t[e]);return r[n]=r[n].join(" "),r},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 r=0,n=(e=Array.isArray(e)?e:[e]).length;r<n;r++)t+="number"==typeof e[r]?e[r]:"'"+e[r]+"'",r<n-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,r){return e.split(t).join(r)},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 "),this.find_replace(e," NIN "," nin ")}},Nr=["==","<",">","<=",">=","!=","like","likes","in","nin"],Rr=function(e,t){let r="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?r+=" "+e[t]+" ":r+=e[t];const n=r.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)Nr.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),Nr.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return n.join(" ")},Pr=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,Or=["string","number","boolean","symbol"],kr=e=>Or.includes(typeof e),Ar=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Lr=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(Pr,"\\$1"),"i");window.__query__=function(){return((e,t,r)=>{e=e??"";let n=!0;switch(t){case"like":n=null!==e.toString().match(Lr(r));break;case"likes":n=r.split(/,|,/).some((t=>null!==e.toString().match(Lr(t))));break;case"in":kr(r)&&(r=[r]),Array.isArray(r)&&(n=Array.isArray(e)?r.every((t=>e.includes(t))):r.includes(e));break;case"nin":kr(r)&&(r=[r]),Array.isArray(r)&&(n=!(Array.isArray(e)?r.some((t=>e.includes(t))):r.includes(e)));break;case"!=":case"<>":n=(Ar(e)?e.slice(0,10):e)!=r;break;case"<":n=(Ar(e)?e.slice(0,10):e)<r;break;case"<=":n=(Ar(e)?e.slice(0,10):e)<=r;break;case">":n=(Ar(e)?e.slice(0,10):e)>r;break;case">=":n=(Ar(e)?e.slice(0,10):e)>=r;break;default:n=(Ar(e)?e.slice(0,10):e)==r}return n})(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const _r=Ir.stringify,Fr=Ir.array_format,Hr=function(e){let t=0;const r=e.length;for(let n=0;n<r;n++){const r=e.charAt(n);"("===r&&t++,")"===r&&t--}return 0===t},Dr=(e,t,r)=>{let n=[];t=Ir.replace_symbols(t);try{if(r){const r=new Function("record",`return ${Rr(t,"record")};`);n=gn(e,(e=>r(e)))}else{const r=new Function("array","i",`return ${Rr(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)r(e,t)&&n.push(e[t])}}catch(t){v("Table","组件 `initialFilter` 参数有误!"),n=e}return n},$r=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...$r(e.children)):t.push(e)})),t},qr=e=>e.filter((e=>(e.children&&(e.children=qr(e.children)),!e.hidden&&!e.noAuth))),Mr=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Mr(e.children))})),t},jr=(e,t)=>e.map((e=>(e.children&&(e.children=jr(e.children,t)),t?.(e),e))),Kr=(e,t)=>{for(const r of e){if(r.dataIndex===t)return r;if(r.children){const e=Kr(r.children,t);if(e)return e}}return null},Vr=e=>{const t=e.children;return t?t[0].children?Vr(t[0]):t[0]:e},zr=e=>{const t=e.children;return t?t[t.length-1].children?zr(t[t.length-1]):t[t.length-1]:e},Br=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ur=(e,t)=>{for(const r of e){if(r.rowKey===t)return r;if(r.children){const e=Ur(r.children,t);if(e)return e}}return null},Wr=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Wr(e.children))})),t},Gr=e=>{let t=1;const r=(e,n)=>{if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,r(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,r(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return Mr(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Yr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const n=e.parentNode;if(r.top+=e.offsetTop,r.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(r.top-=n.scrollTop,r.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Yr(e.offsetParent,t,r)}return r},Xr=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Qr=(e,t)=>(0,te.transform)(e,((e,r,n)=>{(0,te.isEqual)(r,t[n])||(e[n]=(0,te.isPlainObject)(r)&&(0,te.isPlainObject)(t[n])?Qr(r,t[n]):r)})),Zr=(e,t)=>(0,te.get)(e,t)??"",Jr=(e,t,r,n)=>{n>=0&&null!=r&&(r=Number(r).toFixed(n)),(0,te.set)(e,t,r??"")},en=(e,t)=>{if(!t.includes("|"))return Zr(e,t);const r=[];return t.split("|").forEach((t=>{t&&r.push(Zr(e,t))})),r.every((e=>!e))?"":r.join(" | ")},tn=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),rn=e=>{const t=(e=e.toString()).split("."),r="-"===t[0].charAt(0)?"-":"";let n=r?t[0].slice(1):t[0],i="";for(;n.length>3;)i=`,${n.slice(-3)}${i}`,n=n.slice(0,n.length-3);return n&&(i=n+i),`${r}${i}${t[1]?`.${t[1]}`:""}`},nn=(e,t)=>{const r=e.toString();if(!tn(r)||0===t)return e;const n=Number.parseFloat(r).toString(),i=n.indexOf(".");if(-1===i)return n+"."+"0".repeat(t);const a=Math.max(0,t-(n.length-i-1));return n+"0".repeat(a)},an=(e,t)=>e?u()(e,t):null,on=(e,t)=>e?u()(e).format(t):"",ln=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 r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},sn=e=>{const t=[];if(o().isValidElement(e)){const{children:r}=e.props;o().Children.forEach(r,(e=>{t.push(...sn(e))}))}else t.push(e);return t},cn=e=>sn(e).join(""),dn=e=>e.filter((e=>!e._group)),un=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="";if(Array.isArray(e)){let n=0;for(let i=0,a=e.length;i<a;i++){const a=e[i];if(!a.fieldName)continue;const o=Array.isArray(a.condition)?Fr(a.condition):_r(a.condition,"^");r+=`${a.bracketLeft} ${t?`${a.fieldName}|${a.fieldType}`:a.fieldName} ${a.expression} ${o} ${a.bracketRight} ${a.logic} `,n=a.logic.length}r=r.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[i,a]=n.includes("|")?n.split("|"):[n,""],o=e[n];for(const e in o)r+=`${t?`${i}|${a}`:i} ${e} ${Array.isArray(o[e])?Fr(o[e]):_r(o[e],"^")} and `}r=r.slice(0,-1*n)}return r.replace(/\s+/g," ").trim()},pn=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((r=>{const n=JSON.stringify((t=>{const r=[];return e.forEach((e=>r.push(Zr(t,e)))),r})(r));t[n]=t[n]||[],t[n].push(r)})),Object.keys(t).map((e=>t[e]))},hn=(e,t)=>{for(let r=0;r<e.length;r++){if(e[r].dataIndex===t)return[e[r]];if(Array.isArray(e[r].children)){const n=hn(e[r].children,t);if(n)return[e[r],n].flat()}}},mn=(e,t)=>{for(let r=0;r<e.length;r++){if(e[r].rowKey===t)return[t];if(Array.isArray(e[r].children)){const n=mn(e[r].children,t);if(n)return[e[r].rowKey,n].flat()}}},fn=(e,t)=>{for(const r of e){if(Array.isArray(r.children)){const e=fn(r.children,t);if(e)return e}if(t(r))return r}return null},gn=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&gn(e.children,t),t(e)||e.children&&e.children.length))),bn=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),yn=80,vn="1",xn="0",En=400,Sn=["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"],wn={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Cn=function(e){return e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year",e}({}),Tn=function(e){return 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",e}({}),In=function(e){return e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss",e}({});const Nn={items:s().arrayOf(s().shape({type:s().string.isRequired,fieldName:s().string.isRequired})),initialValues:s().object,initialExtras:s().object,layout:s().oneOf(["horizontal","vertical"]),size:(e,t,r)=>{if(!x(e[t]||""))return y("Form","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},cols:s().number,customClass:s().string,compactMode:s().bool,labelWidth:s().oneOfType([s().number,s().string]),labelAlign:s().oneOf(["left","right"]),labelWrap:s().bool,formType:s().oneOf(["default","search","onlyShow"]),disabled:s().bool,uniqueKey:s().string,defaultRows:s().number,defaultExpand:s().bool,searchButtonCols:s().number,scrollToFirstError:s().bool,authConfig:s().object,isAutoFocus:s().bool,isCollapse:s().bool,isFieldsDefine:s().bool,isSearchBtn:s().bool,isSubmitBtn:s().bool,fieldsChange:s().func,onValuesChange:s().func,onFieldsChange:s().func,onFinish:s().func,onFinishFailed:s().func,onReset:s().func,onCollapse:s().func},Rn={layout:"horizontal",labelWidth:yn,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:ae,onFieldsChange:ae,onFinish:ae,onFinishFailed:ae,onReset:ae,onCollapse:ae},Pn=(e,t)=>{if(!e)return null;if(t===Tn.week){const t=e.match(/^(\d{4})-(\d+)/);return t?u()().year(Number(t[1])).week(Number(t[2])):null}if(t===Tn.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?u()().year(Number(t[1])).quarter(Number(t[2])):null}return u()(e,t)},On=(e,t)=>e?u()(e).format(t):"",kn=e=>""===e||null==e,An=(e,t)=>{if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let n="";for(let t=0,i=r.length;t<i;t++)n+=(e[r[t].trim()]??"")+(t===i-1?"":" | ");return n},Ln=(e,t,r)=>{for(const n in r)if(Object.keys(t).includes(n)&&t[n]!==r[n])if(t[n].includes("|")){const i=t[n].split("|"),a=r[n].split("|");i.forEach(((t,r)=>e[t]=e[a[r]]))}else e[t[n]]=e[r[n]]},_n=(e,t,r)=>{for(const n in r)if(Object.keys(t).includes(n)&&t[n]!==r[n])if(t[n].includes("|")){const i=t[n].split("|"),a=r[n].split("|");i.forEach(((t,r)=>e[t]=e[a[r]]))}else e[t[n]]=e[r[n]]},Fn=(e,t,r)=>e.map((e=>{const n={value:e[t],text:e[r]};return e.disabled&&(n.disabled=!0),(0,te.isUndefined)(e.isLeaf)||(n.isLeaf=!!e.isLeaf),(0,te.isUndefined)(e.selectable)||(n.selectable=!!e.selectable),Array.isArray(e.children)&&(n.children=Fn(e.children,t,r)),n})),Hn=(e,t)=>{for(const r of e){if(r.value===t)return r;if(Array.isArray(r.children)){const e=Hn(r.children,t);if(e)return e}}return null},Dn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=[];return e.forEach((e=>{e.value==t.split(",")[r]&&n.push(e),Array.isArray(e.children)&&n.push(...Dn(e.children,t,r+1))})),n},$n=e=>ne(e)||"string"==typeof e,qn=e=>ne(e)?sn(e).join(""):e??"",Mn=(e,t,r,n)=>{const i={};return i.filters=e.filters?.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}))||[],i.table={columns:e.columns||[],rowKey:e.valueName},i.fieldsDefine={valueKey:e.valueKey||e.valueName},i.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(i.table.fetch={api:r(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(i.echoRequest={fetchApi:r(e.echoSetting.api),formatter:t=>Object.assign({},t,{[e.echoSetting.paramKey]:t.key??t.keys}),dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(i.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(i.tree={fetch:{api:r(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{const t={};return e.treeSetting.relativeTable?.forEach((e=>t[e.tableField]=e.treeField)),t}}),e.emmediateSetting&&(i.columns=e.emmediateSetting.columns,i.request={fetchApi:r(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),i},jn={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"}},Kn="阿",Vn="鿿",zn=1,Bn=2,Un=3;let Wn,Gn=null;function Yn(e){return e||null===Gn?("object"==typeof Intl&&Intl.Collator?(Wn=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Gn=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Gn=!1,Gn):Gn}function Xn(e){const t=jn.UNIHANS,r=jn.PINYINS,n=jn.EXCEPTIONS,i={source:e};if(e in n)return i.type=Bn,i.target=n[e],i;let a,o=-1;if(e.charCodeAt(0)<256)return i.type=zn,i.target=e,i;if(a=Wn.compare(e,Kn),a<0)return i.type=Un,i.target=e,i;if(0===a)i.type=Bn,o=0;else{if(a=Wn.compare(e,Vn),a>0)return i.type=Un,i.target=e,i;0===a&&(i.type=Bn,o=t.length-1)}if(i.type=Bn,o<0){let r=0,n=t.length-1;for(;r<=n;){o=~~((r+n)/2);const i=t[o];if(a=Wn.compare(e,i),0===a)break;a>0?r=o+1:n=o-1}}return a<0&&o--,i.target=r[o],i.target||(i.type=Un,i.target=i.source),i}function Qn(e){return"string"==typeof e&&Yn()?e.split("").map((e=>Xn(e))):e}const Zn={isSupported:Yn,parse:Qn,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(jn)})))},genToken:Xn,convertToPinyin:(e,t,r)=>Qn(e).map((e=>t&&e.type===Bn?e.target.toLowerCase():e.target)).join(r||"")},Jn={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}};Zn.isSupported()&&Jn.shouldPatch(Zn.genToken)&&Zn.patchDict(Jn);const ei=Zn,ti=e=>{const{value:t,bordered:r}=e;return o().createElement(L.Input,{value:t,title:t,bordered:r,readOnly:!0})};ti.displayName="FormItemView";const ri=ti;function ni(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}const{Option:ai}=L.Select,oi=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,multiple:i,loading:a,onChange:l,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=f("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:g,disabled:b}=e.option,{itemList:y=[],filterable:v=!0,listHeight:x=En,collapseTags:E,maxTagTextLength:S,dropdownStyle:w,openPyt:C=!0}=d,T=de(y)?n:y,I=e=>T.find((t=>t.value===e))?.text||e?.toString()||"",N=e=>i?e?.map((e=>I(e))).join(",")||"":I(e);return t.isOnlyShow?o().createElement(ri,{value:N(r),bordered:h}):o().createElement(L.Select,ii({value:r,mode:i?"multiple":void 0,popupClassName:`form-popper__${c}`,dropdownStyle:w,placeholder:p,style:u,loading:a,bordered:h,allowClear:m,disabled:b,showSearch:v,listHeight:x,maxTagCount:E?"responsive":void 0,maxTagTextLength:S},i?{title:N(r)}:null,{filterOption:(e,t)=>{const r=t?.children?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{l?.(e),s(e,N(e),T)})(e)}}),T.map((e=>o().createElement(ai,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class li extends a.Component{constructor(){super(...arguments),ni(this,"context",void 0),ni(this,"state",{itemList:[],loading:!1}),ni(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(f)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(oi,{option:this.props.option,items:t,loading:r,multiple:this.props.multiple,onValuesChange:(t,r,n)=>{g(t,r,n),e.setViewValue(l,r)}}))),h&&o().createElement(L.Col,null,e.renderFormItemButton(l,h)),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}ni(li,"contextType",Cr);const si=li;function ci(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const di=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{label:a,options:l={},style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=xn,trueValue:h=vn}=l;return o().createElement(L.Checkbox,{checked:r===h,style:s,disabled:d||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{n?.(e),i(e,f(e===h?"am.form.trueText":"am.form.falseText"))})(t?h:p)}},u?a:null)};class ui extends a.Component{constructor(){super(...arguments),ci(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option,{labelToCheckbox:m}=l;return o().createElement(L.Form.Item,{label:m?" ":e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(di,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}ci(ui,"contextType",Cr);const pi=ui,hi=require("react-sortablejs");function mi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fi extends a.Component{constructor(){super(...arguments),mi(this,"context",void 0),mi(this,"linkRef",o().createRef()),mi(this,"state",{visible:!1}),mi(this,"getFormFieldsConfig",(async e=>{const t=this.context.global,r=t?.getComponentConfigApi;if(r)try{const t=await r({key:e});if(200===t.code)return t.data}catch(e){}})),mi(this,"saveFormFieldsConfig",(async(e,t)=>{const r=this.context.global,n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}})),mi(this,"resetFieldsHandle",(e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||pe(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));return e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):this.context.global?.getComponentConfigApi&&this.setLocalFields(this.props.items)})).catch((()=>{})),e?(0,te.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:r}=t,n=e.find((e=>e.fieldName===r));return n?((0,te.isUndefined)(n.hidden)||(t.hidden=n.hidden),t):t})):e.map((e=>({...this.props.items.find((t=>t.fieldName===e.fieldName)),...e}))):void 0}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return(0,te.isUndefined)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),r=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,te.isEqual)(t,r)||(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;t?.([...e])}popupRender(){const{items:e}=this.props;return o().createElement(Cr.Consumer,null,(t=>{const r=t.$$form;return o().createElement("div",{className:we()("ant-dropdown-menu","fields-list")},o().createElement("div",{className:"reset"},o().createElement(be,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},f("qm.table.columnFilter.reset"))),o().createElement(hi.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const n=t.map((e=>e.fieldName)),i=e.map((e=>e.fieldName));if((0,te.isEqual)(n,i))return;r.setExpandHandle(!0);const a=bn(t);this.changeHandle(a),this.setLocalFields(a)}},e.map((t=>o().createElement("li",{key:t.fieldName,className:"item",style:t.noAuth?{display:"none"}:void 0},o().createElement(L.Checkbox,{disabled:t.rules?.findIndex((e=>e.required))>-1,checked:!t.hidden,onChange:r=>{const{checked:n}=r.target;t.hidden=!n,this.changeHandle(e),this.setLocalFields(e)}}),o().createElement(Te.HolderOutlined,{className:"handle",title:f("qm.form.draggable")}),o().createElement("span",{className:"title"},r.getFormItemLabel(t.label)))))))}))}render(){const{visible:e}=this.state,t=Ce("form-fields-filter");return o().createElement(Cr.Consumer,null,(r=>{const{$size:n}=r.$$form,i={[t]:!0,[`${t}--lg`]:"large"===n,[`${t}--sm`]:"small"===n};return o().createElement(L.Dropdown,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:we()(i),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},o().createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},o().createElement(Te.UnorderedListOutlined,null)))}))}}mi(fi,"contextType",c);const gi=fi;function bi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yi=o().forwardRef(((e,t)=>{const{$$form:r}=o().useContext(Cr),{value:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},placeholder:c=f("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h,onBlur:m=ae,onEnter:g=ae}=e.option,{prefix:b,suffix:y,password:v,maxLength:x,pattern:E,toUpper:S,toTrim:w,autoFocus:C,autoComplete:T,secretType:I}=l,N=I&&(p||h),R=o().useRef(),P=e=>{i?.(e),a(e)},O=v?L.Input.Password:L.Input,k=N?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}(n,I):n;return r.isOnlyShow?o().createElement(ri,{value:(e=>e&&v?new Array(e.length).fill("*").join(""):e)(k),bordered:d}):o().createElement(O,{ref:e=>{R.current=e,"function"==typeof t&&t(e)},value:k,autoComplete:v?"new-password":T,autoFocus:C,placeholder:c,style:s,title:v?"":k,prefix:b,suffix:y,maxLength:x,bordered:d,allowClear:u,readOnly:p,disabled:h,onBlur:t=>{let r=t.target.value??"";if(w){const e=r.trim();r!==e&&(r=e,P(r))}(t=>{const{onBlur:r}=e;r?.(t)})(r),m(r)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;g(t),r.isFilterType&&(r.SUBMIT_FORM(),R.current?.blur())}},onChange:e=>{let t=e.target.value;(0,te.isRegExp)(E)&&(t=E.test(t)?t:n??""),S&&(t=t.toUpperCase()),P(t)}})}));yi.displayName="VInput";class vi extends a.Component{constructor(){super(...arguments),bi(this,"context",void 0),bi(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(yi,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(i,t)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(i,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}bi(vi,"contextType",Cr);const xi=vi;function Ei(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Si=e=>{const{$$form:t}=o().useContext(Cr),{value:r=[],onChange:n,onValuesChange:i}=e,{options:a={},placeholder:l=f("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{prefix:p,suffix:h,maxLength:m}=a,g=e=>{const t=e.every((e=>!e))?[]:e;n?.(t),i(t,b(t))},b=e=>e.join(" - ");return t.isOnlyShow?o().createElement(ri,{value:b(r),bordered:s}):o().createElement(L.Input.Group,null,o().createElement(L.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:l[0],prefix:p,suffix:h,maxLength:m,allowClear:c,bordered:s,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),o().createElement(L.Input,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:l[1],prefix:p,suffix:h,maxLength:m,bordered:s,allowClear:c,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class wi extends a.Component{constructor(){super(...arguments),Ei(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,labelWidth:l=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(s),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(l)},required:e.getFormItemRequired(u)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Si,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(i,t)}}))),c&&o().createElement(L.Col,{flex:he(c.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...c}))))}}Ei(wi,"contextType",Cr);const Ci=wi,Ti=require("big.js");var Ii=n.n(Ti);function Ni(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ri=o().forwardRef(((e,t)=>{const{$$form:r}=o().useContext(Cr),{value:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},placeholder:c=f("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:u,disabled:p,onBlur:h=ae,onEnter:m=ae}=e.option,{step:g=1,min:b,max:y,precision:v,autoFocus:x,stringMode:E,textAlign:S="left",controls:w=!0,formatter:C,parser:T}=l,I=o().useRef(),N=o().useRef(n),R=e=>{const t=kn(e)?"":(0,te.isNumber)(e)?e.toFixed(v):new(Ii())(e).toFixed(v);return"function"==typeof C?C(t):t},P={[S]:!0,controls:w};return r.isOnlyShow?o().createElement(ri,{value:R(n),bordered:d}):o().createElement(L.InputNumber,{ref:e=>{I.current=e,"function"==typeof t&&t(e)},value:n,className:we()(P),placeholder:c,style:{width:"100%",...s},step:g,min:b,max:y,controls:w,precision:v,autoFocus:x,stringMode:E,formatter:C,parser:T,bordered:d,readOnly:u,disabled:p,onBlur:()=>{se((()=>{(t=>{const{onBlur:r}=e;r?.(t)})(N.current),h(N.current)}))},onKeyUp:e=>{13===e.keyCode&&(m(n),r.isFilterType&&(r.SUBMIT_FORM(),I.current?.blur()))},onChange:e=>{const t=e??"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{N.current=e,i?.(e),a(e,R(e))})(t)}})}));Ri.displayName="VInputNumber";class Pi extends a.Component{constructor(){super(...arguments),Ni(this,"context",void 0),Ni(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ri,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,r)=>{m(t),e.setViewValue(i,r)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(i,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ni(Pi,"contextType",Cr);const Oi=Pi;function ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ai=e=>{const{$$form:t}=o().useContext(Cr),{value:r=[],onChange:n,onValuesChange:i}=e,{options:a={},placeholder:l=f("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{step:p=1,min:h=0,max:m,textAlign:g="left",controls:b=!0,precision:y,formatter:v,parser:x}=a,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),S(e)},S=e=>{const t=e.every((e=>null===e))?[]:[...e];n?.(t),i(t,w(t))},w=e=>kn(e)?"":e.map((e=>kn(e)?"":Number(e).toFixed(y))),C={[g]:!0,controls:b};return t.isOnlyShow?o().createElement(ri,{value:w(r),bordered:s}):o().createElement(L.Input.Group,null,o().createElement(L.InputNumber,{value:r[0],className:we()("site-input-left",C),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:l[0],step:p,min:h,max:m,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:d,disabled:u,onChange:e=>{S([e,r[1]])},onBlur:()=>{E(r)}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),o().createElement(L.InputNumber,{value:r[1],className:we()("site-input-right",C),style:{width:"calc(50% - 5px)"},placeholder:l[1],step:p,min:h,max:m,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:d,disabled:u,onChange:e=>{S([r[0],e])},onBlur:()=>{E(r)}}))};class Li extends a.Component{constructor(){super(...arguments),ki(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,labelWidth:l=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(s),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(l)},required:e.getFormItemRequired(u)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ai,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(i,t)}}))),c&&o().createElement(L.Col,{flex:he(c.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...c}))))}}ki(Li,"contextType",Cr);const _i=Li;let Fi=function(e){return e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small",e}({});function Hi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{Search:Di}=L.Input;class $i extends a.Component{constructor(e){var t;super(e),t=this,Hi(this,"context",void 0),Hi(this,"deriveParams",void 0),Hi(this,"valueKey",void 0),Hi(this,"_is_change",!1),Hi(this,"_record",void 0),Hi(this,"_prevValue",null),Hi(this,"state",{visible:!1,loading:!1}),Hi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Hi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Hi(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:r,echoRequest:n}=this.searchHelper;if(t||v("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||v("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&v("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Hi(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Hi(this,"getDerivedSearchHelper",(()=>this.searchHelper)),Hi(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;this.setState({loading:!0});try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e),this.searchHelperChangeHandle(e)}i?.([t])}}}catch(e){}this.setState({loading:!1})})),Hi(this,"todoOpen",(e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)})),Hi(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:r}=this.searchHelper,n=""!==e?e:void 0,i=("function"==typeof r?r():r)||[],a={[t]:n};return(Array.isArray(i)?i:[i]).forEach((e=>{if((0,te.isPlainObject)(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a})),Hi(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:r={}}=this.searchHelper,{beforeFetch:n=oe,formatter:i=(e=>e)}=t.fetch;return new Promise((async(a,o)=>{const l=(0,te.merge)({},this.searchHelper.table.fetch.params,{...r,...i(this.createFilters(e))},{currentPage:1,pageSize:500});if(!n(l))return o();this.setState({loading:!0});try{const e=await t.fetch.api(l);200===e.code?a(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[]):o()}catch(e){o(e)}finally{se((()=>this.setState({loading:!1})))}}))})),Hi(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;for(const n in this.alias){const i=An(e,this.alias[n]);void 0!==i&&(t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i))}for(const r in this.extras){const n=An(e,this.extras[r]);void 0!==n&&t.SET_FIELDS_EXTRA({[r]:n})}})),Hi(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;const{fieldName:n}=t.props.option,i=e.filter((e=>An(e,t.alias[n])?.toString().toLowerCase().includes(r.toLowerCase())));if(1===i.length)return t.closeSearchHelper(i[0]);t.openSearchHelper(r)})),Hi(this,"openSearchHelper",(async(e,t)=>{await this.props.waiting();const{$$form:r}=this.context,{beforeOpen:n}=this.searchHelper,i=(n??oe)(r.state.formData);i?.then?i.then((()=>{this.todoOpen(e),t?.()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),t?.())})),Hi(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias)n!==r&&t.SET_FIELDS_VALUE({[n]:An(e,this.alias[n])});for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])});const n=An(e,this.alias[r]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(e)),200)}))})),Hi(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)})),Hi(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const r in this.alias)r!==t&&e.SET_FIELDS_VALUE({[r]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}})),Hi(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,t?.(e,this._record)})),Hi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e)})),Hi(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;t?.(e)})),Hi(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(){if(null===this._prevValue)return;const e=this.getItemValue();this._prevValue!==e&&e!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=e}render(){const{$$form:e}=this.context,{visible:t,loading:r}=this.state,{value:n}=this.props,{type:i,fieldName:a,options:l={},searchHelper:s={},style:c={},placeholder:d=f("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:g,suffix:b,maxLength:y}=l,v={visible:t,title:f("qm.searchHelper.text"),width:s.width??"60%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?o().createElement(ri,{value:n,bordered:u}):o().createElement(o().Fragment,null,o().createElement(Di,{ref:e=>this[`${i}_Ref`]=e,value:n,title:n,loading:r,placeholder:d,style:c,prefix:g,suffix:b,maxLength:y,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:r}=e.target,{onlySelect:n=!0,table:i}=this.searchHelper;this.triggerBlur(r),this._is_change&&!t&&(r?n?i?.fetch?.api&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e,r))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(r):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:r}=e.target;!t&&this.openSearchHelper(r)}},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"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):se((()=>this.clearSearchHelperValue())))}}),o().createElement(Er,v,o().createElement(ad,x)))}}Hi($i,"contextType",Cr);class qi extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Hi(this,"context",void 0),Hi(this,"promiseRef",void 0),Hi(this,"searchRef",void 0),Hi(this,"state",{searchHelper:{}}),Hi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Hi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement($i,{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(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Hi(qi,"contextType",Cr);const Mi=qi;function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ji.apply(this,arguments)}function Ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=e=>{class t extends a.Component{constructor(){var e;super(...arguments),e=this,Ki(this,"startClick",void 0),Ki(this,"event1",null),Ki(this,"event2",null),Ki(this,"$el",null),Ki(this,"omitClassNames",[]),Ki(this,"state",{clickOutside:!1}),Ki(this,"mousedownHandler",(e=>{this.startClick=e})),Ki(this,"mouseupHandler",(e=>{this.documentHandler(e,this.startClick)})),Ki(this,"documentHandler",((e,t)=>{const r=e.target,n=t?.target,i=!r||!n,a=this.$el?.contains(r)||this.$el?.contains(n),o=this.$el===r,l=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),s=l.some((e=>e?.contains(r)))||l.includes(n);let c;c=!(i||a||o||s),this.setState({clickOutside:c})})),Ki(this,"setCurrentElement",(e=>{e&&(this.$el=e)})),Ki(this,"setOmitClassNames",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}))}componentDidMount(){this.event1=Gt()(document,"mousedown",this.mousedownHandler),this.event2=Gt()(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){this.event1?.remove(),this.event2?.remove()}render(){const{forwardedRef:t}=this.props,{clickOutside:r}=this.state;return o().createElement(e,ji({ref:t},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return Ki(t,"displayName",`OutsideClick(${e.displayName||e.name})`),o().forwardRef(((e,r)=>o().createElement(t,ji({},e,{forwardedRef:r}))))},zi=require("rc-trigger");var Bi,Ui,Wi=n.n(zi);function Gi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Yi=Vi((Ui=class extends a.Component{constructor(e){var t;super(e),t=this,Gi(this,"context",void 0),Gi(this,"searchRef",o().createRef()),Gi(this,"_records",[]),Gi(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),Gi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Gi(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Gi(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),Gi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Gi(this,"setItemList",(e=>{this.setState({itemList:e})})),Gi(this,"setRecords",(e=>{this._records=e})),Gi(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Gi(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;t.setViewValue(r,this.createViewText(e))})),Gi(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),Gi(this,"closeSearchHelper",(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:n}=t.alias;t.setRecords((0,te.uniqBy)([...t._records.filter((e=>r.includes(e[n]))),...e],n));const i=t.recordsToDict();t.setItemList(i),t.triggerChange(i.map((e=>e.value)));const{closed:a}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>a?.(t._records)),200)}))})),Gi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),t?.(e),r(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:r=[]}=e,{value:n=[],clickOutside:i}=this.props;(0,te.isEqual)((0,te.intersection)(r,n),n)||(0,te.isEqual)(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,callback:o,fieldAliasMap:l}=this.searchHelper.echoRequest||this.props.option.searchHelper?.request||{},s="function"==typeof l?l():l||{},{value:c}=this.props;if(r&&!de(c)){this.setState({loading:!0});try{const l=await r(i({...n,keys:c}));if(200===l.code){let r=Array.isArray(l.data)?l.data:(0,te.get)(l.data,a)??[];r.forEach((r=>{s?.valueKey&&s.valueKey!==t&&(r[t]=r[s.valueKey]),s?.textKey&&s.textKey!==e&&(r[e]=r[s.textKey])})),r=r.filter((e=>c.includes(e[t])));const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setViewValue(c),o?.(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:t,visible2:r,loading:n,itemList:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},searchHelper:c={},style:d={},placeholder:u=f("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{collapseTags:b,maxTagTextLength:y}=s,v={visible:t,title:f("qm.searchHelper.text"),width:c.width??"60%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:(0,te.merge)({},c.initialValue),defaultSelectedKeys:a,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},E=i.filter((e=>a?.includes(e.value))),S=o().createElement("ul",{className:"ant-dropdown-menu"},E.length?E.map((e=>o().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):o().createElement("li",{className:"ant-dropdown-menu-item"},f("qm.table.config.emptyText"))),w=this.searchRef.current?this.searchRef.current.offsetWidth:300,C=Ce("form-multiple-search-helper"),{size:T}=e.context,I={[C]:!0,[`${C}--lg`]:"large"===T,[`${C}--sm`]:"small"===T};this.props.setOmitClassNames?.([`.${C}`]);const N=i.filter((e=>a?.includes(e.value))).map((e=>e.text)).join(",");return e.isOnlyShow?o().createElement(ri,{value:N,bordered:p}):o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},o().createElement(Wi(),{popupVisible:!g&&r,popup:S,popupClassName:we()(I),popupStyle:{minWidth:w},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:wn,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement(L.Select,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:y,open:!1,value:a,placeholder:u,loading:n,bordered:p,allowClear:h,disabled:g,style:{width:"100%",...d},title:N,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;t.classList.contains("ant-select-selection-overflow-item-rest")&&(this.props.setCurrentElement?.(t),this.setState({visible2:!0}))},onDoubleClick:()=>{g||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},i.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:g,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),o().createElement(Er,v,o().createElement(ad,x)))}},Gi(Ui,"contextType",Cr),Bi=Ui))||Bi;class Xi extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Gi(this,"context",void 0),Gi(this,"promiseRef",void 0),Gi(this,"state",{searchHelper:{}}),Gi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Gi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(Yi,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{f(t,n),e.setViewValue(a,r)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Gi(Xi,"contextType",Cr);const Qi=Xi;function Zi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{Search:Ji}=L.Input;class ea extends a.Component{constructor(e){super(e),Zi(this,"context",void 0),Zi(this,"valueKey",void 0),Zi(this,"_record",void 0),Zi(this,"_prevValue",null),Zi(this,"state",{visible:!1,loading:!1}),Zi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Zi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Zi(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:r,echoRequest:n}=this.searchHelper;if(t||v("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||v("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&v("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Zi(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Zi(this,"getDerivedSearchHelper",(()=>this.searchHelper)),Zi(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;this.setState({loading:!0});try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e)}i?.([t])}}}catch(e){}this.setState({loading:!1})})),Zi(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;for(const n in this.alias){const i=An(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i)}for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])})})),Zi(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),Zi(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias)n!==r&&t.SET_FIELDS_VALUE({[n]:An(e,this.alias[n])});for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])});const n=An(e,this.alias[r]);this.triggerChange(n);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(e)),200)}))})),Zi(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const r in this.alias)r!==t&&e.SET_FIELDS_VALUE({[r]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),Zi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this._record)})),Zi(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;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(){if(null===this._prevValue)return;const e=this.getItemValue();this._prevValue!==e&&e!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=e}render(){const{$$form:e}=this.context,{visible:t,loading:r}=this.state,{value:n=""}=this.props,{type:i,fieldName:a,options:l={},searchHelper:s={},style:c={},placeholder:d=f("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:g,suffix:b,maxLength:y}=l,v={visible:t,title:f("qm.searchHelper.text"),width:s.width??"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:(0,te.merge)({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return e.isOnlyShow?o().createElement(ri,{value:n,bordered:u}):o().createElement(o().Fragment,null,o().createElement(Ji,{ref:e=>this[`${i}_Ref`]=e,value:n,title:n,loading:r,placeholder:d,style:c,prefix:g,suffix:b,maxLength:y,bordered:u,allowClear:p,readOnly:h,disabled:m,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"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),o().createElement(Er,v,o().createElement(ud,x)))}}Zi(ea,"contextType",Cr);class ta extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Zi(this,"context",void 0),Zi(this,"promiseRef",void 0),Zi(this,"state",{searchHelper:{}}),Zi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Zi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(ea,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r)=>{f(t,r),e.setViewValue(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Zi(ta,"contextType",Cr);const ra=ta;var na,ia;function aa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let oa=Vi((ia=class extends a.Component{constructor(e){var t;super(e),t=this,aa(this,"context",void 0),aa(this,"searchRef",o().createRef()),aa(this,"_records",[]),aa(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),aa(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),aa(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),aa(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),aa(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),aa(this,"setItemList",(e=>{this.setState({itemList:e})})),aa(this,"setRecords",(e=>{this._records=e})),aa(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),aa(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;t.setViewValue(r,this.createViewText(e))})),aa(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),aa(this,"closeSearchHelper",(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:n}=t.alias;t.setRecords((0,te.uniqBy)([...t._records.filter((e=>r.includes(e[n]))),...e],n));const i=t.recordsToDict();t.setItemList(i),t.triggerChange(i.map((e=>e.value)));const{closed:a}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>a?.(t._records)),200)}))})),aa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),t?.(e),r(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:r=[]}=e,{value:n=[],clickOutside:i}=this.props;(0,te.isEqual)((0,te.intersection)(r,n),n)||(0,te.isEqual)(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||this.props.option.searchHelper?.request||{},l="function"==typeof o?o():o||{},{value:s}=this.props;if(r&&!de(s)){this.setState({loading:!0});try{const o=await r(i({...n,keys:s}));if(200===o.code){let r=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];r.forEach((r=>{l?.valueKey&&l.valueKey!==t&&(r[t]=r[l.valueKey]),l?.textKey&&l.textKey!==e&&(r[e]=r[l.textKey])})),r=r.filter((e=>s.includes(e[t])));const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setViewValue(s)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:t,visible2:r,loading:n,itemList:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},searchHelper:c={},style:d={},placeholder:u=f("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{collapseTags:b,maxTagTextLength:y}=s,v={visible:t,title:f("qm.searchHelper.text"),width:c.width??"65%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:(0,te.merge)({},c.initialValue),defaultSelectedKeys:a,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},E=i.filter((e=>a?.includes(e.value))),S=o().createElement("ul",{className:"ant-dropdown-menu"},E.length?E.map((e=>o().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):o().createElement("li",{className:"ant-dropdown-menu-item"},f("qm.table.config.emptyText"))),w=this.searchRef.current?this.searchRef.current.offsetWidth:300,C=Ce("form-multiple-tree-table-helper"),{size:T}=e.context,I={[C]:!0,[`${C}--lg`]:"large"===T,[`${C}--sm`]:"small"===T};this.props.setOmitClassNames?.([`.${C}`]);const N=i.filter((e=>a?.includes(e.value))).map((e=>e.text)).join(",");return e.isOnlyShow?o().createElement(ri,{value:N,bordered:p}):o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},o().createElement(Wi(),{popupVisible:!g&&r,popup:S,popupClassName:we()(I),popupStyle:{minWidth:w},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:wn,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement(L.Select,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:y,open:!1,value:a,placeholder:u,loading:n,bordered:p,allowClear:h,disabled:g,style:{width:"100%",...d},title:N,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;t.classList.contains("ant-select-selection-overflow-item-rest")&&(this.props.setCurrentElement?.(t),this.setState({visible2:!0}))},onDoubleClick:()=>{g||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},i.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:g,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),o().createElement(Er,v,o().createElement(ud,x)))}},aa(ia,"contextType",Cr),na=ia))||na;class la extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),aa(this,"context",void 0),aa(this,"promiseRef",void 0),aa(this,"state",{searchHelper:{}}),aa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),aa(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(oa,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{f(t,n),e.setViewValue(a,r)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}aa(la,"contextType",Cr);const sa=la;function ca(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const da=new Array(2).fill("");class ua extends a.Component{constructor(e){var t;super(e),t=this,ca(this,"context",void 0),ca(this,"_is_change",!1),ca(this,"_ceho_data",void 0),ca(this,"_records",[]),ca(this,"_is_clear",!1),ca(this,"state",{visible:!1,loading:!1,itemList:[],textValue:da}),ca(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),ca(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),ca(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),ca(this,"setItemList",(e=>{this.setState({itemList:e})})),ca(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),ca(this,"setTextValue",(e=>{this.setState({textValue:e})})),ca(this,"setRecords",(e=>{this._records=e})),ca(this,"setViewValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())})),ca(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;this._is_change=!1,t?.(e),r(e,this.createViewText(),this._records)})),ca(this,"clearSearchHelperValue",(()=>{this.setRecords([]),this.setTextValue(da),this.triggerChange([])})),ca(this,"closeSearchHelper",(e=>{const{valueKey:t,textKey:r}=this.alias,n=e.map((e=>({value:e[t],text:e[r]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>e.text??""))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(this._records)),200)}))})),ca(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),ca(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,r=de(e)?void 0:e;return{[t]:r}})),ca(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:r={}}=this.searchHelper,{beforeFetch:n=oe,formatter:i=(e=>e)}=t.fetch;return new Promise((async(a,o)=>{const l=(0,te.merge)({},this.searchHelper.table.fetch.params,{...r,...i(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!n(l))return o();this.setState({loading:!0});const e=await t.fetch.api(l);if(se((()=>this.setState({loading:!1}))),200===e.code)return a(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}o()}))})),ca(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{textValue:r}=t.state,{textKey:n}=t.alias,i=e.filter((e=>{const t=e[n]?.toString().toLowerCase();return r.some((e=>t?.includes(e.toLowerCase())))}));if(2===i.length)return t.closeSearchHelper(i);t.openSearchHelper()})),ca(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:r=[]}=this.props;(0,te.isEqual)((0,te.intersection)(t,r),r)||(0,te.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:n}=this.context,{fieldName:i}=this.props.option;if(!(0,te.isEqual)(n[i],this._ceho_data)&&(this._ceho_data=n[i],this.setItemList(n[i]),r.length)){const e=da.map(((e,t)=>n[i].find((e=>e.value===r[t]))?.text??""));this.setTextValue(e)}}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||{},l="function"==typeof o?o():o||{},{value:s}=this.props;if(r&&!de(s)){this.setState({loading:!0});try{const o=await r(i({...n,keys:s}));if(200===o.code){let r=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];r.forEach((r=>{l?.valueKey&&l.valueKey!==t&&(r[t]=r[l.valueKey]),l?.textKey&&l.textKey!==e&&(r[e]=r[l.textKey])})),r=r.filter((e=>s.includes(e[t]))).slice(0,2);const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setTextValue(n.map((e=>e.text??""))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){const{$$form:e}=this.context,{value:t=[]}=this.props,{visible:r,loading:n,textValue:i}=this.state,{fieldName:a,options:l={},searchHelper:s={},placeholder:c=f("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=i.every((e=>kn(e)))?"":i.join(" - "),g={visible:r,title:f("qm.searchHelper.text"),width:s.width??"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},b={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:(0,te.merge)({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?o().createElement(ri,{value:m,bordered:d}):o().createElement(o().Fragment,null,o().createElement(L.Input.Group,null,o().createElement(L.Input,{value:i[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;this._is_change&&!r&&(t?i.every((e=>!!e))&&this.searchHelper.table?.fetch?.api&&this.getSearchHelperTableData(i).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):i.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,i[1]]))}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),o().createElement(L.Input.Search,{value:i[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:n,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;this._is_change&&!r&&(t?i.every((e=>!!e))&&this.searchHelper.table?.fetch?.api&&this.getSearchHelperTableData(i).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):i.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([i[0],t]))},onSearch:(e,t)=>{"click"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),o().createElement(Er,g,o().createElement(yd,b)))}}ca(ua,"contextType",Cr);class pa extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),ca(this,"context",void 0),ca(this,"promiseRef",void 0),ca(this,"state",{searchHelper:{}}),ca(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),ca(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(ua,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{m(t,n),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(a,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...d}))))}}ca(pa,"contextType",Cr);const ha=pa;function ma(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=l,h=de(p)?n:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?o().createElement(ri,{value:m(r),bordered:c}):o().createElement(L.Checkbox.Group,{value:r,style:{width:"100%",...s},disabled:u,onChange:e=>{(e=>{i?.(e),a(e,m(e))})(e)}},h.map((e=>o().createElement(L.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class ga extends a.Component{constructor(){super(...arguments),ma(this,"context",void 0),ma(this,"state",{itemList:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t)try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(fa,{option:this.props.option,items:t,onValuesChange:(t,r)=>{m(t),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}ma(ga,"contextType",Cr);const ba=ga;function ya(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const va=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},style:l={},allowClear:s=!0,readOnly:c,disabled:d=t.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:h}=a;return o().createElement(L.Rate,{value:r,count:p,style:l,allowHalf:u,allowClear:s,tooltips:h,disabled:d||t.isOnlyShow,onChange:e=>{(e=>{var t;n?.(e),i(e,(t=e,h?h[Math.ceil(t)-1]:t.toString()))})(e)}})};class xa extends a.Component{constructor(){super(...arguments),ya(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(va,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}ya(xa,"contextType",Cr);const Ea=xa;function Sa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},bordered:c=!1,readOnly:d,disabled:u=t.isFormDisabled}=e.option,{itemList:p=[]}=l,h=de(p)?n:p,m=e=>h.find((t=>t.value===e))?.text??"";return t.isOnlyShow?o().createElement(ri,{value:m(r),bordered:c}):o().createElement(L.Radio.Group,{value:r,style:{width:"100%",...s},disabled:u||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{i?.(e),a(e,m(e))})(t)}},h.map((e=>o().createElement(L.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Ca extends a.Component{constructor(){super(...arguments),Sa(this,"context",void 0),Sa(this,"state",{itemList:[]}),Sa(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t)try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(wa,{option:this.props.option,items:t,onValuesChange:(t,r)=>{m(t),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Sa(Ca,"contextType",Cr);const Ta=Ca;function Ia(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Na=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{label:a,options:l={},style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=xn,trueValue:h=vn}=l;return o().createElement(o().Fragment,null,o().createElement(L.Switch,{checked:r===h,style:s,disabled:d||t.isOnlyShow,checkedChildren:o().createElement(Te.CheckOutlined,null),unCheckedChildren:o().createElement(Te.CloseOutlined,null),onChange:e=>{(e=>{n?.(e),i(e,f(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?o().createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},a):null)};class Ra extends a.Component{constructor(){super(...arguments),Ia(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option,{labelToSwitch:m}=l;return o().createElement(L.Form.Item,{label:m?" ":e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Na,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ia(Ra,"contextType",Cr);const Pa=Ra;function Oa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ka=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},style:l={},placeholder:s=f("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p,onBlur:h=ae,onEnter:m=ae}=e.option,{showCount:g,maxLength:b,autoSize:y}=a,v=Object.assign({},{minRows:1,maxRows:3},y);return o().createElement(L.Input.TextArea,{value:r,placeholder:s,style:l,maxLength:b,showCount:g,autoSize:v,bordered:c,allowClear:d,readOnly:u||t.isOnlyShow,disabled:p,onBlur:t=>{const{value:r}=t.target;(t=>{const{onBlur:r}=e;r?.(t)})(r),h(r)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;m(t)}},onChange:e=>{const{value:t}=e.target;(e=>{n?.(e),i(e)})(t)}})};class Aa extends a.Component{constructor(){super(...arguments),Oa(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(ka,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Oa(Aa,"contextType",Cr);const La=Aa;function _a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.datePlaceholder"),bordered:d=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{dateType:g="date",format:b,disabledDate:y,minDateTime:v,maxDateTime:x,shortCuts:E=!0}=l,S=o().createRef(),w=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),n?.(e),i(e,C(e))},C=e=>kn(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,T=e=>{let t=On(u()().subtract(e,"day"),Tn[g]);"date"===g&&(t=t.slice(0,10)),w(t),S.current.blur(),S.current.focus()};return t.isOnlyShow?o().createElement(ri,{value:C(r),bordered:d}):o().createElement(j,{ref:S,style:{width:"100%",...s},popupClassName:`form-popper__${a}`,picker:Cn[g],format:b,bordered:d,showToday:!1,showTime:"datetime"===g&&{defaultValue:u()("00:00:00","HH:mm:ss")},allowClear:p,disabled:m,inputReadOnly:h,disabledDate:y??(e=>((e,t)=>{let[r,n]=t;return r&&n?e.isBefore(r,"day")||e.isAfter(n,"day"):r?e.isBefore(r,"day"):!!n&&e.isAfter(n,"day")})(e,[v,x])),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():o().createElement(o().Fragment,null,o().createElement(L.Tag,{color:"processing",onClick:()=>T(0)},f("qm.form.datePickers")[0]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(1)},f("qm.form.datePickers")[1]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(7)},f("qm.form.datePickers")[2]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(30)},f("qm.form.datePickers")[3])):void 0,value:Pn(r,Tn[g]),onChange:(e,t)=>{w(On(e,Tn[g]))}})};class Ha extends a.Component{constructor(){super(...arguments),_a(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Fa,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}_a(Ha,"contextType",Cr);const Da=Ha;function $a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qa=e=>[u()().subtract(e,"day"),u()()],Ma=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.daterangePlaceholder"),bordered:d=!0,allowClear:p=!0,readOnly:h,disabled:m=t.isFormDisabled}=e.option,{dateType:g="date",format:b,disableds:y=[!1,!1],allowEmpty:v,disabledDate:x,minDateTime:E,maxDateTime:S,shortCuts:w=!0}=l,C={[f("qm.form.dateRangePickers")[0]]:qa(7),[f("qm.form.dateRangePickers")[1]]:qa(30),[f("qm.form.dateRangePickers")[2]]:qa(90),[f("qm.form.dateRangePickers")[3]]:qa(180)},T=e=>kn(e)?"":e.map((e=>["date","exactdate"].includes(g)?e?.slice(0,10):e)).join(" - ");return t.isOnlyShow?o().createElement(ri,{value:T(r),bordered:d}):o().createElement(j.RangePicker,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,picker:Cn[g],format:b,bordered:d,showTime:"datetime"===g&&{defaultValue:[u()("00:00:00","HH:mm:ss"),u()("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:v,disabled:m?[!0,!0]:y,inputReadOnly:h,disabledDate:x??(e=>((e,t)=>{let[r,n]=t;return r&&n?e.isBefore(r,"day")||e.isAfter(n,"day"):r?e.isBefore(r,"day"):!!n&&e.isAfter(n,"day")})(e,[E,S])),ranges:w&&g.includes("date")?C:void 0,value:de(r)?null:[Pn(r?.[0],Tn[g]),Pn(r?.[1],Tn[g])],onChange:(e,t)=>{(e=>{"date"===g&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),n?.(e),i(e,T(e))})([On(e?.[0],Tn[g]),On(e?.[1],Tn[g])])}})};class ja extends a.Component{constructor(){super(...arguments),$a(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ma,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}$a(ja,"contextType",Cr);const Ka=ja;function Va(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const za=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.timePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:g=1,minuteStep:b=1,secondStep:y=1}=l;return t.isOnlyShow?o().createElement(ri,{value:r,bordered:d}):o().createElement(B,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,bordered:d,showNow:!0,hourStep:g,minuteStep:b,secondStep:y,allowClear:u,disabled:h,inputReadOnly:p,format:In[m],value:Pn(r,In[m]),onChange:(e,t)=>{(e=>{const t=On(e,In[m]);n?.(t),i(t)})(e)}})};class Ba extends a.Component{constructor(){super(...arguments),Va(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(za,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Va(Ba,"contextType",Cr);const Ua=Ba;function Wa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ga=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.timerangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:g=[!1,!1],allowEmpty:b,hourStep:y=1,minuteStep:v=1,secondStep:x=1}=l,E=e=>kn(e)?"":e.join(" - ");return t.isOnlyShow?o().createElement(ri,{value:E(r),bordered:d}):o().createElement(B.RangePicker,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,bordered:d,showNow:!1,hourStep:y,minuteStep:v,secondStep:x,allowClear:u,allowEmpty:b,disabled:h?[!0,!0]:g,inputReadOnly:p,format:In[m],value:de(r)?null:[Pn(r?.[0],In[m]),Pn(r?.[1],In[m])],onChange:(e,t)=>{(e=>{const t=[On(e?.[0],In[m]),On(e?.[1],In[m])];n?.(t),i(t,E(t))})(e)}})};class Ya extends a.Component{constructor(){super(...arguments),Wa(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ga,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Wa(Ya,"contextType",Cr);const Xa=Ya;function Qa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Za extends a.Component{constructor(e){super(e),Qa(this,"context",void 0),Qa(this,"searchRef",o().createRef()),Qa(this,"valueKey",void 0),Qa(this,"_clicking",!1),Qa(this,"_record",void 0),Qa(this,"_prevValue",null),Qa(this,"state",{itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0}),Qa(this,"getSearchHelper",wr()(((e,t)=>Object.assign({},this.props.helperConfig,e,t)))),Qa(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e,options:t,searchHelper:r}=this.props.option,{fieldAliasMap:n,fieldsDefine:i,echoRequest:a}=this.searchHelper;if(n||v("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||v("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),a&&!this.valueKey&&v("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!r&&v("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),Qa(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Qa(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e)}i?.([t])}}}catch(e){}})),Qa(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias){const i=An(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i)}for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])})})),Qa(this,"fetchHandle",(0,te.debounce)(this.getItemList,200)),Qa(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Qa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this._record)})),Qa(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;t?.(e)})),Qa(this,"clickHandle",((e,t)=>{const{$$form:r}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias)t!==n&&r.SET_FIELDS_VALUE({[t]:An(e,this.alias[t])});for(const t in this.extras)r.SET_FIELDS_EXTRA({[t]:An(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=An(e,this.alias[n]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()})),this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){const t=e.option.searchHelper?.request?.params||e.option.request?.params,r=this.props.option.searchHelper?.request?.params||this.props.option.request?.params;if((0,te.isEqual)(t,r)||this.getItemList(),null===this._prevValue)return;const n=this.getItemValue();this._prevValue!==n&&n!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=n}async getItemList(e){const{fieldName:t}=this.props.option,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=await r(i({...n,[t]:e}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{visible:t,loading:r,itemList:n,inputText:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},style:d={},placeholder:u=f("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{listHeight:b=En}=s,{hideHeader:y,onlySelect:v=!0}=this.searchHelper||s,x=this.searchHelper.columns||[],E=Ce("form-immediate"),S=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,w=o().createElement(L.Spin,{spinning:r},n.length?o().createElement("table",{cellSpacing:0,cellPadding:0,className:we()("table")},!y&&o().createElement("thead",null,o().createElement("tr",null,x.filter((e=>!e.hidden)).map((e=>o().createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),o().createElement("tbody",null,n.map(((e,t)=>o().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)))}},x.filter((e=>!e.hidden)).map((t=>o().createElement("td",{key:t.dataIndex},(0,te.get)(e,t.dataIndex))))))))):o().createElement(ft,null));return o().createElement(c.Consumer,null,(r=>{const s={[E]:!0,[`${E}--lg`]:"large"===r?.size,[`${E}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:a,bordered:p}):o().createElement(Wi(),{action:g?[]:["click"],popupVisible:!g&&t,popup:w,popupClassName:we()(s,`form-popper__${l}`),popupStyle:{minWidth:S,maxHeight:b},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:u,allowClear:h,bordered:p,readOnly:m,disabled:g,style:{width:"100%",...d},value:i??a,title:a,onFocus:()=>{!n.length&&this.fetchHandle(a)},onBlur:e=>{v&&!this._clicking&&i!==a&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(n[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const r=40===e.keyCode?++t%n.length:(--t+n.length)%n.length;this.setState({activeIndex:r})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}Qa(Za,"contextType",Cr);class Ja extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Qa(this,"context",void 0),Qa(this,"promiseRef",void 0),Qa(this,"state",{searchHelper:{}}),Qa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Qa(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(Za,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";f(t,arguments.length>1?arguments[1]:void 0),e.setViewValue(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Qa(Ja,"contextType",Cr);const eo=Ja;function to(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ro extends a.Component{constructor(){super(...arguments),to(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,fieldName:n,className:i,style:a={},collapse:l={}}=this.props.option,{expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=ae}=l,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===n))??[],r=c??t.length-1;t.slice(r+1).forEach((t=>{const r=d.find((e=>e.fieldName===t.fieldName));if(!r)return;const n=r.showLabel?`${t.label}:`:"",i=e.getViewValue(t.fieldName)??"";""!==i&&p.push({...t,text:`${n}${i}`})}))}return o().createElement(L.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},o().createElement(Re,{id:n,label:r,className:i,extra:p.map((e=>e.text)).join(" | "),style:{...a},collapse:s[n],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[n]:t})}))),u(t)}}))}}to(ro,"contextType",Cr);const no=ro;function io(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ao(){return ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ao.apply(this,arguments)}const oo=(e,t,r,n)=>e.map((e=>e[r]===t?{...e,children:n}:e.children?{...e,children:oo(e.children,t,r,n)}:e)),lo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,multiple:i,loading:a,onChange:l,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=f("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:g,readOnly:b,disabled:y}=e.option,{itemList:v,filterable:x=!0,listHeight:E=En,checkStrictly:S,checkStrategy:w="SHOW_CHILD",collapseTags:C,defaultExpandAll:T=!g,defaultExpandedKeys:I,dropdownStyle:N,openPyt:R=!0}=d,[P,O]=o().useState(de(v)?n:v),k=o().useRef(P);Me((()=>{const e=de(v)?n:v;g?(0,te.isEqual)(e,k.current)||(O(e),k.current=e):O(e)}),[v,n]);const A=e=>Hn(P,e)?.text||e?.toString()||"",_=e=>i?e?.map((e=>A(e))).join(",")||"":A(e);return t.isOnlyShow?o().createElement(ri,{value:_(r),bordered:h}):o().createElement(L.TreeSelect,ao({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:i,treeCheckable:i,treeCheckStrictly:S,showCheckedStrategy:L.TreeSelect[w],popupClassName:`form-popper__${c}`,dropdownStyle:N,placeholder:p,listHeight:E,style:u,loading:a,bordered:h,allowClear:m,disabled:y,treeDefaultExpandAll:T,treeDefaultExpandedKeys:I,showSearch:x,maxTagCount:C?"responsive":void 0,loadData:g?async e=>{let{key:t,children:r}=e;if(!g||r)return;const{fetchApi:n,params:i,dataKey:a,textKey:o="text",valueKey:l="value",callback:s,formatter:c=(e=>e)}=g;if(n)try{const e=await n(c({...i,[l]:t}));if(200===e.code){const r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,a)??[],n=oo(P,t,l,Fn(r,l,o));O(n),s?.(r)}}catch(e){}}:void 0,treeData:P},i?{title:_(r)}:null,{filterTreeNode:(e,t)=>{const r=t?.text?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(R?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{l?.(e),s(e,_(e),P)})(e)}}))};class so extends a.Component{constructor(){super(...arguments),io(this,"context",void 0),io(this,"state",{itemList:[],loading:!1}),io(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=Fn(t,i,a);this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(lo,{option:this.props.option,items:t,loading:r,multiple:this.props.multiple,onValuesChange:(t,r,n)=>{f(t,r,n),e.setViewValue(l,r)}}))),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}io(so,"contextType",Cr);const co=so;function uo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po.apply(this,arguments)}const ho=e=>{const{$$form:t}=o().useContext(Cr),{value:r,multiple:n,items:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:u=!0,asyncLoad:p,readOnly:h,disabled:m}=e.option,{itemList:g,changeOnSelect:b,checkStrictly:y,checkStrategy:v="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:S=!0}=l,[w,C]=o().useState(de(g)?i:g),T=o().useRef(w);Me((()=>{const e=de(g)?i:g;p?(0,te.isEqual)(e,T.current)||(C(e),T.current=e):C(e)}),[g,i]);const I=e=>Dn(w,e??"").map((e=>e.text)).join("/"),N=e=>n?e?.map((e=>I(e))).join(",")||"":I(e);return t.isOnlyShow?o().createElement(ri,{value:N(r),bordered:d}):o().createElement(L.Cascader,po({value:(e=>de(e)?[]:n?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:w,multiple:n,maxTagCount:"responsive",changeOnSelect:b||y,showCheckedStrategy:L.Cascader[v],popupClassName:`form-popper__${a}`,dropdownStyle:E,placeholder:c,style:s,bordered:d,allowClear:u,disabled:m,showSearch:x&&!p&&{filter:(e,t)=>t.some((t=>{const r=t?.text?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?async e=>{const t=e[e.length-1];if(!p||t.children)return;const{fetchApi:r,params:n,dataKey:i,textKey:a="text",valueKey:o="value",callback:l,formatter:s=(e=>e)}=p;if(r)try{const e=await r(s({...n,[o]:t.value}));if(200===e.code){const r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[],n=oo(w,t.value,o,Fn(r,o,a));C(n),l?.(r)}}catch(e){}}:void 0},n?{title:N(r)}:null,{onChange:t=>{(t=>{const{onChange:r,onValuesChange:n}=e;r?.(t),n(t,N(t),w)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class mo extends a.Component{constructor(){super(...arguments),uo(this,"context",void 0),uo(this,"state",{itemList:[],loading:!1}),uo(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=Fn(t,i,a);this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(ho,{option:this.props.option,multiple:t,items:r,onValuesChange:(t,r,n)=>{f(t,r,n),e.setViewValue(l,r)}}))),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}uo(mo,"contextType",Cr);const fo=mo,go=require("china-area-data");var bo=n.n(go);function yo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vo=["110000","120000","310000","500000"],xo=["810000","820000"],Eo=[{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"}],So=[{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"}],wo=e=>ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Co=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(r>2)&&e[t])return("86"===t?Object.keys(e[t]).filter((e=>![...vo,...xo].includes(e))):Object.keys(e[t])).map((n=>({l:wo(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Co(e,n,r+1)})))},To=(e,t)=>t.map((t=>({l:wo(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Io extends a.Component{constructor(e){super(e),yo(this,"context",void 0),yo(this,"searchRef",o().createRef()),yo(this,"scrollRef",o().createRef()),yo(this,"zxsAndGa",void 0),yo(this,"provinces",void 0),yo(this,"allCities",void 0),yo(this,"letterCities",void 0),yo(this,"state",{visible:!1,select_type:"0",active_key:""}),yo(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),yo(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(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(){this.searchRef.current?.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),Xt()(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){return this.allCities.find((t=>t.c===e))?.n||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:To(bo(),vo)},{l:"Z2",n:"港澳",c:"",p:"",children:To(bo(),xo)}]}createProvince(){return(Co(bo(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return So.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...vo,...xo].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return o().createElement(L.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}))}},o().createElement(L.Radio.Button,{value:"0"},f("qm.form.citySelectType.0")),o().createElement(L.Radio.Button,{value:"1"},f("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Eo:So).map((t=>o().createElement("li",{key:t.value,className:we()({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return o().createElement(L.Select,{size:"small",placeholder:f("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>(t?.children?.toString()||"").toLowerCase().indexOf(e.toLowerCase())>=0,value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>o().createElement(L.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,r)=>o().createElement("div",{key:r},o().createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),o().createElement("dd",null,t.children?.map((t=>o().createElement("li",{key:t.c,className:we()({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:r}=this.props,{fieldName:n,options:i={},style:a={},placeholder:l=f("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:d=!0,readOnly:u,disabled:p}=this.props.option,h=Ce("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,g=this.createTextValue(r),b=o().createElement("div",{className:"container",style:{...a}},o().createElement("div",{className:"city-drop"},o().createElement("div",{className:"city-drop-toper"},o().createElement("div",{className:"city-drop-toper__type"},this.renderType()),o().createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),o().createElement("div",{className:"city-drop-letter"},this.renderLetter()),o().createElement("div",{ref:this.scrollRef,className:"city-drop-list"},o().createElement("dl",null,this.renderCity(r)))));return o().createElement(c.Consumer,null,(r=>{const i={[h]:!0,[`${h}--lg`]:"large"===r?.size,[`${h}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:g,bordered:s}):o().createElement(Wi(),{action:p?[]:["click"],popupVisible:!p&&t,popup:b,popupClassName:we()(i,`form-popper__${n}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:l,allowClear:d,bordered:s,readOnly:u,disabled:p,style:{width:"100%",...a},value:g,title:g,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}yo(Io,"contextType",Cr);class No extends a.Component{constructor(){super(...arguments),yo(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Io,{option:this.props.option,onValuesChange:(t,r)=>{h(t,r),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}yo(No,"contextType",Cr);const Ro=No;function Po(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oo=(e,t)=>{if(e[t])return Object.keys(e[t]).map((r=>({text:e[t][r],value:r,children:Oo(e,r)})))};class ko extends a.Component{constructor(e){super(e),Po(this,"context",void 0),Po(this,"searchRef",o().createRef()),Po(this,"prevText",void 0),Po(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Po(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const t=Oo(bo(),"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:r}=this.props;t!==r&&this.state.values.join(",")!==(r??"")&&this.initial()}get isFetch(){return!!this.props.option.request?.fetchApi}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){this.searchRef.current?.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>this.state.tabs[t]?.find((t=>t.value===e))?.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 r=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const i=Hn(e,t[n]);if(i&&de(i.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(i?.children)&&(r[n+1]=i?.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:r})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:r,formatter:n=(e=>e),dataKey:i,valueKey:a="value",textKey:o="text"}=t;if(r)try{const t=await r(n({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,te.get)(t.data,i)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[a]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,r)=>{const n=t.find((t=>t.value===e[r]))?.text||`${f("qm.form.selectPlaceholder").replace("...","")}(${f("qm.form.regionSelectLabel")[r]})`;return o().createElement(cr.TabPane,{key:r.toString(),tab:n},o().createElement("div",{className:"region-box"},t.map((t=>o().createElement("span",{key:t.value,className:we()({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[r]=t.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},t.text)))))}));return t.length?o().createElement(cr,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):o().createElement(ft,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:r}=this.props,{fieldName:n,options:i={},style:a={},placeholder:l=f("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:d=!0,readOnly:u,disabled:p}=this.props.option,h=Ce("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,g=o().createElement("div",{className:"container"},this.renderTabs());let b=this.prevText;if(!t){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(b=e,this.prevText=b)}return o().createElement(c.Consumer,null,(r=>{const i={[h]:!0,[`${h}--lg`]:"large"===r?.size,[`${h}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:b,bordered:s}):o().createElement(Wi(),{action:p?[]:["click"],popupVisible:!p&&t,popup:g,popupClassName:we()(i,`form-popper__${n}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:l,allowClear:d,bordered:s,style:{width:"100%",...a},readOnly:u,disabled:p,value:b,title:b,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&se((()=>this.initial()))}})))}))}}Po(ko,"contextType",Cr);class Ao extends a.Component{constructor(){super(...arguments),Po(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(ko,{option:this.props.option,onValuesChange:(t,r)=>{h(t,r),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Po(Ao,"contextType",Cr);const Lo=Ao;function _o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fileTypes:h,fileSize:m,fileDirection:g,onPreview:b,onRemove:y}=a,{action:v,headers:x,params:E,withCredentials:S=!1,dataKey:w="",downloadWithHeaders:C,fieldAliasMap:T,beforeUpload:I,button:N}=l,R="function"==typeof T?T():T||{};return o().createElement(xl,{name:"file",action:v,multiple:u,headers:x,data:E,withCredentials:S,downloadWithHeaders:C,beforeUpload:I,maxCount:p,fileTypes:h,fileSize:m,fileDirection:g,disabled:c,readOnly:t.isOnlyShow||d,button:N,showUploadList:{showDownloadIcon:!0,downloadIcon:o().createElement(Te.DownloadOutlined,null)},fileList:r,onChange:e=>{let{file:t,fileList:r}=e;(e=>{const t=e.map((e=>{const t=e.response||{},r={};for(const n in R)r[n]=e[n]||t.data?.[R[n]]||"";return e.response&&200!==t.code&&L.message.error(t.message||f("qm.uploadCropper.uploadError")),{uid:e.uid,name:e.name,...r,url:e.url||(w?(0,te.get)(t.data,w):t.data)||"",status:e.status}}));n?.(t),t.every((e=>"done"===e.status&&e.url))&&i(t)})(r)},onPreview:b,onRemove:y})};class Ho extends a.Component{constructor(){super(...arguments),_o(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Fo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,"")}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}_o(Ho,"contextType",Cr);const Do=Ho;function $o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fixedSize:h,quality:m,openCropper:g,fileTypes:b,fileSize:y,onRemove:v}=a,{action:x,headers:E,params:S,withCredentials:w=!1,dataKey:C="",popupClassName:T,fieldAliasMap:I,beforeUpload:N}=l,R="function"==typeof I?I():I||{};return o().createElement(Nl,{name:"file",action:x,multiple:u,headers:E,data:S,withCredentials:w,popupClassName:T,beforeUpload:N,maxCount:p,fixedSize:h,quality:m,openCropper:g,fileTypes:b,fileSize:y,disabled:c,readOnly:t.isOnlyShow||d,fileList:r,onChange:e=>{let{file:t,fileList:r}=e;(e=>{const t=e.map((e=>{const t=e.response||{},r={};for(const n in R)r[n]=e[n]||t.data?.[R[n]]||"";return e.response&&200!==t.code&&L.message.error(t.message||f("qm.uploadCropper.uploadError")),{uid:e.uid,name:e.name,...r,url:e.url||(C?(0,te.get)(t.data,C):t.data)||"",status:e.status}}));n?.(t),t.every((e=>"done"===e.status&&e.url))&&i(t)})(r)},onRemove:v})};class Mo extends a.Component{constructor(){super(...arguments),$o(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(qo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,"")}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}$o(Mo,"contextType",Cr);const jo=Mo;function Ko(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l,style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:h}=a;return o().createElement(ml,{value:r,tinymce:u,upload:l,thresholdSize:p,style:{width:"100%",...s},disabled:d||c||t.isOnlyShow,onResizeEditor:h,onChange:e=>{(e=>{n?.(e),i(e)})(e)}})};class zo extends a.Component{constructor(){super(...arguments),Ko(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Vo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ko(zo,"contextType",Cr);const Bo=zo;function Uo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Wo extends a.Component{constructor(e){super(e),Uo(this,"context",void 0),Uo(this,"provide",{$$form:this,echo_data:{}}),Uo(this,"_initialValues",void 0),Uo(this,"_initialOthers",void 0),Uo(this,"_initialExtras",void 0),Uo(this,"_fieldAuth",{}),Uo(this,"wrapperRef",o().createRef()),Uo(this,"formRef",o().createRef()),Uo(this,"originItems",[]),Uo(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!!this.props.defaultExpand}),Uo(this,"resizeObserveHandler",(()=>{const e=this.wrapperRef.current?.offsetWidth;if(void 0===e||0===e||this.props.cols>0)return;let t=Math.floor(e/300);t=24%t==0?t:t-1,t=t<1?1:t,t=t>8?8:t,t!==this.state.flexCols&&this.setState({flexCols:t})})),Uo(this,"resizeListenerHandle",(0,te.debounce)(this.resizeObserveHandler,10)),Uo(this,"getFormItems",wr()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),Uo(this,"getFlattenItems",wr()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,te.isPlainObject)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),Uo(this,"valuesChangeHandle",((e,t)=>{this.props.onValuesChange?.(e,this._initialValues)})),Uo(this,"fieldsChangeHandle",((e,t)=>{this.props.onFieldsChange?.(e,t)})),Uo(this,"finishHandle",(e=>{this.props.onFinish?.(Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),Uo(this,"finishFailedHandle",(e=>{let{values:t,errorFields:r}=e;this.props.onFinishFailed?.(r)})),Uo(this,"openValidateInfo",(e=>{const t=o().createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return o().createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));L.notification.error({message:f("qm.form.validatePrompt"),description:t,duration:10})})),Uo(this,"scrollToField",(e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Xt()(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})})),this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){return this.props.size??this.context.size??""}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(){const e=this.context.global;return this.props.compactMode??("small"===this.$size&&!!e?.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(){Tt(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){It(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&&v("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)),r={};for(const n in e)t.includes(n)||(r[n]=e[n]);return Object.assign({},r)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,te.isPlainObject)(e.extra))).forEach((r=>{t[r.fieldName]=e[r.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,te.isPlainObject)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:r,options:n}=e;return t=t??void 0,Sn.includes(r)&&(t=t??[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=t??n?.falseValue??xn),t}createFormValue(e){const t={};return this.flattenItems.forEach((r=>{t[r.fieldName]=this.getInitialValue(r,e[r.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=pe(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((r=>({viewData:Object.assign({},r.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}setExpandHandle(e){e!==this.state.collapse&&(this.setState({collapse:e}),this.props.onCollapse?.(e),se((()=>this.props.onCollapse?.(e))))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:r}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!r||setTimeout((()=>this.CREATE_FOCUS(r)))}getFormItemLabel(e){if($n(e))return qn(e);if((0,te.isPlainObject)(e)){const{fieldName:t,label:r,options:n={}}=e;if($n(r))return qn(r);const{itemList:i=[]}=n,a=this.formRef.current?.getFieldsValue([t])[t]??this._initialValues[t]??i[0]?.value;return i.find((e=>e.value===a))?.text||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,r=this.dividers.length;t<r;t++){const r=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(r,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:r}=e;if("DIVIDER"===t)return!0;const n=this.getBlockDerivedItems();for(let e=0,t=n.length;e<t;e++){const t=n[e],i=this.dividers.find((e=>e.fieldName===t[0].fieldName)),a=i?.collapse?.showLimit??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===r&&e>a)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const r=e[t];if(kn(r)&&(e[t]=""),Array.isArray(r)&&r.forEach(((r,n)=>{kn(r)&&(e[t][n]="")})),t.includes("|")&&Array.isArray(r)){const[n,i]=t.split("|");e[n]=r[0]??"",e[i]=r[1]??""}}if(this.isFilterType)for(const t in e)de(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}async createFormAuth(){const{authConfig:e}=this.props;if(!e)return;let t=ue(e,["fetch"]);if(e.fetch){const{api:r,params:n,dataKey:i}=e.fetch;try{const e=await r(n);200===e.code&&(t=(i?(0,te.get)(e.data,i):e.data)??{})}catch(e){}}if(Array.isArray(t.fieldList)){const e=this.props.items.map((e=>{const{fieldName:r}=e,n=t.fieldList.find((e=>e.dataIndex===r));if(n){const t=this.originItems.find((e=>e.fieldName===r)),{visible:i=1,disabled:a,secretName:o}=n;i||(e.noAuth=!0,t.noAuth=!0),a&&(e.disabled=!0,t.disabled=!0),o&&(e.options?e.options.secretType=o:e.options={secretType:o},t.options=Object.assign({},t.options,{secretType:o})),this.setFieldAuth(r,{visible:i,disabled:a,secretName:o})}return e}));this.props.fieldsChange?.(e)}}INPUT(e){return o().createElement(xi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return o().createElement(Ci,{option:e})}INPUT_NUMBER(e){return o().createElement(Oi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return o().createElement(_i,{option:e})}SEARCH_HELPER(e){return o().createElement(Mi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return o().createElement(Qi,{option:e})}TREE_TABLE_HELPER(e){return o().createElement(ra,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return o().createElement(sa,{option:e})}RANGE_SEARCH_HELPER(e){return o().createElement(ha,{option:e})}CHECKBOX(e){return o().createElement(pi,{option:e})}MULTIPLE_CHECKBOX(e){return o().createElement(ba,{option:e})}RATE(e){return o().createElement(Ea,{option:e})}RADIO(e){return o().createElement(Ta,{option:e})}SWITCH(e){return o().createElement(Pa,{option:e})}TEXT_AREA(e){return o().createElement(La,{option:e})}DATE(e){return o().createElement(Da,{option:e})}RANGE_DATE(e){return o().createElement(Ka,{option:e})}TIME(e){return o().createElement(Ua,{option:e})}RANGE_TIME(e){return o().createElement(Xa,{option:e})}SELECT(e){return o().createElement(si,{option:e})}MULTIPLE_SELECT(e){return o().createElement(si,{option:e,multiple:!0})}IMMEDIATE(e){return o().createElement(eo,{option:e})}DIVIDER(e){return o().createElement(no,{option:e})}TREE_SELECT(e){return o().createElement(co,{option:e})}MULTIPLE_TREE_SELECT(e){return o().createElement(co,{option:e,multiple:!0})}CASCADER(e){return o().createElement(fo,{option:e})}MULTIPLE_CASCADER(e){return o().createElement(fo,{option:e,multiple:!0})}CITY_SELECT(e){return o().createElement(Ro,{option:e})}REGION_SELECT(e){return o().createElement(Lo,{option:e})}UPLOAD_FILE(e){return o().createElement(Do,{option:e})}UPLOAD_IMG(e){return o().createElement(jo,{option:e})}TINYMCE(e){return o().createElement(Bo,{option:e})}renderFormLabel(e){if($n(e)||!(0,te.isPlainObject)(e))return e;const{type:t,fieldName:r,label:n,options:i={},onChange:a=ae}=e,{itemList:l=[]}=i;return"SELECT"===t?o().createElement(L.Form.Item,{name:r,noStyle:!0},o().createElement(oi,{option:e,items:l,loading:!1,onValuesChange:(e,t)=>a(e,t)})):"CHECKBOX"===t?o().createElement(o().Fragment,null,o().createElement("span",{style:{paddingRight:5}},n),o().createElement(L.Form.Item,{name:r,noStyle:!0},o().createElement(di,{option:e,onValuesChange:e=>a(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:r,style:n={},render:i}=e,{extra:a}=this.state;if(r)return o().createElement(L.Tooltip,{className:"extra-tooltip",title:a[t]},o().createElement(Te.ExclamationCircleOutlined,{style:{marginLeft:4}}));const l=this.formItems.find((e=>e.fieldName===t));return o().createElement("div",{className:"extra-text",title:i?"":a[t],style:n},o().createElement("span",{className:"extra-overflow-cut"},i?i(l,this):a[t]))}renderFormItemButton(e,t){const r=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(r):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:r,invisible:n,tooltip:i,className:a,labelWidth:l=this.props.labelWidth,rules:s=[],style:c={},render:d}=e;return de(this.state.formData)?null:o().createElement(L.Form.Item,{label:this.renderFormLabel(t),name:r,rules:s,tooltip:i,hidden:n,className:we()(a),style:{width:"100%",...c},labelCol:{flex:this.verticalLayout?"initial":he(l)}},d?.(e,this))}createFormItem(e){return(0,te.isFunction)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(v("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:r,isFieldsDefine:n}=this.props,i=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:r=0}=e;for(let e=0;e<t;e++)i.push({});i.push(e);for(let e=0;e<r;e++)i.push({})}));const a=24/e,l=[],s=i.reduce(((e,t)=>{const{selfCol:r=1}=t,n=e+r;return l.push(n),n}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=i.map(((t,r)=>{let{selfCol:n=1}=t;const{type:i,fieldName:s}=t;n=n>=24||"DIVIDER"===i||"TINYMCE"===i?e:n;const u=!(!this.state.collapse&&this.showFilterCollapse)||l[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(t);return u&&d.push(l[r]),o().createElement(L.Col,{key:s??r,className:s,span:n*a,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},i?this.createFormItem(pe(t)):null)}));return n&&"default"===t&&u.push(o().createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:t,collapse:r}=this.state,{searchButtonCols:n,isSearchBtn:i,isFieldsDefine:a=!0}=this.props;if(!this.isFilterType)return null;const l=24/t,s=n||1,c=t-e%t-s;return i?o().createElement(L.Col,{key:"-",span:s*l,offset:c*l,style:{textAlign:"right"}},o().createElement(L.Space,{style:{marginBottom:12}},o().createElement(be,{type:"primary",size:this.$size,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},f("qm.form.search")),o().createElement(be,{size:this.$size,icon:o().createElement(Te.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},f("qm.form.reset")),a?this.createFieldsDefine():null,this.showFilterCollapse&&o().createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)," ",f(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const n=24/e;return r&&"default"===t?o().createElement(L.Row,{gutter:0},o().createElement(L.Col,{key:"-",span:n},o().createElement(L.Form.Item,null,o().createElement(L.Space,{style:{marginBottom:12}},o().createElement(be,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},f("qm.form.save")),o().createElement(be,{size:this.$size,onClick:()=>this.RESET_FORM()},f("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:r}=this.props;return o().createElement(gi,{uniqueKey:e,items:t,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise((async(e,t)=>{const[r,n]=await this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>this[`${e.fieldName}_Ref`]?.searchRef._is_change)).map((e=>({name:[e.fieldName],errors:[f("qm.form.searchHelperTips")],warnings:[]})));r||i.length?t((r||[]).concat(i)):e(n)}))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}async GET_FORM_DATA(){try{const e=await 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]}}async VALIDATE_FIELDS(e){try{return[null,await 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)}async SUBMIT_FORM(){try{await this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}RESET_FORM(){const e=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),t=this.flattenItems.map((e=>e.fieldName)).filter((t=>!e.includes(t)));t.length&&this.formRef.current.resetFields(t),this.setState((e=>{const t=Object.keys(e.other),r=Object.keys(this._initialOthers),n=t.filter((e=>!r.includes(e))),i={};return n.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),this.props.onReset?.()}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){v("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,r){const{items:n,fieldsChange:i}=this.props,a=n.find((t=>t.fieldName===e));if(!a)return v("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!(0,te.isPlainObject)(t))return v("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(a.noAuth)return v("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const r in t)r&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===r||(0,te.set)(a,r,t[r]));r&&(i?i([...n]):v("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:r,disabled:n,labelWidth:i,labelAlign:a,labelWrap:l,customClass:s}=this.props,c=Ce("form"),d={required:"${label}"+f("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return o().createElement("div",{ref:this.wrapperRef,className:we()(u,e),style:t},o().createElement(L.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:a,labelWrap:l,colon:!1,disabled:n,labelCol:{flex:this.verticalLayout?"initial":he(i)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},o().createElement(Cr.Provider,{value:this.provide},o().createElement(L.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}Uo(Wo,"contextType",c),Uo(Wo,"propTypes",Nn),Uo(Wo,"defaultProps",Rn);const Go=Wo,Yo={onActivate:l.func,onAddUndo:l.func,onBeforeAddUndo:l.func,onBeforeExecCommand:l.func,onBeforeGetContent:l.func,onBeforeRenderUI:l.func,onBeforeSetContent:l.func,onBeforePaste:l.func,onBlur:l.func,onChange:l.func,onClearUndos:l.func,onClick:l.func,onContextMenu:l.func,onCommentChange:l.func,onCopy:l.func,onCut:l.func,onDblclick:l.func,onDeactivate:l.func,onDirty:l.func,onDrag:l.func,onDragDrop:l.func,onDragEnd:l.func,onDragGesture:l.func,onDragOver:l.func,onDrop:l.func,onExecCommand:l.func,onFocus:l.func,onFocusIn:l.func,onFocusOut:l.func,onGetContent:l.func,onHide:l.func,onInit:l.func,onKeyDown:l.func,onKeyPress:l.func,onKeyUp:l.func,onLoadContent:l.func,onMouseDown:l.func,onMouseEnter:l.func,onMouseLeave:l.func,onMouseMove:l.func,onMouseOut:l.func,onMouseOver:l.func,onMouseUp:l.func,onNodeChange:l.func,onObjectResizeStart:l.func,onObjectResized:l.func,onObjectSelected:l.func,onPaste:l.func,onPostProcess:l.func,onPostRender:l.func,onPreProcess:l.func,onProgressState:l.func,onRedo:l.func,onRemove:l.func,onReset:l.func,onSaveContent:l.func,onSelectionChange:l.func,onSetAttrib:l.func,onSetContent:l.func,onShow:l.func,onSubmit:l.func,onUndo:l.func,onVisualAid:l.func,onSkinLoadError:l.func,onThemeLoadError:l.func,onModelLoadError:l.func,onPluginLoadError:l.func,onIconsLoadError:l.func,onLanguageLoadError:l.func},Xo={apiKey:l.string,id:l.string,inline:l.bool,init:l.object,initialValue:l.string,onEditorChange:l.func,value:l.string,tagName:l.string,cloudChannel:l.string,plugins:l.oneOfType([l.string,l.array]),toolbar:l.oneOfType([l.string,l.array]),disabled:l.bool,textareaName:l.string,tinymceScriptSrc:l.string,rollback:l.oneOfType([l.number,l.oneOf([!1])]),scriptLoading:l.shape({async:l.bool,defer:l.bool,delay:l.number}),...Yo},Qo=e=>"function"==typeof e,Zo=e=>e in Yo,Jo=e=>e.substr(2),el=(e,t,r,n,i)=>((t,r,n,i,a,o,l)=>{const s=Object.keys(a).filter(Zo),c=Object.keys(o).filter(Zo),d=s.filter((e=>void 0===o[e])),u=c.filter((e=>void 0===a[e]));d.forEach((e=>{const t=Jo(e),r=l[t];n(t,r),delete l[t]})),u.forEach((n=>{const i=((t,r)=>n=>t(r)?.(n,e))(t,n),a=Jo(n);l[a]=i,r(a,i)}))})(i,e.on.bind(e),e.off.bind(e),0,t,r,n);let tl=0;const rl=e=>{const t=Date.now(),r=Math.floor(1e9*Math.random());return tl++,e+"_"+r+tl+String(t)},nl=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),il=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),al=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},ol=()=>({listeners:[],scriptId:rl("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),ll=(()=>{let e=ol();return{load:(t,r,n,i,a,o)=>{const l=()=>((t,r,n,i,a,o)=>{const l=r.createElement("script");l.referrerPolicy="origin",l.type="application/javascript",l.id=t,l.src=n,l.async=i,l.defer=a;const s=()=>{l.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};l.addEventListener("load",s),r.head&&r.head.appendChild(l)})(e.scriptId,t,r,n,i);e.scriptLoaded?o():(e.listeners.push(o),e.scriptLoading||(e.scriptLoading=!0,a>0?setTimeout(l,a):l()))},reinitialize:()=>{e=ol()}}})(),sl=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};function cl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class dl extends a.Component{constructor(e){var t;super(e),t=this,cl(this,"editor",void 0),cl(this,"id",void 0),cl(this,"elementRef",void 0),cl(this,"inline",void 0),cl(this,"currentContent",void 0),cl(this,"boundHandlers",void 0),cl(this,"rollbackTimer",void 0),cl(this,"valueCursor",void 0),cl(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})),cl(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){}})),cl(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),cl(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))}})),cl(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),cl(this,"initialise",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=t.elementRef.current;if(!r)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,r=e.parentNode;for(;null!=r;)t=r,r=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 n=sl(t.view);if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...t.props.init,selector:void 0,target:r,readonly:t.props.disabled,inline:t.inline,plugins:(a=t.props.init?.plugins,o=t.props.plugins,il(a).concat(il(o))),toolbar:t.props.toolbar??t.props.init?.toolbar,setup:e=>{t.editor=e,t.bindHandlers({}),t.inline&&!nl(r)&&e.once("PostRender",(r=>{e.setContent(t.getInitialValue(),{no_events:!0})})),t.props.init&&Qo(t.props.init.setup)&&t.props.init.setup(e)},init_instance_callback:e=>{const r=t.getInitialValue();t.currentContent=t.currentContent??e.getContent(),t.currentContent!==r&&(t.currentContent=r,e.setContent(r),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const n=t.props.disabled??!1;al(t.editor,n?"readonly":"design"),t.props.init&&Qo(t.props.init.init_instance_callback)&&t.props.init.init_instance_callback(e)}};var a,o;t.inline||(r.style.visibility=""),nl(r)&&(r.value=t.getInitialValue()),n.init(i)})),this.id=this.props.id||rl("tiny-react"),this.elementRef=a.createRef(),this.inline=this.props.inline??this.props.init?.inline??!1,this.boundHandlers={}}get view(){return this.elementRef.current?.ownerDocument.defaultView??window}componentDidUpdate(e){if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=this.currentContent??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 r=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,r])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;al(this.editor,e?"readonly":"design")}}}componentDidMount(){null!==sl(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&ll.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),this.props.scriptLoading?.async??!1,this.props.scriptLoading?.defer??!1,this.props.scriptLoading?.delay??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(){const e=sl(this.view)?.Env?.browser?.isIE();return e?"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 a.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return a.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){el(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,r=t(e),n=t(this.props);!r&&n?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):r&&!n&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function ul(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}cl(dl,"propTypes",Xo),cl(dl,"defaultProps",{cloudChannel:"6"});var pl=function(e){return e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en",e}(pl||{});class hl extends a.Component{constructor(){super(...arguments),ul(this,"context",void 0),ul(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(){const{size:e,className:t,style:r,tinymce:n={},upload:i={},thresholdSize:a=.5,tinymceScriptSrc:l,disabled:s,value:c,onResizeEditor:d,onChange:u}=this.props,p=this.context.global,h=this.context.locale,m=e||this.context.size||"",g=Ce("tinymce"),b={[g]:!0,[`${g}--lg`]:"large"===m,[`${g}--sm`]:"small"===m},y={init:{height:n.height||this.defaultOption.height,plugins:n.plugins||this.defaultOption.plugins,toolbar:n.toolbar||this.defaultOption.toolbar,menubar:n.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:pl[h],skin:"tinymce-5",...ue(n,["height","plugins","toolbar","menubar"]),images_upload_handler:e=>new Promise((async(t,r)=>{const{action:n,headers:o,dataKey:l}=i,s=`data:image/jpeg;base64,${e.base64()}`,c=new FormData;c.append("file",e.blob(),e.filename());const d=e.blob().size;if(n&&d/1024/1024>a)try{const e=await fetch(n,{method:"POST",body:c,headers:o});if(!e.ok)throw new Error(f("qm.upload.uploadError"));const r=await e.json();200===r.code&&t(l?(0,te.get)(r.data,l):r.data)}catch(e){L.message.error(f("qm.uploadCropper.uploadError"))}else t(s)})),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:r,offsetHeight:n}=e.editorContainer;d?.({width:r,height:n},t)}))}},value:c,disabled:s,tinymceScriptSrc:l||p?.tinymce?.scriptSrc||void 0,onEditorChange:(e,t)=>{u?.(t.getContent(),t)}};return o().createElement("div",{className:we()(b,t),style:r},o().createElement(dl,y))}}ul(hl,"contextType",c),ul(hl,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Tinymce","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")}});const ml=hl,fl=require("cropperjs");var gl=n.n(fl);function bl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yl extends a.Component{constructor(){super(...arguments),bl(this,"imgRef",o().createRef()),bl(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:r,alt:n,imgStyle:i,...a}=this.props,o={};for(const e in a)void 0!==this.props[e]&&(o[e]=this.props[e]);this.cropper=new(gl())(this.imgRef.current,o)}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:r,alt:n,imgStyle:i}=this.props,a=Ce("cropper"),l={[a]:!0};return o().createElement("div",{className:we()(l,e),style:t},o().createElement("img",{ref:this.imgRef,src:r,alt:n,style:{maxWidth:"100%",...i}}))}}bl(yl,"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});const vl=yl,xl=Kt;function El(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Sl extends a.Component{constructor(){super(...arguments),El(this,"context",void 0),El(this,"cropperRef",o().createRef()),El(this,"beforeUploadRef",void 0),El(this,"fileRef",void 0),El(this,"resolveRef",void 0),El(this,"rejectRef",void 0),El(this,"state",{src:""}),El(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:r,uid:n}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let i=new File([e],r,{type:t});Object.assign(i,{uid:n});const{fileTypes:a=[],fileSize:o}=this.props;if(a.length&&!a.includes(i.name.slice(i.name.lastIndexOf(".")+1).toLowerCase()))return L.message.warning(f("qm.upload.tooltip",{type:a.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(i);const l=this.beforeUploadRef(i,[i]);if("boolean"==typeof l||l){if(!0===l)return this.resolveRef(i);if(!1===l)return this.rejectRef("not upload");if(l&&"function"==typeof l.then)try{const e=await l,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(i=e),this.resolveRef(i)}catch(e){this.rejectRef(e)}}else v("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await le(100),this.onClose()})),El(this,"onOk",(()=>{this.confirmHandle()})),El(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,r=Array.isArray(e)?e[0]:e;if(!r)return null;const{beforeUpload:n,...i}=r.props;return this.beforeUploadRef=n,o().createElement(r.type,{...i,beforeUpload:(e,r)=>new Promise((async(n,i)=>{const a=()=>n(L.Upload.LIST_IGNORE);if(t&&!await t(e,r))return void a();this.fileRef=e,this.resolveRef=n,this.rejectRef=a;const o=new FileReader;o.onload=()=>{this.setSrc(o.result),o.onload=null},o.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 o().createElement("div",{className:"cropper-preview"},o().createElement("div",{className:"cropper-area"},o().createElement("div",{className:"img-cropper"},o().createElement(vl,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),o().createElement("div",{className:"actions"},o().createElement(L.Space,{size:"small"},o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},f("qm.uploadCropper.zoomIn")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},f("qm.uploadCropper.zoomOut")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},f("qm.uploadCropper.rotatePlus")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},f("qm.uploadCropper.rotateSubtract"))))),o().createElement("div",{className:"preview-area"},o().createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:t}=this.state,r=Ce("cropper-preview");return o().createElement(o().Fragment,null,this.renderUpload(),t&&o().createElement(L.Modal,{open:!0,wrapClassName:we()(r,e),title:f("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}El(Sl,"contextType",c);const wl=Sl;function Cl(){return Cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cl.apply(this,arguments)}function Tl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Il extends a.Component{constructor(){super(...arguments),Tl(this,"context",void 0),Tl(this,"state",{previewVisible:!1,currentIndex:0}),Tl(this,"isFocused",!1),Tl(this,"beforeUpload",((e,t)=>new Promise((async(r,n)=>{const{fileTypes:i=[],fileSize:a,beforeUpload:o}=this.props,l=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!a||e.size/1024/1024<a,c=l&&s;if(l||L.message.warning(f("qm.upload.tooltip",{type:i.join(",")})),s||L.message.warning(f("qm.upload.sizeLimit",{size:a})),!c)return L.Upload.LIST_IGNORE;if(o){const i=o(e,t);if(!0===i)return r(e);if(!1===i)return n("not upload");if(i&&"function"==typeof i.then)try{r(await i)}catch(e){n(e)}}else r(e)})))),Tl(this,"handlePreview",(e=>{this.setState({currentIndex:this.props.fileList?.findIndex((t=>t.url===e.url))||0,previewVisible:!0})})),Tl(this,"handlePaste",(async e=>{const{fileList:t=[],action:r,data:n,headers:i,onChange:a}=this.props;if(this.isFocused&&this.showUploadButton&&r)for(const o of e.clipboardData.items)if("file"===o.kind&&o.type.startsWith("image/")){const e=o.getAsFile(),l=Date.now(),s=new File([e],`screenshot-${l}.png`,{type:e.type});Object.assign(s,{uid:`rc-upload-${l}`});try{await this.beforeUpload(s,[...t,s]);const e=new FormData;if(e.append("file",s),n)for(const t in n)e.append(t,n[t]);const o="string"==typeof r?r:await r(s),l=await fetch(o,{method:"POST",body:e,headers:i});if(!l.ok)throw new Error(f("qm.upload.uploadError"));const c=await l.json();a?.({file:s,fileList:[...t,{uid:s.uid,lastModified:s.lastModified,lastModifiedDate:s.lastModifiedDate,name:s.name,type:s.type,size:s.size,response:c,status:"done",percent:100,originFileObj:s}]})}catch(e){}}}))}get $size(){return this.context.size??""}get showUploadButton(){const e=this.props.fileList?.length??0;return!this.props.maxCount||e<this.props.maxCount}componentDidMount(){document.addEventListener("paste",this.handlePaste)}componentDidUpdate(e){const{fileList:t}=e,{fileList:r}=this.props;t===r||this.showUploadButton||(this.isFocused=!1)}componentWillUnmount(){document.removeEventListener("paste",this.handlePaste)}render(){const{previewVisible:e,currentIndex:t}=this.state,{fileList:r=[],fixedSize:n,quality:i,fileTypes:a,fileSize:l,disabled:s,readOnly:c,className:d,popupClassName:u,openCropper:p,beforeCrop:h}=this.props,m=Ce("upload-img"),g={[m]:!0,[`${m}--lg`]:"large"===this.$size,[`${m}--sm`]:"small"===this.$size},b=s||c,y=o().createElement(L.Upload,Cl({className:we()(g,d)},ue(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:b,onPreview:this.handlePreview,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,r,n)=>o().createElement("div",{className:"upload-item"},e,!b&&o().createElement(Te.CloseOutlined,{title:f("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),!this.showUploadButton||c&&r.length?null:o().createElement(o().Fragment,null,o().createElement("p",{className:"ant-upload-drag-icon"},o().createElement(Te.InboxOutlined,null)),o().createElement("p",{className:"ant-upload-text"},f("qm.uploadCropper.dragableText")),o().createElement("button",{className:we()("ant-upload-button",{disabled:b}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{this.isFocused=!0},onBlur:()=>{this.isFocused=!1}},f("qm.uploadCropper.pasteText"))));return o().createElement(o().Fragment,null,p?o().createElement(wl,{className:u,fixedSize:n,quality:i,fileTypes:a,fileSize:l,beforeCrop:h},y):y,o().createElement("div",{style:{display:"none"}},o().createElement(L.Image.PreviewGroup,{preview:{visible:e,current:t,rootClassName:u,onVisibleChange:e=>{this.setState({previewVisible:e})}}},r.map((e=>o().createElement(L.Image,{key:e.uid,src:e.url,alt:""}))))))}}Tl(Il,"contextType",c),Tl(Il,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0});const Nl=Il,Rl=(e,t,r)=>{let n;for(let i=0;i<e.length;i++){const a=e[i];if(a.children)if(a.children.some((e=>e[r]===t)))n=a[r];else{const e=Rl(a.children,t,r);e&&(n=e)}}return n},Pl=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Pl(e.children,t),t(e)||e.children&&e.children.length))),Ol=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...Ol(e.children,t)),t(e)&&r.push(e)})),r},kl=(e,t)=>{let r=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(r=kl(e[n].children,t)),r)return r;if(t(e[n]))return e[n]}return r},Al=(e,t,r,n)=>e.map((e=>e[r]===t?{...e,children:n}:e.children?{...e,children:Al(e.children,t,r,n)}:e)),Ll=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...Ll(e.children,t)),Array.isArray(e.children)&&e.children.length&&r.push(e[t])})),r},_l=(e,t,r)=>{for(let n=0;n<e.length;n++){if(e[n][r]===t)return[t];if(Array.isArray(e[n].children)){const i=_l(e[n].children,t,r);if(i)return[e[n][r],i].flat()}}},Fl=(e,t)=>{const r=e.children?.map((e=>e[t]))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...Fl(e,t)))),r},Hl=o().forwardRef(((e,t)=>{const{className:r,style:n,filterable:i=!0,multiple:a,draggable:l,dataSource:s,fetch:d,asyncLoad:u,checkStrictly:p,checkStrategy:h="SHOW_CHILD",placeholder:m=f("qm.form.inputPlaceholder"),fieldsDefine:g,value:b,height:y,defaultSelectedKeys:v=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:S=!0,onSelectChange:w,onCheckChange:C,onDragStart:T,onDragChange:I,onExpand:N}=e,{size:R}=o().useContext(c),P=o().useMemo((()=>e.size??R??""),[e.size,R]),O=g?.valueKey||"value",k=g?.textKey||"text",A=o().useRef(null),_=Nt(A),[F,H]=o().useState(y),[D,$]=o().useState(!1),q=Ot((()=>{H(A.current.offsetHeight-Z.current.offsetHeight-10)}),5);Pt((()=>{y||q()}),[_.height]);const[M,j]=o().useState([]),[K,V]=o().useState({}),[z,B]=o().useState([]),[U,W]=o().useState([]),[G,Y]=o().useState(""),[X,Q]=o().useState(x),Z=o().useRef(null),J=o().useRef([]),ee=o().useRef([]);o().useEffect((()=>{Array.isArray(s)&&(re(s),B(ne(s)),V({}))}),[s]),o().useEffect((()=>{oe()}),[]),Me((()=>{oe()}),[d?.params]),Me((()=>{W(ae())}),[K]),o().useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const r=Array.isArray(t)?t:[t],n=kl(M,(t=>e===t[O]));n&&(Array.isArray(n.children)?n.children.push(...r):n.children=[...r],re([...M]))},REMOVE_RECORD:e=>{const t=Rl(M,e,O);if(void 0===t&&M.find((t=>t[O]===e)))re(M.filter((t=>t[O]!==e)));else{const r=kl(M,(e=>t===e[O]));if(!r)return;const n=r.children?.findIndex((t=>e===t[O]));n>=0&&(r.children.splice(n,1),re([...M]))}},UPDATE_RECORD:(e,t)=>{const r=kl(M,(t=>e===t[O]));r&&((0,te.merge)(r,t),re([...M]))}})));const re=e=>{j(e),J.current=e,ee.current=Ll(e,O)},ne=e=>{if(a)return v;const t=Ol(e,(e=>v.includes(e[k])));return 1===t.length?[t[0][O]]:[]},ie=e=>_l(M,e,O)?.slice(0,-1)||[],ae=()=>{if(x)return ee.current;const e=[];return z.forEach((t=>{if(a){if("SHOW_ALL"===h&&!ee.current.includes(t)&&e.push(...ie(t)),"SHOW_CHILD"===h&&e.push(...ie(t)),"SHOW_PARENT"===h){const r=Hn(M,t);if(r){const n=ie(t),i=Fl(r,O);e.push(...n,...[t,...i].filter((e=>ee.current.includes(e))))}}}else e.push(...ie(t))})),[...new Set(e)]},oe=async()=>{if(!d)return;const{api:e,params:t,dataKey:r,afterFetch:n,callback:i}=d;try{$(!0);const a=await e(t);if(200===a.code){let e=Array.isArray(a.data)?a.data:(0,te.get)(a.data,r)??[];e="function"==typeof n?await n(e):e,re(e),B(ne(e)),V({}),i?.(e)}}catch(e){}$(!1)},le=e=>`${e}|${ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=Ce("search-tree"),ce={[se]:!0,[`${se}--lg`]:"large"===P,[`${se}--sm`]:"small"===P};return o().createElement("div",{ref:A,className:we()(ce,r),style:n},o().createElement("div",{ref:Z,className:"topper"},E&&o().createElement(L.Input.Search,{value:G,size:P,placeholder:m,allowClear:!0,onChange:e=>(e=>{if(!i)return;const t=Pl(J.current,(t=>{if(!e)return!0;const r=t[k]||"";return-1!==le(r).indexOf(e)}));Y(e),j(t),x||e?W(Ll(t,O)):V({})})(e.target.value)}),S&&o().createElement("a",{className:"trigger",onClick:()=>{Q(!X),W(X?[]:ee.current)}},X?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)," ",f(X?"qm.form.collect":"qm.form.spread"))),o().createElement(xt,{spinning:D},o().createElement(L.Tree,{fieldNames:{title:k,key:O,children:"children"},multiple:a,draggable:l,blockNode:l,checkable:a,selectable:!a,height:F,disabled:e.disabled,checkStrictly:p,selectedKeys:b??z,checkedKeys:b??z,expandedKeys:U,treeData:M,loadData:u?async e=>{let{key:t,children:r}=e;if(!d||r)return;const{api:n,params:i,dataKey:a,formatter:o=(e=>e),afterFetch:l}=d;try{const e=await n(o({...i,[O]:t}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,a)??[];r="function"==typeof l?await l(r):r;const n=Al(J.current,t,O,r);re(n)}}catch(e){}}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!G)return!1;const t=e[k]||"";return-1!==le(t).indexOf(G)},onDragStart:T,onDragEnter:e=>{W(e.expandedKeys)},onDrop:e=>{const t=e.node.key,r=e.dragNode.key,n=e.node.pos.split("-"),i=e.dropPosition-Number(n[n.length-1]),a=(e,t,r)=>{for(let n=0;n<e.length;n++){if(e[n][O]===t)return r(e[n],n,e);e[n].children&&a(e[n].children,t,r)}},o=[...M];let l;if(a(o,r,((e,t,r)=>{r.splice(t,1),l=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)a(o,t,(e=>{e.children=e.children||[],e.children.unshift(l)}));else{let e,r=[];a(o,t,((t,n,i)=>{r=i,e=n})),-1===i?r.splice(e,0,l):r.splice(e+1,0,l)}else a(o,t,(e=>{e.children=e.children||[],e.children.unshift(l)}));re(o)},onDragEnd:e=>{I?.(e,M)},onExpand:(e,t)=>{de(e)&&Q(!1),ee.current.every((t=>e.includes(t)))&&Q(!0),W(e),N?.(e,t)},onSelect:e=>{B(e);const t=Ol(J.current,(t=>e.includes((0,te.get)(t,O))));w?.(a?t:t[0])},onCheck:e=>{p&&(e=e.checked),B(e),"SHOW_CHILD"===h&&(e=e.filter((e=>!ee.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,r)=>!r.includes(Rl(M,e,O)))));const t=Ol(J.current,(t=>e.includes((0,te.get)(t,O))));C?.(a?t:t[0])}})))}));Hl.displayName="QmSearchTree";const Dl=Hl,$l=(0,a.createContext)(void 0),ql={dataIndex:s().string.isRequired,title:s().string.isRequired,description:s().string,colSpan:s().number,width:s().number,minWidth:s().number,fixed:s().oneOf(["left","right"]),align:s().oneOf(["left","center","right"]),theadAlign:s().oneOf(["left","center","right"]),printFixed:s().bool,hidden:s().bool,noAuth:s().bool,noFixed:s().bool,ellipsis:s().bool,className:s().string,theadClassName:s().string,children:s().array,sorter:s().oneOfType([s().bool,s().func]),filter:s().shape({type:s().oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:s().arrayOf(s().shape({text:s().string,value:s().oneOfType([s().string,s().number])})),style:s().object}),precision:s().number,displayPrecision:s().number,formatType:s().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:s().bool,canCopy:s().bool,editRender:s().func,dictItems:s().arrayOf(s().shape({text:s().string,value:s().oneOfType([s().string,s().number])})),summation:s().shape({sumBySelection:s().bool,displayWhenNotSelect:s().bool,dataKey:s().string,unit:s().string,render:s().func}),groupSummary:s().shape({dataKey:s().string,unit:s().string,render:s().func}),shouldCellUpdate:s().func,headRender:s().func,render:s().func},Ml=(s().arrayOf(s().shape(ql)).isRequired,s().func,s().array,s().oneOfType([s().string,s().func]).isRequired,s().number,s().bool,s().bool,s().shape({api:s().func.isRequired,params:s().object.isRequired,formatter:s().func,beforeFetch:s().func,afterFetch:s().func,stopToFirst:s().bool,dataKey:s().string,callback:s().func}),s().bool,s().bool,s().string,s().string,s().bool,s().bool,s().bool,s().bool,s().oneOfType([s().object,s().func]),s().oneOfType([s().object,s().func]),s().array,s().func,s().bool,s().object,s().object,s().shape({type:s().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:s().array,selectedRowKeys:s().array,hideSelectAll:s().bool,checkStrictly:s().bool,filterable:s().bool,selectByClickRow:s().bool,selectFirstRowOnChange:s().bool,clearableAfterFetched:s().bool,selectAllOnCurrentPage:s().bool,fetchSelectedRows:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),fetchAllRowKeys:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),disabled:s().func,onChange:s().func,onSelect:s().func,onSelectAll:s().func}),s().shape({currentRowKey:s().oneOfType([s().number,s().string]),disabled:s().func,onChange:s().func}),s().shape({virtual:s().bool,doubleXScrollbar:s().bool}),s().shape({virtual:s().bool,expandIconColumn:s().string}),s().shape({defaultExpandAllRows:s().bool,defaultExpandedRowKeys:s().array,expandedRowKeys:s().array,hideExpandAll:s().bool,rowExpandable:s().func,expandedRowClassName:s().string,expandedRowRender:s().func,onExpand:s().func,onChange:s().func}),s().shape({cellMerge:s().bool,onCellMerge:s().func,onSelectChange:s().func}),s().shape({groupItems:s().arrayOf(s().shape({dataIndex:s().string.isRequired,titleIndex:s().string,color:s().string,backgroundColor:s().string})),fetch:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),onChange:s().func}),s().func,s().bool,s().bool,s().bool,s().bool,s().shape({current:s().number,pageSize:s().number,pageSizeOptions:s().array,showSizeChanger:s().bool,showQuickJumper:s().bool}),s().shape({fileName:s().string,fetch:s().shape({api:s().func.isRequired,params:s().object}),beforeExport:s().func,cellStyle:s().bool,hideIcon:s().bool}),s().shape({showLogo:s().bool}),s().shape({fetch:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),fieldList:s().arrayOf(s().object)}),s().shape({position:s().oneOf(["top","bottom"]),hideAlert:s().bool,hideClearButton:s().bool}),s().oneOf(["left","right"]),s().func,s().func,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().func,s().func,s().func,s().func,s().func,s().func,s().func,s().func,s().func,{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}),jl=10,Kl="1",Vl="0",zl="YYYY-MM-DD",Bl="YYYY-MM-DD HH:mm:ss",Ul="YYYYMMDDHHmmss",Wl={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Gl=function(e){return e.left="flex-start",e.right="flex-end",e}({});function Yl(e){const t=a.useRef();t.current=e;const r=a.useCallback((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current?.(...r)}),[]);return r}let Xl=0;const Ql={...a}.useId,Zl=Ql?function(e){const t=Ql();return e||t}:function(e){const[t,r]=a.useState(`qm_unique_${Xl}`);return a.useEffect((()=>{const e=Xl;Xl+=1,r(`qm_unique_${e}`)}),[]),e||t};let Jl=[];const es={getFocusInstance:function(){return Jl[0]??null},getInstance:function(e){return Jl.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==Jl.findIndex((e=>e===t))&&(this.deregister(e),Jl=[t,...Jl])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Jl=[{id:e,vm:t},...Jl])},deregister:function(e){e&&(Jl=Jl.filter((t=>t.id!==e)))}};function ts(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rs=class{constructor(){ts(this,"state",{required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]}),ts(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),ts(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)})),ts(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),ts(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)})),ts(this,"addToEdited",(e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)})),ts(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)})),ts(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),ts(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),ts(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),ts(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),ts(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),ts(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),ts(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}))}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}},ns={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"};function is(e){return void 0!==e}function as(e,t){const{defaultValue:r,value:n,onChange:i,postState:o}=t||{},[l,s]=a.useState((()=>is(n)?n:is(r)?"function"==typeof r?r():r:"function"==typeof e?e():e)),c=is(n)?n:l,d=o?o(c):c,u=Yl(i),[p,h]=a.useState([c]);return Pt((()=>{const e=p[0];l!==e&&u(l,e)}),[p]),Pt((()=>{is(n)||s(n)}),[n]),[d,Yl((e=>{s(e),h([c])}))]}let os;const ls=()=>{if(re)return 0;if(void 0!==os)return os;const e=document.createElement("div");e.className="qm-scrollbar__wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",e.appendChild(r);const n=r.offsetWidth;return e.parentNode?.removeChild(e),os=t-n,os},ss=e=>e.map((e=>{const t={...e};return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=ss(t.children)),t})),cs=(e,t)=>{const{fetch:r,columns:n,height:i,minHeight:a,maxHeight:l,border:s=!0,rowSelection:c,summation:d,expandable:u,treeConfig:p,webPagination:h,scrollPagination:m,showSuperSearch:g,showFastSearch:b,showGroupSummary:y,showTableImport:v,showClipboard:x,showSelectCollection:E,footRender:S}=e,{tableRef:w,getRowKey:C,tableFullData:T,tableData:I,selectionKeys:N,sorter:R,filters:P,superFilters:O,pagination:k,mergedTdCells:A}=t,{selectionRows:L,summaries:_}=w.current,{expandIconColumn:F=""}=p||{},H=o().useMemo((()=>!!r?.api),[r?.api]),D=o().useMemo((()=>!H&&!!h),[H,h]),$=o().useMemo((()=>H&&!!m),[H,m]),q=o().useMemo((()=>(H||D)&&!$),[H,D,$]),M=o().useMemo((()=>!!(i||a||l)),[i,a,l]),j=o().useMemo((()=>(e=>{const t=(e=>{const t=[],r=[],n=[];for(let i=0;i<e.length;i++){const a=e[i];"left"===a.fixed?t.push(a):"right"===a.fixed?r.push(a):n.push(a)}return[...t,...n,...r]})(ss(e)),r=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:ns.selectionColumn,title:"radio"===t?f("qm.table.config.selectionText"):"",width:ns.selectionColumnWidth,fixed:"left",type:t}})(c),n=(i=u,i?.expandedRowRender?{dataIndex:ns.expandableColumn,title:"",width:ns.selectionColumnWidth,fixed:"left",type:"expand"}:null);var i;return r&&t.unshift(r),n&&t.unshift(n),qr(t)})(n)),[n]),K=o().useMemo((()=>$r(j)),[j]),V=o().useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),z=o().useMemo((()=>K.filter((e=>!!e.summation))),[K]),B=o().useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),U=o().useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),W=o().useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const r=T.find((t=>C(t,t.index)===e.rowKey)),n=K.findIndex((t=>t.dataIndex===e.dataIndex));if(!r||n<0)return;const i={row:r.index,col:n,rowSpan:e.rowSpan,colSpan:e.colSpan};t.push(i);for(let r=1;r<e.colSpan;r++)for(let n=0;n<e.rowSpan;n++)t.push({row:i.row+n,col:i.col+r,rowSpan:0,colSpan:0});for(let r=1;r<e.rowSpan;r++)for(let n=0;n<e.colSpan;n++)t.push({row:i.row+r,col:i.col+n,rowSpan:0,colSpan:0})})),t})(A)),[A,K,T]),G=o().useMemo((()=>{const e=K.filter((e=>![ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(e.dataIndex)));return F&&e.some((e=>e.dataIndex===F))?F:e[0]?.dataIndex??""}),[K,F]),Y=o().useMemo((()=>z.length>0),[z]),X=o().useMemo((()=>!!S||Y),[S,Y]),Q=o().useMemo((()=>Gr(j).length>1),[j]),Z=o().useMemo((()=>s||Q),[s,Q]),J=o().useMemo((()=>K.some((e=>e.sorter))),[K]),ee=o().useMemo((()=>K.some((e=>e.filter))),[K]),te=o().useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),re=o().useMemo((()=>!H&&!!v),[H,v]),ne=o().useMemo((()=>!!x&&V.length>0),[x,V]),ie=o().useMemo((()=>!!E&&"checkbox"===c?.type),[E,c]),ae=o().useMemo((()=>!!g&&ee),[g,ee]),oe=o().useMemo((()=>!H&&!!b&&ee),[H,b,ee]),le=o().useMemo((()=>!!y&&K.some((e=>!!e.groupSummary))),[K]),se=o().useMemo((()=>!!d?.groupItems?.length),[d]),ce=o().useMemo((()=>T.some((e=>Array.isArray(e.children)))),[T]),de=o().useMemo((()=>!I.length),[I]),ue=o().useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:r,precision:n,displayPrecision:i,summation:a}=t,{sumBySelection:o,displayWhenNotSelect:l,unit:s}=a,c=se?dn(w.current.tableFullData):w.current.tableFullData,d=!L.length&&!!l;let u=(!o||d?c:L).reduce(((e,t)=>{if(t?.[ns.summaryIgnore])return e;const n=Zr(t,r);return tn(n)?e.plus(n):e}),new(Ii())(0));!Object.keys(_).includes(r)||o&&!d||(u=new(Ii())(Zr(_,r))),Jr(e,r,u.toNumber());let p=n>=0?u.toFixed(n):u.toString();i>=0&&""!==p&&(p=nn(p,i)),p=rn(p),Jr(e,`${r}_text`,s?`${p} ${s}`:p)})),[e]})()),[I,N,_]),pe=o().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),he=o().useMemo((()=>{const e=(e=>{const t=[];return Object.keys(e).forEach((r=>{null!==e[r]&&t.push(`${r}|${e[r]}`)})),t.join(",")})(R),t=((e,t)=>{const r=[];if(Object.keys(e).length)for(const t in e){const[n,i]=ns.showFilterType?t.split("|"):[t,""],a=e[t];Object.keys(a).forEach((e=>{r.push({type:i,bracketLeft:"",fieldName:n,expression:e,value:a[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{r.push({type:ns.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),r.length&&(r[r.length-1].logic=""),r})(P,O);return{...e?{[ns.sorterFieldName]:e}:null,...t.length?{[ns.filterFieldName]:t}:null,...pe?{[ns.groupSummary.summaryFieldName]:pe,usedJH:1}:null,...r?.params??null,[ns.currentPageName]:k.current,[ns.pageSizeName]:k.pageSize}}),[r?.params,k.current,k.pageSize,R,P,O,pe]);return{isFetch:H,isWebPagination:D,isScrollPagination:$,showPagination:q,shouldUpdateHeight:M,tableColumns:j,flattenColumns:K,editableColumns:V,summationColumns:z,leftFixedColumns:B,rightFixedColumns:U,derivedMergeCells:W,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Q,bordered:Z,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ie,isTableImport:re,isTableClipboard:ne,isSuperSearch:ae,isFastSearch:oe,isGroupSummary:le,isGroupSubtotal:se,isTreeTable:ce,isTableEmpty:de,summationRows:ue,fetchParams:he}},ds=require("react-dom");var us=n.n(ds);const ps=(e,t)=>{const{rowKey:r,height:n,dataSource:i,summation:a,fetch:l,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,treeConfig:h,authConfig:m,ignorePageIndex:f,columnsChange:g,onChange:b,onDataChange:y,onDataLoad:x,onScrollEnd:E,onFetchError:S}=e,{getRowKey:w,tableRef:C,tableElementRef:T,tableBodyRef:I,$size:N,tableColumns:R,flattenColumns:P,tableFullData:O,pagination:k,layout:A,filters:L,sorter:_,superFilters:F,fetchParams:H,selectionKeys:D,rowExpandedKeys:$,highlightKey:q,summationColumns:M,shouldUpdateHeight:j,isFetch:K,isTreeTable:V,isWebPagination:z,isScrollPagination:B,isServiceSummation:U,isGroupSubtotal:W,doLayout:G,setTableData:Y,setTableFlatColumns:X,setTableFullData:Q,setTableOriginData:Z,setTableFlatData:J,setAllTableData:ee,setDeriveRowKeys:re,setPagination:ne,setSpinning:ie,setSorter:ae,setFilters:le,setSuperFilters:se,setSelectionKeys:ce,setRowExpandedKeys:pe,setHighlightKey:he,setSelectionRows:me,setScrollXLoad:fe,setScrollYLoad:ge,setScrollXStore:be,setScrollYStore:ye,computeVirtualX:ve,computeVirtualY:xe,setFieldAuth:Ee,setResizeState:Se,setSummaries:we,setPermission:Ce,setRecordsMap:Te,resetTableScroll:Ie,clearElementStore:Ne,clearRecordsMap:Re}=t,{store:Pe,scrollBarRef:Oe}=C.current,ke=Number.parseInt(o().version)>=18?us().flushSync:null,Ae=o().useRef({...H}),Le=o().useRef(new Map),_e=o().useRef(!1),Fe=Nt(T);Pt((()=>{je(),C.current.scrollXLoad?Ve(Oe.current.scrollLeft):ze(),G()}),[R]),Pt((()=>{He()}),[Fe,N,n,A.tableAutoHeight]),Me((()=>{It(),Rt(),kt(),K||(z&>(),dt(i)),s&&ae(s),c&&le(c)}),[i,l?.params]),Me((()=>{const e=ot(H,Ae.current);e||K&&d?.clearableAfterFetched&&At(),!e&&H[ns.currentPageName]>1&&!l?.stopToFirst?gt():K&&st(),Ae.current=H}),[H]),Me((()=>{z&&St(),B||Ie(),nt()}),[k.current,k.pageSize]),Me((()=>{C.current.scrollYLoad&&We(Oe.current.scrollTop),K||De(O.length),G()}),[O]),Me((()=>{V&&C.current.scrollYLoad&&(bt(),St())}),[$]);const He=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:r}=C.current,{width:n,height:i}=r,{width:a,height:o}=Fe,l=a!==n,s=o!==i;G(),l&&e&&ze(),s&&j&&t&&Ge(),Se(Object.assign({},r,{width:a,height:o}))},De=e=>{e!==k.total&&ne((t=>Object.assign({},t,{total:e})))},$e=e=>{_e.current=e},qe=Ot((e=>{ht(),E?.(e)})),je=()=>{fe(P.length>ns.virtualScrollX)},Ke=function(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).length>ns.virtualScrollY;p?.virtual&&(e=!0),h?.virtual&&(e=!0),ge(e)},Ve=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollXStore:t}=C.current,{startIndex:r,endIndex:n,offsetSize:i}=t,{toVisibleIndex:a,visibleSize:o}=ve(e,A.tableWidth),l=Math.max(0,a-1-i),s=a+o+i;(a<=r||a>=n-o-1)&&(r===l&&n===s||(be(Object.assign({},t,{startIndex:l,endIndex:s})),ze()))},ze=()=>{Be(),Ue()},Be=()=>{const{scrollXLoad:e,scrollXStore:t}=C.current;if(!e)return;const r=[],n=[],i=[];for(let e=0;e<P.length;e++){const a=P[e];a.fixed?"left"===a.fixed?r.push(a):i.push(a):e>=t.startIndex&&e<t.endIndex&&n.push(a)}ke?queueMicrotask((()=>ke((()=>X([...r,...n,...i]))))):X([...r,...n,...i])},Ue=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:r}=C.current,{tableBodyWidth:n,gutterWidth:i}=A;let a="",o="";r&&(a=`${P.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,o=`${scrollY?n-i:n}px`),e.$tableBody.style.marginLeft=a,e.$tableXspace.style.width=o},We=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=C.current,{startIndex:r,endIndex:n,offsetSize:i,visibleSize:a,rowHeight:o}=t,{toVisibleIndex:l}=xe(e,o),s=Math.max(0,l-1-i),c=l+a+i;(l<=r||l>=n-a-1)&&(r===s&&n===c||(ye(Object.assign({},t,{startIndex:s,endIndex:c})),Ge()))},Ge=()=>{const{tableFlatData:e}=C.current;Et(e),(e=>{const{elementStore:t,scrollYStore:r,scrollYLoad:n}=C.current,{startIndex:i,rowHeight:a}=r;let o="",l="";n&&(o=`${Math.max(0,i*a)}px`,l=e.length*a+"px"),t.$tableBody.style.marginTop=o,t.$tableYspace.style.height=l})(e)},Ye=e=>W?Xe(Qe(e,0)):e,Xe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Xe(e.children)),delete e.children,t.push(e)})),t},Qe=(e,t)=>{const n=a.groupItems?.[t];return n?pn(e,[n.dataIndex]).map((e=>{const i={children:Qe(e,t+1),_group:n.dataIndex};return"function"!=typeof r&&Jr(i,r.toString(),ln()),n.titleIndex&&Jr(i,n.titleIndex,Zr(e[0],n.titleIndex)),Jr(i,n.dataIndex,Zr(e[0],n.dataIndex)),M.forEach((e=>{const{dataIndex:t}=e,r=i.children?.reduce(((e,r)=>{if(r[ns.summaryIgnore])return e;const n=Number(Zr(r,t));return Number.isNaN(n)?e:e+n}),0);Jr(i,t,r)})),i})):(e.forEach(((t,r)=>{t._rowSpan=0===r?e.length:0,t._colSpan=1})),e)},Ze=e=>{ce(e),me((e=>{const{selectionRows:t,allTableData:r,recordsMap:n}=C.current;if(K)return[...t.filter((t=>e.includes(w(t,t.index)))),...r.filter((r=>{const n=w(r,r.index);return e.includes(n)&&-1===t.findIndex((e=>w(e,e.index)===n))}))];const i=[];for(let t=0,r=e.length;t<r;t++){const r=e[t];n.has(r)&&i.push(n.get(r))}return i})(e))},Je=e=>{const{type:t,checkStrictly:r=!0}=d||{},n=Array.isArray(e)?e:D;let i=[];return C.current.treeTable&&!r&&n.forEach((e=>{i.push(...((e,t)=>{const{disabled:r}=d||{},{deriveRowKeys:n,recordsMap:i}=C.current,a=Ur(n,e);let o=[];if(!a)return o;let l=tt(a?.children||[]);return r&&(l=l.filter((e=>!i.has(e)||!r(i.get(e))))),o=[...new Set([...t,...l])],(mn(n,e)?.slice(0,-1).reverse()||[]).forEach((e=>{const t=Ur(n,e),r=t?.children?.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),i="radio"===t?n.slice(0,1):[...new Set([...n,...i])],i},et=e=>{const{allRowKeys:t,flattenRowKeys:r,deriveRowKeys:n}=C.current,{defaultExpandAllRows:i,expandedRowRender:a}=u||{},o=Array.isArray(e)?e:$;if(C.current.treeTable){a&&v("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];q&&e.unshift(q);let l=[];return e.forEach((e=>{const t=mn(n,e)||[];l.push(...t.length>1?t.slice(0,-1).reverse():t)})),l=i?t:[...new Set([...o,...l])],l.filter((e=>!r.includes(e)))}return u?i?t.slice(0):[...o]:[]},tt=e=>{const t=[];for(let r=0;r<e.length;r++)Array.isArray(e[r].children)&&t.push(...tt(e[r].children)),t.push(e[r].rowKey);return t},rt=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...rt(e.children,t)),e.rowKey===t&&e.parentRowKey&&r.push(e.parentRowKey)})),r.length&&r.push(...rt(e,r[r.length-1])),r},nt=Ot((()=>{b?.(k,at(L),it(_),F,{currentDataSource:xt()})})),it=e=>{const t={};for(const r in e)null!==e[r]&&(t[r]=e[r]);return t},at=e=>{const t={};for(const r in e){if(!r.includes("|"))continue;const[n,i]=r.split("|");t[ns.showFilterType?`${n}|${i}`:n]=e[r]}return t},ot=(e,t)=>{const r=Object.keys(Qr(e,t));return 1===r.length&&(r.includes(ns.currentPageName)||r.includes(ns.pageSizeName))},lt=async()=>{if(!l)return;const{formatter:e=(e=>e),beforeFetch:t=oe,afterFetch:r,callback:n}=l;if(!t(H))return;const i=!!a?.fetch?.api;ie(!0);try{const[t,o]=i?await Promise.all([l.api(e(H)),a.fetch.api(e(H))]):[await l.api(e(H))];if(C.current.unMounted)return;if(i?200===t.code&&200===o.code:200===t.code){const e=l.dataKey??ns.dataKey;let i=(0,te.get)(t.data,e)??[];i="function"==typeof r?await r(i):i;const a=(0,te.get)(t.data,e.replace(/[^.]+$/,ns.totalKey))||i.length||0,s=Math.max(Math.ceil(a/k.pageSize),1);if(H[ns.currentPageName]>s)return mt({...k,current:s});dt(_e.current?C.current.tableFullData.concat(i):i),De(a),ut(o?.data||t.data),n?.(t.data,t)}}catch(e){S?.(e)}((e,t)=>Object.prototype.hasOwnProperty.call(e,"stopToFirst"))(l)&&(l.stopToFirst=!1),ie(!1),$e(!1)},st=Ot(lt),ct=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=ct(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:r}=k;return!K||B?e:(t-1)*r+e})(t)),e))),dt=e=>{const t=Ye(ct(e));wt(t),Ct(t),Ze(Je()),pe(et()),pt(),x?.(t)},ut=e=>{if(!U)return;const t=a?.fetch?.dataKey??ns.summationKey,r=(t?(0,te.get)(e,t):e)??{},n={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{Jr(n,e.dataIndex,Number(Zr(r,e.summation.dataKey)))})),we(n)},pt=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=xt();if(e.length){const t=w(e[0],e[0].index);Ze([t])}else Ze([])}},ht=()=>{if(!B)return;const e=ft();_e.current||k.current>=e||($e(!0),mt({...k,current:k.current+1}))},mt=e=>{let{current:t,pageSize:r}=e;ne((e=>Object.assign({},e,{current:t,pageSize:r})))},ft=()=>{const{pageSize:e,total:t}=k;return Math.ceil(t/e)||1},gt=()=>{mt(Object.assign({},k,{current:1}))},bt=()=>{const{scrollYLoad:e,deriveRowKeys:t}=C.current;if(!C.current.treeTable||!e)return;const r=yt(t,(()=>{const{allTableData:e,allRowKeys:t}=C.current,{rowExpandable:r}=u||{},n=[];return"function"==typeof r&&e.forEach(((e,i)=>!r(e)&&n.push(t[i]))),n.length?$.filter((e=>!n.includes(e))):$})());Le.current.clear(),r.forEach(((e,t)=>Le.current.set(e,t)))},yt=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...yt(e.children,t)),(void 0===e.parentRowKey||t.includes(e.parentRowKey)&&e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1)))&&r.push(e.rowKey)})),r},vt=()=>{const{current:e,pageSize:t}=k;return C.current.tableFullData.slice((e-1)*t,e*t)},xt=()=>z?vt():C.current.tableFullData,Et=e=>{const{scrollYLoad:t,scrollYStore:r}=C.current;if(!t)return Y(e);const{startIndex:n,endIndex:i}=r;ke?queueMicrotask((()=>ke((()=>Y(e.slice(n,i)))))):Y(e.slice(n,i))},St=()=>{(()=>{let e=xt();C.current.treeTable&&h?.virtual&&(e=(e=>{const{recordsMap:t,allRowKeys:r}=C.current,n=[];for(let e=0,i=r.length;e<i;e++){const i=r[e];Le.current.has(i)&&n.push(t.get(i))}return n})()),Ke(e),J(e)})(),Ge()},wt=e=>{Q(e),ee(e),re(e),Tt(),bt(),St()},Ct=e=>{Z(e)},Tt=()=>{Re(),C.current.allTableData.forEach((e=>Te(w(e,e.index),e)))},It=()=>{ae({})},Rt=()=>{le({})},kt=()=>{se([])},At=()=>{Ze([])};return{initialTable:()=>{(async()=>{if(!m)return;let t=ue(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:n}=m.fetch;try{const i=await e(r);200===i.code&&(t=(n?(0,te.get)(i.data,n):i.data)??{})}catch(e){}}if(Object.keys(t).length){const{isExport:e=1,isImport:r=1,isPrint:n=1}=t;Ce((t=>Object.assign({},t,{export:!!e,import:!!r,print:!!n})))}if(Array.isArray(t.fieldList)){const{originColumns:r}=C.current,n=jr(e.columns,(e=>{const{dataIndex:n}=e,i=t.fieldList.find((e=>e.dataIndex===n));if(i){const{visible:t=1,disabled:a,secretName:o}=i,l=Kr(r,n);Ee(n,{visible:t,disabled:a,secretName:o}),t||(e.noAuth=!0,l.noAuth=!0),o&&(e.formatType=`secret-${o}`,l.formatType=`secret-${o}`)}}));g?.(n)}})(),q&&I.current.setClickedValues([q,""]),"radio"===d?.type&&D.length&&I.current.setClickedValues([D[0],""]),je(),Ke(),K?lt():dt(i)},checkDataIndex:()=>{const e=P.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&v("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:wt,getTableData:lt,handleTableData:Et,createWebPageData:vt,createTableData:dt,createGroupData:Ye,createSelectionKeys:Je,createRowExpandedKeys:et,setSelectionKeysEffect:Ze,findParentRowKeys:rt,getAllChildRowKeys:tt,doFieldValidate:(e,t,r,n)=>{if(!Array.isArray(e))return v("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Pe.removeFromRequired({x:r,y:n}),Pe.removeFromValidate({x:r,y:n}),e.forEach((e=>{e.required&&de(t)&&Pe.addToRequired({x:r,y:n,text:e.message}),"function"!=typeof e.validator||e.validator?.(t)||Pe.addToValidate({x:r,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:r,updated:n,removed:i}=Pe.state,a=(0,te.intersection)(r,i),o=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:o(e),validate:o(t),inserted:r.filter((e=>!a.includes(e))),updated:n.filter((e=>![...(0,te.intersection)(n,r),...(0,te.intersection)(n,i)].includes(e))),removed:i.filter((e=>!a.includes(e)))}},dataChange:()=>{y?.(C.current.tableFullData)},tableChange:nt,toLastPage:()=>{const e=ft();k.current!==e&&mt(Object.assign({},k,{current:e}))},toFirstPage:gt,getPageCount:ft,pagerChangeHandle:mt,triggerScrollXEvent:e=>{Ve(e)},triggerScrollYEvent:e=>{We(e)},scrollBottomDebouncer:qe,clearTableSorter:It,clearTableFilter:Rt,clearSuperFilters:kt,clearRowSelection:At,clearRowHighlight:()=>{he("")},clearTableLog:()=>{Pe.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=C.current;Ne(),Pe.destroy(),e.deregister(t)}}},hs=(e,t)=>{const{height:r,minHeight:n,maxHeight:i,ellipsis:a,showHeader:l,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,$size:h,tableColumns:m,flattenColumns:f,leftFixedColumns:g,derivedMergeCells:b,layout:y,scrollX:v,scrollY:x,showFooter:E,showPagination:S,isFullScreen:w,setLayout:C,setScrollX:T,setScrollY:I,setElementStore:N,setScrollXStore:R,setScrollYStore:P,setShouldToTop:O}=t,k=o().useRef(x),A=o().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=y,a={};return n&&Object.assign(a,{minHeight:`${Xr(n)}px`}),i&&Object.assign(a,{maxHeight:`${Xr(i)}px`}),w?{...a,maxHeight:"",minHeight:"",height:`${e}px`}:r?{...a,height:"auto"!==r?`${Xr(r)}px`:`${t}px`}:a}),[r,i,n,w,y]),L=()=>{const{elementStore:e,scrollYLoad:t,resizeState:r}=d.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,i=l?e.$header.offsetHeight:y.headerHeight,a=E?e.$footer.offsetHeight:y.footerHeight,o=n-i-a,s=e.$tableBody.offsetHeight,c=t||s>o;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+jl:0,n=e.$pager?e.$pager.offsetHeight+jl:0;u=r.winHeight-t-n-20}(t||o!==y.viewportHeight)&&F(o),k.current=c,I(c),C((e=>Object.assign({},e,{headerHeight:i,footerHeight:a,viewportHeight:o,tableBodyHeight:s,tableFullHeight:u})))},_=(e,t)=>{const r=e+t;let n=-1,i=0,a=0;for(let t=0,o=f.length;t<o;t++){const o=f[t];if(i+=o.width||o.renderWidth,-1===n&&e<i&&(n=t),n>=0&&(a++,i>r))break}return{toVisibleIndex:Math.max(0,n),visibleSize:Math.max(8,a)}},F=e=>{const{scrollBarRef:t,scrollYStore:r,isIE:n}=d.current,i=t.current.scrollTop,{rowHeight:a}=r,{toVisibleIndex:o}=H(i,a),l=Math.max(8,Math.ceil(e/a)+2),s=n?5:0,c=Math.max(0,o-1-s),u=Math.max(o+l+s,r.endIndex);P(Object.assign({},r,{visibleSize:l,offsetSize:s,startIndex:c,endIndex:u}))},H=(e,t)=>{const r=Math.floor(e/t);return{toVisibleIndex:Math.max(0,r)}},D=(e,t)=>{const{scrollBarRef:r,elementStore:n,scrollYStore:i,scrollYLoad:a,tableFlatData:o}=d.current;if(void 0!==t&&t>=0)r.current.SET_SCROLL_TOP(t*i.rowHeight);else if(a){const t=o.findIndex((t=>e===c(t,t.index)));t>=0&&r.current.SET_SCROLL_TOP(t*i.rowHeight)}else{const t=n.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);t&&r.current.SET_SCROLL_TOP(t.offsetTop)}};return{createElementStore:()=>{N("$toper",u.current),N("$table",p.current)},tableStyles:A,getSpan:(e,t,r,n,i)=>{let a=1,o=1;if("function"==typeof s){const l=s({row:e,column:t,rowIndex:r,columnIndex:n,tableData:i});Array.isArray(l)?(a=l[0],o=l[1]):(0,te.isPlainObject)(l)&&(a=l.rowSpan,o=l.colSpan)}if(b.length>0){const e=b.find((e=>e.row===r&&e.col===n));e&&(a=e.rowSpan,o=e.colSpan)}return{rowSpan:a,colSpan:o}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Vr(Kr(m,e)).dataIndex);let t=0;for(let r=0;r<f.length;r++){const n=f[r];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=zr(Kr(m,e)).dataIndex);const r="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let r=[];return e.forEach((e=>{e.colSpan>0&&r.length>0&&(t.push(r),r=[]),r.push(e)})),r.length>0&&t.push(r),t.map((e=>{const[t,r]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...r,...t.reverse()]})).flat()})(f):f;let n=0;for(let t=r.length-1;t>=0;t--){const i=r[t];if(i.dataIndex===e)break;n+=i.width||i.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const{scrollBarRef:r}=d.current,n=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(n<0)return;const i=g.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),a=f.slice(0,n).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);r.current.SET_SCROLL_LEFT(a-i)},scrollYToRecord:D,rowInViewport:e=>{const{scrollBarRef:t,scrollYStore:r}=d.current,{viewportHeight:n,gutterWidth:i}=y,a=e*r.rowHeight;return!(a<t.current.scrollTop||a+r.rowHeight>t.current.scrollTop+(v?n-i:n))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,n=t.winHeight-e.$table.getBoundingClientRect().top-(S?Fi["small"!==h?"middle":h]+jl:0)-jl;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&D("",0),O(!0)},computeVirtualX:_,computeVirtualY:H,doLayout:()=>{a?L():se((()=>L())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,r=e.$table.clientWidth,n=k.current?y.gutterWidth:0,{defaultColumnWidth:i}=ns,a=[];let o=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,o+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||i)),0);if(e<=r-n){T(!1);const t=r-n-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||i)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||i)),0);let r=0;a.forEach(((t,n)=>{if(0===n)return;const a=Math.floor((t.minWidth||i)*e);r+=a,t.renderWidth=(t.minWidth||i)+a})),a[0].renderWidth=(a[0].minWidth||i)+t-r}}else T(!0),a.forEach((e=>{e.renderWidth=e.minWidth||i}));C((t=>({...t,tableBodyWidth:Math.max(e,r)})))}else o=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||i)),0),T(o>r),C((e=>({...e,tableBodyWidth:o})));C((e=>({...e,tableWidth:r}))),t&&(e=>{const{scrollXStore:t,isIE:r,scrollBarRef:n}=d.current,i=n.current.scrollLeft,{toVisibleIndex:a,visibleSize:o}=_(i,e),l=r?5:0,s=Math.max(0,a-1-l),c=Math.max(a+o+l,t.endIndex);R(Object.assign({},t,{visibleSize:o,offsetSize:l,startIndex:s,endIndex:c}))})(r)})()}}},ms=e=>{const{total:t}=e,{tableRef:r,selectionKeys:n,isHeadSorter:i,isHeadFilter:a,isTreeTable:l,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p}=o().useContext($l),{infoBarConfig:h,rowSelection:m,rowHighlight:g}=r.current.props,{allTableData:b,invalidRowKeys:y}=r.current,{hideAlert:v,hideClearButton:x}=h||{},E=o().useMemo((()=>!v),[v]),S=o().useMemo((()=>!x&&!!(i||a||m||g)),[x,i,a,m,g]),w=Ce("table"),C={[`${w}__alert`]:!0};return E?o().createElement("div",{className:we()(C)},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.InfoCircleFilled,null)),o().createElement("span",null,f("qm.table.alert.total",{total:l?b.length:t}),m?`,${f("qm.table.alert.selected",{total:Math.max(n.length-y.length,0)})}`:""),S&&o().createElement("em",{onClick:()=>{c(),d(),u(),p(),se((()=>s()))}},f("qm.table.alert.clear"))):null},fs=o().forwardRef(((e,t)=>{const{isFullScreen:r,open:n=!0}=e,{setFullScreen:i}=o().useContext($l),a=()=>{i(!r)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table");return n?o().createElement("span",{className:`${l}-full-screen`,title:f(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},r?o().createElement(Te.FullscreenExitOutlined,null):o().createElement(Te.FullscreenOutlined,null))):null}));fs.displayName="FullScreen";const gs=fs,bs=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{getTableData:n}=o().useContext($l),i=()=>{n()};o().useImperativeHandle(t,(()=>({clickHandle:i})));const a=Ce("table");return r?o().createElement("span",{className:`${a}-reload`,title:f("qm.table.refresh.text"),onClick:()=>i()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.ReloadOutlined,null))):null}));bs.displayName="Reload";const ys=bs,vs=()=>{const e={dateFormat:e=>{const t=e?u()(e).format(zl):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?u()(e).format(Bl):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?u()(e).format(Bl.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>tn(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>rn(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,r,n)=>{const{dictItems:i,precision:a,displayPrecision:o,formatType:l,editRender:s}=r,c=i||s?.(n,r)?.items||[];let d=c.find((e=>e.value==t))?.text??t??"";if(Array.isArray(t)&&(d=t.map((e=>c.find((t=>t.value==e))?.text??e)).join(",")),a>=0&&""!==d&&(d=tn(d)?new(Ii())(d).toFixed(a):d),o>=0&&""!==d&&(d=nn(d,o)),l){const t=e[`${ce(l)}Format`];t?d=t(d):v("Table","字段的格式化类型 `formatType` 配置不正确")}return d},r=e=>ne(e)?sn(e).join(""):e??"";return{renderText:t,getTitleFromCellNode:r,getTitleFromCellValue:(e,n,i,a)=>{const o=Zr(e,n.dataIndex),l=n.render?n.render(o,e,n,i,a):t(o,n,e);return r(l)}}},xs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,{global:i}=o().useContext(c),{tableRef:a,flattenColumns:l,summationRows:s,showSummary:d,getSpan:u}=o().useContext($l),{tablePrint:p,showHeader:h}=a.current.props,{getTitleFromCellValue:m}=vs(),g=i?.print?.leftLogo??"",b=i?.print?.rightLogo??"",y=!(!g&&!b),v=o().useMemo((()=>pe(Br(r,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn]))),[r]),x=o().useMemo((()=>pe(Br(l,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn]))),[l]),E=o().useMemo((()=>pe(r.filter((e=>e.printFixed)))),[r]),S=e=>{const t=Object.assign({},hn(v,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?S(t):t},w=(e,t)=>(0,te.map)((0,te.groupBy)((0,te.flatten)(e),t),(0,te.spread)((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,te.mergeWith)(...r,((e,r)=>{if(Array.isArray(e))return w(e.concat(r),t)}))}))),C=()=>{const{allTableData:e}=a.current,t=(e=>{const t=[];let r=[],n=0,i=0;for(;i<e.length;){const a=e[i];n+=a.width||a.renderWidth||a.minWidth||ns.defaultColumnWidth,n<=ns.printWidth?(r.push(a),i===e.length-1&&t.push(r),i++):i>0?(e.splice(0,i),E.length&&e.unshift(...E),t.push(r),r=[],n=0,i=0):(a.width=ns.printWidth,r.push(a),t.push(r),i++)}return t})([...x]),r=(e=>{const t=[];return e.forEach((e=>{let r=[];e.forEach((e=>{1===e.level?r.push(e):r.push(S(e))})),r=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const r=e.filter((e=>e.dataIndex===t));return r.length<=1?r[0]:w(r,"dataIndex")[0]})))(r),t.push(Gr(r))})),t})(t);let n=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let i=0;i<t.length;i++)n+=T(r[i],t[i],e),n+='<div class="page-break"></div>';return n+"</body></html>"},T=(e,t,r)=>{const{showLogo:n=!0}=p;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((e=>{let{width:t,minWidth:r,renderWidth:n}=e;return`<col style="width:${t||n||r||ns.defaultColumnWidth}px">`})).join("")}</colgroup>`,h&&(i+=["<thead>",n&&y?`<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">',g?`<img src="${g}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',b?`<img src="${b}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:r}=e;return 0===r?null:`<th colspan="${r}" rowspan="${t}">${cn(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),r.length&&(i+=`<tbody>${r.map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:i,colSpan:a}=u(e,t,e.index,n,r);return i&&a?`<td rowspan="${i}" colspan="${a}">${m(e,t,e.index,n)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),d&&s.length&&(i+=["<tfoot>",s.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:i,summation:a}=t,o=a?.render?a.render(r):Zr(e,`${i}_text`);return`<td>${0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},I=()=>{((e,t)=>{const{filename:r,type:n,isDownload:i}={filename:"print",type:"html",isDownload:!1},a=`${r}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!i)return Promise.resolve({type:n,content:t,blob:e});Dt(e,a)}})(0,C())?.then((e=>{let{content:t,blob:r}=e,n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.setAttribute("height","0"),n.style.display="none",document.body.appendChild(n),a.current.isIE?(n.contentDocument.write(t),n.contentDocument.execCommand("print"),n.parentNode.removeChild(n),n=null):(n.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{n.parentNode.removeChild(n),n=null}))},n.src=URL.createObjectURL(r))}))};o().useImperativeHandle(t,(()=>({clickHandle:I})));const N=Ce("table");return n?o().createElement("span",{className:`${N}-print`,title:f("qm.table.print.text"),onClick:()=>I()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.PrinterOutlined,null))):null}));xs.displayName="TablePrint";const Es=xs,Ss=require("exceljs");var ws=n.n(Ss);const Cs="606060",Ts="thin",Is="d4d4d4",Ns=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Rs=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Ps=()=>({top:{style:Ts,color:{argb:Is}},left:{style:Ts,color:{argb:Is}},bottom:{style:Ts,color:{argb:Is}},right:{style:Ts,color:{argb:Is}}}),Os=e=>{const{children:t}=e;return t&&t.length?Os(t[0]):e},ks=e=>{const{precision:t,formatType:r}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===r?{numFmt:n?`0${n}%`:"0%"}:"finance"===r?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},As=()=>{const{tableRef:e,getSpan:t,showSummary:r,isHeadGroup:n}=o().useContext($l),{spanMethod:i,showHeader:a}=e.current.props,l=(e,t)=>e.find((e=>e.text==t))?.value??t??"";return{exportXLSX:async(o,l,s,c)=>{const{columns:d,footSummation:u}=o,{scrollYStore:{rowHeight:p}}=e.current,h=$r(d),m=Gr(d),g=[],b=[],y=[],v=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,width:r,minWidth:n,renderWidth:i}=e;E[t]=cn(e.title),y.push({key:t,width:(r||i||n||ns.defaultColumnWidth)/8})})),a&&(n?m.forEach(((e,t)=>{const r={};e.forEach((e=>{const{colSpan:n,rowSpan:i}=e,a=Os(e),o=h.findIndex((e=>{let{dataIndex:t}=e;return t===a.dataIndex}));r[a.dataIndex]=cn(e.title),0!==n&&(n>1||i>1)&&v.push({s:{r:t,c:o},e:{r:t+i-1,c:o+n-1}})})),g.push(r)})):(h.forEach(((e,t)=>{const{colSpan:r,rowSpan:n}=e;(r>1||n>1)&&v.push({s:{r:x,c:t},e:{r:x+n-1,c:t+r-1}})})),g.push(E)),x+=g.length);const S=l.map(((e,r)=>{const n={};return h.forEach(((a,o)=>{if("function"==typeof i){const{rowSpan:n,colSpan:i}=t(e,a,r,o,l);(i>1||n>1)&&v.push({s:{r:r+x,c:o},e:{r:r+x+n-1,c:o+i-1}})}const s=["percent","finance"].includes(a.formatType);n[a.dataIndex]=s?Zr(e,a.dataIndex):c(e,r,a,o)})),n}));x+=S.length,r&&u&&s(h,l).forEach(((e,t)=>{const r={};h.forEach(((t,n)=>{const{dataIndex:i,summation:a}=t,o=a?.render?a.render(l):Zr(e,i);r[i]=0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o})),b.push(r)}));const{sheetName:w,useStyle:C}=o,T=new(ws().Workbook),I=T.addWorksheet(w);I.columns=y,a&&I.addRows(g).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n,theadAlign:i}=r;Rs(e,i||n),C&&Object.assign(e,{font:{bold:!0,color:{argb:Cs}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Ps()})}))})),I.addRows(S).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n}=r;Rs(e,n),Object.assign(e,ks(r)),C&&Object.assign(e,{font:{color:{argb:Cs}},border:Ps()})}))})),r&&u&&I.addRows(b).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n}=r;Rs(e,n),Object.assign(e,ks(r)),C&&Object.assign(e,{font:{color:{argb:Cs}},border:Ps()})}))})),v.forEach((e=>{let{s:t,e:r}=e;I.mergeCells(t.r+1,t.c+1,r.r+1,r.c+1)}));const N=await T.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const r=e=>{let t=e;const r=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),n=-1!==e.indexOf('"');return n&&(t=t.replace(/"/g,'""')),(r||n)&&(t='"'+t+'"'),t},n="\ufeff"+(e=>{let t,n,i,a,o="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],n=0;n<i.cells.length;n+=1)a=i.cells[n],o=o+(n?",":"")+r(a.textContent.trim());o+="\r\n"}return o})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,r)=>{t=t||"",r=r||512;const n=window.atob(e),i=[];let a;for(a=0;a<n.length;a+=r){const e=n.slice(a,a+r),t=new Array(e.length);let o;for(o=0;o<e.length;o+=1)t[o]=e.charCodeAt(o);const l=new window.Uint8Array(t);i.push(l)}return new window.Blob(i,{type:t})})((i=n,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:r,file:n}=e,i=$r(r),a=new FileReader;a.onerror=()=>{L.message.error(f("qm.table.import.error"))},a.onload=e=>{const r=i.map((e=>cn(e.title))),n=new(ws().Workbook),a=e.target;a?n.xlsx.load(a.result).then((e=>{const n=e.worksheets[0];if(n){const e=n.getSheetValues(),a=e.findIndex((e=>e&&e.length>0)),o=e[a],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(r,o);if(s){const n=e.slice(a+1).map((e=>{const t={};e.forEach(((e,r)=>{let n=e;Array.isArray(n?.richText)&&(n=n.richText.map((e=>e.text)).join("")),(0,te.isPlainObject)(n)&&"text"in n&&(n=n.text),(0,te.isDate)(n)&&(n=on(n,Bl)),n?.formula&&(n=n.result??n.value),t[o[r]]=n}));const n={};return r.forEach(((e,r)=>{const{dataIndex:a,dictItems:o}=i[r];Array.isArray(o)&&(t[e]?.toString().includes(",")?t[e]=t[e].split(",").map((e=>l(o,e))).filter((e=>""!==e)):t[e]=l(o,t[e])),Jr(n,a,t[e])})),n}));t?.(n)}else L.message.error(f("qm.table.import.error"))}else L.message.error(f("qm.table.import.error"))})):L.message.error(f("qm.table.import.error"))},a.readAsArrayBuffer(n)}}},Ls=e=>{const{fileType:t,onChange:r}=e;let n,i;const a=Ce("table"),l=e=>{const t=e.name,r=t.lastIndexOf("."),n=t.substring(r+1,t.length);return{filename:t.substring(0,r),type:n}};return o().createElement(be,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return n||(n=document.createElement("form"),i=document.createElement("input"),n.className=`${a}--file-form`,i.name="file",i.type="file",n.appendChild(i),document.body.appendChild(n)),new Promise(((e,r)=>{const a=!t.type;i.multiple=!!t.multiple,i.accept=a?"":`.${t.type}`,i.onchange=o=>{const{files:s}=o.target,c=s[0];let d="";if(!a)for(let e=0;e<s.length;e++){const{type:r}=l(s[e]);if(t.type!==r){d=r;break}}d?(L.message.warning(f("qm.upload.notType",{type:d})),r()):e(c),document.body.removeChild(n),n=null,i=null},n.reset(),i.click()}))})({type:t});r?.(e.name,e)}catch(e){}})()},f("qm.upload.text"))},_s=e=>{const{columns:t,onClose:r}=e,{tableRef:n,createTableData:i,dataChange:a}=o().useContext($l),{beforeTableImport:l}=n.current.props,{importXLSX:s}=As(),c=o().useRef(null),[d,u]=o().useState(!1),[p,h]=o().useState(!0),m=e=>e.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))),[g,b]=o().useState([{type:"INPUT",label:f("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:r}=t.GET_FIELDS_VALUE(["fileName"]);return o().createElement(o().Fragment,null,r?o().createElement("span",null,r):o().createElement(Ls,{fileType:t.state.formData.fileType,onChange:(e,r)=>{t.SET_FIELDS_VALUE({fileName:e,file:r}),r&&h(!1)}}))}},{type:"SELECT",label:f("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:f("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:f("qm.table.import.fillText"),value:"fill"},{text:f("qm.table.import.addText"),value:"add"},{text:f("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{g.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,b([...g])}},{type:"INPUT_NUMBER",label:f("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),y=Ce("table");return o().createElement("div",{className:`${y}-import__setting`},o().createElement(Go,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:g,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:d,disabled:p,onClick:()=>(async()=>{const[e,o]=await c.current.GET_FORM_DATA();e||(u(!0),s({columns:m(t),file:o.file},(async e=>{const{tableFullData:t,store:s}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof l)try{e=await l(e)}catch(e){}if("fill"===o.importType&&i(e),"add"===o.importType&&i([...t,...e]),"insert"===o.importType){const{tableFullData:t}=n.current,r=o.posIndex,a=t.slice(0,r).concat(e).concat(t.slice(r));i(a)}e.forEach((e=>{s.addToInserted(e)})),a(),L.message.success(f("qm.table.import.success",{total:e.length})),u(!1),r()})))})()},f("qm.table.import.text"))))},Fs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,[i,a]=o().useState(!1),l=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:l})));const s=Ce("table"),c={[`${s}-import`]:!0},d={visible:i,title:f("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:we()(c),title:f("qm.table.import.textNoSpace"),onClick:()=>l()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.ImportOutlined,null))),o().createElement(Er,d,o().createElement(_s,{columns:r,onClose:()=>a(!1)})))}));Fs.displayName="TableImport";const Hs=Fs,Ds=e=>{const{columns:t,onChange:r}=e,{$size:n}=o().useContext($l),i=o().useRef([]),[a,l]=o().useState(!1),[s,c]=o().useState(t);Me((()=>{u()}),[s]),o().useEffect((()=>{d()}),[t]);const d=()=>{const e=[];t.forEach(((r,n)=>{const i=r.colSpan;i>1&&t.slice(n+1,n+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(t.slice(n,n+i))})),i.current=e},u=()=>{const e=[];s.forEach((t=>{const{colSpan:r,dataIndex:n}=t;if(0===r)return;if(1===r)return e.push(t);const a=i.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...i.current[a].map(((e,r)=>{let{dataIndex:n}=e;const i=s.find((e=>e.dataIndex===n));return r>0&&void 0!==t.hidden&&(i.hidden=t.hidden),i})))})),r?.(e)},p=Ce("table"),h={[`${p}__popper`]:!0,"column-filter__popper":!0,[`${p}--lg`]:"large"===n,[`${p}--sm`]:"small"===n},m=[`${p}-column-filter`,{selected:a}];return o().createElement(Wi(),{action:["click"],popupVisible:a,popup:o().createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},o().createElement("div",{className:"main"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),r=s.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||c(bn(e))}},s.map((e=>((e,t)=>{const{colSpan:r}=e;if(0===r)return o().createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle","main-handle"];return o().createElement("li",{key:e.dataIndex,className:"item"},o().createElement(L.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,c([...s])}}),o().createElement("i",{className:we()(n),title:f("qm.table.columnFilter.draggable")},o().createElement(Te.HolderOutlined,null)),o().createElement("span",{className:"text"},cn(e.title)))})(e)))))),popupClassName:we()(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{l(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("span",{className:we()(m),title:f("qm.table.columnFilter.text")},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.SettingOutlined,null)),o().createElement("span",null,f("qm.table.columnFilter.text"))))},$s=e=>{const{defaultValue:t,onClose:r,onOk:n}=e,{tableRef:i,selectionKeys:a,pagination:l,showSummary:s}=o().useContext($l),{rowSelection:c}=i.current.props,d=o().useRef(null),[p,h]=o().useState(!1),m=o().useMemo((()=>Object.assign({},{fileName:`${u()().format(Ul)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:a.length?"selected":"all","startIndex|endIndex":[1,l.total],footSummation:s?1:0,useStyle:0},t,{columns:pe(t.columns||[])})),[]),[g,b]=o().useState([{type:"INPUT",label:f("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:f("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:f("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:f("qm.table.export.all"),value:"all"},{text:f("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==c?.type},{text:f("qm.table.export.custom"),value:"custom"}]},onChange:e=>{g.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,b([...g])}},options:{min:1},disabled:!0},{type:"INPUT",label:f("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>o().createElement(Ds,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:f("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:f("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),y=Ce("table");return o().createElement("div",{className:`${y}-export__setting`},o().createElement(Go,{ref:d,initialValues:m,items:g,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await d.current.GET_FORM_DATA();if(!e){h(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),await le(1e3),h(!1),r()}})()},f("qm.table.export.text"))))},qs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,{global:i}=o().useContext(c),{tableRef:a,flattenColumns:l,pagination:s,fetchParams:d,isFetch:p,isGroupSubtotal:h,showSummary:m,getSpan:g}=o().useContext($l),{exportExcel:b,fetch:y,showHeader:v}=a.current.props,{getTitleFromCellValue:x}=vs(),[E,S]=o().useState(!1),[w,C]=o().useState(!1),T=o().useMemo((()=>!!b?.fetch?.api),[b]),I=o().useMemo((()=>!s.total||w),[s.total,w]),N=o().useMemo((()=>Br(r,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn])),[r]),R=o().useMemo((()=>Br(l,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn])),[l]),P=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.map(((e,n)=>{const i={...e,index:n,pageIndex:n},a=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=a,i._level=r,Array.isArray(e.children)&&(i.children=P(e.children,a,r+1)),R.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&Jr(i,t,Zr(i,t))})),i}))},O=(e,t)=>{const r={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,i=(h?dn(t):t).reduce(((e,t)=>{if(t?.[ns.summaryIgnore])return e;const r=Number(Zr(t,n));return Number.isNaN(r)?e:e+r}),0);Jr(r,n,i)})),[r]},k=(e,t,r,n)=>{const{precision:i,formatType:a}=r;let o=x(e,r,t,n);return i>=0&&!a&&""!==o&&(o=Number(o)),o},{exportXLSX:A,exportCSV:_}=As(),F=async e=>{const{api:t,formatter:r=(e=>e),afterFetch:n,dataKey:i}=y;let a=[];try{C(!0);const o=await t({...r(d),[ns.currentPageName]:1,[ns.pageSizeName]:e??s.total});if(200===o.code){let e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,i)??[];e="function"==typeof n?await n(e):e,a=Wr(P(e))}}catch(e){}return C(!1),a},H=e=>{const t=i?.table?.recordExportLog;try{t?.({fileName:e})}catch(e){}},D=b?.fileName??`${u()().format(Ul)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),q=()=>{if(I)return L.message.warning(f("qm.table.export.warnText"));T?(async e=>{C(!0);try{const{api:t,params:r}=b.fetch,n=await t({columns:R.map((e=>{const{title:t,dataIndex:r,hidden:n}=e,{type:i}=e.filter||{};return{title:t,dataIndex:r,type:i,hidden:n}})),...d,...r,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[ns.currentPageName]:void 0,[ns.pageSizeName]:void 0});n.data&&(Dt(n.data,e),H(e))}catch(e){}C(!1)})(D):S(!0)};o().useImperativeHandle(t,(()=>({clickHandle:q})));const M=Ce("table"),j={[`${M}-export`]:!0},K={visible:E,title:f("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},V={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:N,useStyle:b?.cellStyle?1:0};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:we()(j),title:f("qm.table.export.textNoSpace"),onClick:()=>q()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.DownloadOutlined,null))),o().createElement(Er,K,o().createElement($s,{defaultValue:V,onClose:()=>S(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:r,exportType:n,startIndex:i=1,endIndex:o}=e,{allTableData:l,selectionRows:s}=a.current;let c=[];if(p?("all"===n&&(c=await F()),"custom"===n&&(c=await F(o),c=c.slice(i-1))):("all"===n&&(c=l.slice(0)),"custom"===n&&(c=l.slice(i-1,o||void 0))),"selected"===n&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof b?.beforeExport)try{c=b?.beforeExport(c)}catch(e){}if("xlsx"===r){const r=await A(e,c,O,k);Dt(r,`${t}.xlsx`),H(`${t}.xlsx`)}if("csv"===r){const r=_(e,((e,t)=>{const{columns:r,footSummation:n}=e,i=Gr(r),a=$r(r);let o='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return o+=`<colgroup>${a.map((e=>{let{width:t,minWidth:r,renderWidth:n}=e;return`<col style="width:${t||n||r||ns.defaultColumnWidth}px">`})).join("")}</colgroup>`,v&&(o+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:r}=e;return 0===r?null:`<th colspan="${r}" rowspan="${t}">${cn(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(o+=`<tbody>${t.map((e=>`<tr>${a.map(((r,n)=>{const{rowSpan:i,colSpan:a}=g(e,r,e.index,n,t);return i&&a?`<td rowspan="${i}" colspan="${a}">${k(e,e.index,r,n)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),m&&n&&(o+=["<tfoot>",O(a,t).map((e=>`<tr>${a.map(((r,n)=>{const{dataIndex:i,summation:a}=r,o=a?.render?a.render(t):Zr(e,i);return`<td>${0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),o+="</table>",o})(e,c));Dt(r,`${t}.csv`),H(`${t}.csv`)}})(Object.assign({},e,{columns:qr(e.columns)}))}})))}));qs.displayName="TableExport";const Ms=qs,js=e=>{const{columns:t,onClose:r}=e,{tableRef:n,tableBodyRef:i,dataChange:a}=o().useContext($l),{beforeClipboard:l}=n.current.props,s=o().useRef(null),[c,d]=o().useState([{type:"INPUT_NUMBER",label:f("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:f("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:cn(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:f("qm.table.clipboard.content"),fieldName:"content",placeholder:f("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[u,p]=o().useState(!1),h=Ce("table");return o().createElement("div",{className:`${h}-clipboard__setting`},o().createElement("h3",{className:"info"},f("qm.table.clipboard.supportText")),o().createElement(Go,{ref:s,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:u,onClick:()=>(async()=>{const[e,o]=await s.current.GET_FORM_DATA();if(e)return;const{tableFullData:c,store:d}=n.current;p(!0);const u=o.content.trim().replace(/(\r|\n)$/,"");let h=u.replace(/"[^"]+"/g,"^");(u.match(/"[^"]+"/g)?.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," ")))||[]).forEach((e=>{h=h.replace(/\^/,e)}));let m=h.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof l)try{m=await l(m,m[0].map(((e,r)=>t[o.colIndex+r].dataIndex)))}catch(e){}m.forEach(((e,r)=>{e.forEach(((e,i)=>{const a=c[o.rowIndex-1+r],l=t[o.colIndex+i];if(a&&l){let t=!1;if(l.editRender){const e=l.editRender(a,l);t=!(e.disabled||e.extra?.disabled||n.current.fieldAuth[l.dataIndex]?.disabled)}t&&l.dictItems&&(t=l.dictItems.some((t=>t.value==e))),t&&(Jr(a,l.dataIndex,e),d.addToUpdated(a))}}))})),i.current.forceUpdate(),a(),L.message.success(f("qm.table.clipboard.success",{total:m.length})),p(!1),r()})()},f("qm.table.clipboard.text"))))},Ks=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{flattenColumns:n}=o().useContext($l),[i,a]=o().useState(!1),l=o().useMemo((()=>(e=>e.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))))(n)),[n]),s=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:s})));const c=Ce("table"),d={[`${c}-clipboard`]:!0},u={visible:i,title:f("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:we()(d),title:f("qm.table.clipboard.textNoSpace"),onClick:()=>s()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.CopyOutlined,null))),o().createElement(Er,u,o().createElement(js,{columns:l,onClose:()=>a(!1)})))}));Ks.displayName="TableClipboard";const Vs=Ks,zs=e=>{const{columns:t,onClose:r}=e,{tableRef:n,$size:i,selectionKeys:a,setSelectionKeysEffect:l}=o().useContext($l),{rowKey:s,rowSelection:c}=n.current.props,d=o().useRef(null),u=Nt(d),p=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=p(e.children)),t})),[h,m]=o().useState([{title:f("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...p(t.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))))]),[g]=o().useState((()=>{const{disabled:e}=c||{},t=n.current.selectionRows.map((e=>({...e,children:void 0})));return e?t.filter((t=>!e(t))):t})()),[b,y]=o().useState(300),v=Ot((()=>{const e=d.current;y(e.offsetHeight-2*Fi[i]-30)}),5);return Pt((()=>{v()}),[u.width]),o().createElement("div",{ref:d,style:{height:"100%"}},o().createElement(td,{size:i,columns:h,dataSource:g,rowKey:s,height:b,rowSelection:{type:"checkbox",selectedRowKeys:a,onChange:e=>l(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),o().createElement("div",{style:{height:10}}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r()},f("qm.table.selectCollection.closeButton"))))},Bs=o().forwardRef(((e,t)=>{const{columns:r,open:n=!0}=e,{tableRef:i,getRowKey:a,selectionKeys:l,isFetch:s,isTableEmpty:c,setSelectionKeysEffect:d,setSelectionRows:u}=o().useContext($l),{rowSelection:p}=i.current.props,[h,m]=o().useState(!1),g=o().useRef(!1);Me((()=>{!g.current&&b()}),[c]);const b=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=p;if(s&&e)try{const r=await e.api(Object.assign({},{selectedKeys:l},e.params));if(200===r.code){let n=Array.isArray(r.data)?r.data:(0,te.get)(r.data,e.dataKey)??[];n=n.filter((e=>!t(e))),d(n.map(((e,t)=>a(e,t)))),u(n),g.current=!0}}catch(e){}},y=()=>{m(!0)};o().useImperativeHandle(t,(()=>({clickHandle:y})));const v=Ce("table"),x={visible:h,title:f("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:`${v}-select-collection`,title:f("qm.table.selectCollection.text"),onClick:()=>y()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.CheckSquareOutlined,null))),o().createElement(Er,x,o().createElement(zs,{columns:r,onClose:()=>m(!1)})))}));Bs.displayName="SelectCollection";const Us=Bs,Ws=require("localforage");var Gs=n.n(Ws);const Ys=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),Xs=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,getRowKey:i,$size:a,flattenColumns:l,pagination:s,createWebPageData:d,setPagination:u,scrollYToRecord:p,setHighlightKey:h,setShouldToTop:m,isTreeTable:g,isWebPagination:b}=o().useContext($l),{uniqueKey:y}=n.current.props,x=o().useRef(null),E=o().useRef(null),S=o().useRef([]),w=o().useRef(""),C=o().useRef(-1),T=o().useRef("stop");Me((()=>{const e=Wr(d()).findIndex((e=>i(e,e.index)===w.current));p("",e)}),[s.current]);const I=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},N=e=>e.filter((e=>e?.dataIndex)).map((e=>({type:I(e.filter.type),fieldName:e.dataIndex,label:cn(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:e.dictItems??[]},onChange:async()=>{const[e,t]=await x.current.GET_FORM_DATA(),[r,n]=await E.current.GET_FORM_DATA(),i=(0,te.omitBy)(Object.assign({},t,n),de);k(i)}}))),R={case:0,fullchar:0},P=o().useMemo((()=>l.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[l]),[O,k]=o().useState({}),[A,_]=o().useState(R),[F]=o().useState(N([P[0]])),[H]=o().useState(N(P.slice(1))),[D,$]=o().useState(0),q=o().useMemo((()=>!Object.keys(O).length),[O]);Me((()=>{T.current="ready"}),[O,A]);const M=e=>{_(Object.assign({},A,e))},j=(e,t,r)=>new Promise(((n,i)=>{L.Modal.confirm({title:f("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{r(),n()}})})),K=async e=>{if(!Object.keys(O).length)return L.Modal.warning({title:f("qm.button.confirmPrompt"),content:f("qm.table.fastSearch.queryCondition")});if("ready"===T.current&&(T.current="stop",S.current=(e=>{const{allTableData:t}=n.current,r=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];let a=!0;for(const t in e){const{type:r}=P.find((e=>e.dataIndex===t)).filter;let n=Zr(i,t),o=!0;if("text"===r||"textarea"===r?o=new RegExp(A.fullchar?`^${e[t]}$`:e[t],A.case?"":"i").test(n):(n=Ys(n)?n.slice(0,10):n,o=n==e[t]),!o){a=!1;break}}a&&r.push(i)}return r})(O),$(S.current.length)),!S.current.length)return h(""),L.Modal.warning({title:f("qm.button.confirmPrompt"),content:f("qm.table.fastSearch.notMatch")});"next"===e&&(C.current=C.current<0?0:C.current+1,C.current>S.current.length-1&&await j(f("qm.table.fastSearch.toTheEnd"),(()=>C.current=0),(()=>C.current=S.current.length-1))),"prev"===e&&(C.current=C.current<0?S.current.length-1:C.current-1,C.current<0&&await j(f("qm.table.fastSearch.toStart"),(()=>C.current=S.current.length-1),(()=>C.current=0)));const t=S.current[C.current],r=i(t,t.index);let a=t.index;if(g&&b){const e=mn(n.current.deriveRowKeys,r)[0];a=n.current.tableFullData.findIndex((t=>i(t,t.index)===e))}((e,t)=>{if(w.current=e,b){const{pageSize:e}=s,r=Math.ceil((t+1)/e);m(!1),u(Object.assign({},s,{current:r}))}else p(e)})(r,a),h(r)},V=()=>{x.current.RESET_FORM(),E.current.RESET_FORM()},z=o().useMemo((()=>y?`fastSearch_${y}`:""),[y]),[B,U]=o().useState([]),[W,G]=o().useState(""),[Y,X]=o().useState("");Me((()=>{if(Y){const{filters:e,config:t}=B.find((e=>e.value===Y)).list;x.current.SET_FIELDS_VALUE(ue(e,H.map((e=>e.fieldName)))),E.current.SET_FIELDS_VALUE(ue(e,F.map((e=>e.fieldName)))),k(e),_(t)}else V(),k({}),_(R)}),[Y]),o().useEffect((()=>{Q()}),[]);const Q=async()=>{if(!z)return;let e=await Gs().getItem(z);e||(e=await Z(z),Array.isArray(e)&&await Gs().setItem(z,e)),Array.isArray(e)&&e.length&&(U(e),X(e[0].value))},Z=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},J=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},ee=Ce("table");return o().createElement("div",{className:`${ee}-fast-search__setting`},o().createElement("div",{className:"main"},o().createElement("div",{className:"top"},o().createElement("div",{className:"container"},o().createElement(cr,{defaultActiveKey:"1",size:"small",tabBarExtraContent:o().createElement("span",null,f("qm.table.alert.total",{total:D}))},o().createElement(cr.TabPane,{tab:f("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},o().createElement(Go,{ref:x,items:F,cols:1,labelWidth:110})),o().createElement(cr.TabPane,{tab:f("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},o().createElement(Go,{ref:E,items:H,cols:1,labelWidth:110})))),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:a,value:W,placeholder:f("qm.table.highSearch.configText"),disabled:q,onChange:e=>{const{value:t}=e.target;G(t)}}),o().createElement(be,{type:"primary",disabled:!W||q,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!z)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...B,{text:W,value:e,list:{filters:O,config:A}}];U(t),X(e),G(""),await Gs().setItem(z,t),await J(z,t)})()},f("qm.table.highSearch.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[a]}px`}},o().createElement("span",null,f("qm.table.fastSearch.savedSetting"))),o().createElement("ul",null,B.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===Y}),title:e.text,onClick:()=>(e=>{X(e!==Y?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=B.filter((t=>t.value!==e));U(t),e===Y&&X(""),await Gs().setItem(z,t),await J(z,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!B.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement("div",{className:"bottom"},o().createElement("div",null,o().createElement(L.Checkbox,{checked:!!A.case,onChange:e=>M({case:e.target.checked})},f("qm.table.fastSearch.matchCase")),o().createElement(L.Checkbox,{checked:!!A.fullchar,onChange:e=>M({fullchar:e.target.checked})},f("qm.table.fastSearch.matchFullchar"))),o().createElement("div",null,o().createElement(be,{onClick:()=>V()},f("qm.table.fastSearch.clear"))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Fi[a]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.fastSearch.closeButton")),o().createElement(be,{type:"primary",style:{marginRight:8},onClick:()=>K("prev")},f("qm.table.fastSearch.queryPrev")),o().createElement(be,{type:"primary",onClick:()=>K("next")},f("qm.table.fastSearch.queryNext"))))},Qs=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{$size:n}=o().useContext($l),[i,a]=o().useState(!1),l=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:l})));const s=Ce("table"),c={visible:i,title:f("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Fi[n]+20}px`},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${s}-super-search`,title:f("qm.table.fastSearch.text"),onClick:()=>l()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.MonitorOutlined,null))),o().createElement(Er,c,o().createElement(Xs,{onClose:()=>a(!1)})))}));Qs.displayName="FastSearch";const Zs=Qs,Js=e=>{const{columns:t,group:r,summary:n}=e,{tableRef:i,$size:a,pagination:l,fetchParams:s,isFetch:c}=o().useContext($l),{fetch:d}=i.current.props,p=e=>{const r=t.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:r.dictItems??[]}},h=r.map((e=>({dataIndex:e.group,...p(e.group)}))),m=n.map((e=>e.summary===ns.groupSummary.total.value?{dataIndex:e.summary,title:ns.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...p(e.summary),formula:e.formula})),g=o().useMemo((()=>Object.assign({},s,{[ns.sorterFieldName]:void 0,[ns.groupSummary.summaryFieldName]:n.map((e=>`${e.formula}|${e.summary}`)).join(","),[ns.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[ns.currentPageName]:1})),[s,r,n]),[b,y]=o().useState(((e,r)=>[{title:f("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...r.map((e=>{const r=t.find((t=>t.dataIndex===e.dataIndex))?.groupSummary;let n=r?{summation:r}:null;return e.dataIndex===ns.groupSummary.total.value&&(n={dataIndex:ns.groupSummary.recordTotalIndex,summation:{render:()=>l.total}}),{...e,..."count"===e.formula||"sum"===e.formula?n:null}}))])(h,m)),[v]=o().useState(c?[]:(e=>{const t=pn(e,r.map((e=>e.group))),i=[];return t.forEach((e=>{const t={};b.forEach((r=>{const{dataIndex:n}=r;"index"!==n&&Jr(t,n,Zr(e[0],n))})),n.forEach((r=>{const n=r.summary!==ns.groupSummary.total.value?r.summary:ns.groupSummary.recordTotalIndex,i=r.formula;"count"===i&&Jr(t,n,e.length),"sum"===i&&Jr(t,n,(0,te.sumBy)(e,n)),"max"===i&&Jr(t,n,(0,te.maxBy)(e,n)[n]),"min"===i&&Jr(t,n,(0,te.minBy)(e,n)[n]),"avg"===i&&Jr(t,n,((0,te.sumBy)(e,n)/e.length).toFixed(2))})),i.push(t)})),i})(i.current.tableFullData)),x={size:a,height:400,...c?{fetch:{api:d.api,params:g,dataKey:d?.dataKey}}:{dataSource:v},columns:b,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${u()().format(Ul)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)};return o().createElement(td,x)},ec=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,$size:i,flattenColumns:a}=o().useContext($l),{uniqueKey:l}=n.current.props,s=o().useRef(null),d=o().useRef(null),[u,p]=o().useState(!1),[h,m]=o().useState([]),[g,b]=o().useState(""),[y,x]=o().useState("");Me((()=>{if(y){const{group:e,summary:t}=h.find((e=>e.value===y)).list;N(e),k(t)}else{const e=H();N(e?.group||[]),k(e?.summary||[])}}),[y]),o().useEffect((()=>{D()}),[]);const E=o().useMemo((()=>l?`summary_${l}`:""),[l]),S=o().useMemo((()=>a.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex)))),[a]),w=S.filter((e=>!e.groupSummary)).map((e=>({text:cn(e.title),value:e.dataIndex}))),C=[ns.groupSummary.total,...S.filter((e=>!!e.groupSummary)).map((e=>({text:cn(e.title),value:e.dataIndex})))],T=[{text:f("qm.table.groupSummary.sumText"),value:"sum"},{text:f("qm.table.groupSummary.maxText"),value:"max"},{text:f("qm.table.groupSummary.minText"),value:"min"},{text:f("qm.table.groupSummary.avgText"),value:"avg"},{text:f("qm.table.groupSummary.countText"),value:"count"}],[I,N]=o().useState([]),[R,P]=o().useState([{title:f("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(t)}},f("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:f("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>({...e,disabled:I.findIndex((t=>t.group===e.value))>-1})))})}]),[O,k]=o().useState([]),[A,_]=o().useState([{title:f("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(t)}},f("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:f("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:f("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===ns.groupSummary.total.value?T.slice(T.length-1):T})}]),F=o().useMemo((()=>{const e=I.length&&I.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[I,O]),H=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},D=async()=>{if(!E)return;const e=H();if(e){const{group:t,summary:r}=e;N(t),k(r)}let t=await Gs().getItem(E);t||(t=await $(E),Array.isArray(t)&&await Gs().setItem(E,t)),Array.isArray(t)&&t.length&&(m(t),!e&&x(t[0].value))},$=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},q=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},M=Ce("table"),j={visible:u,title:f("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return o().createElement("div",{className:`${M}-group-summary__setting`},o().createElement("div",{className:"main"},o().createElement("div",{style:{width:"30%"}},o().createElement(td,{ref:s,size:i,columns:R,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{N(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),o().createElement("div",{className:"container line"},o().createElement(td,{ref:d,size:i,columns:A,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>_(e),onDataChange:e=>{k(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:i,value:g,placeholder:f("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;b(t)}}),o().createElement(be,{type:"primary",disabled:!g||F,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!E)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...h,{text:g,value:e,list:{group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];m(t),x(e),b(""),await Gs().setItem(E,t),await q(E,t)})()},f("qm.table.groupSummary.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[i]}px`}},o().createElement("span",null,f("qm.table.groupSummary.savedSetting"))),o().createElement("ul",null,h.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===y}),title:e.text,onClick:()=>(e=>{x(e!==y?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.groupSummary.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=h.filter((t=>t.value!==e));m(t),e===y&&x(""),await Gs().setItem(E,t),await q(E,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!h.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement(Er,j,o().createElement(Js,{columns:S,group:I,summary:O})),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.groupSummary.closeButton")),o().createElement(be,{type:"primary",disabled:F,onClick:()=>(E&&sessionStorage.setItem(E,JSON.stringify({group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))})),void p(!0))},f("qm.table.groupSummary.confirmButton"))))},tc=o().forwardRef(((e,t)=>{const{open:r=!0}=e,[n,i]=o().useState(!1),a=()=>{i(!0)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table"),s={visible:n,title:f("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${l}-group-summary`,title:f("qm.table.groupSummary.text"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.PieChartOutlined,null))),o().createElement(Er,s,o().createElement(ec,{onClose:()=>i(!1)})))}));tc.displayName="GroupSummary";const rc=tc,nc=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,$size:i,flattenColumns:a,setSuperFilters:l,clearTableFilter:s}=o().useContext($l),{uniqueKey:d}=n.current.props,u=o().useRef(null),[p,h]=o().useState([]),[m,g]=o().useState([]),[b,y]=o().useState(""),[x,E]=o().useState("");Me((()=>{h(x?m.find((e=>e.value===x)).list:H()||[])}),[x]),o().useEffect((()=>{D()}),[]);const S=o().useMemo((()=>d?`superSearch_${d}`:""),[d]),w=o().useMemo((()=>a.filter((e=>!!e.filter))),[a]),C=un(p),T=o().useMemo((()=>!(C&&Hr(C))),[C]),I=o().useMemo((()=>!!p.length&&T),[p,T]),N=[{value:"and",text:f("qm.table.highSearch.andText")},{value:"or",text:f("qm.table.highSearch.orText")}],R=a.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:cn(e.title)}))),P=e=>["in","nin"].includes(e),O=(e,t)=>{let r;switch(e){case"number":r="number";break;case"date":r="date";break;case"checkbox":case"radio":r=t?"select-multiple":"select";break;default:r="text"}return r},k=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:f("qm.table.highSearch.gtText")},{value:"<",text:f("qm.table.highSearch.ltText")},{value:">=",text:f("qm.table.highSearch.gteText")},{value:"<=",text:f("qm.table.highSearch.lteText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:f("qm.table.highSearch.inText")},{value:"nin",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:f("qm.table.highSearch.likeText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}]}return t},[A,_]=o().useState([{title:f("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},f("qm.table.highSearch.removeText")))},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>o().createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:R,rules:[{required:!0,message:f("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{const r=Object.values(t)[0],n=w.find((e=>e.dataIndex===r))?.filter.type,i=k(n);e.fieldType=n,e.expression=r?i[0]?.value:"",e.condition=P(e.expression)?[]:"",r||(e.bracketLeft=e.bracketRight="")}})},{title:f("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:f("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{const t=w.find((t=>t.dataIndex===e.fieldName))?.filter.type;return{type:"select",editable:!0,items:k(t),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=P(e.expression)?[]:""}}}},{title:f("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{const t=w.find((t=>t.dataIndex===e.fieldName)),r=t?.filter.type,n=t?.filter?.items??t?.dictItems??[];return{type:O(r,P(e.expression)),editable:!0,items:n,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>o().createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:N,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),F=()=>{S&&sessionStorage.setItem(S,JSON.stringify(p.filter((e=>!!e.fieldName))))},H=()=>{if(!S)return;const e=sessionStorage.getItem(S);return e?JSON.parse(e):null},D=async()=>{if(!S)return;const e=H();e&&h(e);let t=await Gs().getItem(S);t||(t=await $(S),Array.isArray(t)&&await Gs().setItem(S,t)),Array.isArray(t)&&t.length&&(g(t),!e&&E(t[0].value))},$=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},q=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},M=Ce("table");return o().createElement("div",{className:`${M}-super-search__setting`},o().createElement("div",{className:"main"},o().createElement("div",{className:"container"},o().createElement(td,{ref:u,size:i,columns:A,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>_(e),onRowClick:(e,t)=>{const{dataIndex:r}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(r)&&("bracketLeft"===r&&(e[r]=e[r]?"":"("),"bracketRight"===r&&(e[r]=e[r]?"":")"),h([...p]))},onDataChange:e=>{h(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),ns.highSearch.showSQL&&C&&o().createElement("code",{className:"lang-js"},C)),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:i,value:b,placeholder:f("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;y(t)}}),o().createElement(be,{type:"primary",disabled:!b||T,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!S)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...m,{text:b,value:e,list:p.filter((e=>!!e.fieldName))}];g(t),E(e),y(""),await Gs().setItem(S,t),await q(S,t)})()},f("qm.table.highSearch.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[i]}px`}},o().createElement("span",null,f("qm.table.highSearch.savedSetting"))),o().createElement("ul",null,m.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{E(e!==x?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=m.filter((t=>t.value!==e));g(t),e===x&&E(""),await Gs().setItem(S,t),await q(S,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!m.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.highSearch.closeButton")),o().createElement(be,{type:"primary",disabled:I,onClick:()=>(s(),l(p.map((e=>ue(e,["index","pageIndex"])))),F(),void t())},f("qm.table.highSearch.searchButton"))))},ic=o().forwardRef(((e,t)=>{const{open:r=!0}=e,[n,i]=o().useState(!1),a=()=>{i(!0)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table"),s={visible:n,title:f("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${l}-super-search`,title:f("qm.table.highSearch.text"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.FunnelPlotOutlined,null))),o().createElement(Er,s,o().createElement(nc,{onClose:()=>i(!1)})))}));ic.displayName="SuperSearch";const ac=ic,oc=o().forwardRef(((e,t)=>{const{tableColumns:r,showFullScreen:n,showReload:i,showPrint:a,showImport:l,showExport:s,showClipboard:d,showCollection:u,showFastSearch:p,showSuperSearch:h,showGroupSummary:m,showToolBox:g}=e,{global:b}=o().useContext(c),{tableRef:y,isFullScreen:x,$size:E}=o().useContext($l),{uniqueKey:S,exportExcel:w}=y.current.props,C=o().useRef(null),T=o().useRef(null),I=o().useRef(null),N=o().useRef(null),R=o().useRef(null),P=o().useRef(null),O=o().useRef(null),k=o().useRef(null),A=o().useRef(null),_=o().useRef(null),F=o().useRef(!1),H=o().useMemo((()=>S?`toolBox_${S}`:""),[S]),[D,$]=o().useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),q={fullScreen:n,reload:i,print:a,import:l,export:s&&!w?.hideIcon,clipboard:d,collection:u,fastSearch:p,superSearch:h,groupSummary:m},[M,j]=o().useState(!1);Me((()=>{F.current&&(V(),F.current=!1)}),[D]),o().useEffect((()=>{K()}),[]),o().useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return v("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const K=()=>{if(!H||!g)return;const e=JSON.parse(localStorage.getItem(H));e||z(H).then((e=>{e&&($(Object.assign({},D,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},D,e))},V=()=>{if(!H||!g)return;const e={};for(const t in D)D[t]&&(e[t]=D[t]);localStorage.setItem(H,JSON.stringify(e)),B(H,e)},z=async e=>{const t=b?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},B=async(e,t)=>{const r=b?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}},U=async e=>{j(!1),await le(100),e.current.clickHandle()},W=(e,t)=>{F.current=!0,$(Object.assign({},D,{[t]:e}))},G=Ce("table"),Y={"top-toolbox__popper":!0,[`${G}--lg`]:"large"===E,[`${G}--sm`]:"small"===E};return o().createElement(o().Fragment,null,n&&o().createElement(gs,{ref:C,isFullScreen:x,open:!g||D.fullScreen}),i&&o().createElement(ys,{ref:T,open:!g||D.reload}),a&&o().createElement(Es,{ref:I,tableColumns:r,open:!g||D.print}),l&&o().createElement(Hs,{ref:N,tableColumns:r,open:!g||D.import}),s&&o().createElement(Ms,{ref:R,tableColumns:r,open:(!g||D.export)&&!w?.hideIcon}),d&&o().createElement(Vs,{ref:P,open:!g||D.clipboard}),u&&o().createElement(Us,{ref:O,columns:r,open:!g||D.collection}),p&&o().createElement(Zs,{ref:k,open:!g||D.fastSearch}),m&&o().createElement(rc,{ref:A,open:!g||D.groupSummary}),h&&o().createElement(ac,{ref:_,open:!g||D.superSearch}),g&&o().createElement(L.Dropdown,{open:M,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.screen.full"))),onClick:()=>U(C)},{key:"reload",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.refresh.text"))),onClick:()=>U(T)},{key:"print",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.print.text"))),onClick:()=>U(I)},{key:"import",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.import.textNoSpace"))),onClick:()=>U(N)},{key:"export",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.export.textNoSpace"))),onClick:()=>U(R)},{key:"clipboard",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.clipboard.textNoSpace"))),onClick:()=>U(P)},{key:"collection",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.selectCollection.text"))),onClick:()=>U(O)},{key:"fastSearch",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.fastSearch.text"))),onClick:()=>U(k)},{key:"groupSummary",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.groupSummary.text"))),onClick:()=>U(A)},{key:"superSearch",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.highSearch.text"))),onClick:()=>U(_)}];return o().createElement(L.Menu,{items:e.filter((e=>q[e.key]))})})(),overlayClassName:we()(Y),overlayStyle:{minWidth:120},onOpenChange:e=>{j(e)}},o().createElement("span",{className:`${G}-toolbox`,title:f("qm.table.toolbox.text")},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.AppstoreAddOutlined,null)))))}));oc.displayName="ToolBox";const lc=oc,sc=(e,t)=>e.map((e=>(e.children&&(e.children=sc(e.children,t)),t(e)))),cc=o().forwardRef(((e,t)=>{const{columns:r}=e,{global:n}=o().useContext(c),{tableRef:i,$size:a}=o().useContext($l),{showColumnDefine:l,uniqueKey:s,onlyShowIcon:d,columnsChange:u}=i.current.props,p=o().useRef([]),[h,m]=o().useState(!1),g=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),b=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),y=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),v=o().useMemo((()=>s?`table_${s}`:""),[s]);Me((()=>{E(r)}),[r]),o().useLayoutEffect((()=>{S()}),[]),o().useImperativeHandle(t,(()=>({initialHandler:S})));const x=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=x(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),{dataIndex:e.dataIndex,...t}})),E=e=>{if(!v)return;const t=x(e),r=JSON.parse(localStorage.getItem(v));i.current.columnsDefined&&!(0,te.isEqual)(t,r)&&(localStorage.setItem(v,JSON.stringify(t)),(async(e,t)=>{const r=n?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})(v,t))},S=()=>{const e=(()=>{if(!v)return;const e=JSON.parse(localStorage.getItem(v));return e||(async e=>{const t=n?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}})(v).then((e=>{e?(localStorage.setItem(v,JSON.stringify(e)),S()):n?.getComponentConfigApi&&E(r)})).catch((()=>{})),e?(0,te.xor)(Mr(e).map((e=>e.dataIndex)),Mr(r).map((e=>e.dataIndex))).length>0?sc(r,(t=>{const r=Kr(e,t.dataIndex);return r&&(void 0!==r.hidden&&(t.hidden=r.hidden),void 0!==r.fixed&&(t.fixed=r.fixed),void 0!==r.width&&(t.width=r.width),void 0!==r.renderWidth&&(t.renderWidth=r.renderWidth)),t})):sc(e,(e=>{const t=Kr(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)})):void 0})();var t;e&&(t=w(e),p.current=t,u?.(e))},w=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((r,n)=>{const i=r.colSpan;i>1&&e.slice(n+1,n+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(n,n+i))})),t},C=e=>{const t=[];e.forEach((r=>{const{colSpan:n,dataIndex:i}=r;if(0===n)return;if(1===n)return t.push(r);const a=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===a)return t.push(r);t.push(...p.current[a].map(((t,n)=>{let{dataIndex:i}=t;const a=e.find((e=>e.dataIndex===i));return n>0&&(void 0!==r.hidden&&(a.hidden=r.hidden),void 0!==r.fixed?a.fixed=r.fixed:a.fixed&&delete a.fixed),a})))})),r.forEach(((e,r)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(r,0,e)})),u?.(t)},T=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,C(r))},I=(e,t)=>{const{colSpan:n,noFixed:i}=e;if(0===n)return o().createElement("li",{key:e.dataIndex,style:{display:"none"}});const a=cn(e.title),l=["svgicon","handle",`${t}-handle`],s=o().createElement("li",{key:e.dataIndex,className:"item"},o().createElement(L.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,C(r)}}),o().createElement("i",{className:we()(l),title:f("qm.table.columnFilter.draggable")},o().createElement(Te.HolderOutlined,null)),o().createElement("span",{className:"text",title:a},a),"main"===t?o().createElement("span",{className:we()("fixed",i?"disabled":"")},o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},o().createElement(Te.StepBackwardOutlined,null)),o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},o().createElement(Te.StepForwardOutlined,null))):"sub"!==t?o().createElement("span",{className:we()("fixed",i?"disabled":"")},o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},o().createElement(Te.CloseCircleOutlined,null))):null);return!e.hidden&&e.children?.length?o().createElement(L.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:N(e.children,e.dataIndex)},s):s},N=(e,t)=>o().createElement("div",{className:"column-filter--wrap"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:n=>{const i=n.map((e=>e.dataIndex)),a=e.map((e=>e.dataIndex));(0,te.isEqual)(i,a)||((e,t)=>{Kr(r,t).children=e,u?.([...r])})(bn(n),t)}},e.map((e=>I(e,"sub"))))),R=Ce("table"),P={[`${R}__popper`]:!0,"column-filter__popper":!0,[`${R}--lg`]:"large"===a,[`${R}--sm`]:"small"===a},O=[`${R}-column-filter`,{selected:h}];return l?o().createElement(Wi(),{action:["click"],popupVisible:h,popup:o().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},o().createElement("div",{className:"reset"},o().createElement(be,{type:"text",size:"small",onClick:()=>{const e=t=>t.map((t=>{const n=Kr(r,t.dataIndex)||pe(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));u?.(e(i.current.originColumns))}},f("qm.table.columnFilter.reset"))),o().createElement("div",{className:"left"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),r=g.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...bn(e),...y,...b])}},g.map((e=>I(e,"left"))))),o().createElement("div",{className:"divider"}),o().createElement("div",{className:"main"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),r=y.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...g,...bn(e),...b])}},y.map((e=>I(e,"main"))))),o().createElement("div",{className:"divider"}),o().createElement("div",{className:"right"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),r=b.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...g,...y,...bn(e)])}},b.map((e=>I(e,"right")))))),popupClassName:we()(P),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},o().createElement("span",{className:we()(O),title:d?f("qm.table.columnFilter.text"):void 0},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.SettingOutlined,null)),!d&&o().createElement("span",null,f("qm.table.columnFilter.text")))):null}));cc.displayName="ColumnFilter";const dc=cc,uc=()=>o().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"}));function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pc.apply(this,arguments)}const hc=e=>{const{column:t,filters:r}=e,{$size:n,setFilters:i,clearSuperFilters:a}=o().useContext($l),l=o().useRef(null),s=o().useRef(null),c=o().useRef(null),[d,u]=o().useState(!1),[p,h]=o().useState(!1),[m,g]=o().useState({}),b=o().useMemo((()=>{const{dataIndex:e,filter:r}=t;return`${e}|${r.type}`}),[t]),y=o().useMemo((()=>{let e=!1;for(const t in r[b])if(!de(r[b][t])||p){e=!0;break}return e}),[b,r,p]);o().useLayoutEffect((()=>{d&&setTimeout((()=>x()),20)}),[d]),o().useEffect((()=>{(0,te.isEqual)(m[b],r[b])||g({[b]:r[b]||{}}),h(""===r[b]?.["=="])}),[r]);const x=()=>{switch(t.filter.type){case"text":l.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},E=e=>{e&&g(e),a(),i((e=>{for(const t in e){for(const r in e[t])if(de(e[t][r])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][r])continue;delete e[t][r]}Object.keys(e[t]).length||delete e[t]}return e})({...r,...m,...e})),u(!1)},S={text:e=>o().createElement(o().Fragment,null,o().createElement(L.Input,{ref:l,size:n,placeholder:f("qm.table.filter.searchText",{text:cn(e.title)}),style:{width:"180px"},value:m[b]?.like??"",disabled:p,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&E()}}),o().createElement("div",{style:{marginTop:8}},o().createElement(L.Checkbox,{checked:p,onChange:e=>{const{checked:t}=e.target,r=t?"":null;g((e=>Object.assign({},e,{[b]:{"==":r,like:null}}))),h(t)}},f("qm.table.filter.nullValue")))),textarea:e=>o().createElement(o().Fragment,null,o().createElement(L.Input.TextArea,{ref:c,size:n,placeholder:f("qm.table.filter.searchAreaText",{text:cn(e.title)}),style:{width:"220px"},value:m[b]?.likes??"",disabled:p,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),E())}}),o().createElement("div",{style:{marginTop:8}},o().createElement(L.Checkbox,{checked:p,onChange:e=>{const{checked:t}=e.target,r=t?"":null;g((e=>Object.assign({},e,{[b]:{"==":r,like:null}}))),h(t)}},f("qm.table.filter.nullValue")))),number:e=>{const t=e=>({value:m[b]?.[e]??"",size:n,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||g((r=>Object.assign({},r,{[b]:Object.assign({},r[b],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&E()}});return o().createElement("ul",null,o().createElement("li",null,o().createElement("span",null,"> "),o().createElement(L.InputNumber,pc({ref:s},t(">"),{placeholder:f("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"< "),o().createElement(L.InputNumber,pc({},t("<"),{placeholder:f("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"= "),o().createElement(L.InputNumber,pc({},t("=="),{placeholder:f("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"!="),o().createElement(L.InputNumber,pc({},t("!="),{placeholder:f("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>({value:an(m[b]?.[e],zl),format:zl,size:n,onChange:t=>{g((r=>Object.assign({},r,{[b]:Object.assign({},r[b],{[e]:on(t,zl)})})))},onKeyDown:e=>{13===e.keyCode&&E()}});return o().createElement("ul",null,o().createElement("li",null,o().createElement("span",null,"> "),o().createElement(j,pc({},t(">"),{placeholder:f("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"< "),o().createElement(j,pc({},t("<"),{placeholder:f("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"= "),o().createElement(j,pc({},t("=="),{placeholder:f("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"!="),o().createElement(j,pc({},t("!="),{placeholder:f("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("ul",null,o().createElement(L.Radio.Group,{style:{width:"100%"},value:m[b]?.["=="],onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{"==":t}})))}},n.map((e=>o().createElement("li",{key:e.value},o().createElement(L.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("ul",null,o().createElement(L.Checkbox.Group,{style:{width:"100%"},value:m[b]?.in,onChange:e=>{g((t=>Object.assign({},t,{[b]:{in:e}})))}},n.map((e=>o().createElement("li",{key:e.value},o().createElement(L.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("div",{style:{height:200,...t.style}},o().createElement(Dl,{multiple:!0,value:m[b]?.in||[],dataSource:n,onCheckChange:e=>{const t=e.map((e=>e.value));g((e=>Object.assign({},e,{[b]:{in:t}})))}}))}},w=Ce("table"),C={"head-filter__popper":!0,[`${w}--lg`]:"large"===n,[`${w}--sm`]:"small"===n},T=["cell--filter",{selected:d,actived:y}];return o().createElement(Wi(),{action:["click"],popupVisible:d,popup:(()=>{const e=t.filter.type,r=S[e];return r?o().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},o().createElement("div",null,r(t)),o().createElement(L.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},o().createElement(be,{size:n,onClick:()=>(E({[b]:{}}),void h(!1))},f("qm.table.filter.reset")),o().createElement(be,{type:"primary",size:n,onClick:()=>E()},f("qm.table.filter.search")))):(v("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:we()(C),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},o().createElement("div",{className:we()(T),title:f("qm.table.filter.text"),onClick:e=>e.stopPropagation()},o().createElement("span",{className:"svgicon icon"},o().createElement(uc,null))))},mc=e=>{const{column:t}=e,{tableRef:r,bordered:n}=o().useContext($l),{columns:i,resizable:a,columnsChange:l=ae}=r.current.props,s=o().useMemo((()=>zr(t)),[t]),c={resizable:!0,"is--line":a&&!n};return o().createElement("div",{className:we()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,a=n.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=Yr(t,n.$table).left-n.$tableBody.parentNode.parentNode.scrollLeft+o;n.$table.classList.add("c--resize"),a.style.left=`${d}px`,a.style.display="block";const u=s.width||s.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,r=u+t;r<(s.minWidth||ns.defaultColumnWidth)||(p=Math.floor(r),a.style.left=`${t+d}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),a.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(Kr(i,s.dataIndex).width=p,l([...i]))},!1}})},fc=e=>{const{selectionKeys:t}=e,{tableRef:r,getRowKey:n,fetchParams:i,createWebPageData:a,setSelectionKeysEffect:l,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=o().useContext($l),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:g,onSelectAll:b}=p,y=o().useRef([]),v=o().useMemo((()=>d&&!!h),[d,h]),x=o().useMemo((()=>!v&&!!m),[v,m]),E=o().useMemo((()=>(g??!0)&&!x),[g,x]),S=()=>u?a():r.current.tableFullData,w=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>n(e,e.index)))},C=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:i}=p;if(v)return y.current.length?y.current:(0,te.union)(t,w());if(!x)return i?t.filter((t=>!i(e.get(t)))):t;const a=i?S().filter((e=>!i(e))).map((e=>n(e,e.index))):S().map((e=>n(e,e.index)));return(0,te.union)(a,w())})(),T=t.filter((e=>!C.includes(e))),I=t.length-T.length,N=I>0&&I<C.length,R=!!I&&I===C.length;s(T);const P=async()=>{const e=h;let t=[];c(!0);try{const r=await e.api(i);if(200===r.code){t=Array.isArray(r.data)?r.data:(0,te.get)(r.data,e.dataKey)??[];const{disabled:i}=p;i&&(t=(0,te.xor)(t,S().filter((e=>i(e))).map((e=>n(e,e.index))))),y.current=t}}catch(e){}return c(!1),t},O=async e=>{let t=[];t=v?e?await P():[]:e?C.slice(0):[],t=[...new Set([...t,...T])],l(t),b?.(e,t)};return o().createElement("div",{className:"cell--selection"},o().createElement(L.Checkbox,{checked:R,indeterminate:N,disabled:!C.length,onChange:e=>O(e.target.checked)}),E&&o().createElement(L.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>(()=>{const e=[{key:1,label:f("qm.table.selection.all"),onClick:()=>{O(!0)}},{key:2,label:f("qm.table.selection.invert"),onClick:()=>(async()=>{let e=[];e=v?(0,te.xor)(t,await P()):(0,te.xor)(t,C),e=[...new Set([...e,...T])],l(e)})()},{key:3,label:f("qm.table.selection.clear"),onClick:()=>{O(!1)}}];return o().createElement(L.Menu,{items:e})})()},o().createElement(Te.DownOutlined,{className:"svgicon icon"})),x&&o().createElement(L.Tooltip,{placement:"top",title:f("qm.table.selection.currentPage")},o().createElement(Te.InfoCircleOutlined,{className:"info"})))},gc=e=>{const{style:t}=e,{tableRef:r,isTreeTable:n,setRowExpandedKeys:i}=o().useContext($l),{expandable:a}=r.current.props,[l,s]=o().useState(a?.defaultExpandAllRows||!1);Me((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;i(l?e.filter((e=>!(n&&t.includes(e)))):[])}),[l]);const c=Ce("expand"),d={[`${c}--icon`]:!0,expanded:l,collapsed:!l};return o().createElement("span",{className:we()(d),title:"",onClick:e=>{e.stopPropagation(),s(!l)},style:t})},bc=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),yc=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),vc=e=>{const{tableColumns:t,sorter:r,filters:n}=e,{tableRef:i,layout:a,scrollY:l,flattenColumns:s,superFilters:c,selectionKeys:d,rightFixedColumns:u,treeExpandIndex:p,isFetch:h,isTreeTable:m,isGroupSubtotal:g,tableChange:b,setSorter:y,setElementStore:v,resetTableScroll:x,getStickyLeft:E,getStickyRight:S,createGroupData:w,createTableFullData:C}=o().useContext($l),{ellipsis:T,resizable:I,multipleSort:N,rowSelection:R,expandable:P}=i.current.props,[O,k]=ns.sortDirections,{tableOriginData:A}=i.current,_=o().useRef(null),F=o().useMemo((()=>A.some((e=>Array.isArray(e.children)))),[A]),H=o().useMemo((()=>!h),[h]),D=o().useMemo((()=>!h),[h]),$=o().useMemo((()=>!P?.hideExpandAll),[P]),q=o().useMemo((()=>!(!R||(h?!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys:R.hideSelectAll))),[h,R]);Me((()=>{B(),b(),x()}),[r]),Me((()=>{G(),b(),x()}),[n]),Me((()=>{G(),b(),x()}),[c]),o().useEffect((()=>{!de(r)&&se((()=>B())),!de(n)&&se((()=>G()))}),[]),o().useLayoutEffect((()=>{M()}),[]);const M=()=>{v("$header",_.current)},j=e=>{const{dataIndex:t,type:n,sorter:i,title:a,description:l}=e;if(t===ns.selectionColumn&&"checkbox"===n){if("checkbox"===n)return o().createElement("div",{className:"cell"},q?o().createElement(fc,{selectionKeys:d}):f("qm.table.config.selectionText"));if("radio"===n)return o().createElement("div",{className:"cell"},a)}const s=[];return s.push(o().createElement("div",{key:0,className:"cell",title:cn(a)},m&&t===p&&$?o().createElement(gc,null):null,t===ns.expandableColumn&&$?o().createElement(gc,null):a)),l&&s.push(o().createElement(L.Tooltip,{key:1,placement:"top",title:l},o().createElement(Te.InfoCircleOutlined,{className:"tip"}))),i&&s.push(K(r[t])),s},K=e=>{const t=["svgicon cell--sorter__asc",{actived:e===O}],r=["svgicon cell--sorter__desc",{actived:e===k}];return o().createElement("div",{key:2,className:"cell--sorter",title:f("qm.table.sorter.text")},o().createElement("span",{className:we()(t)},o().createElement(bc,null)),o().createElement("span",{className:we()(r)},o().createElement(yc,null)))},V=e=>o().createElement(hc,{column:e,filters:n}),z=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===k?null:k:O;N?(delete r[i],y(Object.assign({},r,{[i]:t}))):y(Object.assign({},{[i]:t}))}},B=()=>{H&&U()},U=e=>{const t=(0,te.pickBy)(r,(e=>null!==e));for(const e in t){const r=s.find((t=>t.dataIndex===e));r?W(r,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},O)},W=(e,t)=>{const{tableFullData:r}=i.current,{dataIndex:n,sorter:a}=e,o=(e,r)=>{const i=Zr(e,n),a=Zr(r,n);return Number.isNaN(i-a)?t===O?i.toString().localeCompare(a.toString()):a.toString().localeCompare(i.toString()):t===O?i-a:a-i},l=g?w(dn(r).sort("function"==typeof a?a:o)):r.sort("function"==typeof a?a:o).slice(0);C(l)},G=()=>{D&&Y()},Y=()=>{const e=c.length?un(c):un(n),t=""!==e?g?w(Dr(dn(A),e,F)):Dr(A,e,F):A;C(t),U(!0)},X=Gr(t),Q=Ce("table"),{tableBodyWidth:Z}=a;return o().createElement("div",{ref:_,className:`${Q}--header-wrapper`},o().createElement("table",{className:`${Q}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Z?`${Z}px`:""}},(()=>{const{gutterWidth:e}=a;return o().createElement("colgroup",null,s.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})})),l&&o().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),o().createElement("thead",null,(e=>{const{isIE:t}=i.current,n=["gutter",{"cell-fix-right":!!u.length}],s=t?null:{right:u.length?0:""};return e.map(((e,t)=>o().createElement("tr",{key:t,className:"header--row"},e.map(((t,n)=>((e,t,n)=>{const{isIE:s}=i.current,{gutterWidth:c}=a,{dataIndex:d,colSpan:u,rowSpan:p,fixed:h,align:m,theadAlign:f,theadClassName:g="",sorter:b,filter:y,required:v,headRender:x}=e;if(0===u)return null;const w=f||m,C=["header--column",{"col--ellipsis":e.ellipsis??T,"col--center":"center"===w,"col--right":"right"===w,"column--required":!!v,"column-has-sorter":b,"column-has-filter":y,"column--sort":!!r[d],"cell-fix-left":!s&&"left"===h,"cell-fix-right":!s&&"right"===h,"cell-fix-left-last":!s&&"left"===h&&!n[t+(u??1)]?.fixed,"cell-fix-right-first":!s&&"right"===h&&!n[t-1]?.fixed,[g]:!!g}],N=s?null:{left:"left"===h?`${E(d)}px`:"",right:"right"===h?`${S(d,"thead")+(l?c:0)}px`:""},R=I&&![ns.expandableColumn,ns.selectionColumn].includes(d);return o().createElement("th",{key:d,className:we()(C),colSpan:u,rowSpan:p,style:{...N},onClick:t=>z(t,e)},o().createElement("div",{className:"cell--wrapper"},x?o().createElement("div",{className:"cell--text cell"},x(e,i.current.tableFullData)):o().createElement(o().Fragment,null,o().createElement("div",{className:"cell--text"},j(e)),y?V(e):null)),R&&o().createElement(mc,{column:e}))})(t,n,e))),l&&o().createElement("th",{className:we()(n),style:{...s}}))))})(X))))},xc=o().createContext([]),Ec=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Sc=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>t?.contains(e.target))),wc=(e,t)=>{const r=e.target;return!("button"in e&&e.button>0||r&&!Ec(r).contains(r)||t.current?.contains(r))};function Cc(e){let{ref:t,handler:r,enabled:n=!0,omitClassNames:i=[]}=e;const o=Yl(r),l=a.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});a.useEffect((()=>{if(!n)return;const e=e=>{wc(e,t)&&(l.current.isPointerDown=!0)},a=e=>{l.current.ignoreEmulatedMouseEvents?l.current.ignoreEmulatedMouseEvents=!1:r&&l.current.isPointerDown&&wc(e,t)&&Sc(e,i)&&(l.current.isPointerDown=!1,o(e))},s=e=>{l.current.ignoreEmulatedMouseEvents=!0,r&&l.current.isPointerDown&&wc(e,t)&&Sc(e,i)&&(l.current.isPointerDown=!1,o(e))},c=Ec(t.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",a,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",a,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[r,t,o,l,n])}function Tc(){const[,e]=a.useReducer((e=>e+1),0);return e}function Ic(){const{locale:e}=a.useContext(c);return{t:f,$locale:e}}const Nc=e=>{const{selectionKeys:t,column:r,record:n,rowKey:i}=e,{tableRef:a,isTreeTable:l,getAllChildRowKeys:s}=o().useContext($l),{rowSelection:c}=a.current.props,d=o().useMemo((()=>r.type||""),[r.type]),u=e=>{const r=c.checkStrictly??!0;if(!l||r)return!1;const n=Ur(a.current.deriveRowKeys,e);return((e,t)=>{const r=new Set(t);let n=!1,i=!1;for(const t of e)if(r.has(t)?n=!0:i=!0,n&&i)break;return n&&i})(s(n?.children??[]),t)};return"radio"===d?(()=>{const e=c.disabled,r=e?.(n),a=!r&&t[0]===i;return o().createElement(L.Radio,{checked:a,disabled:r})})():(()=>{const e=c.disabled,r=e?.(n),a=!!t.includes(i);return o().createElement(L.Checkbox,{checked:a,indeterminate:u(i),disabled:r})})()},Rc=e=>{const{record:t,rowKey:r,style:n}=e,{tableRef:i,rowExpandedKeys:a,setRowExpandedKeys:l}=o().useContext($l),{expandable:s={}}=i.current.props,[c]=o().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(t)),d=o().useMemo((()=>a.includes(r)),[a,r]);Me((()=>{s.onExpand?.(d,t)}),[d]);const u=Ce("expand"),p={[`${u}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return o().createElement("span",{className:we()(p),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?a.filter((e=>e!==r)):[...a,r];l(t)},style:n})},Pc=o().forwardRef(((e,t)=>{const{size:r,defaultValue:n,value:i,min:a,max:l,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:h,allowClear:m,readOnly:f,disabled:g,formatter:b=(e=>e.toString()),parser:y=(e=>e),onFocus:v}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>l&&(t=l.toString()),t&&Number(t)<a&&(t=a.toString()),p>=0&&""!==t&&(t=new(Ii())(t).toFixed(p)),t},E=void 0!==i,[S,w]=o().useState(n??""),C=b(E?i:S),T=y(C);return Me((()=>{e.onChange?.(T)}),[S]),o().createElement(L.Input,{ref:t,size:r,value:C,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:m,readOnly:f,disabled:g,onChange:t=>{const r=y(t.target.value);let n=/^-?\d*(\.\d*)?$/.test(r)||""===r||"-"===r;if(0===p&&r.includes(".")&&(n=!1),a>=0&&r.startsWith("-")&&(n=!1),n){if(!h&&(Number(r)>Number.MAX_SAFE_INTEGER||Number(r)<Number.MIN_SAFE_INTEGER))return;(t=>{E?e.onChange?.(t):w(t)})(r)}},onFocus:v,onBlur:()=>{const t=x(T);e.onBlur?.(t,T)},onKeyUp:t=>{13===t.keyCode&&e.onEnter?.(x(T),T)}})}));Pc.displayName="InputNumber";const Oc=Pc;function kc(){return kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kc.apply(this,arguments)}const{Search:Ac}=L.Input,Lc=o().forwardRef(((e,t)=>{const{column:r,record:n,rowKey:i,columnKey:a}=e,{tableRef:l,tableBodyRef:s,$size:c,flattenColumns:d,updateTableData:u,doFieldValidate:p,dataChange:h}=o().useContext($l),m=o().useContext(xc),g=Tc(),{store:b,fieldAuth:y}=l.current,x=r.editRender?.(n,r)||{},E=o().useRef(null),S=o().useRef(null),w=o().useRef(null),C=o().useRef(null),T=o().useRef(null),I=o().useRef(!1),N=o().useRef({}),R=o().useRef({}),P=o().useRef([]),[O,k]=o().useState(!1),[A,_]=o().useState(!1),[F,H]=o().useState(!1),[D,$]=o().useState(x.items||[]),[q,M]=o().useState(),K=(x.editable||(0,te.isEqual)(m,[i,a]))&&!x.disabled&&!y[a]?.disabled,V=`${i}|${a}`,z=2===m.length?`${m[0]}|${m[1]}`:"",U=![...b.state.required,...b.state.validate].some((e=>{let{x:t,y:r}=e;return t===i&&r===a})),W=b.state.required.find((e=>{let{x:t,y:r}=e;return t===i&&r===a}))?.text||"",G=b.state.validate.find((e=>{let{x:t,y:r}=e;return t===i&&r===a}))?.text||"",Y=b.state.edited.some((e=>{let{x:t,y:r}=e;return t===i&&r===a})),X=K||!U||O||F||A,Q=!!x.helper?.combinedDataIndex&&("search-helper"===x.type||"tree-helper"===x.type),Z=x.type?.endsWith("multiple");o().useLayoutEffect((()=>{X&&z===V&&ne()}),[m]),o().useLayoutEffect((()=>{const{items:e}=x;Z&&e&&re(e.map((e=>({[R.current.valueKey]:e.value,[R.current.textKey]:e.text}))))}),[]);const J=()=>{u(),h()},ee=(e,t)=>{k(e),t?.()},re=e=>{P.current=e},ne=()=>{const{type:e}=x;switch(e){case"text":S.current?.focus();break;case"number":w.current?.select();break;case"search-helper":C.current?.focus();break;case"tree-helper":T.current?.focus()}};o().useImperativeHandle(t,(()=>({focus:ne})));const ie=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},ae=(e,t,r)=>{const{cornerSign:n=!0}=x.extra||{};b.addToUpdated(e),n&&b.addToEdited({x:t,y:r})},le=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",ce={text:(e,t,r)=>{const{dataIndex:n}=t,{type:l,extra:s={},rules:d=[],onInput:u,onChange:h,onEnter:m,onBlur:b}=x,y=Zr(e,n),v=Object.assign({},{minRows:1,maxRows:4},s.autoSize),E=r?{rows:v.minRows,autoSize:v}:null,w=s.password?L.Input.Password:r?L.Input.TextArea:L.Input;return o().createElement(w,kc({ref:S,size:c,value:y,maxLength:s.maxLength,showCount:s.showCount},E,{autoComplete:s.password?"new-password":"off",placeholder:s.placeholder||f("qm.table.editable.inputPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,suffix:s.suffix,onChange:t=>{const r=t.target.value??"";Jr(e,n,r),p(d,r,i,a),g(),u?.({[V]:r}),I.current=!0},onFocus:()=>_(!0),onBlur:t=>{_(!1);const r=t.target.value??"";I.current&&(I.current=!1,ae(e,i,a),h?.({[V]:r},e),b?.({[V]:r},e),J())},onKeyUp:t=>{if(13===t.keyCode&&!t.shiftKey){const r=t.target.value??"";m?.({[V]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&m&&e.preventDefault()}}))},textarea:(e,t)=>ce.text(e,t,!0),number:(e,t)=>{const{dataIndex:r,precision:n,formatType:l}=t,{type:s,extra:d={},rules:u=[],onInput:h,onChange:m,onEnter:b,onBlur:y}=x,v=Zr(e,r);let E,S;return"finance"===l&&(E=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},S=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===l&&(E=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new(Ii())(e).times(100).toNumber()}`,S=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new(Ii())(e).times(.01).toString()),o().createElement(Oc,{ref:w,size:c,value:v,min:d.min,max:d.max,precision:n,stringMode:d.stringMode,prefix:d.prefix,suffix:d.suffix??("percent"===l?"%":void 0),placeholder:d.placeholder||f("qm.table.editable.inputPlaceholder"),maxLength:d.maxLength,allowClear:d.allowClear,readOnly:d.readOnly,disabled:d.disabled,formatter:E,parser:S,onChange:t=>{Jr(e,r,t),p(u,t,i,a),g(),h?.({[V]:t}),I.current=!0},onFocus:()=>_(!0),onBlur:(t,n)=>{if(_(!1),!I.current)return;I.current=!1;let o=d.stringMode?t:le(t);"percent"===l&&"."===n.charAt(n.length-1)&&(o=Number(t)/100),Jr(e,r,o),ae(e,i,a),m?.({[V]:o},e),y?.({[V]:o},e),J()},onEnter:(t,r)=>{let n=d.stringMode?t:le(t);"percent"===l&&"."===r.charAt(r.length-1)&&(n=Number(t)/100),b?.({[V]:n},e)}})},select:(e,t,r)=>{const{dataIndex:n,dictItems:l=[]}=t,{type:s,extra:d={},rules:u=[],items:h,onChange:m,onEnter:g}=x,b=h||l,y=Zr(e,n);let v=y;return o().createElement(L.Select,{mode:r?"multiple":void 0,size:c,popupClassName:"table-editable__popper",value:y||void 0,placeholder:d.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:d.allowClear,listHeight:d.listHeight,maxTagCount:d.collapseTags?"responsive":void 0,maxTagTextLength:d.maxTagTextLength,disabled:d.disabled,style:{width:"100%"},showSearch:d.filterable??!0,filterOption:(e,t)=>{const r=t?.children?.toString()||"";return`${r}|${ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{Jr(e,n,t),p(u,t,i,a),ae(e,i,a),m?.({[V]:t},e),J()},onSelect:e=>{v=e},onInputKeyDown:t=>{13===t.keyCode&&se((()=>g?.({[V]:v},e)))}},b.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ce.select(e,t,!0),date:(e,t,r)=>{const{dataIndex:n}=t,{type:l,extra:s={},rules:d=[],onChange:u}=x,h=r||"exactdate",m=Zr(e,n);return o().createElement(j,{size:c,popupClassName:"table-editable__popper",value:an(m,Tn[h])??void 0,picker:Cn[h],format:s.format,showTime:"datetime"===h,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:r}=s;return t&&r?e.isBefore(t,"day")||e.isAfter(r,"day"):t?e.isBefore(t,"day"):!!r&&e.isAfter(r,"day")})(e),placeholder:s.placeholder,allowClear:s.allowClear,disabled:s.disabled,style:{width:"100%"},onChange:t=>{const r=on(t,Tn[h]);Jr(e,n,r),p(d,r,i,a),ae(e,i,a),u?.({[V]:r},e),J()}})},datetime:(e,t)=>ce.date(e,t,"datetime"),month:(e,t)=>ce.date(e,t,"month"),year:(e,t)=>ce.date(e,t,"year"),time:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:d}=x,u="HH:mm:ss",h=Zr(e,r);return o().createElement(B,{size:c,popupClassName:"table-editable__popper",value:an(h,u)??void 0,format:l.format||u,placeholder:l.placeholder,allowClear:l.allowClear,disabled:l.disabled,style:{width:"100%"},onChange:t=>{const n=on(t,u);Jr(e,r,n),p(s,n,i,a),ae(e,i,a),d?.({[V]:n},e),J()}})},checkbox:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:c}=x,{trueValue:d=Kl,falseValue:u=Vl,disabled:h}=l,m=Zr(e,r);return o().createElement(L.Checkbox,{checked:m===d,disabled:h,onChange:t=>{const n=t.target.checked?d:u;Jr(e,r,n),p(s,n,i,a),ae(e,i,a),c?.({[V]:n},e),J()}})},switch:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:c}=x,{trueValue:d=Kl,falseValue:u=Vl,disabled:h}=l,m=Zr(e,r);return o().createElement(L.Switch,{checked:m===d,disabled:h,onChange:t=>{const n=t?d:u;Jr(e,r,n),p(s,n,i,a),ae(e,i,a),c?.({[V]:n},e),J()}})},"search-helper":(e,t)=>{const{dataIndex:r,precision:n}=t,{type:l,extra:s={},rules:u=[],helper:h={},onInput:m,onChange:g,onEnter:b}=x,y=en(e,Q?h.combinedDataIndex:r),S=h.fieldAliasMap;S||v("Table","helper 需要配置 `fieldAliasMap` 选项");const w="function"==typeof S?S():S||{};Object.keys(w).includes(r)||v("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),Q&&(h.combinedDataIndex.split("|").every((e=>Object.keys(w).includes(e)))||v("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),w[r].includes("|")&&v("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const T=e=>{const{filterAliasMap:t}=h,n=""!==e?e:void 0,i=("function"==typeof t?t():t)||[],a={[r]:n};return(Array.isArray(i)?i:[i]).forEach((e=>{if((0,te.isPlainObject)(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a},R=e=>{const{autoQueryAssign:t=!0}=h;t&&(N.current=T(e)),k(!0)},P=(r,n)=>{const{beforeOpen:i}=h,a=(i??oe)({[V]:y},e,t);a?.then?a.then((()=>{R(r),n?.()})).catch((()=>{})):!1!==a&&(R(r),n?.())},A=e=>{const t={};for(const n in w){const i=w[n];n!==r&&(t[n]=en(e,i))}const n=w[r]?en(e,w[r]):"";_(n,t);const{closed:i}=h;ee(!1,(()=>ie(E.current))),ne(),i?.(e)},L=()=>{const{onlySelect:e=!0}=h;I.current&&_(e?"":y),ee(!1,(()=>ie(E.current)))},_=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;if((0,te.isPlainObject)(o)&&Object.keys(o).length)for(const t in o){const r=o[t],n=d.find((e=>e.dataIndex===t));if(n){Jr(e,t,r,n.precision);const a=n.editRender?.(e,n);a&&Array.isArray(a.rules)&&p(a.rules,r,i,t)}else Jr(e,t,r)}Q&&!t&&((e,t,r,n)=>{if(!t.includes("|"))return Jr(e,t,"",void 0);const i="".split("|")||[];t.split("|").forEach(((t,r)=>{t&&Jr(e,t,i[r]?.trim())}))})(e,h.combinedDataIndex),Jr(e,r,t,n),p(u,t,i,a),ae(e,i,a),g?.({[V]:t},e),J(),N.current={},I.current=!1,M(void 0)},F={visible:O,title:f("qm.searchHelper.text"),width:h.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{L()}},D={...h,size:c,initialValue:Object.assign({},N.current,h.initialValue),onClose:e=>{e?A(e):L()}};return o().createElement(o().Fragment,null,o().createElement(Ac,{ref:C,value:q??y,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,onBlur:e=>{const{value:t}=e.target,{onlySelect:n=!0,table:i}=h;if(I.current&&!O)return t&&n&&i?.fetch?.api?(e=>{const{table:t,initialValue:r={}}=h,{beforeFetch:n=oe}=t.fetch;return new Promise((async(i,a)=>{const o=(0,te.merge)({},t.fetch.params,{...r,...T(e)},{currentPage:1,pageSize:500});if(!n(o))return a();H(!0);try{const e=await t.fetch.api(o);200===e.code?i(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[]):a()}catch(e){a(e)}finally{se((()=>H(!1)))}}))})(t).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=>en(t,w[r]).toString().includes(e)));if(1===t.length)return A(t[0]);P(e)}(e,t))).catch((()=>_(""))):void _(t)},onChange:e=>{const{value:t}=e.target;m?.({[V]:t}),I.current=!0,M(t)},onKeyUp:t=>{if(13===t.keyCode){const r=t.target.value??"";b?.({[V]:r},e)}},onDoubleClick:e=>{const{value:t}=e.target;P(t)},onSearch:(e,t)=>{"click"===t?.type&&"INPUT"!==t.target.tagName&&P(e)}}),o().createElement(Er,F,o().createElement(ad,D)))},"search-helper-multiple":(e,t)=>{const{dataIndex:r}=t,{type:n,items:l=[],extra:s={},rules:d=[],helper:u={},onInput:h,onChange:m,onEnter:g}=x,b=Zr(e,r),y=u.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes("valueKey")&&Object.keys(S).includes("textKey")||v("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),R.current=S;const w=r=>{const{beforeOpen:n}=u,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},T=t=>{Jr(e,r,t),p(d,t,i,a),ae(e,i,a),m?.({[V]:t},e,P.current),J()},I={visible:O,title:f("qm.searchHelper.text"),width:u.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},N={...u,size:c,multiple:!0,initialValue:(0,te.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:r,valueKey:n}=S;re((0,te.uniqBy)([...P.current.filter((e=>t.includes(e[n]))),...e],n));const i=P.current.map((e=>({text:e[r],value:e[n]}))),a=(0,te.uniqBy)([...i,...l],"value").filter((e=>t.includes(e.value)));$(a),T(a.map((e=>e.value)));const{closed:o}=u;ee(!1,(()=>ie(E.current))),o?.(P.current)})(e,t):C()}};return o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{className:"ant-input-wrapper ant-input-group"},o().createElement(L.Select,{mode:"multiple",open:!1,value:b,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&g?.({[V]:b},e)},onDoubleClick:()=>{s.disabled||w()},onChange:e=>{const{valueKey:t}=S;re(P.current.filter((r=>e.includes(r[t])))),T(e)}},D.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text)))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:s.disabled,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{w()}})))),o().createElement(Er,I,o().createElement(ad,N)))},"tree-helper":(e,t)=>{const{dataIndex:r,precision:n}=t,{type:l,extra:s={},rules:u=[],helper:h={},onChange:m,onEnter:g}=x,b=en(e,Q?h.combinedDataIndex:r),y=h.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes(r)||v("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),Q&&(h.combinedDataIndex.split("|").every((e=>Object.keys(S).includes(e)))||v("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),S[r].includes("|")&&v("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const w=r=>{const{beforeOpen:n}=h,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},I=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;if((0,te.isPlainObject)(o)&&Object.keys(o).length)for(const t in o){const r=o[t],n=d.find((e=>e.dataIndex===t));if(n){Jr(e,t,r,n.precision);const a=n.editRender?.(e,n);a&&Array.isArray(a.rules)&&p(a.rules,r,i,t)}else Jr(e,t,r)}Jr(e,r,t,n),p(u,t,i,a),ae(e,i,a),m?.({[V]:t},e),J()},N={visible:O,title:f("qm.searchHelper.text"),width:h.width??"30%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},R={...h,defaultSelectedKeys:[b],size:c,onClose:e=>{e?(e=>{const t={};for(const n in S){const i=S[n];n!==r&&(t[n]=en(e,i))}const n=S[r]?en(e,S[r]):"";I(n,t);const{closed:i}=h;ee(!1,(()=>ie(E.current))),ne(),i?.(e)})(e):C()}};return o().createElement(o().Fragment,null,o().createElement(Ac,{ref:T,value:b,allowClear:s.allowClear??!0,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{if(13===t.keyCode){const r=t.target.value??"";g?.({[V]:r},e)}},onDoubleClick:()=>{w()},onSearch:(e,t)=>{"click"===t?.type&&("INPUT"!==t.target.tagName?w():I(""))}}),o().createElement(Er,N,o().createElement(hd,R)))},"tree-helper-multiple":(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},items:s=[],rules:d=[],helper:u={},onInput:h,onChange:m,onEnter:g}=x,b=Zr(e,r),y=u.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes("valueKey")&&Object.keys(S).includes("textKey")||v("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),R.current=S;const w=r=>{const{beforeOpen:n}=u,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},T=t=>{Jr(e,r,t),p(d,t,i,a),ae(e,i,a),m?.({[V]:t},e,P.current),J()},I={visible:O,title:f("qm.searchHelper.text"),width:u.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},N={...u,size:c,multiple:!0,initialValue:(0,te.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:r}=S;re(e);const n=P.current.map((e=>({text:e[t],value:e[r]})));$(n),T(n.map((e=>e.value)));const{closed:i}=u;ee(!1,(()=>ie(E.current))),i?.(P.current)})(e):C()}};return o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{className:"ant-input-wrapper ant-input-group"},o().createElement(L.Select,{mode:"multiple",open:!1,value:b,placeholder:l.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:l.allowClear,maxTagCount:l.collapseTags?"responsive":void 0,maxTagTextLength:l.maxTagTextLength,disabled:l.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&g?.({[V]:b},e)},onDoubleClick:()=>{l.disabled||w()},onChange:e=>{const{valueKey:t}=S;re(P.current.filter((r=>e.includes(r[t])))),T(e)}},D.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text)))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:l.disabled,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{w()}})))),o().createElement(Er,I,o().createElement(hd,N)))}};return o().createElement(o().Fragment,null,X?(()=>{const{type:e}=x,t=ce[e];if(!t)return v("Table","单元格编辑的类型 `type` 配置不正确"),null;const i=["cell--edit",{"is-error":!U}];return o().createElement("div",{ref:E,className:we()(i)},t(n,r),!U&&o().createElement("div",{className:"cell-error"},W||G))})():(()=>{const{extra:t={}}=x;return o().createElement("span",{style:{color:t.disabledColor}},e.children)})(),Y&&o().createElement("i",{className:"cell--sign"}))}));Lc.displayName="CellEdit";const _c=Lc,Fc=require("copy-to-clipboard");var Hc=n.n(Fc);const Dc=function(e){if(!o().isValidElement(e))return null;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return o().cloneElement(e,...r)},$c=e=>{const{text:t,options:r,showMessage:n=!0,onCopy:i}=e;return Dc(e.children,{onClick:a=>{const l=o().Children.only(e.children),s=Hc()(t,r);i?.(t,s),s&&n&&L.message.success(f("qm.clipboard.success")),l&&l.props&&"function"==typeof l.props.onClick&&l.props.onClick(a)}})};$c.displayName="QmCopyToClipboard";const qc=$c,Mc=o().forwardRef(((e,t)=>{const{column:r,row:n,rowIndex:i,columnIndex:l,rowKey:s,depth:c,showTitle:d}=e,{flattenColumns:u,selectionKeys:p,treeExpandIndex:h,updateMark:m,isTreeTable:f}=o().useContext($l),{dataIndex:g,canCopy:b,render:y,editRender:v,shouldCellUpdate:x}=r,{t:E}=Ic(),{renderText:S,getTitleFromCellNode:w}=vs(),C=o().useRef(null),T=Zr(n,g),[I,N]=function(e,c,d){const u=a.useRef({});return"value"in u.current&&!((e,t)=>{if(x){const[,r]=e,[,i]=t;return x(i,r,n)}return!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=new Set;return function e(t,i){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n.has(t))return!1;if(t===i)return!0;if(r&&a>1)return!1;n.add(t);const o=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],i[r],o))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const r=Object.keys(t);return r.length===Object.keys(i).length&&r.every((r=>e(t[r],i[r],o)))}return!1}(e,t)}(e,t,!0)})(u.current.condition,c)||(u.current.value=(()=>{const e=y?y(T,n,r,i,l):S(T,r,n);return[e,v?o().createElement(_c,{ref:t,column:r,record:n,rowKey:s,columnKey:g},e):null]})(),u.current.condition=c),u.current.value}(0,[m,T,y,v]);o().useEffect((()=>{if([ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(g))return;const e=C.current.parentNode;d?e.title=w(I):e.removeAttribute("title")}),[d,I]);const R=e=>Array.isArray(e.children);return o().createElement("div",{ref:C,className:"cell"},(()=>{if(g===ns.expandableColumn)return o().createElement(Rc,{record:n,rowKey:s});if(g===ns.selectionColumn)return o().createElement(Nc,{selectionKeys:p,column:r,record:n,rowKey:s});if(N)return N;if(f&&g===h)return o().createElement(o().Fragment,null,(e=n._level)?o().createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*ns.treeTable.textIndent+"px"}}):null,o().createElement(Rc,{key:"expand",record:n,rowKey:s,style:R(n)?{}:{visibility:"hidden"}}),I);var e;if(b){const e=w(I);return o().createElement("div",{className:"cell--copy"},o().createElement("span",{className:"text"},I),e&&o().createElement(qc,{text:e},o().createElement(Te.CopyOutlined,{className:"icon",title:E("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return I})())}));Mc.displayName="Cell";const jc=Mc,Kc={startX:0,startY:0,startOffsetX:0,startOffsetY:0,containerSizeX:0,containerSizeY:0},Vc={open:!1,offsetX:0,offsetY:0},zc=o().forwardRef(((e,t)=>{const{tableRef:r,getRowKey:n,flattenColumns:i,mergedTdCells:a,setMergedCells:l}=o().useContext($l),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Ic(),p=o().useRef(document.onselectstart),h=o().useRef(null),m=o().useRef(null),[f,g]=o().useState(null),[b,y]=o().useState(null),[v,x]=o().useState(null);Cc({ref:h,handler:()=>D()});const E=o().useRef(Kc),S=e=>{E.current=Object.assign({},E.current,e)};o().useEffect((()=>{const e=Gt()(c.$tableBody,"mousedown",k),t=Gt()(c.$tableBody,"contextmenu",P),r=Gt()(document,"keydown",O);return()=>{e.remove(),t.remove(),r.remove()}}),[]);const w=()=>{g(null),y(null),x(null)};o().useImperativeHandle(t,(()=>({blur:w})));const C=()=>c.$tableBody.parentNode,T=e=>{const{offsetLeft:t,offsetTop:r,offsetWidth:n,offsetHeight:i}=e;return{rowKey:e.parentNode.getAttribute("data-row-key"),colIndex:Number(e.getAttribute("data-col-index")),l:t,t:r,w:n,h:i}},I=Ot(((e,t)=>{let r=null;const n=c.$tableBody.querySelectorAll("tbody > tr");for(let i=0;i<n.length;i++){if(n[i].offsetTop>t||n[i].offsetTop+n[i].offsetHeight<t)continue;const a=n[i].querySelectorAll("td");for(let t=0;t<a.length;t++)if(!(a[t].offsetLeft>e||a[t].offsetLeft+a[t].offsetWidth<e)){r=a[t];break}break}r&&y(T(r))}),5),N=Yl((()=>{const e=[];if(!f||!b)return e;const[t,r]=[f.colIndex,b.colIndex],[a,o]=[f.rowKey,b.rowKey];let[l,s]=[0,0];for(let e=0;e<d.length;e++){const t=n(d[e],d[e].index);if(t==a&&(l=e),t==o){s=e;break}}const c=i.slice(Math.min(t,r),Math.max(t,r)+1);return d.slice(l,s+1).forEach((t=>{for(let r=0;r<c.length;r++){const{dataIndex:i}=c[r];e.push({rowKey:n(t,t.index),dataIndex:i,cellValue:Zr(t,i)})}})),e})),R=e=>{l(e),s.onCellMerge?.(e),se((()=>w()))},P=Yl((e=>{s.cellMerge&&f&&F(e.clientX,e.clientY)?(e.preventDefault(),H(e)):v?.open&&D()})),O=e=>{27===e.keyCode&&w()},k=Yl((e=>{e.stopPropagation();const t=(e=>{let t=e;for(;t;){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null})(e.target);if(1!==e.buttons||!t)return;D(),setTimeout((()=>{g(T(t)),y(T(t))}));const[r,n]=[c.$tableBody.getBoundingClientRect().top,C().getBoundingClientRect().left],{offsetWidth:i,offsetHeight:a}=C();S({startX:e.clientX,startY:e.clientY,startOffsetX:e.clientX-n,startOffsetY:e.clientY-r,containerSizeX:i,containerSizeY:a}),document.addEventListener("mousemove",A),document.addEventListener("mouseup",L),p.current=document.onselectstart,document.onselectstart=()=>!1})),A=e=>{const t=e.clientX-E.current.startX,r=e.clientY-E.current.startY,n=E.current.startOffsetX+t,i=E.current.startOffsetY+r;I(Math.min(n,E.current.containerSizeX),Math.min(i,E.current.containerSizeY))},L=()=>{S(Kc),s.onSelectChange?.(N()),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",L),_()},_=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)},F=(e,t)=>{const{top:r,left:n}=C().getBoundingClientRect(),[i,a]=[e-n,t-r],{el:o,et:l,ew:s,eh:c}=M();return!(i<o||i>o+s||a<l||a>l+c)},H=e=>{const{top:t,left:r,height:n}=m.current.getBoundingClientRect();x({open:!0,offsetX:e.clientX-r,offsetY:-1*(n-(e.clientY-t))})},D=()=>{x((e=>({...e,open:!1})))},$=()=>{if(!f||!b||(t=b,(e=f).rowKey===t.rowKey&&e.colIndex===t.colIndex))return w();var e,t;const[r,o]=f.t<=b.t?[f.rowKey,b.rowKey]:[b.rowKey,f.rowKey],[l,s]=[f.colIndex,b.colIndex];let[c,u]=[0,0],p=r;for(let e=0;e<d.length;e++){const t=d[e],i=n(t,t.index);if(i==r&&(p=i,c=e),i==o){u=e;break}}const h={rowKey:p,dataIndex:i[Math.min(l,s)].dataIndex,rowSpan:u-c+1,colSpan:Math.abs(s-l+1)};R([...a.filter((e=>!(e.rowKey===h.rowKey&&e.dataIndex===h.dataIndex))),h])},q=()=>{let e=f.rowKey;const t=f.colIndex;for(let t=0;t<d.length;t++){const r=d[t],i=n(r,r.index);if(i==e){e=i;break}}const r=e,o=i[t].dataIndex;R(a.filter((e=>!(e.rowKey===r&&e.dataIndex===o))))},M=()=>{const{w:e,h:t,l:r,t:n}=f;let{w:i,h:a,l:o,t:l}=b;return i=o-r>0?o-r+i:Math.abs(o-r)+e,a=l-n>0?l-n+a:Math.abs(l-n)+t,o=o>r?r:o,l=l>n?n:l,{sl:r,st:n,sw:e,sh:t,el:o,et:l,ew:i,eh:a}},j=Ce("table");return o().createElement("div",{className:`${j}--area-select`},(()=>{if(!f||!b)return null;const{sl:e,st:t,sw:r,sh:n,el:i,et:a,ew:l,eh:s}=M(),{open:c,offsetX:d,offsetY:p}=v||Vc,g=o().createElement("ul",{ref:h,className:"ant-dropdown-menu"},o().createElement("li",{className:"ant-dropdown-menu-item",onClick:$},u("qm.table.areaSelect.mergeCell")),o().createElement("li",{className:"ant-dropdown-menu-item",onClick:q},u("qm.table.areaSelect.cancelMerge")));return o().createElement(o().Fragment,null,o().createElement("div",{className:"active-area",style:{left:e,top:t,width:r,height:n}}),o().createElement(Wi(),{popupVisible:c,popup:g,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:"table-editable__popper",builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,p+4],overflow:{adjustX:1,adjustY:1}}}},o().createElement("div",{ref:m,className:"checked-area",style:{left:i,top:a,width:l,height:s}})))})())}));zc.displayName="AreaSelect";const Bc=zc,Uc=o().forwardRef(((e,t)=>{const{tableFlatColumns:r,tableData:n}=e,{getRowKey:i,tableRef:a,flattenColumns:l,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:h,showFooter:m,scrollX:f,scrollY:g,selectionKeys:b,rowExpandedKeys:y,highlightKey:v,isPingLeft:x,isPingRight:E,isTableEmpty:S,isTreeTable:w,isGroupSubtotal:C,isWebPagination:T,setElementStore:I,createTableFullData:N,setSelectionKeysEffect:R,setHighlightKey:P,getStickyLeft:O,getStickyRight:k,scrollXToColumn:A,scrollYToRecord:L,rowInViewport:_,dataChange:F,setPingLeft:H,setPingRight:D,setFullScreen:$,findParentRowKeys:q,getAllChildRowKeys:M,triggerScrollXEvent:j,triggerScrollYEvent:K,scrollBottomDebouncer:V}=o().useContext($l),{height:z,minHeight:B,maxHeight:U,rowHeight:W,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Q,summation:Z,rowStyle:J,cellStyle:ee,spanMethod:re,tableConfig:ne,areaSelection:ie,nativeScrollBar:le,ellipsis:se,showHeader:ce,rowDraggable:de,onRowClick:ue,onRowDblclick:pe,onRowContextmenu:he,onRowEnter:me}=a.current.props,fe=o().useRef(null),ge=o().useRef({}),be=o().useRef(null),ye=o().useRef(null),ve=o().useRef(null),xe=o().useRef({prevST:0,prevSL:0}),Ee=a.current.scrollXLoad?r:l,Se=o().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:r,tableFullHeight:n,tableAutoHeight:i}=h,a={};return S&&Object.assign(a,{minHeight:"100px"}),B&&Object.assign(a,{minHeight:Xr(B)-e-r+"px"}),U&&Object.assign(a,{maxHeight:Xr(U)-e-r+"px"}),z||n||i?{...a,maxHeight:"",minHeight:"",height:`${t}px`}:a}),[z,U,B,S,h]),Te=o().useMemo((()=>{const{scrollYStore:e}=a.current,{viewportHeight:t,gutterWidth:r}=h;return Math.floor((f?t-r:t)/e.rowHeight)}),[h,f]),[Ie,Ne]=o().useState([]),Re=Tc();Cc({ref:fe,omitClassNames:[".table-editable__popper"],handler:()=>{Ae([]),ve.current?.blur()}}),o().useImperativeHandle(t,(()=>({setClickedValues:Ae,createFocus:ke,forceUpdate:Re}))),Me((()=>{Ie.length&&a.current.tableManager.focus(a.current.uid)}),[Ie]),o().useLayoutEffect((()=>{Oe();const e=Gt()(document,"keydown",Pe);return()=>e.remove()}),[]);const Pe=Yl((e=>{const{keyCode:t}=e;if(a.current.uid===a.current.tableManager.getFocusInstance()?.id&&(27===t&&(Ae([]),P(""),$(!1)),Ie.length&&(Xe(document.activeElement,fe.current)||"INPUT"!==document.activeElement?.tagName))){if(13===t&&("radio"===G?.type||Y)){const t=b[0]??v??null,r=n.find((e=>i(e,e.index)===t))??null;r&&me?.(r,e)}if(38===t||40===t){Ve(e);const{allTableData:r}=a.current,o=T?Wr(n):r,l=o.length;let s=o.findIndex((e=>i(e,e.index)===Ie[0]));const c=38===t?(--s+l)%l:++s%l,d=o[c],u=i(d,d.index);"radio"!==G?.type||G.disabled?.(d)||R([u]),Y&&!Y.disabled?.(d)&&P(u),_(c)||(38===t&&L(u,c),40===t&&L(u,Te>c+1?0:c+1-Te)),Ae([u,Ie[1]])}if(9===t){if(Ve(e),!s.length)return Ae([]);const t=s.length;let r=s.findIndex((e=>e.dataIndex===Ie[1]));const n=++r%t,i=s[n].dataIndex;Ae([Ie[0],i]),A(i)}}})),Oe=()=>{I("$tableBody",fe.current),I("$tableXspace",be.current),I("$tableYspace",ye.current)},ke=(e,t)=>{ge.current[`${e}-${t}`]?.focus()},Ae=e=>{(0,te.isEqual)(e,Ie)||Ne(e)},Le=(e,t,r)=>r?[...t,e]:t.filter((t=>t!==e)),_e=(e,t,r)=>{const{disabled:n}=G||{},{deriveRowKeys:i,recordsMap:o}=a.current,l=Ur(i,e);let s=[],c=M(l?.children||[]);return n&&(c=c.filter((e=>!o.has(e)||!n(o.get(e))))),s=r?[...new Set([...t,e,...c])]:t.filter((t=>![e,...c].includes(t))),(mn(i,e)?.slice(0,-1).reverse()||[]).forEach((e=>{const t=Ur(i,e),r=t?.children?.every((e=>s.includes(e.rowKey)));s=r?[...s,e]:s.filter((t=>t!==e))})),s},Fe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((e=>{const n=e.index,l=i(e,e.index);if(r.push(He(e,n,l,t)),X?.expandedRowRender){const{expandedRowClassName:t,rowExpandable:i=oe}=X;y.includes(l)&&i(e)&&r.push(o().createElement("tr",{key:`expand_${l}`,className:"body--row-expanded"},o().createElement("td",{colSpan:Ee.length,className:"body--column",style:{paddingLeft:G?2*ns.selectionColumnWidth:ns.selectionColumnWidth}},o().createElement("div",{className:we()("cell",t)},X.expandedRowRender(e,n)))))}if(!a.current.scrollYLoad&&(e=>Array.isArray(e.children))(e)){const n="function"!=typeof X?.rowExpandable||X.rowExpandable(e);y.includes(l)&&n&&r.push(...Fe(e.children,t+1))}})),r},He=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const{disabled:i}=G||{},a=["body--row",{"body--row-striped":Q&&t%2!=0,"body--row-selected":b.includes(r)&&!i?.(e),"body--row-current":v===r,...C?je(e._group):null}];return o().createElement("tr",{key:r,"data-row-key":r,className:we()(a)},Ee.map(((i,a)=>De(i,a,e,t,r,n))))},De=(e,t,r,n,s,u)=>{const{isIE:h}=a.current,{dataIndex:m,fixed:f,align:g,className:y="",editRender:v}=e;a.current.scrollXLoad&&(t=l.findIndex((e=>e.dataIndex===m)));const{rowSpan:x,colSpan:E}=$e(r,e,n,t);if(!x||!E)return null;const S=e.ellipsis??se,T=!h&&"left"===f,I=!h&&"right"===f,N=["body--column",{"col--ellipsis":S,"col--center":"center"===g,"col--right":"right"===g,"column--sort":!!p[m],"cell-fix-left":T,"cell-fix-right":I,"cell-fix-left-last":T&&c[c.length-E]?.dataIndex===m,"cell-fix-right-first":I&&d[0]?.dataIndex===m,[y]:!!y}],A=I&&E>1?l.slice(t+1,t+E).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0):0,L=h?null:{left:T?`${O(m)}px`:"",right:I?k(m)-A+"px":""},_=J?"function"==typeof J?J(r,n):J:null,F=ee?"function"==typeof ee?ee(r,e,n,t):ee:null,H=C?qe(r._group):null,D=Object.assign({},L,W?{height:W}:null,H,_,F);if(v){const{extra:t}=v(r,e)||{};t?.disabledBackgroundColor&&Object.assign(D,{backgroundColor:t?.disabledBackgroundColor})}return o().createElement("td",{key:m,"data-col-index":t,rowSpan:x>1?x:void 0,colSpan:E>1?E:void 0,className:we()(N),style:D,onClick:t=>((e,t,r)=>{const{dataIndex:n}=r;if([ns.expandableColumn,ns.operationColumn].includes(n))return;const a=i(t,t.index);Ae([a,n]);const o=r.editRender?.(t,r),l=o&&!o.disabled,{type:s,selectByClickRow:c=!0,disabled:d=ae}=G||{};!s||d(t)||l||(c||n===ns.selectionColumn)&&((e,t)=>{const{type:r,checkStrictly:n=!0,onSelect:i}=G||{};if("radio"===r&&R([e]),"checkbox"===r){const r=!b.includes(e),a=w&&!n?_e(e,b,r):Le(e,b,r);R(a),i?.(r,t,a)}})(a,t),[ns.selectionColumn].includes(n)||(!Y||Y.disabled?.(t)||l||P(a),ue?.(t,r,e))})(t,r,e),onDoubleClick:t=>((e,t,r)=>{const{dataIndex:n}=r;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(n)||pe?.(t,r,e)})(t,r,e),onContextMenu:t=>((e,t,r)=>{const{dataIndex:n}=r;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(n)||he?.(t,r,e)})(t,r,e)},o().createElement(jc,{ref:e=>ge.current[`${s}-${m}`]=e,row:r,column:e,rowIndex:n,columnIndex:t,rowKey:s,depth:u,showTitle:S}))},$e=(e,t,r,i)=>{let a=1,o=1;if("function"==typeof re){const l=re({row:e,column:t,rowIndex:r,columnIndex:i,tableData:n});if(Array.isArray(l)?(a=l[0],o=l[1]):(0,te.isPlainObject)(l)&&(a=l.rowSpan,o=l.colSpan),e===n[0]&&0===a){a=1;for(let e=1;e<n.length;e++){const{rowSpan:r}=$e(n[e],t,n[e].index,i);if(r>0)break;a++}}}if(u.length>0){const e=u.find((e=>e.row===r&&e.col===i));e&&(a=e.rowSpan,o=e.colSpan)}return{rowSpan:a,colSpan:o}},qe=e=>{const{backgroundColor:t,color:r}=Z.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:r}},je=e=>{const t=Z.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ke=Ce("table");return o().createElement(o().Fragment,null,o().createElement(Ht,{ref:a.current.scrollBarRef,wrapClassName:`${Ke}--body-wrapper`,wrapStyle:Se,native:le,showTopScrollbar:ne?.doubleXScrollbar,onScroll:e=>{const{elementStore:t,scrollXLoad:r,scrollYLoad:n}=a.current,{prevST:i,prevSL:o}=xe.current,l=g?h.gutterWidth:0,{scrollTop:s,scrollLeft:c}=e;if(c!==o){ce&&(t.$header.scrollLeft=c),m&&(t.$footer.scrollLeft=c);const e=c>0,r=Math.ceil(c)+h.tableWidth<h.tableBodyWidth+l;x!==e&&H(e),E!==r&&D(r)}if(n&&s!==i&&K(s),r&&c!==o&&j(c),g&&s!==i){const r=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+h.viewportHeight-l>=r&&V({type:"scroll",target:e,preventDefault:ae,stopPropagation:ae})}xe.current.prevST=s,xe.current.prevSL=c}},o().createElement("div",{ref:ye,className:"body--y-space"}),o().createElement("div",{ref:be,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),o().createElement(xc.Provider,{value:Ie},o().createElement("table",{ref:fe,className:`${Ke}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0",style:{width:0}},o().createElement("colgroup",null,Ee.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})}))),de?o().createElement(hi.ReactSortable,{itemKey:e=>i(e,e.index),tag:"tbody",animation:200,list:n,setList:e=>{const t=e.map((e=>i(e,e.index))),r=n.map((e=>i(e,e.index)));if((0,te.isEqual)(t,r))return;const o=bn(e),l=[];a.current.tableFullData.forEach((e=>{n.includes(e)?l.push(o.shift()):l.push(e)})),N(l),F()}},n.map((e=>He(e,e.index,i(e,e.index))))):o().createElement("tbody",null,Fe(n)))),!!ie&&o().createElement(Bc,{ref:ve})))}));Uc.displayName="TableBody";const Wc=Uc,Gc=e=>{const{summationRows:t}=e,{tableRef:r,sorter:n,layout:i,scrollY:a,flattenColumns:l,leftFixedColumns:s,rightFixedColumns:c,setElementStore:d,getStickyLeft:u,getStickyRight:p}=o().useContext($l),{footRender:h}=r.current.props,m=o().useRef(null);o().useLayoutEffect((()=>{g()}),[]);const g=()=>{d("$footer",m.current)},b=Ce("table"),{tableBodyWidth:y}=i;return o().createElement("div",{ref:m,className:`${b}--footer-wrapper`},h?h(l,r.current.tableFullData):o().createElement("table",{className:`${b}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:y?`${y}px`:""}},(()=>{const{gutterWidth:e}=i;return o().createElement("colgroup",null,l.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})})),a&&o().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),o().createElement("tfoot",null,(()=>{const{isIE:e}=r.current,d=["gutter",{"cell-fix-right":!!c.length}],h=e?null:{right:c.length?0:""};return t.map(((e,t)=>o().createElement("tr",{key:t,className:"footer--row"},l.map(((t,l)=>((e,t,l)=>{const{isIE:d}=r.current,{gutterWidth:h}=i,{dataIndex:m,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!n[m],"cell-fix-left":!d&&"left"===g,"cell-fix-right":!d&&"right"===g,"cell-fix-left-last":!d&&"left"===g&&s[s.length-1]?.dataIndex===m,"cell-fix-right-first":!d&&"right"===g&&c[0]?.dataIndex===m}],x=d?null:{left:"left"===g?`${u(m)}px`:"",right:"right"===g?`${p(m)+(a?h:0)}px`:""},E=y?.render?y.render(r.current.tableFullData):Zr(t,`${m}_text`),S=0===l&&""===E?f("qm.table.config.summaryText"):E;return o().createElement("td",{key:m,title:S,className:we()(v),style:{...x}},o().createElement("div",{className:"cell"},S))})(t,e,l))),a&&o().createElement("td",{className:we()(d),style:{...h}}))))})())))};var Yc=function(e){return e.small="small",e.middle="default",e.large="default",e}(Yc||{});const Xc=e=>{const{current:t,pageSize:r,total:n,onChange:i}=e,{global:a}=o().useContext(c),{tableRef:l,$size:s,setElementStore:d}=o().useContext($l),{uniqueKey:u,paginationConfig:p,infoBarConfig:h}=l.current.props,m=o().useRef(null),f=o().useMemo((()=>u?`tablePager_${u}`:""),[u]);o().useLayoutEffect((()=>{g(),x()}),[]);const g=()=>{d("$pager",m.current)},b=p?.showSizeChanger??ns.pagination.showSizeChanger,y=p?.showQuickJumper??ns.pagination.showQuickJumper,v=p?.pageSizeOptions||a?.table?.pagination?.pageSizeOptions||ns.pagination.pageSizeOptions,x=async()=>{if(!f)return;const e=await E(f);e&&e!==r&&(i(t,e),localStorage.setItem(f,e.toString()))},E=async e=>{const t=a?.getComponentConfigApi;if(t&&!localStorage.getItem(f))try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},S=Ce("table"),w={[`${S}-pager`]:!0};return o().createElement("div",{ref:m,className:we()(w)},o().createElement("div",{className:"pager-alert"},"bottom"===h?.position&&o().createElement(ms,{total:n})),o().createElement(L.Pagination,{size:Yc[s],showSizeChanger:b,showQuickJumper:y,pageSizeOptions:v,current:t,pageSize:r,total:n,onChange:(e,t)=>{i(e,t)},onShowSizeChange:(e,t)=>{f&&((async(e,t)=>{const r=a?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})(f,t),localStorage.setItem(f,`${t}`))}}))},Qc=()=>{const{layout:e}=o().useContext($l),t=o().useMemo((()=>{const{headerHeight:t,viewportHeight:r}=e;return{top:`${t}px`,height:`${r}px`}}),[e]),r=Ce("table");return o().createElement("div",{className:`${r}--empty`,style:t},o().createElement(ft,null))},Zc=()=>{const{setElementStore:e}=o().useContext($l),t=o().useRef(null);o().useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",t.current)},n=Ce("table");return o().createElement("div",{ref:t,className:`${n}--resizable-bar`})};function Jc(){return Jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jc.apply(this,arguments)}const ed=o().forwardRef(((e,t)=>{const r=((e,t)=>({...e,...Object.keys(t).reduce(((r,n)=>(r[n]=void 0!==t[n]?t[n]:e[n],r)),{})}))(Ml,e),{rowKey:n,columns:i,loading:a,resizable:l,customClass:s,areaSelection:d,tablePrint:u,exportExcel:p,infoBarConfig:h,topSpaceAlign:m,showTableInfo:f,showFullScreen:g,showRefresh:b,showToolBox:y,showHeader:x}=r,{size:E}=o().useContext(c),S=o().useMemo((()=>r.size??E??""),[r.size,E]),w=o().useRef(null),C=o().useRef(null),T=o().useRef(null),I=o().useRef(null),N=o().useRef(null),R=Yl(((e,t)=>{const r="function"==typeof n?n(e,t):e?.[n];return void 0===r?(v("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):r})),{tableRef:P,tableFullData:O,setElementStore:k,setOriginColumns:A,setTableFullData:L,setTableOriginData:_,setTableFlatData:F,setAllTableData:H,setDeriveRowKeys:D,setInvalidRowKeys:$,setFieldAuth:q,setColumnsDefined:M,setScrollXStore:j,setScrollYStore:K,setScrollXLoad:V,setScrollYLoad:z,setResizeState:B,setHandleState:U,setSummaries:W,setSelectionRows:G,setShouldToTop:Y,setRecordsMap:X,setUnMounted:Q,clearElementStore:Z,clearRecordsMap:J}=((e,t)=>{let{getRowKey:r,$size:n}=t;const{rowHeight:i,dynamicThead:a}=e,l=o().useRef({props:e,uid:Zl(),tableManager:es,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],tableFlatData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:o().createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:i||ns.rowHeightMaps[n]},store:new rs,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,isIE:!re&&/MSIE|Trident/.test(navigator.userAgent)});(e=>{l.current.props=e})(e);const s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return e.map((e=>{const o=r(e,e.index),l=n?`${n}#${o}`:`${o}`,c=i?`${i}.${e.index+1}`:`${e.index+1}`,d={level:a,rowKey:o,rowKeyPath:l,indexPath:c};return e.indexPath=c,e._level=a,Array.isArray(e.children)&&(d.children=s(e.children,o,l,c,a+1)),t?Object.assign({},d,{parentRowKey:t}):d}))},c=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...c(e.children)):t.push(e.rowKey)})),t};return{tableRef:l,...l.current,setElementStore:(e,t)=>{l.current.elementStore[e]=t},setOriginColumns:e=>{l.current.originColumns=e},setTableFullData:e=>{l.current.tableFullData=e},setTableFlatData:e=>{l.current.tableFlatData=e},setTableOriginData:e=>{l.current.tableOriginData=e},setAllTableData:e=>{const t=Wr(e);l.current.allTableData=t,l.current.allRowKeys=t.map((e=>r(e,e.index)))},setDeriveRowKeys:e=>{const t=l.current.tableFullData.some((e=>Array.isArray(e.children)));l.current.treeTable=t,l.current.deriveRowKeys=t?s(e,""):[],l.current.flattenRowKeys=t?c(l.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{l.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{l.current.fieldAuth[e]=t},setColumnsDefined:e=>{l.current.columnsDefined=e},setScrollXStore:e=>{l.current.scrollXStore=e},setScrollYStore:e=>{l.current.scrollYStore=e},setResizeState:e=>{l.current.resizeState=e},setHandleState:e=>{l.current.handleState=e},setSummaries:e=>{l.current.summaries=e},setScrollXLoad:e=>{l.current.scrollXLoad=e},setScrollYLoad:e=>{l.current.scrollYLoad=e},setShouldToTop:e=>{l.current.shouldToTop=e},setSelectionRows:e=>{l.current.selectionRows=e},setRecordsMap:(e,t)=>{l.current.recordsMap.set(e,t)},setUnMounted:e=>{l.current.unMounted=e},clearElementStore:()=>{for(const e in l.current.elementStore)l.current.elementStore[e]=null},clearRecordsMap:()=>{l.current.recordsMap.clear()}}})(r,{getRowKey:R,$size:S}),{tableData:ee,setTableData:ne,tableFlatColumns:ie,setTableFlatColumns:ae,filters:oe,setFilters:le,sorter:ce,setSorter:de,superFilters:ue,setSuperFilters:he,pagination:me,setPagination:fe,selectionKeys:ge,setSelectionKeys:be,rowExpandedKeys:ye,setRowExpandedKeys:ve,highlightKey:xe,setHighlightKey:Ee,updateMark:Se,forceUpdate:Te,mergedTdCells:Ie,setMergedCells:Ne,layout:Re,setLayout:Pe,permission:Oe,setPermission:ke,spinning:Ae,setSpinning:Le,scrollX:_e,setScrollX:Fe,scrollY:He,setScrollY:De,isPingLeft:$e,setPingLeft:qe,isPingRight:je,setPingRight:Ke,isFullScreen:Ve,setFullScreen:ze,updateTableData:Be}=(e=>{const{uniqueKey:t,nativeScrollBar:r,initialSorter:n={},initialFilter:i={},paginationConfig:a,rowSelection:l,expandable:s,rowHighlight:d,mergedCells:u}=e,{global:p}=o().useContext(c),h={current:a?.current??ns.pagination.current,pageSize:(()=>{if(t)return Number(localStorage.getItem(`tablePager_${t}`))||void 0})()??a?.pageSize??p?.table?.pagination?.pageSize??ns.pagination.pageSize,total:0},m=l?.selectedRowKeys??l?.defaultSelectedRowKeys??[],f=s?.expandedRowKeys??s?.defaultExpandedRowKeys??[],[g,b]=o().useState([]),[y,v]=o().useState([]),[x,E]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),i),[S,w]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),n),[C,T]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),[]),[I,N]=o().useState(h),[R,P]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),m),[O,k]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),f),[A,L]=o().useState(d?.currentRowKey??""),[_,F]=o().useReducer((e=>e+1),0),[H,D]=as([],{value:u}),[$,q]=o().useState({gutterWidth:r?ls():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[M,j]=o().useState({export:!0,import:!0,print:!0}),[K,V]=o().useState(!1),[z,B]=o().useState(!1),[U,W]=o().useState(!1),[G,Y]=o().useState(!1),[X,Q]=o().useState(!1),[Z,J]=o().useState(!1);return{tableData:g,setTableData:b,tableFlatColumns:y,setTableFlatColumns:v,filters:x,setFilters:E,sorter:S,setSorter:w,superFilters:C,setSuperFilters:T,pagination:I,setPagination:N,selectionKeys:R,setSelectionKeys:P,rowExpandedKeys:O,setRowExpandedKeys:k,highlightKey:A,setHighlightKey:L,updateMark:_,forceUpdate:F,mergedTdCells:H,setMergedCells:D,layout:$,permission:M,setPermission:j,setLayout:q,spinning:K,setSpinning:V,scrollX:z,setScrollX:B,scrollY:U,setScrollY:W,isPingLeft:G,setPingLeft:Y,isPingRight:X,setPingRight:Q,isFullScreen:Z,setFullScreen:J,updateTableData:()=>b([...g])}})(r),{isFetch:Ue,isWebPagination:We,isScrollPagination:Ge,showPagination:Ye,shouldUpdateHeight:Xe,tableColumns:Qe,flattenColumns:Ze,editableColumns:Je,summationColumns:et,leftFixedColumns:tt,rightFixedColumns:rt,derivedMergeCells:nt,treeExpandIndex:it,showSummary:at,showFooter:ot,isHeadGroup:lt,bordered:st,isHeadSorter:ct,isHeadFilter:dt,isServiceSummation:ut,isSelectCollection:pt,isTableImport:ht,isTableClipboard:mt,isSuperSearch:ft,isFastSearch:gt,isGroupSummary:bt,isGroupSubtotal:yt,isTreeTable:vt,isTableEmpty:Et,summationRows:St,fetchParams:wt}=cs(r,{getRowKey:R,tableRef:P,tableFullData:O,tableData:ee,sorter:ce,filters:oe,superFilters:ue,selectionKeys:ge,pagination:me,mergedTdCells:Ie}),{createElementStore:Ct,tableStyles:Tt,getSpan:It,getStickyLeft:Nt,getStickyRight:Rt,scrollXToColumn:Pt,scrollYToRecord:Ot,rowInViewport:kt,calcTableHeight:At,resetTableScroll:Lt,computeVirtualX:_t,computeVirtualY:Ft,doLayout:Ht}=hs(r,{getRowKey:R,tableRef:P,topElementRef:w,tableElementRef:C,$size:S,tableColumns:Qe,flattenColumns:Ze,leftFixedColumns:tt,derivedMergeCells:nt,layout:Re,scrollX:_e,scrollY:He,showFooter:ot,showPagination:Ye,isFullScreen:Ve,setLayout:Pe,setScrollX:Fe,setScrollY:De,setElementStore:k,setScrollXStore:j,setScrollYStore:K,setShouldToTop:Y}),{initialTable:Dt,checkDataIndex:$t,createTableFullData:qt,getTableData:Mt,handleTableData:jt,createWebPageData:Kt,createTableData:Vt,createGroupData:zt,createSelectionKeys:Bt,createRowExpandedKeys:Ut,setSelectionKeysEffect:Wt,findParentRowKeys:Gt,getAllChildRowKeys:Yt,doFieldValidate:Xt,getTableLog:Qt,dataChange:Zt,tableChange:Jt,toLastPage:er,toFirstPage:tr,getPageCount:rr,pagerChangeHandle:nr,triggerScrollXEvent:ir,triggerScrollYEvent:ar,scrollBottomDebouncer:or,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearRowSelection:dr,clearRowHighlight:ur,clearTableLog:pr,destroy:hr}=ps(r,{getRowKey:R,tableRef:P,tableElementRef:C,tableBodyRef:T,$size:S,tableColumns:Qe,flattenColumns:Ze,tableFullData:O,pagination:me,layout:Re,filters:oe,sorter:ce,superFilters:ue,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,summationColumns:et,shouldUpdateHeight:Xe,isFetch:Ue,isTreeTable:vt,isWebPagination:We,isScrollPagination:Ge,isServiceSummation:ut,isGroupSubtotal:yt,doLayout:Ht,setTableData:ne,setTableFlatColumns:ae,setTableFullData:L,setTableOriginData:_,setTableFlatData:F,setAllTableData:H,setDeriveRowKeys:D,setPagination:fe,setSpinning:Le,setSorter:de,setFilters:le,setSuperFilters:he,setSelectionKeys:be,setRowExpandedKeys:ve,setHighlightKey:Ee,setSelectionRows:G,setScrollXLoad:V,setScrollYLoad:z,setScrollXStore:j,setScrollYStore:K,computeVirtualX:_t,computeVirtualY:Ft,setFieldAuth:q,setResizeState:B,setSummaries:W,setPermission:ke,setRecordsMap:X,resetTableScroll:Lt,clearElementStore:Z,clearRecordsMap:J});((e,t)=>{const{columns:r,summation:n,rowSelection:i,expandable:a,rowHighlight:l}=e,{tableRef:s,tableBodyRef:c,$size:d,scrollX:u,pagination:p,selectionKeys:h,rowExpandedKeys:m,highlightKey:f,summationRows:g,showSummary:b,isWebPagination:y,isScrollPagination:x,isTreeTable:E,checkDataIndex:S,toLastPage:w,toFirstPage:C,getPageCount:T,setHandleState:I,scrollYToRecord:N,setSelectionKeysEffect:R,setOriginColumns:P,setRowExpandedKeys:O,setHighlightKey:k,setResizeState:A,setPingRight:L,setUnMounted:_,calcTableHeight:F,createSelectionKeys:H,createRowExpandedKeys:D,initialTable:$,destroy:q}=t,M=o().useRef(g);Me((()=>{if(!i)return;const{onChange:e}=i;"radio"===i.type&&c.current.setClickedValues(h.length?[h[0],""]:[]),h.__prevent__||e?.(h,s.current.selectionRows),delete h.__prevent__}),[h]),Me((()=>{if(!a)return;const{onChange:e}=a;m.__prevent__||e?.(m,m.map((e=>s.current.recordsMap.get(e)))),delete m.__prevent__}),[m]),Me((()=>{E&&O(D()),l&&(c.current.setClickedValues(f?[f,""]:[]),l.onChange?.(f,s.current.recordsMap.get(f)??null))}),[f]),Me((()=>{(0,te.isEqual)(g,M.current)||(M.current=g,b&&n&&n.onChange?.(g))}),[g]),Me((()=>{const e=H(i.selectedRowKeys);(0,te.isEqual)(e,h)||(e.__prevent__=!0,R(e),E&&O(D()))}),[i?.selectedRowKeys]),Me((()=>{const e=D(a.expandedRowKeys);(0,te.isEqual)(e,m)||(e.__prevent__=!0,O(e))}),[a?.expandedRowKeys]),Me((()=>{const{currentRowKey:e}=l;e!==f&&k(e??"")}),[l?.currentRowKey]),Me((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?w():C()),N("","after"===e?1e5:0)),t&&p.current>T()&&w(),(e||t)&&I({insert:null,remove:!1})}),[p.total]),Me((()=>{L(u)}),[u]),Me((()=>{F()}),[d]),Me((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||v("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||v("Table","必须设置组件参数 `ellipsis`")),x&&(e.height||e.maxHeight||v("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,x]);const j=Yl((()=>{const{resizeState:e}=s.current,{winHeight:t}=e,r=window.innerHeight;r!==t&&(A(Object.assign({},e,{winHeight:r})),F())}));o().useEffect((()=>(P(pe(r)),$(),window.addEventListener("resize",j,!1),S(),se((()=>F())),()=>{q(),window.removeEventListener("resize",j),_(!0)})),[])})(r,{tableRef:P,tableBodyRef:T,$size:S,scrollX:_e,pagination:me,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,showSummary:at,summationRows:St,isWebPagination:We,isScrollPagination:Ge,isTreeTable:vt,checkDataIndex:$t,toLastPage:er,toFirstPage:tr,getPageCount:rr,setHandleState:U,scrollYToRecord:Ot,setOriginColumns:A,setSelectionKeysEffect:Wt,setRowExpandedKeys:ve,setHighlightKey:Ee,setResizeState:B,setPingRight:Ke,setUnMounted:Q,calcTableHeight:At,createSelectionKeys:Bt,createRowExpandedKeys:Ut,initialTable:Dt,destroy:hr});const mr=o().useMemo((()=>({getRowKey:R,tableRef:P,tableBodyRef:T,$size:S,flattenColumns:Ze,editableColumns:Je,leftFixedColumns:tt,rightFixedColumns:rt,treeExpandIndex:it,sorter:ce,filters:oe,superFilters:ue,layout:Re,bordered:st,showFooter:ot,showSummary:at,summationRows:St,scrollX:_e,scrollY:He,pagination:me,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,mergedTdCells:Ie,derivedMergeCells:nt,updateMark:Se,isFetch:Ue,isPingLeft:$e,isPingRight:je,isHeadSorter:ct,isHeadFilter:dt,isFullScreen:Ve,isTableEmpty:Et,isHeadGroup:lt,isTreeTable:vt,isGroupSubtotal:yt,isWebPagination:We,dataChange:Zt,tableChange:Jt,getTableData:Mt,setElementStore:k,createWebPageData:Kt,createTableFullData:qt,updateTableData:Be,setSorter:de,setFilters:le,setSuperFilters:he,setHighlightKey:Ee,setRowExpandedKeys:ve,setSelectionRows:G,setSelectionKeysEffect:Wt,setInvalidRowKeys:$,setMergedCells:Ne,getSpan:It,getStickyLeft:Nt,getStickyRight:Rt,scrollXToColumn:Pt,scrollYToRecord:Ot,rowInViewport:kt,setPagination:fe,setPingLeft:qe,setPingRight:Ke,setSpinning:Le,setFullScreen:ze,setShouldToTop:Y,doFieldValidate:Xt,createTableData:Vt,createGroupData:zt,findParentRowKeys:Gt,getAllChildRowKeys:Yt,triggerScrollXEvent:ir,triggerScrollYEvent:ar,scrollBottomDebouncer:or,resetTableScroll:Lt,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearRowSelection:dr,clearRowHighlight:ur})),[S,Ze,Je,tt,rt,it,ce,oe,ue,Re,st,ot,at,St,_e,He,me,wt,ge,ye,xe,nt,Se,Ue,$e,je,ct,dt,Ve,Et,lt,vt,yt,We]);((e,t)=>{const{getRowKey:r,tableRef:n,toolBoxRef:i,tableBodyRef:a,columnFilterRef:l,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:h,highlightKey:m,isFetch:f,dataChange:g,getTableData:b,handleTableData:y,createTableData:x,createTableFullData:E,calcTableHeight:S,scrollXToColumn:w,scrollYToRecord:C,doFieldValidate:T,setTableOriginData:I,setHandleState:N,setColumnsDefined:R,setSelectionKeysEffect:P,setRowExpandedKeys:O,setHighlightKey:k,setSelectionRows:A,setOriginColumns:L,forceUpdate:_,getTableLog:F,clearRowSelection:H,clearRowHighlight:D,clearTableSorter:$,clearTableFilter:q,clearSuperFilters:M,clearTableLog:j}=t,{columns:K,columnsChange:V}=n.current.props,z=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=z(e.children,t,n));const a=t.includes(i);return a&&n?.(e,i),!a}));o().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{S()},DO_REFRESH:async e=>{f&&(await b(),e?.())},GET_LOG:()=>F(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(H(),D(),$(),q(),M(),j(),x([]))},CLEAR_LOG:()=>{j()},CREATE_FOCUS:(e,t)=>{a.current.createFocus(e,t)},FORCE_UPDATE:()=>{_()},DO_EXPORT:()=>{i.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{w(e)},SET_SELECTION:(e,t)=>{const r=[...e];t&&(r.__prevent__=!0),P(r)},SET_EXPANDABLE:(e,t)=>{const r=[...e];t&&(r.__prevent__=!0),O(r)},SET_HIGHLIGHT:e=>{k(e)},SET_SELECTION_ROWS:e=>{A(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),R(!0),l.current.initialHandler()},SET_TABLE_COLUMN:(e,t,r)=>{const n=Kr(K,e);if(!n)return v("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!(0,te.isPlainObject)(t))return v("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(n.noAuth)return v("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&(0,te.set)(n,e,t[e]);r&&(V?V([...K]):v("Table","需要设置 `columnsChange` 参数"),_())},INSERT_RECORDS:(e,t)=>{const{store:i,tableFullData:a}=n.current,o=(Array.isArray(e)?e:[e]).filter((e=>(0,te.isPlainObject)(e)));if(!o.length)return;o.forEach((e=>{s.forEach((t=>{const{dataIndex:r}=t;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(r)||Jr(e,r,Zr(e,r))})),i.addToInserted(e)}));const l="before"===t?.mode,c=void 0===t?.parentRowKey,d=a;if(c)l?d.unshift(...o):d.push(...o);else{const e=fn(a,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?l?e.children.unshift(...o):e.children.push(...o):e.children=o)}c&&N(Object.assign({},n.current.handleState,{insert:l?"before":"after"})),x(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:i}=n.current,a=(Array.isArray(e)?e:[e]).map((e=>(0,te.isPlainObject)(e)?r(e,e.index):e));if(!a.length)return;let o=!1;const l=z(i,a,((e,r)=>{t.addToRemoved(e),c.forEach((n=>{const{dataIndex:i,editRender:a}=n,o=a?.(e,n);if(!o)return;const{rules:l=[],disabled:s}=o;!s&&l.length&&(t.removeFromRequired({x:r,y:i}),t.removeFromValidate({x:r,y:i}),t.removeFromEdited({x:r,y:i}))})),o=!0}));o&&(N(Object.assign({},n.current.handleState,{remove:!0})),E(l),P(p.filter((e=>!a.includes(e)))),a.includes(m)&&D(),O(h.filter((e=>!a.includes(e)))),g(),se((()=>{I(z(n.current.tableOriginData,a))})))},VALIDATE_FIELDS:(e,t)=>{n.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:a,editRender:o}=i,l=o?.(n,i);if(!l)return;const s=r(n,n.index);if(e&&!e.includes(s))return;if(t&&!t.includes(a))return;const{rules:c=[],disabled:d}=l;!d&&c.length&&T(c,Zr(n,a),s,a)}))}));const{required:i,validate:a}=F(),o=[...i,...a];return o.length&&C(o[0].rowKey),_(),{required:i,validate:a}}})))})(t,{getRowKey:R,tableRef:P,toolBoxRef:I,tableBodyRef:T,columnFilterRef:N,flattenColumns:Ze,editableColumns:Je,pagination:me,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,isFetch:Ue,dataChange:Zt,getTableData:Mt,handleTableData:jt,createTableData:Vt,createTableFullData:qt,calcTableHeight:At,scrollXToColumn:Pt,scrollYToRecord:Ot,doFieldValidate:Xt,setTableOriginData:_,setHandleState:U,setColumnsDefined:M,setSelectionKeysEffect:Wt,setRowExpandedKeys:ve,setHighlightKey:Ee,setSelectionRows:G,setOriginColumns:A,forceUpdate:Te,getTableLog:Qt,clearRowSelection:dr,clearRowHighlight:ur,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearTableLog:pr}),o().useLayoutEffect((()=>{Ct(),P.current.tableManager.register(P.current.uid,t??{current:null})}),[]);const fr=Ce("table"),gr={[`${fr}--wrapper`]:!0,[`${fr}--lg`]:"large"===S,[`${fr}--sm`]:"small"===S,[`${fr}--maximize`]:Ve,[s]:!!s},br={[fr]:!0,"is--border":st,"is--fixed":tt.length||rt.length,"is--sortable":ct,"is--filterable":dt,"is--head-group":lt,"is--area-select":!!d,"is--ping-left":$e,"is--ping-right":je};return o().createElement($l.Provider,{value:mr},o().createElement("div",{className:we()(gr)},f&&o().createElement("div",{ref:w,className:`${fr}-top`},o().createElement("div",{className:`${fr}-top__space`},"bottom"!==h?.position&&o().createElement(ms,{total:me.total}),o().createElement("div",{className:`${fr}-top__space-slot`,style:{justifyContent:Gl[m]}},r.children)),o().createElement("div",{className:`${fr}-top__actions`},o().createElement(lc,{ref:I,showFullScreen:g,showReload:b&&Ue,showPrint:Oe.print&&!!u,showImport:Oe.import&&ht,showExport:Oe.export&&!!p,showClipboard:mt,showCollection:pt,showFastSearch:gt,showSuperSearch:ft,showGroupSummary:bt,showToolBox:y,tableColumns:Qe}),o().createElement(dc,{ref:N,columns:i}))),o().createElement(xt,{spinning:a??Ae},o().createElement("div",{ref:C,className:we()(br),style:Tt},o().createElement("div",{className:`${fr}--main-wrapper`},x&&o().createElement(vc,{tableColumns:Qe,sorter:ce,filters:oe}),o().createElement(Wc,{ref:T,tableFlatColumns:ie,tableData:ee}),ot&&o().createElement(Gc,{summationRows:St})),st&&o().createElement("div",{className:`${fr}--border-line`}),Et&&o().createElement(Qc,null),l&&o().createElement(Zc,null))),Ye&&o().createElement(Xc,Jc({},me,{onChange:(e,t)=>nr({current:e,pageSize:t})}))))}));ed.displayName="QmTable";const td=ed,rd=td;function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}const id=e=>{const{uniqueKey:t,multiple:r,initialValue:n,selectionRows:i,defaultSelectedKeys:a=[],filters:l=[],table:s={},className:d,style:u,onClose:p}=e,{size:h}=o().useContext(c),m=o().useMemo((()=>e.size??h??""),[e.size,h]),g=o().useRef(null),b=o().useRef(null),y=o().useRef(null),v=Nt(g),[x,E]=o().useState(s),[S,w]=o().useState(),[C,T]=o().useState(a),[I,N]=o().useState(!1),[R,P]=o().useState(300),[O,k]=o().useState(l),[A,L]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},...s.columns||[]]),[_,F]=o().useState((0,te.merge)({},s.fetch?.params,n)),[H,D]=o().useState([]),$=()=>{const e=g.current,t=e.querySelector(".form-wrap");P(e.offsetHeight-t.offsetHeight-2*Fi[m]-30)},q=Ot($,5);Pt((()=>{q()}),[v.width]),Me((()=>{(0,te.isEqual)(l,O)||k(l)}),[l]),o().useEffect((()=>{M()}),[_]),o().useEffect((()=>{i&&y.current.SET_SELECTION_ROWS(i)}),[i]),o().useEffect((()=>{n&&b.current?.SET_FIELDS_VALUE(n)}),[]);const M=async()=>{const{webPagination:e,fetch:t}=x;if(!e||!t?.api)return;const{api:n,dataKey:i,beforeFetch:a=oe}=t;if(a(_)){N(!0);try{const e=await n(_);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[];r||(T([]),await le(0)),D(t)}}catch(e){}N(!1)}},j=e=>{r||(w(e),p(e))},K=e=>{F(Object.assign({},_,e))},V=Ce("search-helper"),z={[`${V}--wrapper`]:!0},B=x.webPagination?{dataSource:H,loading:I,webPagination:!0}:{fetch:{...x.fetch,params:_}};return o().createElement("div",{ref:g,className:we()(z,d),style:u},o().createElement("div",{className:"form-wrap"},O.length?o().createElement(Go,{ref:b,items:O,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>$(),onFinish:e=>K(e),onReset:async()=>{const[e,t]=await b.current.GET_FORM_DATA();e||K(t)}}):null),o().createElement("div",null,o().createElement(rd,nd({ref:y,uniqueKey:t,height:R,columns:A,rowKey:x.rowKey||"pageIndex"},B,{rowSelection:{type:r?"checkbox":"radio",clearableAfterFetched:!r,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{T(e),w(r?t:t[0])}},paginationConfig:x.paginationConfig,columnsChange:e=>L(e),onRowDblclick:j,onRowEnter:j}))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>p(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!S,onClick:()=>p(S,r?C:void 0)},f("qm.dialog.confirm"))))};id.displayName="SearchHelper";const ad=id;function od(){return od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},od.apply(this,arguments)}const ld=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...ld(e.children)),e.children&&t.push(e.value)})),t},sd=(e,t)=>{let r=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(r=sd(e[n].children,t)),r)return r;if(t(e[n]))return e[n]}return r},cd=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&cd(e.children,t),t(e)||e.children&&e.children.length))),dd=e=>{const{uniqueKey:t,multiple:r,initialValue:n,selectionRows:i,defaultSelectedKeys:a=[],filters:l=[],table:s={},tree:d={},className:u,style:p,onClose:h}=e,{size:m}=o().useContext(c),g=o().useMemo((()=>e.size??m??""),[e.size,m]),b=o().useRef(null),y=o().useRef(null),x=o().useRef(null),E=Nt(b),[S,w]=o().useState(s),[C,T]=o().useState(),[I,N]=o().useState(a),[R,P]=o().useState(!1),[O,k]=o().useState(300),[A,_]=o().useState(300),[F,H]=o().useState(l),[D,$]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},...s.columns||[]]),[q,M]=o().useState((0,te.merge)({},s.fetch?.params,n)),[j,K]=o().useState([]),V=()=>{const e=b.current,t=e.querySelector(".form-wrap"),r=e.querySelector(".input-wrap");k(e.offsetHeight-r.offsetHeight-10),_(e.offsetHeight-t.offsetHeight-2*Fi[g]-30)},z=Ot(V,5);Pt((()=>{z()}),[E.width]),Me((()=>{(0,te.isEqual)(l,F)||H(l)}),[l]),o().useEffect((()=>{B()}),[q]),o().useEffect((()=>{i&&x.current.SET_SELECTION_ROWS(i)}),[i]),o().useEffect((()=>{n&&y.current?.SET_FIELDS_VALUE(n),ne()}),[]);const B=async()=>{const{webPagination:e,fetch:t}=S;if(!e||!t?.api)return;const{api:n,dataKey:i,beforeFetch:a=oe}=t;if(a(q)){P(!0);try{const e=await n(q);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[];r||(N([]),await le(0)),K(t)}}catch(e){}P(!1)}},U=e=>{r||(T(e),h(e))},W=e=>{M(Object.assign({},q,e))},[G,Y]=o().useState([]),[X,Q]=o().useState([]),[Z,J]=o().useState(""),ee=o().useRef(G),re=o().useRef([]);Me((()=>{Q(ld(G))}),[G]);const ne=async()=>{if(!d.fetch)return;const{api:e,params:t,dataKey:r,valueKey:n="value",textKey:i="text"}=d.fetch;try{const a=await e(t);if(200===a.code){const e=Array.isArray(a.data)?a.data:(0,te.get)(a.data,r)??[],t=Fn(e,n,i);Y(t),ee.current=t,re.current=e}}catch(e){}},ie=e=>`${e}|${ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ae=Ce("tree-table-helper"),se={[`${ae}--wrapper`]:!0},ce=S.webPagination?{dataSource:j,loading:R,webPagination:!0}:{fetch:{...S.fetch,params:q}};return o().createElement("div",{ref:b,className:we()(se,u),style:p},o().createElement(at,{defaultValue:200,style:{height:"100%"}},o().createElement(at.Pane,{min:100,style:{overflowY:"auto"}},o().createElement(L.Input.Search,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:f("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=cd(ee.current,(t=>{if(!e)return!0;const r=t.text||"";return-1!==ie(r).indexOf(e)}));J(e),Y(t)})(e.target.value)}),o().createElement(L.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:O,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ie(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return v("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,r={};for(const n in t)r[n]=(0,te.get)(e,t[n]);W(r)})(sd(re.current,(r=>(0,te.get)(r,t)===e[0]))||{})}})),o().createElement(at.Pane,{className:"split-pane"},o().createElement("div",{className:"form-wrap"},F.length?o().createElement(Go,{ref:y,items:F,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>H(e),onCollapse:()=>V(),onFinish:e=>W(e),onReset:async()=>{const[e,t]=await y.current.GET_FORM_DATA();e||W(t)}}):null),o().createElement("div",null,o().createElement(rd,od({ref:x,uniqueKey:t,height:A,columns:D,rowKey:S.rowKey||"pageIndex"},ce,{rowSelection:{type:r?"checkbox":"radio",clearableAfterFetched:!r,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:I,onChange:(e,t)=>{N(e),T(r?t:t[0])}},paginationConfig:S.paginationConfig,columnsChange:e=>$(e),onRowDblclick:U,onRowEnter:U}))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[g]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>h(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!C,onClick:()=>h(C,r?I:void 0)},f("qm.dialog.confirm"))))};dd.displayName="TreeTableHelper";const ud=dd,pd=e=>{const{multiple:t,tree:r={},defaultSelectedKeys:n,className:i,style:a,onClose:l}=e,{size:s}=o().useContext(c),d=o().useMemo((()=>e.size??s??""),[e.size,s]),[u,p]=o().useState(),[h]=o().useState(r.fetch?.params),m=Ce("tree-helper"),g={[`${m}--wrapper`]:!0},b=r.fetch?{...ue(r.fetch,["params","valueKey","textKey"]),params:h}:void 0;return o().createElement("div",{className:we()(g,i),style:a},o().createElement(Dl,{multiple:t,fetch:b,fieldsDefine:{valueKey:r.fetch?.valueKey,textKey:r.fetch?.textKey},asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:n,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[d]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>l(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!u,onClick:()=>l(u)},f("qm.dialog.confirm"))))};pd.displayName="TreeHelper";const hd=pd;function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},md.apply(this,arguments)}const fd="_startSign",gd="_endSign",bd=e=>{const{uniqueKey:t,initialValue:r,filters:n=[],table:i={},onClose:a}=e,{size:l}=o().useContext(c),s=o().useMemo((()=>e.size??l??""),[e.size,l]),d=o().useRef(null),u=o().useRef(null),p=o().useRef(null),h=Nt(d),[m,g]=o().useState(i),[b,y]=o().useState(!1),[v,x]=o().useState([]),[E,S]=o().useState(300),[w,C]=o().useState(n),[T,I]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},{title:f("qm.form.rangeSearchHelper")[0],dataIndex:fd,width:80,align:"right",render:(e,t)=>o().createElement("span",{className:"icon-sign"},e)},...i.columns||[],{title:f("qm.form.rangeSearchHelper")[1],dataIndex:gd,fixed:"right",width:80,render:(e,t)=>o().createElement("span",{className:"icon-sign"},e)}]),[N,R]=o().useState((0,te.merge)({},i.fetch?.params,r)),[P,O]=o().useState([]),k=o().useMemo((()=>v.map((e=>e?.pageIndex))),[v]),A=o().useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),_=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*Fi[s]-30)},F=Ot(_,5);Pt((()=>{F()}),[h.width]),Me((()=>{(0,te.isEqual)(n,w)||C(n)}),[n]),o().useEffect((()=>{H()}),[N]);const H=async()=>{const{webPagination:e,fetch:t}=m;if(!e||!t?.api)return;const{api:r,dataKey:n,beforeFetch:i=oe}=t;if(i(N)){y(!0);try{const e=await r(N);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[];O(t)}}catch(e){}y(!1)}},D=(e,t)=>{delete e[t]},$=()=>{v.forEach((e=>{e&&(D(e,fd),D(e,gd))})),x([])},q=e=>{$(),R(Object.assign({},N,e))},M=Ce("range-helper"),j=m.webPagination?{dataSource:P,loading:b,webPagination:!0}:{fetch:{...m.fetch,params:N}};return o().createElement("div",{ref:d,className:`${M}--wrapper`},o().createElement("div",{className:"form-wrap"},w.length?o().createElement(Go,{ref:u,items:w,initialValues:r,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>C(e),onCollapse:()=>_(),onFinish:e=>q(e),onReset:async()=>{const[e,t]=await u.current.GET_FORM_DATA();e||q(t)}}):null),o().createElement("div",null,o().createElement(rd,md({ref:p,height:E,columns:T,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},j,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:r}=t;[fd,gd].includes(r)&&(r===fd&&(e[r]?(D(e,r),x([void 0,v[1]])):e.pageIndex>k[1]?L.message.warning(f("qm.searchHelper.rangeStartTip")):(v[0]&&D(v[0],r),e[r]="[",x([e,v[1]]))),r===gd&&(e[r]?(D(e,r),x([v[0],void 0])):e.pageIndex<k[0]?L.message.warning(f("qm.searchHelper.rangeEndTip")):(v[1]&&D(v[1],r),e[r]="]",x([v[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[fd]="["),e.pageIndex===k[1]&&(e[gd]="]")}))}}),o().createElement(be,{type:"primary",icon:o().createElement(Te.ClearOutlined,null),title:f("qm.table.alert.clear"),onClick:()=>$()}))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>a(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!A,onClick:()=>a(v.map((e=>(e=>{const t={};for(const r in e)[fd,gd].includes(r)||(t[r]=e[r]);return t})(e))))},f("qm.dialog.confirm"))))};bd.displayName="RangeTableHelper";const yd=bd,vd=e=>null!=e;function xd(e,t,r,n){const[i,a]=o().useState(void 0);o().useLayoutEffect((()=>{const t="function"==typeof e?e():e;a(t||null)}));const[l,s]=o().useState(null),c=Yl((()=>{if(i){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,{top:n,right:i,bottom:a,left:o}=e.getBoundingClientRect();return n>=0&&o>=0&&i<=t&&a<=r})(i)&&t&&i.scrollIntoView(n);const{left:e,top:r,width:a,height:o}=i.getBoundingClientRect(),l={left:e,top:r,width:a,height:o,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(l)?l:e))}else s(null)}));return o().useLayoutEffect((()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[i,t,c]),[o().useMemo((()=>{if(!l)return l;const e=r?.offset||6,t=r?.radius||2;return{left:l.left-e,top:l.top-e,width:l.width+2*e,height:l.height+2*e,radius:t}}),[l,r]),i]}const Ed={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"]}},Sd={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"]}},wd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Cd(e){const{arrowWidth:t,autoAdjustOverflow:r,arrowPointAtCenter:n,offset:i,borderRadius:a,visibleFirst:o}=e,l=t/2,s={};return Object.keys(Ed).forEach((e=>{const c={...n&&Sd[e]||Ed[e],offset:[0,0],dynamicInset:!0};switch(s[e]=c,wd.has(e)&&(c.autoArrow=!1),e){case"top":case"topLeft":case"topRight":c.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":c.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":c.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":c.offset[0]=l+i}const d=function(e){const{contentRadius:t,limitVerticalRadius:r}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:r?8:n}}({contentRadius:a,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":c.offset[0]=-d.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":c.offset[0]=d.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":c.offset[1]=-d.arrowOffsetHorizontal-l;break;case"leftBottom":case"rightBottom":c.offset[1]=d.arrowOffsetHorizontal+l}c.overflow=function(e,t,r,n){if(!1===n)return{adjustX:!1,adjustY:!1};const i=n&&"object"==typeof n?n:{},a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+r,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+r,a.shiftX=!0,a.adjustX=!0}const o={...a,...i};return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}(e,d,t,r),o&&(c.htmlRegion="visibleFirst")})),s}const Td=require("@rc-component/portal");var Id=n.n(Td);const Nd=require("@rc-component/trigger");var Rd=n.n(Nd);function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pd.apply(this,arguments)}const Od={fill:"transparent",pointerEvents:"auto"},kd=e=>{const{prefixCls:t,rootClassName:r,pos:n,showMask:i,style:a={},fill:l="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${t}-mask-${Zl()}`,p="object"==typeof c?c?.placeholder:c;return o().createElement(Id(),{open:s,autoLock:!0},o().createElement("div",{className:we()(`${t}-mask`,r),style:{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none",...a}},i?o().createElement("svg",{style:{width:"100%",height:"100%"}},o().createElement("defs",null,o().createElement("mask",{id:u},o().createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&o().createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:p?`${t}-placeholder-animated`:""}))),o().createElement("rect",Pd({},n?null:Od,{x:"0",y:"0",width:"100%",height:"100%",fill:l,mask:`url(#${u})`})),n&&o().createElement(o().Fragment,null,o().createElement("rect",Pd({},Od,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),o().createElement("rect",Pd({},Od,{x:"0",y:"0",width:n.left,height:"100%"})),o().createElement("rect",Pd({},Od,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),o().createElement("rect",Pd({},Od,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},Ad=e=>{const{prefixCls:t,zIndex:r,open:n,onPause:i,onPlay:a}=e,[l,s]=as(void 0,{value:n,postState:e=>e??!0}),c=o().useRef(null),d=o().useRef(!1),u=Yl((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));o().useEffect((()=>{const e=Gt()(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},h=()=>{d.current?d.current=!1:(s(!l),l?i?.():a?.())};return o().createElement("div",{ref:c,className:`${t}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,r=t.offsetWidth,n=t.offsetHeight,i=window.innerWidth,a=window.innerHeight,o=e.clientX-Ge(t).x,l=e.clientY-Ge(t).y;return document.onmousemove=e=>{let s=e.clientX-o,c=e.clientY-l;s<0&&(s=0),s>i-r-1&&(s=i-r-1),c<0&&(c=0),c>a-n-1&&(c=a-n-1),Be(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>h()},l?o().createElement(Te.PauseOutlined,null):o().createElement(Te.CaretRightOutlined,null))},Ld=e=>{const{prefixCls:t,current:r,total:n=0,cover:i,title:a,description:l,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:h,onFinish:m,className:f,indicatorsRender:g}=e,{t:b}=Ic(),y="primary"!==c?"primary":"default",v=Yl((e=>{w(e),40===e.keyCode&&(r<n-1?h?.():m?.()),38===e.keyCode&&r>0&&p?.()}));o().useEffect((()=>{const e=Gt()(document,"keyup",v);return()=>e.remove()}),[]);const x=vd(i)?o().createElement("div",{className:`${t}-cover`},i):null,E=vd(l)?o().createElement("div",{className:`${t}-description`},l):null;let S;S=g?g(r,n):[...Array.from({length:n}).keys()].map(((e,n)=>o().createElement("span",{key:e,className:we()(n===r&&`${t}-indicator-active`,`${t}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return o().createElement("div",{className:we()(`${t}-content`,f)},o().createElement("div",{className:`${t}-inner`},o().createElement(Te.CloseOutlined,{className:`${t}-close`,onClick:u}),s.content&&o().createElement(L.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},o().createElement(Te.QuestionCircleOutlined,{className:we()(`${t}-close`,"help-icon")})),x,o().createElement("div",{className:`${t}-header`},o().createElement("div",{className:`${t}-title`},a)),E,o().createElement("div",{className:`${t}-footer`},n>1&&o().createElement("div",{className:`${t}-indicators`},S),o().createElement(Ee,{className:`${t}-buttons`},0!==r?o().createElement(be,{className:`${t}-prev-btn`,size:"small",onMouseDown:w,onClick:p},b("qm.tour.prevStep")):null,r===n-1?o().createElement(be,{className:`${t}-finish-btn`,type:y,size:"small",onClick:m},b("qm.tour.finish")):o().createElement(be,{className:`${t}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:h},b("qm.tour.nextStep"))))))},_d=e=>{const{current:t,renderPanel:r}=e;return o().createElement(o().Fragment,null,"function"==typeof r?r(e,t):o().createElement(Ld,e))};function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fd.apply(this,arguments)}const Hd={left:"50%",top:"50%",width:1,height:1},Dd=o().forwardRef(((e,t)=>{const{steps:r=[],defaultCurrent:n,current:i,onChange:a,onClose:l,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:h=!0,overlayClassName:m,overlayStyle:f,placement:g,helper:b,zIndex:y,renderPanel:v,indicatorsRender:x,gap:E,animated:S=!0,scrollIntoViewOptions:w=!0,...C}=e,T=o().useRef(),[I,N]=as(0,{value:i,defaultValue:n}),[R,P]=as(void 0,{value:c,postState:e=>!(I<0||I>=r.length)&&(e??!1)}),[O,k]=as(1051,{value:y,defaultValue:y}),[A,L]=o().useState(),_=o().useRef(R);o().useLayoutEffect((()=>{R&&!_.current&&N(0),_.current=R,L(R)}),[R]),o().useImperativeHandle(t,(()=>({OPEN:()=>P(!0),CLOSE:()=>P(!1),SET_ZINDEX:e=>k(e)})));const{target:F,type:H,placement:D,trigger:$,delay:q,style:M,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:B,action:U}=r[I]||{},W=B||O,G=H||d,Y=R&&(V??u),X=z??w,[Q,Z]=xd(F,!!c,E,X),J=((e,t,r)=>r??t??(null===e?"center":"bottom"))(Z,g,D),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;o().useLayoutEffect((()=>{T.current?.forceAlign()}),[te,I]),Me((()=>{R&&(ie(),U?.(Z,I))}),[R,Z]);const re=e=>{N(e),a?.(e)},ne=()=>{P(!1),l?.(I)},ie=()=>{if(!Z)return;const e=[];!function t(r){if(1===r.nodeType){var n;"INPUT"!==r.tagName&&"TEXTAREA"!==r.tagName||"none"===ze(n=r,"display")||"hidden"===ze(n,"visibility")||"0"===ze(n,"opacity")||e.push(r);for(const e of Array.from(r.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ae=async()=>{if(!$||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),r=Z.offsetWidth,n=Z.offsetHeight,[i,a]=[e+r/2,t+n/2],o=new MouseEvent($,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:a}),l=document.elementFromPoint(i,a);l&&(l.dispatchEvent(o),await le(q??320))},oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,ce=Object.assign({},f,M),de=Ce("tour"),ue=[{[`${de}-primary`]:"primary"===G},m,K],pe=Cd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return o().createElement(o().Fragment,null,o().createElement(kd,{zIndex:W,prefixCls:de,pos:Q,showMask:oe,style:se?.style,fill:se?.color,open:A,animated:S,rootClassName:m}),o().createElement(Id(),{open:A,autoLock:!0},o().createElement(Rd(),Fd({ref:T},C,{zIndex:W,builtinPlacements:pe,popupStyle:ce,popupPlacement:J,popupVisible:A,popupClassName:we()(ue),prefixCls:de,popup:()=>o().createElement(_d,Fd({key:"content",arrow:ee,prefixCls:de,total:r.length,helper:b,renderPanel:v,indicatorsRender:x,onPrev:async()=>{await ae(),re(I-1)},onNext:async()=>{await ae(),re(I+1)},onClose:ne,current:I,onFinish:()=>{ne(),s?.()}},Object.assign({},r[I],{zIndex:W,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),o().createElement("div",{className:we()(m,`${de}-target-placeholder`),style:{...Q||Hd,position:"fixed",pointerEvents:"none"}}))),h&&o().createElement(Id(),{open:R},o().createElement(Ad,{zIndex:W,prefixCls:de,onPause:()=>L(!1),onPlay:()=>L(!0)})))}));Dd.displayName="QmTour";const $d=Dd,qd=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Md=e=>({_s:e,status:qd[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),jd=e=>e?6:5,Kd=(e,t,r,n,i)=>{clearTimeout(n.current);const a=Md(e);t(a),r.current=a,i?.({current:a})},Vd=e=>{const{name:t,in:r,timeout:n,preEnter:i=!0,preExit:l}=e,[s,c]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enter:t=!0,exit:r=!0,preEnter:n,preExit:i,timeout:o,initialEntered:l,mountOnEnter:s,unmountOnExit:c,onStateChange:d}=e||{},[u,p]=(0,a.useState)((()=>Md(l?2:jd(s)))),h=(0,a.useRef)(u),m=(0,a.useRef)(),[f,g]=(e=>(0,te.isPlainObject)(e)?[e.enter,e.exit]:[e,e])(o),b=(0,a.useCallback)((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return jd(t)}})(h.current._s,c);e&&Kd(e,p,h,m,d)}),[d,c]),y=(0,a.useCallback)((e=>{const a=e=>{switch(Kd(e,p,h,m,d),e){case 1:f>=0&&(m.current=setTimeout(b,f));break;case 4:g>=0&&(m.current=setTimeout(b,g));break;case 0:case 3:m.current=setTimeout((()=>a(e+1)),0)}},o=h.current.isEnter;"boolean"!=typeof e&&(e=!o),e?!o&&a(t?n?0:1:2):o&&a(r?i?3:4:jd(c))}),[b,d,t,r,n,i,f,g,c]);return(0,a.useEffect)((()=>()=>clearTimeout(m.current)),[]),[u,y,b]}({timeout:n,preEnter:i,preExit:l,initialEntered:r});return Pt((()=>{c()}),[r]),o().createElement(o().Fragment,null,o().Children.map(e.children,(e=>o().isValidElement(e)?Dc(e,{className:we()(e.props.className,t,s.status)}):e)))},zd={previewWidth:1100,defaultDistance:.45,logoHeight:60},Bd=(0,a.createContext)(void 0);var Ud=null;function Wd(){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),r=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),a=e.match(/x64/i);if(!t&&!r&&a)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||a)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!r){var o=e.match(/Chrome\D?\d+/i);if(o&&(o=o[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Gd(e,t){var r;try{var n=navigator.userAgent,i=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(Wd()){try{r=getCLodop()}catch(e){}if(!r&&"complete"!==document.readyState)return void L.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!r)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else if(i&&n.match(/x64/i),e||t?r=i?e:t:Ud?r=Ud:((r=document.createElement("object")).setAttribute("width",0),r.setAttribute("height",0),r.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?r.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):r.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(r),Ud=r),!r||!r.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),r;return r.VERSION<"6.2.2.6"&&Wd(),r}catch(e){L.message.error("getLodop 出错:"+e)}}Wd();const Yd=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:r}=window.screen;if(t&&r)e[0]=t,e[1]=r;else{let t=document.createElement("DIV");t.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(t),e[0]=parseInt(t.offsetWidth.toString()),e[1]=parseInt(t.offsetHeight.toString()),t.parentNode?.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},Xd=o().forwardRef(((e,t)=>{const{templateRender:r,directPrint:n}=e,{global:i}=o().useContext(c),{$$preview:a}=o().useContext(Bd),{state:l,isWindowsPrinter:s,pageSize:d}=a,u=o().useRef(null),p=o().useRef({}),h=o().useRef([]),m=o().useRef([]),f=o().useRef([]),[g,b]=o().useState(!0);o().useImperativeHandle(t,(()=>({createPreviewDom:k,createExportHtml:L,createPrintHtml:A,SHOW_PREVIEW:_,DIRECT_PRINT:F}))),Me((()=>{O()}),[l.form.printerType,l.form.setting.direction,l.form.setting.distance,l.form.setting.fixedLogo]),o().useEffect((()=>{p.current.templateEl=u.current.querySelector(".origin-template").children[0],p.current.previewEl=u.current.querySelector(".workspace")}),[]);const y=o().useMemo((()=>{const{form:{setting:{direction:e}}}=l,t=s?10*zd.defaultDistance+10*zd.defaultDistance:0;return("vertical"===e?d[0]:d[1])-t}),[l,s,d]),x=o().useMemo((()=>{const{form:{setting:{direction:e}}}=l,t=s?10*zd.defaultDistance+10*zd.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[l,s,d]),E=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return Yd(y-10*(e.left-zd.defaultDistance)-10*(e.right-zd.defaultDistance))}),[l,y]),S=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return Yd(x-10*(e.top-zd.defaultDistance)-10*(e.bottom-zd.defaultDistance))}),[l,x]),w=l.form.scale,C=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return{left:Yd(10*e.left),right:Yd(10*e.right),top:Yd(10*e.top),bottom:Yd(10*e.bottom)}}),[l]),T=o().useMemo((()=>{const{form:{printerType:e}}=l,{left:t,right:r,top:n,bottom:i}=C,a=E+t+r,o=zd.previewWidth-a<=0?0:(zd.previewWidth-a)/2,s=Math.abs((1-w)*a/2);let c=0;return w>1&&(c=s>o?-1*o:-1*s),w<1&&(c=a-2*s>zd.previewWidth?0:o>0?s:(zd.previewWidth-(a-2*s))/2),{width:`${E}px`,height:"stylus"===e?"auto":S+"px",paddingLeft:`${t}px`,paddingRight:`${r}px`,paddingTop:`${n}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${w})`,opacity:g?0:1}}),[l,g,C,w,S,E]),I=(h.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{const e=i?.print?.leftLogo??"",t=i?.print?.rightLogo??"";return[`<tr style="height: ${zd.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',e?`<img src="${e}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',t?`<img src="${t}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),N=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},R=()=>{let e=document.createElement("tr");var t,r;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(r=p.current.templateEl.children[0]).children[0]?r.insertBefore(t,r.children[0]):r.appendChild(t),e=null},P=()=>{const e=p.current.templateEl.children[0].children,t=[],r=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const i=e[n].clientHeight;e[n].style.height=i+"px",r.push(i),t.push(e[n].outerHTML)}m.current=r,h.current=t},O=()=>{if(!h.current.length)return;const{form:{setting:e,printerType:t}}=l;if(n)return f.current.push([N(),I(),...h.current]);const r=e.fixedLogo?S-zd.logoHeight:S;let i=[];if(f.current=[],"stylus"===t)f.current.push([N(),...e.fixedLogo?[I()]:[],...h.current]);else{let t=0;for(let n=0,a=m.current.length;n<a;n++){const o=h.current[n],l=m.current[n];e.fixedLogo||0!==n||(t+=zd.logoHeight),t+=l,t<=r?i.push(o):(f.current.push([N(),...e.fixedLogo?[I()]:[],...i]),i=[],t=0,n-=1),n===a-1&&i.length&&f.current.push([N(),...e.fixedLogo?[I()]:[],...i])}}e.fixedLogo||f.current[0]?.splice(1,0,I());for(let e=0,t=f.current.length;e<t&&e!==t-1;e++)f.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');a.setState({currentPage:1,totalPage:f.current.length}),k()},k=()=>{const{currentPage:e}=l;let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;t+=f.current[e-1]?.join("")??"",t+="</table>",p.current.previewEl.innerHTML=t,p.current.previewEl.parentNode.scrollTop=0},A=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;if(void 0!==e)t+=[...f.current[e-1]].join("");else for(let e=0;e<f.current.length;e++)t+=f.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<h.current.length;t++)e[t]=h.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+I()+N()+e.join("")+"</table>"},_=async()=>{if("TABLE"!==p.current.templateEl?.tagName)return H();p.current.previewEl.innerHTML||(R(),await le(0),P(),O(),b(!1))},F=async()=>{if("TABLE"!==p.current.templateEl?.tagName)return H();R(),await le(0),P(),O(),b(!1),a.doPrint(A()),await le(0),a.doClose()},H=()=>{v("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D=Ce("print-container"),$={[D]:!0,"no-visible":n};return o().createElement("div",{ref:u,className:we()($)},o().createElement(xt,{wrapperClassName:"spin",spinning:g,tip:"Loading..."},o().createElement("div",{className:"preview"},o().createElement("div",{className:"origin-template",style:{width:`${E}px`,marginLeft:`-${Math.floor(E/2)}px`}},r?.()),o().createElement("div",{className:"workspace",style:T}))))}));Xd.displayName="Container";const Qd=Xd;function Zd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Jd extends a.Component{constructor(){super(...arguments),Zd(this,"context",void 0),Zd(this,"formRef",o().createRef()),Zd(this,"createFormList",(()=>[{type:"DIVIDER",fieldName:"_1",label:f("qm.print.setPanel.printParameter")},{type:"SELECT",label:f("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:f("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:f("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:f("qm.print.setPanel.vertical"),value:"vertical"},{text:f("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:f("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:f("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:f("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:f("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]}])),Zd(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})})),Zd(this,"getInitialExtra",(()=>({disleft:f("qm.print.setPanel.sizeUnit"),disright:f("qm.print.setPanel.sizeUnit"),distop:f("qm.print.setPanel.sizeUnit"),disbottom:f("qm.print.setPanel.sizeUnit")}))),Zd(this,"state",{formList:this.createFormList()}),Zd(this,"confirmHandle",(async()=>{const[e,t]=await 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())})),Zd(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return o().createElement(o().Fragment,null,o().createElement(Go,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},f("qm.dialog.close")),o().createElement(be,{type:"primary",onClick:()=>this.confirmHandle()},f("qm.dialog.confirm"))))}}Zd(Jd,"contextType",c);const eu=Jd;function tu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ru extends a.Component{constructor(){super(...arguments),tu(this,"context",void 0),tu(this,"provide",{$$preview:this}),tu(this,"containRef",o().createRef()),tu(this,"state",{visible:!1,form:{printerName:-1,printerType:this.props.defaultConfig?.printerType||"laser",copies:this.props.defaultConfig?.copies||1,scale:1,setting:{distance:{left:zd.defaultDistance,right:zd.defaultDistance,top:zd.defaultDistance,bottom:zd.defaultDistance},pageSize:"210*297",direction:this.props.defaultConfig?.direction||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),tu(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),tu(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),tu(this,"printClickHandle",(async()=>{if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e={...this.state.form,printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text};await Gs().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),tu(this,"doClose",(()=>{this.props.onClose?.()})),tu(this,"getPrintConfig",(async e=>{const t=this.context.global,r=t?.getComponentConfigApi;if(r)try{const t=await r({key:e});if(200===t.code)return t.data}catch(e){}})),tu(this,"savePrintConfig",(async(e,t)=>{const r=this.context.global,n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}})),tu(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 ')),tu(this,"doPrint",(e=>{const t=Gd();if(!t)return;const{uniqueKey:r,closeAfterPrint:n}=this.props,{form:{setting:i,printerName:a,printerType:o,copies:l}}=this.state,{pageSize:s}=this,{defaultDistance:c}=zd,{left:d,right:u,top:p,bottom:h}=i.distance;t.PRINT_INIT(r??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(a),t.SET_PRINT_COPIES(l),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===o&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===o&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==o?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():L.message.error(f("qm.print.printError"))},t.PRINT()})),tu(this,"doExport",(e=>{const t=Gd();if(!t)return;const{uniqueKey:r,closeAfterPrint:n}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(r??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():L.message.error(f("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${u()().format("YYYYMMDDHHmmss")}.xlsx`)}))}get printerTypeItems(){return[{text:f("qm.print.laserPrinter"),value:"laser"},{text:f("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Gd(),t=[{text:f("qm.print.defaultPrinter"),value:-1}];try{const r=e.GET_PRINTER_COUNT();for(let n=0;n<r;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){v("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}`:""}async componentDidMount(){if(this.props.uniqueKey)try{let e=await Gs().getItem(this.printerKey);e||(e=await this.getPrintConfig(this.printerKey),(0,te.isPlainObject)(e)&&await Gs().setItem(this.printerKey,e)),(0,te.isPlainObject)(e)&&Object.keys(e).length&&(0,te.merge)(this.state.form,{...e,printerName:this.printerItems.find((t=>t.text===e.printerName))?.value??-1})}catch(e){}}render(){const{preview:e,templateRender:t}=this.props,{visible:r,form:n,currentPage:i,totalPage:a,printPage:l}=this.state,s=Ce("print-preview"),c={visible:r,title:f("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?o().createElement(o().Fragment,null,o().createElement("div",{className:we()(d)},o().createElement("div",{className:"outer"},o().createElement("div",{className:"header"},o().createElement("span",null,f("qm.print.printer"),":",o().createElement(L.Select,{value:n.printerName,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",null,f("qm.print.type"),":",o().createElement(L.Select,{value:n.printerType,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",null,f("qm.print.copies"),":",o().createElement(L.InputNumber,{value:n.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),o().createElement("span",null,f("qm.print.printPage.0"),o().createElement(L.InputNumber,{value:l,min:1,max:a,precision:0,onChange:e=>{this.setState({printPage:e??void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),f("qm.print.printPage.1")),o().createElement("span",null,o().createElement(L.Pagination,{size:"small",current:i,pageSize:1,total:a,onChange:this.pageChangeHandle})),o().createElement("span",null,o().createElement(be,{type:"text",icon:o().createElement(Te.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},f("qm.print.setting"))),o().createElement("span",null,o().createElement(be,{type:"text",icon:o().createElement(Te.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},f("qm.print.export"))),o().createElement("span",null,o().createElement(be,{icon:o().createElement(Te.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},f("qm.print.print")))),o().createElement("div",{className:"main"},o().createElement(Bd.Provider,{value:this.provide},o().createElement(Qd,{ref:this.containRef,templateRender:t,directPrint:!1}))),o().createElement("div",{className:"footer"},o().createElement("span",null,f("qm.print.scale"),":",o().createElement(L.Slider,{value:n.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{scale:e}})))}}),o().createElement("em",{className:"scale-text"},`${Math.floor(100*n.scale)}%`)),o().createElement("span",null,f("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),o().createElement("span",null,f("qm.print.pageNumber"),":",f("qm.print.pagination",{currentPage:i,totalPage:a}))))),o().createElement(Er,c,o().createElement(eu,{setting:n.setting,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):o().createElement(Bd.Provider,{value:this.provide},o().createElement(Qd,{ref:this.containRef,templateRender:t,directPrint:!0}))}}tu(ru,"contextType",c);const nu=ru;function iu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class au extends a.Component{constructor(){super(...arguments),iu(this,"context",void 0),iu(this,"previewRef",o().createRef()),iu(this,"state",{visible:!1,loading:!1}),iu(this,"clickHandle",(async()=>{this.setState({loading:!0});try{const e=await(this.props.click?.());if(this.setState({loading:!1}),"boolean"==typeof e&&!e)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),iu(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:r,defaultConfig:n,preview:i,closeAfterPrint:a}=this.props,l={visible:e,title:f("qm.print.preview"),width:`${zd.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:t,uniqueKey:r,defaultConfig:n,preview:i,closeAfterPrint:a,onClose:()=>{this.setState({visible:!1})}};return i?o().createElement(Er,l,o().createElement(nu,s)):e?o().createElement(nu,s):null})),iu(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await le(0),this.setState({visible:!0}),await le(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:r,type:n,disabled:i,shape:a}=this.props,l={size:t||this.context.size||"",type:n,shape:a,icon:r,loading:e,disabled:i,click:this.clickHandle};return o().createElement(o().Fragment,null,this.props.children&&o().createElement(be,l,this.props.children),this.createRender())}}iu(au,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Print","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},templateRender:s().elementType}),iu(au,"defaultProps",{preview:!0,type:"primary",icon:o().createElement(Te.PrinterOutlined,null)}),iu(au,"contextType",c);const ou=au;function lu(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function su(e){const t=lu(e);return t?t.frameElement:null}function cu(e){const t=pu(e);return du([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function du(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 uu(e,t){const r=su(e);if(r&&r!==t){const n=[e.getBoundingClientRect()];let i=r,a=!1;for(;i;){const e=cu(i);if(n.push(e),i=su(i),a)break;i&&lu(i)===t&&(a=!0)}return du(n)}return e.getBoundingClientRect()}function pu(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)}}function hu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mu=Object.assign;class fu{constructor(e,t){hu(this,"node",void 0),hu(this,"border",void 0),hu(this,"padding",void 0),hu(this,"content",void 0),this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=vu.border,this.padding.style.borderColor=vu.padding,this.content.style.backgroundColor=vu.background,mu(this.node.style,{borderColor:vu.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){yu(t,"margin",this.node),yu(t,"border",this.border),yu(t,"padding",this.padding),mu(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"}),mu(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class gu{constructor(e,t){hu(this,"tip",void 0),hu(this,"nameSpan",void 0),hu(this,"dimSpan",void 0),this.tip=e.createElement("div"),mu(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),mu(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),mu(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,r){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(r)+"px"}updatePosition(e,t){const r=this.tip.getBoundingClientRect(),n=function(e,t,r){const n=Math.max(r.height,20),i=Math.max(r.width,60);let a;a=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+5:e.top+e.height+5:e.top-n<=t.top+t.height?e.top-n-5<t.top+5?t.top+5:e.top-n-5:t.top+t.height-n-5;let o=e.left+5;return e.left<t.left&&(o=t.left+5),e.left+i>t.left+t.width&&(o=t.left+t.width-i-5),a+="px",o+="px",{style:{top:a,left:o}}}(e,t,{width:r.width,height:r.height});mu(this.tip.style,n.style)}}class bu{constructor(){hu(this,"window",void 0),hu(this,"tipBoundsWindow",void 0),hu(this,"container",void 0),hu(this,"tip",void 0),hu(this,"rects",void 0);const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const r=e.document;this.container=r.createElement("div"),this.container.style.zIndex="10000000",this.tip=new gu(r,this.container),this.rects=[],r.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 r=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>r.length;){const e=this.rects.pop();e?.remove()}if(0===r.length)return;for(;this.rects.length<r.length;)this.rects.push(new fu(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};r.forEach(((e,t)=>{const r=uu(e,this.window),i=pu(e);n.top=Math.min(n.top,r.top-i.marginTop),n.right=Math.max(n.right,r.left+r.width+i.marginRight),n.bottom=Math.max(n.bottom,r.top+r.height+i.marginBottom),n.left=Math.min(n.left,r.left-i.marginLeft),this.rects[t].update(r,i)})),t||(t=r[0].nodeName.toLowerCase(),r[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const i=uu(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function yu(e,t,r){mu(r.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const vu={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 xu=null,Eu=null;function Su(){null!=window.document&&(xu=null,null!==Eu&&(Eu.remove(),Eu=null))}function wu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Cu{constructor(e){wu(this,"_isRunning",void 0),wu(this,"_selectIgnore",void 0),wu(this,"_lastHoveredNode",null),wu(this,"excludeSelectors",void 0),wu(this,"onSelect",void 0),wu(this,"iframesListeningTo",new Set),wu(this,"onClick",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"onMouseEvent",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"onPointerDown",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))})),wu(this,"onPointerMove",(e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Xe(t,window.document.querySelector(e)))))return this._selectIgnore=!0,Su();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 r;r=[t],null,!1,null!=window.document?(null!==xu&&clearTimeout(xu),null!=r&&(null===Eu&&(Eu=new bu),Eu.inspect(r,null))):null!=r&&null!=r[0]&&console.error("showNativeHighlight",r[0])}})),wu(this,"onPointerUp",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"selectFiberForNode",(0,te.throttle)((e=>{this._selectIgnore||this.onSelect?.(e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let r=e;const n=[];for(;r!==t&&null!==r;){let e=r.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(r.classList).reverse();e<n.length;e++)t.test(n[e])&&r.classList.remove(n[e]);if(r.id&&/^rc-\w+/.test(r.id)&&r.removeAttribute("id"),r.id)e+=`#${r.id}`;else{const t=Array.from(r.parentElement.children).filter((e=>e.tagName===r.tagName)),n=r.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let r="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(r+=`.${t[e]}`);e+=r}}else r.getAttribute("name")?e+=`[name=${r.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(r)+1})`}r.nodeType!==Node.TEXT_NODE&&n.unshift(e),r=r.parentElement}return n.join(" > ")}(e))}),200,{leading:!1})),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){Su(),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 Tu(e){return document.querySelector(e)}const Iu=e=>{const{action:t,onConfirm:r,onCancel:n,onFinish:i}=e,{t:a}=Ic();return o().createElement(o().Fragment,null,o().createElement("div",{style:{height:100}},a("qm.table.config.emptyText")),o().createElement(Ee,{style:{width:"100%",justifyContent:"flex-end"}},o().createElement(be,{size:"small",onClick:()=>n?.()},a("qm.guideTracker.closeButton")),o().createElement(be,{size:"small",onClick:()=>r?.()},a("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),o().createElement(be,{size:"small",onClick:()=>i?.()},a("qm.guideTracker.finishButton"))))},Nu={left:"50%",top:"50%",width:1,height:1},Ru=o().forwardRef(((e,t)=>{const{open:r,current:n,defaultCurrent:i,steps:a=[],placement:l="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:h,helper:m={},selectFilter:f=(e=>e),onSelect:g,onChange:b,onClose:y,onFinish:v}=e,{t:x}=Ic(),E=o().useRef(),S=o().useRef(a.length),[w,C]=as(0,{value:n,defaultValue:i}),[T,I]=as(void 0,{value:r,postState:e=>e??!1}),[N,R]=as(1051,{value:h,defaultValue:h}),[P,O]=o().useState({}),[k,A]=o().useState(!1),[_,F]=o().useState(T),[H,D]=o().useState(!1),[$,q]=xd(P.node,!!r),[M,j]=o().useState(22),K=o().useRef(!1),V=o().useMemo((()=>w>=a.length?"add":"edit"),[w,a]),z=o().useMemo((()=>`${w+1} / ${a.length}`),[w,a]);o().useLayoutEffect((()=>{E.current=new Cu({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),O({id:ln(),node:e,path:t}),C(S.current),A(!0),U(),g?.(t,e)}})}),[]),o().useEffect((()=>(T?B():U(),T?setTimeout((()=>F(!0)),16):F(!1),()=>{U()})),[T]),o().useEffect((()=>{S.current=a.length}),[a]);const B=()=>{E.current.startHandle()},U=()=>{E.current.stopHandle()},W=e=>{e.stopPropagation(),e.preventDefault()};o().useImperativeHandle(t,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:w,selector:P.path})})));const G=Ce("guide-tracker"),Y=[{[`${G}-primary`]:!0}],X=Cd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return o().createElement(o().Fragment,null,o().createElement(Id(),{open:T&&k,autoLock:!0},o().createElement(Rd(),{zIndex:N,builtinPlacements:X,popupPlacement:l,popupVisible:T&&k,popupClassName:we()(Y,c),popupStyle:d,prefixCls:G,popup:()=>{const e=()=>{A(!1),B()};return o().createElement("div",{className:`${G}-content`},o().createElement("div",{className:`${G}-inner`},o().createElement(Te.CloseOutlined,{className:`${G}-close`,onClick:()=>{y?.(w),e()}}),o().createElement(L.Dropdown,{open:H,trigger:["click"],dropdownRender:()=>a.length?o().createElement("div",{className:"ant-dropdown-menu step-list"},o().createElement(hi.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.id)),r=a.map((e=>e.id));if((0,te.isEqual)(t,r))return;const n=t.findIndex((e=>e===P.id)),i=-1!==n?n:w;C(i),b?.(bn(e),i)}},a.map(((e,t)=>o().createElement("li",{key:t,className:we()("item",{actived:e.id===P.id})},o().createElement(Te.HolderOutlined,{className:"handle",title:x("qm.form.draggable")}),o().createElement("span",{className:"box"},o().createElement("span",{className:"title",title:e.title,onClick:()=>{t!==w&&(O({id:e.id,node:Tu(e.selector),path:e.selector}),C(t),j(22===M?M+1:M-1),b?.(a,t))}},e.title),o().createElement(L.Popconfirm,{title:x("qm.button.confirmTitle"),zIndex:N+1,onConfirm:()=>{const r=a.filter((t=>t.id!==e.id)),n=t===w;let i=t<=w?w-1:w;if(i=i<0?0:i,i=i>r.length?r.length:i,n&&r[i]){const{id:e,selector:t}=r[i];O({id:e,node:Tu(t),path:t})}C(i),b?.(r,i)}},o().createElement(Te.CloseOutlined,{className:"close-icon"})))))))):o().createElement(o().Fragment,null),overlayClassName:`${G}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:N},onOpenChange:e=>D(e)},o().createElement(Te.MenuOutlined,{className:we()(`${G}-close`,"menu-icon"),style:{width:M}})),m.content&&o().createElement(L.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:N},content:m.content,title:m.title},o().createElement(Te.QuestionCircleOutlined,{className:we()(`${G}-close`,"help-icon")})),o().createElement("div",{className:"panel-label"},o().createElement("span",{className:"title"},x("qm.guideTracker.label")),o().createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),z)),p?p({id:P.id,selector:P.path,actionStatus:V,DO_CLOSE:e},w):o().createElement(Iu,{action:V,onConfirm:()=>{b?.("add"===V?[...a,{id:P.id,selector:P.path,title:"Guide Title"}]:[...a],w),e()},onCancel:()=>{y?.(w),e()},onFinish:()=>{e(),y?.(w),v?.()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},o().createElement("div",{className:we()(`${G}-target-placeholder`),style:{...$||Nu,position:"fixed",zIndex:N-1,backgroundColor:"rgba(120, 170, 210, 0.7)"},onMouseDown:W,onClick:W}))),s&&o().createElement(Id(),{open:_},o().createElement(Ad,{zIndex:N,prefixCls:G,onPause:()=>{K.current=k,A(!1),U()},onPlay:()=>{K.current?A(!0):B()}})))}));Ru.displayName="QmGuideTracker";const Pu=Ru,Ou=e=>{const{content:t,image:r,width:n,height:i,font:l={},gap:s=[100,100],offset:c=[50,50],rotate:d=-22,zIndex:u=9,alpha:p=1,antiTamper:h=!0,grayscale:m,className:f,style:g}=e,b=o().useRef(null),y=o().useRef(new Map),v=l.fontSize??16,x=l.fontWeight??"normal",E=l.fontStyle??"normal",S=l.fontFamily??"sans-serif",w=l.color??"rgba(0, 0, 0, 0.15)",C=l.textAlign??"center",T=Array.isArray(t)?t:[t],I=s[0],N=s[1],R=I/2,P=N/2,O=c[0]??R,k=c[1]??P,A=o().useMemo((()=>{const e=O-R,t=k-P;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:u}}),[R,P,O,k,u]),L=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const a=(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),[o,l]=(e=>{let t=120,a=64;if(!r&&e.measureText){e.font=`${v}px ${S}`;const r=T.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),a=v*T.length+3*(T.length-1)}return[n??t,i??a]})(t),s=o*a,c=l*a,u=(I+o)*a,h=(N+l)*a,f=I/2*a,g=N/2*a,R=u/2,P=h/2,O=2*(I+o);e.width=2*u,e.height=2*h,t.globalAlpha=p,t.save(),t.translate(R,P),t.rotate(Math.PI/180*d),t.translate(-R,-P);const k=()=>{t.restore(),t.drawImage(e,0,0,u,h,u,h,u,h),m&&(e=>{const t=e.getContext("2d");if(!t)return;const r=t.getImageData(0,0,e.width,e.height),{data:n}=r;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(r,0,0)})(e),((e,t)=>{if(b.current){const r=y.current.get(b.current);r&&(b.current.contains(r)&&b.current.removeChild(r),y.current.delete(b.current));const n=document.createElement("div");n.setAttribute("style",(e=>Object.entries(e).map((e=>{let[t,r]=e;return`${n=t,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${r}`;var n})).join(";"))({...A,backgroundImage:`url('${e}')`,backgroundSize:`${t}px`})),b.current?.append(n),y.current.set(b.current,n)}})(e.toDataURL(),O)},L=()=>{const e=Number(v)*a;t.font=`${E} normal ${x} ${e}px/${l}px ${S}`,t.fillStyle=w,t.textAlign=C,t.textBaseline="top",t.translate(s/2,0),T.forEach(((r,n)=>{t.fillText(r??"",f,g+n*(e+3*a))})),k()};if(r){const e=new Image;e.onload=()=>{t.drawImage(e,f,g,s,c),k()},e.onerror=()=>{L()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=r}else L()},_=e=>Array.from(y.current.values()).includes(e);o().useEffect((()=>{L()}),[t,r,n,i,l,s,c,d,u,p,h,m]),function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=window&&"MutationObserver"in window,i=a.useRef(),o=()=>{i.current&&(i.current.disconnect(),i.current=void 0)};a.useLayoutEffect((()=>(o(),n&&e.current&&(i.current=new MutationObserver(t),i.current.observe(e.current,r)),()=>o())),[e])}(b,(e=>{if(h)for(const t of e){const e=Array.from(t.removedNodes).some((e=>_(e))),r="attributes"===t.type&&_(t.target);if(e||r){L();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const F=Ce("watermark");return o().createElement("div",{ref:b,className:we()(F,f),style:{position:"relative",...g}},e.children)},ku=new Map,Au=new WeakMap;let Lu=0;function _u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:undefined;if(void 0===window.IntersectionObserver&&void 0!==n){const i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:a,elements:o}=function(e){const t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(r=e.root,r?(Au.has(r)||(Lu+=1,Au.set(r,Lu.toString())),Au.get(r)):"0"):e[t]}`;var r})).toString()}(e);let r=ku.get(t);if(!r){const n=new Map;let i=[];const a=new IntersectionObserver((t=>{t.forEach((t=>{const r=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),n.get(t.target)?.forEach((e=>{e(r,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:n},ku.set(t,r)}return r}(r),l=o.get(e)||[];return o.has(e)||o.set(e,l),l.push(t),a.observe(e),function(){l.splice(l.indexOf(t),1),0===l.length&&(o.delete(e),a.unobserve(e)),0===o.size&&(a.disconnect(),ku.delete(i))}}const Fu=e=>{const{forceRender:t,height:r,placeholder:n=null,unmountIfInvisible:i,className:a,style:l}=e,{ref:s,inView:c,entry:d}=function(){let{root:e,rootMargin:t,threshold:r,triggerOnce:n,fallbackInView:i,trackVisibility:a,skip:l,delay:s,onChange:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[d,u]=o().useState(null),[p,h]=o().useState({inView:!1,entry:void 0}),m=o().useRef(c);o().useEffect((()=>{if(l||!d)return;let o;return o=_u(d,((e,t)=>{h({inView:e,entry:t}),m.current?.(e,t),t.isIntersecting&&n&&o&&(o(),o=void 0)}),{root:e,rootMargin:t,threshold:r,trackVisibility:a,delay:s},i),()=>{o&&o()}}),[Array.isArray(r)?r.toString():r,d,e,t,n,l,a,i,s]);const f=p.entry?.target,g=o().useRef();d||!f||n||l||g.current===f||(g.current=f,h({inView:!1,entry:void 0}));const b=[u,p.inView,p.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}(Object.assign({},e,{triggerOnce:!i}));o().useEffect((()=>{r||v("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u=Ce("lazy-load"),p={[u]:!0};return o().createElement("div",{ref:s,className:we()(p,a),style:l},t||c?e.children:o().createElement("div",{className:"placeholder",style:{height:r}},n))},Hu=require("html2canvas");var Du=n.n(Hu);function $u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class qu{constructor(e,t,r,n){if($u(this,"x",void 0),$u(this,"y",void 0),$u(this,"pressure",void 0),$u(this,"time",void 0),isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=r||0,this.time=n||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Mu{static fromPoints(e,t){const r=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Mu(e[1],r,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,r){const n=e.x-t.x,i=e.y-t.y,a=t.x-r.x,o=t.y-r.y,l=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+r.x)/2,d=(t.y+r.y)/2,u=Math.sqrt(n*n+i*i),p=Math.sqrt(a*a+o*o),h=p/(u+p),m=c+(l-c)*h,f=d+(s-d)*h,g=t.x-m,b=t.y-f;return{c1:new qu(l+g,s+b),c2:new qu(c+g,d+b)}}constructor(e,t,r,n,i,a){this.startPoint=e,this.control2=t,this.control1=r,this.endPoint=n,this.startWidth=i,this.endWidth=a}length(){let e,t,r=0;for(let n=0;n<=10;n+=1){const i=n/10,a=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),o=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=a-e,i=o-t;r+=Math.sqrt(n*n+i*i)}e=a,t=o}return r}point(e,t,r,n,i){return t*(1-e)*(1-e)*(1-e)+3*r*(1-e)*(1-e)*e+3*n*(1-e)*e*e+i*e*e*e}}function ju(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ku{constructor(e,t){var r=this;ju(this,"canvas",void 0),ju(this,"ctx",void 0),ju(this,"textInput",void 0),ju(this,"width",320),ju(this,"height",200),ju(this,"ratio",Math.max(window.devicePixelRatio||1,1)),ju(this,"penColor","rgba(0,0,0,1)"),ju(this,"backgroundColor","rgba(0,0,0,0)"),ju(this,"canAddHistory",!1),ju(this,"mode",void 0),ju(this,"openSmooth",!0),ju(this,"dotSize",0),ju(this,"throttle",16),ju(this,"minDistance",5),ju(this,"velocityFilterWeight",.7),ju(this,"compositeOperation","source-over"),ju(this,"minWidth",.5),ju(this,"maxWidth",2.5),ju(this,"fontSize",16),ju(this,"eraserSize",20),ju(this,"lineHeight",1.25),ju(this,"degreeOfBlur",5),ju(this,"textInputPos",{x:0,y:0}),ju(this,"onStart",(()=>{})),ju(this,"onEnd",(()=>{})),ju(this,"_drawingStroke",!1),ju(this,"_lastPoints",[]),ju(this,"_data",[]),ju(this,"_historyList",[]),ju(this,"_lastVelocity",0),ju(this,"_lastWidth",0),ju(this,"_strokeMoveUpdate",void 0),ju(this,"setCanvasSize",(()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)})),ju(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))})),ju(this,"isTouchEvent",(e=>"touches"in e)),ju(this,"addListener",(()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)})),ju(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)})),ju(this,"_isLeftButtonPressed",((e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:!(1&~e.buttons))),ju(this,"_pointerEventToSignatureEvent",(e=>({event:e,type:e.type,x:this.isTouchEvent(e)?e.touches[0]?.clientX:e.clientX,y:this.isTouchEvent(e)?e.touches[0]?.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}))),ju(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}))),ju(this,"_strokeBegin",(e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),r={...t,points:[]};this._data.push(r),this._reset(t),this._strokeUpdate(e,!1)})),ju(this,"_strokeUpdate",(function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!r._drawingStroke)return;if(0===r._data.length)return void r._strokeBegin(e);const n=r._createPoint(e.x,e.y,e.pressure),i=r._data[r._data.length-1],a=i.points,o=a.length>0&&a[a.length-1],l=!!o&&n.distanceTo(o)<=r.minDistance,s=r._getPointGroupOptions(i);if(!o||!o||!l){const e=r._addPoint(n,s);t&&(o?e&&r._drawCurve(e,s):r._drawDot(n,s)),a.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}})),ju(this,"_strokeEnd",(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r._drawingStroke&&(t&&r._strokeUpdate(e),r._drawingStroke=!1)})),ju(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})),ju(this,"_drawDot",((e,t)=>{const r=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;r.beginPath(),this._drawCurveSegment(e.x,e.y,n),r.closePath(),r.fillStyle=t.penColor,r.fill()})),ju(this,"_drawCurve",((e,t)=>{const r=this.ctx,n=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());r.beginPath(),r.fillStyle=t.penColor;for(let r=0;r<i;r+=1){const a=r/i,o=a*a,l=o*a,s=1-a,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*a*e.control1.x,u+=3*s*o*e.control2.x,u+=l*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*a*e.control1.y,p+=3*s*o*e.control2.y,p+=l*e.endPoint.y;const h=Math.min(e.startWidth+l*n,t.maxWidth);this._drawCurveSegment(u,p,h)}r.closePath(),r.fill()})),ju(this,"_drawCurveSegment",((e,t,r)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,r,0,2*Math.PI,!1)})),ju(this,"_createPoint",((e,t,r)=>{const n=this.canvas.getBoundingClientRect();return new qu(e-n.left,t-n.top,r,(new Date).getTime())})),ju(this,"_createPointByEvent",(e=>this._createPoint(e.x,e.y,e.pressure))),ju(this,"_addPoint",((e,t)=>{const{_lastPoints:r}=this;if(r.push(e),r.length>2){3===r.length&&r.unshift(r[0]);const e=this._calculateCurveWidths(r[1],r[2],t),n=Mu.fromPoints(r,e);return r.shift(),n}return null})),ju(this,"_strokeWidth",((e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth))),ju(this,"_calculateCurveWidths",((e,t,r)=>{const n=r.velocityFilterWeight*t.velocityFrom(e)+(1-r.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(n,r),a={end:i,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=i,a})),ju(this,"onDrawStart",(e=>{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),this.onStart?.(e))})),ju(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)))})),ju(this,"onDrawEnd",(e=>{this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),this.onEnd?.(e))})),ju(this,"onInputBlur",(e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()})),ju(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})),ju(this,"drawSquare",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,r,n-t,i-r),this.ctx.stroke(),this.ctx.restore()})),ju(this,"drawRound",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=Math.min(n,t),o=Math.min(i,r),l=.5*(Math.max(n,t)-a),s=.5*(Math.max(i,r)-o),c=a+l,d=o+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,l,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()})),ju(this,"drawArrow",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=180*Math.atan2(r-i,t-n)/Math.PI,o=(a+25)*Math.PI/180,l=(a-25)*Math.PI/180,s=15*Math.cos(o),c=15*Math.sin(o),d=15*Math.cos(l),u=15*Math.sin(l);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,r),this.ctx.lineTo(n,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,i);const p=n+s,h=i+c;this.ctx.lineTo(p,h);const m=n+d,f=i+u;this.ctx.lineTo(m,f),this.ctx.lineTo(n,i),this.ctx.fill(),this.ctx.restore()})),ju(this,"getAxisColor",((e,t,r)=>{const n=e.width,i=e.data,a=[];return a[0]=i[4*(r*n+t)],a[1]=i[4*(r*n+t)+1],a[2]=i[4*(r*n+t)+2],a[3]=i[4*(r*n+t)+3],a})),ju(this,"setAxisColor",((e,t,r,n)=>{const i=e.width,a=e.data;a[4*(r*i+t)]=n[0],a[4*(r*i+t)+1]=n[1],a[4*(r*i+t)+2]=n[2],a[4*(r*i+t)+3]=n[3]})),ju(this,"drawMosaic",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,r*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=n.width,a=n.height,o=i/this.degreeOfBlur,l=a/this.degreeOfBlur;for(let e=0;e<l;e++)for(let t=0;t<o;t++){const r=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let a=0;a<this.degreeOfBlur;a++)this.setAxisColor(n,t*this.degreeOfBlur+a,e*this.degreeOfBlur+i,r)}this.ctx.putImageData(n,t*this.ratio,r*this.ratio)})),ju(this,"drawText",(e=>{const{x:t,y:r}=this.textInputPos;if(0===t&&0===r)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,i=this.width-t,a=e.target.innerText,o=[];let l="";for(let e=0;e<a.length;e++){const t=l+a[e];this.ctx.measureText(t).width>i&&l.length>0?(o.push(l),l=a[e]):l=t}o.push(l),o.forEach(((e,i)=>{this.ctx.fillText(e,t+1,r+i*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}})),ju(this,"createPencil",(e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,r)})),ju(this,"drawPencil",(e=>{const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,r),this.ctx.stroke(),this.ctx.restore()})),ju(this,"createEraser",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,r)})),ju(this,"drawEraser",(e=>{const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,r),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"})),ju(this,"drawLine",(e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)})),ju(this,"createTextInput",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=r?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())})),ju(this,"setInputStyle",(()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}})),ju(this,"drawBgColor",(()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))})),ju(this,"clearWorkSpace",(()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)})),ju(this,"addHistory",(()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))})),ju(this,"getLastHistory",(()=>this._historyList[this._historyList.length-1])),ju(this,"setLastHistory",(()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()})),ju(this,"clear",(()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())})),ju(this,"undo",(()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()})),ju(this,"setDrawMode",(e=>{this.mode=e})),ju(this,"setLineWidth",(e=>{this.maxWidth=e})),ju(this,"setPenColor",(e=>{this.penColor=e})),ju(this,"setFontSize",(e=>{this.fontSize=e})),ju(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()})),ju(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(r.canvas.width===r.width)return r.canvas.toDataURL(e,t);const n=document.createElement("canvas");return n.width=r.width,n.height=r.height,n.getContext("2d").drawImage(r.canvas,0,0,n.width,n.height),n.toDataURL(e,t)})),ju(this,"getPNG",(()=>this.toDataURL())),ju(this,"getJPG",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;return r.toDataURL("image/jpeg",e)})),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,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,a=0,o=null;const l=()=>{a=Date.now(),o=null,t=e.apply(r,n),o||(r=null,n=[])};return function(){const s=Date.now(),c=i-(s-a);r=this;for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];return n=u,c<=0||c>i?(o&&(clearTimeout(o),o=null),a=s,t=e.apply(r,n),o||(r=null,n=[])):o||(o=window.setTimeout(l,c)),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()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}ju(Ku,"dataURLToBlob",(e=>{const t=e.split(";base64,"),r=t[0].split(":")[1],n=window.atob(t[1]),i=n.length,a=new Uint8Array(i);for(let e=0;e<i;++e)a[e]=n.charCodeAt(e);return new Blob([a],{type:r})})),ju(Ku,"canvasToDataURL",(e=>e.toDataURL("image/png",1))),ju(Ku,"canvasToBlob",(e=>new Promise(((t,r)=>{e.toBlob((e=>e?t(e):r(null)),"image/png",1)}))));const Vu=Ku,zu=()=>o().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Bu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Uu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Wu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Gu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Yu=o().forwardRef(((e,t)=>{const{open:r,width:n,height:i,imageName:a,penColor:l,minWidth:s,maxWidth:c,backgroundColor:d,className:p,style:h,onOk:m,onCancel:f}=e,{t:g}=Ic(),b=o().useRef(),y=o().useRef(null),x=o().useRef(null),E=o().useRef(null),S=[2,4,6],w=[14,16,18,20,24,28],C=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[T,I]=as(void 0,{value:r,postState:e=>e??!1}),N=o().useMemo((()=>!!e.children),[e.children]),[R,P]=o().useState(N?"square":"line"),[O,k]=o().useState(S[0]),[A,_]=o().useState(N?C[0]:C[4]),[F,H]=o().useState(w[1]),[D,$]=o().useState("bottomLeft"),[q,M]=o().useState(!1),[j,K]=o().useState(!1);o().useEffect((()=>{const e={width:n??x.current?.offsetWidth,height:i??x.current?.offsetHeight,maxWidth:O,mode:R,penColor:A,fontSize:F,backgroundColor:d,openSmooth:!N};return e.openSmooth&&Object.assign(e,{penColor:l,minWidth:s,maxWidth:c}),b.current=new Vu(y.current,e),()=>b.current.destroy()}),[]);const V=e=>{const[t,r]=[n??x.current?.offsetWidth,i??x.current?.offsetHeight],{width:a,height:o}=b.current;let l=!1;t&&t!==a&&(b.current.width=t,l=!0),r&&r!==o&&(b.current.height=r,l=!0),(l||e)&&b.current.update()};Me((()=>{N&&T&&V()}),[T,N]),Me((()=>{b.current.setDrawMode(R)}),[R]),Me((()=>{b.current.setLineWidth(O)}),[O]),Me((()=>{b.current.setPenColor(A)}),[A]),Me((()=>{b.current.setFontSize(F)}),[F]);const z=async()=>{const e=N?x.current.parentNode:y.current;if(e)try{const t=await Du()(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return Vu.canvasToDataURL(t)}catch(e){v("Signature","生成合成图片失败!")}},B=()=>{b.current.clear(),f?.()};o().useImperativeHandle(t,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),CLEAR:()=>b.current.clear(),IS_EMPTY:()=>b.current.isEmpty(),UPDATE:V,GET_DATE_URL:z})));const U=e=>{e&&$((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},W=e=>o().createElement("div",{className:we()("ant-dropdown-menu","content")},"text"!==e?o().createElement("div",{className:"lineWidth"},S.map((e=>o().createElement("span",{key:e,className:we()("dot",`s${e}`,{active:e===O}),onClick:()=>k(e)})))):o().createElement("div",{className:"fontSize"},o().createElement(L.Select,{size:"small",value:F,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>H(e)})),o().createElement("span",{className:"divider"}),o().createElement("div",{className:"penColor"},C.map((e=>o().createElement("span",{key:e,className:we()("dot",{active:e===A}),style:{backgroundColor:e},onClick:()=>_(e)},o().createElement(Te.CheckOutlined,{className:"icon"})))))),G=Ce("signature"),Y={[G]:!0,"is-annotation":N},X=n?{...h,width:n}:h;return o().createElement("div",{className:we()(Y,p),style:X},N&&o().createElement(o().Fragment,null,o().createElement("div",{ref:x,className:"content"},e.children),j&&o().createElement(xt,{spinning:!0,className:"spinning"})),o().createElement("div",{className:we()("signature",{show:T})},o().createElement("canvas",{ref:y,className:R}),N&&o().createElement("div",{ref:E,className:"signature__tool-bar"},o().createElement("div",{className:"wrapper"},o().createElement("div",{className:we()("actions",{hidden:q})},o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("square")},o().createElement(Te.BorderOutlined,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("round")},o().createElement(zu,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("arrow")},o().createElement(Uu,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("line")},o().createElement(Te.EditOutlined,null))),o().createElement(L.Dropdown,{dropdownRender:()=>W("text"),overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("text")},o().createElement(Bu,null))),o().createElement("button",{className:"btn",onClick:async()=>{await(async()=>{K(!0);const e=await z();if(e){const t=a?a.slice(0,a.lastIndexOf(".")>0?a.lastIndexOf("."):void 0):u()().format(Ul);Dt(Vu.dataURLToBlob(e),`${t}.png`)}K(!1)})(),B()}},o().createElement(Te.DownloadOutlined,null)),o().createElement("button",{className:"btn",onClick:()=>P("eraser")},o().createElement(Wu,null)),o().createElement("button",{className:"btn",onClick:()=>b.current.undo()},o().createElement(Gu,null)),o().createElement("button",{className:"btn",onClick:()=>b.current.clear()},o().createElement(Te.ClearOutlined,null)),o().createElement("span",{className:"divider"}),o().createElement("button",{className:"btn",onClick:()=>f?.()},o().createElement(Te.CloseOutlined,null)),o().createElement("button",{className:"btn",onClick:async()=>{K(!0),await le(10);const e=await z();K(!1),B(),m?.(e)}},o().createElement(Te.CheckOutlined,null))),o().createElement("button",{className:"btn btn-fold",title:g(q?"qm.divider.spread":"qm.divider.collect"),onClick:()=>M(!q)},q?o().createElement(Te.LeftOutlined,null):o().createElement(Te.RightOutlined,null))))))}));Yu.displayName="QmSignature";const Xu=Yu,Qu="1.9.29";return i})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("QmDesign",["react"],t):"object"==typeof exports?exports.QmDesign=t(require("react")):e.QmDesign=t(e.React)}("undefined"!=typeof self?self:this,(e=>(()=>{"use strict";var t={442:t=>{t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{Affix:()=>L.Affix,Alert:()=>L.Alert,Anchor:()=>L.Anchor,AutoComplete:()=>L.AutoComplete,Avatar:()=>L.Avatar,BackTop:()=>L.BackTop,Badge:()=>L.Badge,Breadcrumb:()=>L.Breadcrumb,Button:()=>L.Button,Calendar:()=>$,Card:()=>L.Card,Carousel:()=>L.Carousel,Cascader:()=>L.Cascader,Checkbox:()=>L.Checkbox,Col:()=>L.Col,Collapse:()=>L.Collapse,Comment:()=>L.Comment,ConfigProvider:()=>L.ConfigProvider,DatePicker:()=>j,DcpAnchor:()=>nr,DcpButton:()=>be,DcpCollapse:()=>$e,DcpConfigProvider:()=>ee,DcpCopyToClipboard:()=>qc,DcpCountup:()=>ut,DcpCropper:()=>vl,DcpDivider:()=>Re,DcpDownload:()=>Ut,DcpDrawer:()=>hr,DcpEmpty:()=>ft,DcpForm:()=>Go,DcpGuideTracker:()=>Pu,DcpLazyLoad:()=>Fu,DcpModal:()=>Er,DcpPrint:()=>ou,DcpRangeTableHelper:()=>yd,DcpScrollbar:()=>Ht,DcpSearchHelper:()=>ad,DcpSearchTree:()=>Dl,DcpSignature:()=>Xu,DcpSpace:()=>Ee,DcpSpin:()=>xt,DcpSplit:()=>at,DcpTable:()=>rd,DcpTabs:()=>cr,DcpTinymce:()=>ml,DcpTour:()=>$d,DcpTransition:()=>Vd,DcpTreeHelper:()=>hd,DcpTreeTableHelper:()=>ud,DcpUploadFile:()=>xl,DcpUploadImg:()=>Nl,DcpWatermark:()=>Ou,Descriptions:()=>L.Descriptions,Divider:()=>L.Divider,Drawer:()=>L.Drawer,Dropdown:()=>L.Dropdown,Empty:()=>L.Empty,Form:()=>L.Form,Grid:()=>L.Grid,Image:()=>L.Image,Input:()=>L.Input,InputNumber:()=>L.InputNumber,Layout:()=>L.Layout,List:()=>L.List,Mentions:()=>L.Mentions,Menu:()=>L.Menu,Modal:()=>L.Modal,PageHeader:()=>L.PageHeader,Pagination:()=>L.Pagination,Popconfirm:()=>L.Popconfirm,Popover:()=>L.Popover,Progress:()=>L.Progress,QmAnchor:()=>nr,QmButton:()=>be,QmCollapse:()=>$e,QmConfigProvider:()=>ee,QmCopyToClipboard:()=>qc,QmCountup:()=>ut,QmCropper:()=>vl,QmDivider:()=>Re,QmDownload:()=>Ut,QmDrawer:()=>hr,QmEmpty:()=>ft,QmForm:()=>Go,QmGuideTracker:()=>Pu,QmLazyLoad:()=>Fu,QmModal:()=>Er,QmPrint:()=>ou,QmRangeTableHelper:()=>yd,QmScrollbar:()=>Ht,QmSearchHelper:()=>ad,QmSearchTree:()=>Dl,QmSignature:()=>Xu,QmSpace:()=>Ee,QmSpin:()=>xt,QmSplit:()=>at,QmTable:()=>rd,QmTabs:()=>cr,QmTinymce:()=>ml,QmTour:()=>$d,QmTransition:()=>Vd,QmTreeHelper:()=>hd,QmTreeTableHelper:()=>ud,QmUploadFile:()=>xl,QmUploadImg:()=>Nl,QmWatermark:()=>Ou,Radio:()=>L.Radio,Rate:()=>L.Rate,Result:()=>L.Result,Row:()=>L.Row,Segmented:()=>L.Segmented,Select:()=>L.Select,Skeleton:()=>L.Skeleton,Slider:()=>L.Slider,Space:()=>L.Space,Spin:()=>L.Spin,Statistic:()=>L.Statistic,Steps:()=>L.Steps,Switch:()=>L.Switch,Table:()=>L.Table,Tabs:()=>L.Tabs,Tag:()=>L.Tag,TimePicker:()=>B,Timeline:()=>L.Timeline,Tooltip:()=>L.Tooltip,Transfer:()=>L.Transfer,Tree:()=>L.Tree,TreeSelect:()=>L.TreeSelect,Typography:()=>L.Typography,Upload:()=>L.Upload,message:()=>L.message,notification:()=>L.notification,pinyin:()=>ei,version:()=>Qu});var a=n(442),o=n.n(a);const l=require("prop-types");var s=n.n(l);const c=(0,a.createContext)({locale:"zh-cn",size:"middle"}),d=require("dayjs");var u=n.n(d);const p={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:"点击上传",remove:"删除文件"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",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:"查找下一个"}}}};require("dayjs/locale/zh-cn");let h=p;function m(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,r)=>t[r])):e}const f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const[n,i]=t;let a;const o=n.split(".");let l=h;for(let e=0,t=o.length;e<t;e++){if(a=l[o[e]],e===t-1)return m(a,i);if(!a)return"";l=a}return""},g=e=>{h=e||h,h.name&&u().locale(h.name)};class b extends Error{constructor(e){super(e),this.name="QmDesignError"}}function y(e,t){throw new b(`[${e}] ${t}`)}function v(e,t){console.warn(new b(`[${e}] ${t}`))}const x=e=>["","small","middle","large"].includes(e),E=require("dayjs/plugin/localeData");var S=n.n(E);const w=require("dayjs/plugin/advancedFormat");var C=n.n(w);const T=require("dayjs/plugin/customParseFormat");var I=n.n(T);const N=require("dayjs/plugin/quarterOfYear");var R=n.n(N);const P=require("dayjs/plugin/weekOfYear");var O=n.n(P);const k=require("dayjs/plugin/weekday");var A=n.n(k);u().extend(S()),u().extend(C()),u().extend(I()),u().extend(R()),u().extend(O()),u().extend(A());const L=require("antd"),_=require("rc-picker/es/generate/dayjs");var F=n.n(_);const H=require("antd/es/calendar/generateCalendar");var D=n.n(H);require("antd/es/calendar/style");const $=D()(F()),q=require("antd/es/date-picker/generatePicker");var M=n.n(q);require("antd/es/date-picker/style/index");const j=M()(F());function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},K.apply(this,arguments)}const V=a.forwardRef(((e,t)=>a.createElement(j,K({},e,{picker:"time",mode:void 0,ref:t}))));V.displayName="TimePicker";const z=a.forwardRef(((e,t)=>a.createElement(j.RangePicker,K({},e,{picker:"time",mode:void 0,ref:t}))));z.displayName="RangePicker",V.RangePicker=z;const B=V,U={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",remove:"Delete files"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",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"}}}},W=require("antd/es/locale/zh_CN");var G=n.n(W);const Y=require("antd/es/locale/en_GB");var X=n.n(Y);function Q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Z={[U.name]:{qm:U,antd:X()},[p.name]:{qm:p,antd:G()}};class J extends a.Component{constructor(e){super(e),this.state={value:{locale:e.locale,size:e.size,global:e.global}},g(Object.assign({},Z,e.global.langPackage)[e.locale].qm)}static getDerivedStateFromProps(e,t){const{locale:r,size:n}=t.value,{locale:i,size:a,global:o}=e;return i!==r&&g(Object.assign({},Z,o.langPackage)[i].qm),i!==r||a!==n?{value:Object.assign({},t.value,{locale:i,size:a})}:null}render(){const{global:e}=this.props,{value:t}=this.state,r=Object.assign({},Z,e.langPackage);return o().createElement(c.Provider,{value:t},o().createElement(L.ConfigProvider,{locale:r[t.locale].antd,componentSize:t.size,autoInsertSpaceInButton:e.autoInsertSpaceInButton},this.props.children))}}Q(J,"propTypes",{locale:s().string,size:(e,t,r)=>{if(!x(e[t]||""))return y("Divider","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},theme:s().string,global:s().object}),Q(J,"defaultProps",{locale:"zh-cn",size:"middle",global:{}});const ee=J,te=require("lodash-es"),re="undefined"==typeof window,ne=e=>o().isValidElement(e),ie=e=>ne(e)&&e.type===o().Fragment,ae=()=>{},oe=()=>!0,le=async e=>new Promise((t=>setTimeout(t,e))),se=e=>{Promise.resolve().then(e)},ce=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),de=e=>!!(!e&&0!==e||(0,te.isArray)(e)&&!e.length||(0,te.isPlainObject)(e)&&!Object.keys(e).length),ue=(e,t)=>{const r={...e};for(const e of t)delete r[e];return r},pe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if((0,te.isPlainObject)(e)||(0,te.isArray)(e)){const r=Array.isArray(e),n=r?[]:{};if(t.get(e))return e;t.set(e,n);const i=r?void 0:Object.keys(e);return function(e,t){let r=-1;const n=e.length;for(;++r<n;)t(e[r],r)}(i||e,((r,a)=>{i&&(a=r),n[a]=pe(e[a],t)})),n}return e},he=e=>(0,te.isNumber)(e)?`${e}px`:e.toString();function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},me.apply(this,arguments)}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ge extends a.Component{constructor(){super(...arguments),fe(this,"context",void 0),fe(this,"state",{isLoading:!1}),fe(this,"clickHandle",(async e=>{this.setState({isLoading:!0});try{await(this.props.click?.(e))}catch(e){v("Button","`click`方法执行出错")}this.setState({isLoading:!1})}))}render(){const{size:e,loading:t,authConfig:r,click:n,confirm:i}=this.props,{isLoading:a}=this.state,l=e||this.context.size||"",s=(0,te.isFunction)(n)?{onClick:this.clickHandle}:null,c={...ue(this.props,["authConfig","click","confirm"]),size:l,loading:a||t||!1,...s};if(r){const{visible:e=1,disabled:t}=r||{};if(!e)return null;t&&(c.disabled=!0)}return i?o().createElement(L.Popconfirm,{title:i.title||f("qm.button.confirmTitle"),disabled:c.disabled,onConfirm:e=>{i.onConfirm?.(),c.onClick?.(e)},onCancel:e=>{i.onCancel?.(e)}},o().createElement(L.Button,me({},c,{onClick:ae}),this.props.children)):o().createElement(L.Button,c,this.props.children)}}fe(ge,"propTypes",{click:s().func,confirm:s().shape({title:s().node,onConfirm:s().func,onCancel:s().func})}),fe(ge,"contextType",c);const be=ge;function ye(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve=function(e){return e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small",e}(ve||{});class xe extends a.Component{constructor(){super(...arguments),ye(this,"context",void 0)}render(){const{size:e}=this.props,t=e||this.context.size||"",r=(0,te.isNumber)(e)?e:ve[e||t||"default"],n={...this.props,size:r};return o().createElement(L.Space,n,this.props.children)}}ye(xe,"contextType",c);const Ee=xe,Se=require("classnames");var we=n.n(Se);const Ce=e=>`qm-${e}`,Te=require("@ant-design/icons");function Ie(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ne extends a.Component{constructor(){super(...arguments),Ie(this,"context",void 0),Ie(this,"clickHandle",(()=>{const{collapse:e,onCollapseChange:t=ae}=this.props;t(!e)}))}render(){const{size:e,label:t,extra:r,collapse:n,bordered:i,disabled:a,id:l,className:s,style:c}=this.props,d=e||this.context.size||"",u=Ce("divider"),p={[u]:!0,[`${u}-borderless`]:!i,[`${u}--lg`]:"large"===d,[`${u}--sm`]:"small"===d};return o().createElement("div",{id:l,className:we()(p,s),style:c},o().createElement("span",{className:we()(`${u}__title`)},t),o().createElement("div",{className:we()(`${u}__extra`)},r),void 0!==n&&o().createElement(L.Button,{type:"link",className:we()(`${u}__collapse`),disabled:a,onClick:this.clickHandle},f(n?"qm.divider.collect":"qm.divider.spread"),n?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)))}}Ie(Ne,"contextType",c),Ie(Ne,"propTypes",{label:s().string,size:(e,t,r)=>{if(!x(e[t]||""))return y("Divider","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},extra:s().oneOfType([s().element,s().string]),collapse:s().bool,bordered:s().bool}),Ie(Ne,"defaultProps",{bordered:!0});const Re=Ne,Pe=()=>({height:0,opacity:0}),Oe=(e,t)=>"height"===t.propertyName,ke={motionName:"rc-collapse-motion",onEnterStart:Pe,onEnterActive:e=>({height:e.scrollHeight,opacity:1}),onLeaveStart:e=>({height:e.offsetHeight}),onLeaveActive:Pe,onEnterEnd:Oe,onLeaveEnd:Oe,motionDeadline:500,leavedClassName:"rc-collapse-content-hidden"},Ae=require("rc-motion");var Le=n.n(Ae);const _e=o().forwardRef(((e,t)=>{const{forceRender:r,className:n,style:i,boxStyle:a,isActive:l}=e,[s,c]=o().useState(l||r);if(o().useEffect((()=>{(r||l)&&c(!0)}),[r,l]),!s)return null;const d=Ce("collapse");return o().createElement("div",{ref:t,className:we()(`${d}-content`,{[`${d}-content-active`]:l,[`${d}-content-inactive`]:!l},n),style:i},o().createElement("div",{className:`${d}-content-box`,style:a},e.children))}));_e.displayName="PanelContent";const Fe=_e;function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},He.apply(this,arguments)}const De=e=>{const{defaultActive:t,label:r,extra:n,className:i,style:a,containerStyle:l,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[h,m]=o().useState(!!t),f=Ce("collapse"),g=we()({[`${f}`]:!0,[`${f}-active`]:h,[`${f}-disabled`]:c},i);return o().createElement("div",{className:g,style:a},o().createElement(Re,{label:r,extra:n,collapse:h,bordered:s,disabled:c,onCollapseChange:e=>{m(e),p?.(e)}}),o().createElement(Le(),He({visible:h},ke,{leavedClassName:`${f}-content-hidden`,forceRender:d,removeOnLeave:u}),((t,r)=>{let{className:n,style:i}=t;return o().createElement(Fe,{ref:r,prefixCls:f,className:n,style:i,boxStyle:l,isActive:h,forceRender:d},e.children)})))};De.displayName="QmCollapse";const $e=De,qe=o().createContext(void 0);function Me(e,t){((t,r)=>{const n=a.useRef(!0);a.useEffect((()=>(t=>{if(!t)return e()})(n.current)),r),a.useEffect((()=>(n.current=!1,()=>{n.current=!0})),[])})(0,t)}const je=(e,t,r)=>{e&&t&&r&&e.addEventListener(t,r,!1)},Ke=(e,t,r)=>{e&&t&&r&&e.removeEventListener(t,r,!1)},Ve=e=>e.preventDefault(),ze=(e,t)=>{if(re||!e||!t)return null;"float"===(t=ce(t))&&(t="cssFloat");try{const r=e.style[t];if(r)return r;const n=window.getComputedStyle(e);return n?n[t]:""}catch(r){return e.style[t]}},Be=(e,t,r)=>{!re&&e&&t&&((0,te.isPlainObject)(t)?Object.keys(t).forEach((r=>{Be(e,r,t[r])})):(t=ce(t),e.style[t]=r))},Ue=e=>{let t=0,r=e;for(;r;)t+=r.offsetTop,r=r.offsetParent;return t},We=(e,t)=>Math.abs(Ue(e)-Ue(t)),Ge=e=>{let t=0,r=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,r+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:r}},Ye=(e,t)=>{let r=e;for(;r;){if(r.classList?.contains(t))return r;r=r.parentNode}return null},Xe=(e,t)=>{if(re||!e||!t)return!1;let r=e;for(;r;){if(r===t)return!0;r=r.parentNode}return!1},Qe=e=>Math.pow(e,3),Ze=e=>e<.5?Qe(2*e)/2:1-Qe(2*(1-e))/2,Je=e=>{const{minValues:t,onDragChange:r,onDragging:n}=e,{splitRef:i,direction:a}=o().useContext(qe),l=o().useRef(re?null:document.onselectstart),s=o().useMemo((()=>"horizontal"===a),[a]),c=o().useMemo((()=>s?"X":"Y"),[s]),d=o().useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),u=e=>{d.current=Object.assign({},d.current,e)},p=e=>{if(1!==e.buttons)return h();const r=e[`page${c}`]-d.current[`start${c}`],i=[t[0],d.current[`containerSize${c}`]-t[1]];let a=d.current[`firstElementSize${c}`]+r;a=Math.max(i[0],a),a=Math.min(i[1],a),n(a)},h=()=>{u({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),Ke(document,"mousemove",p),Ke(document,"mouseup",h),m()},m=()=>{document.onselectstart!==l.current&&(document.onselectstart=l.current)},g=Ce("split"),b={[`${g}__resize-bar`]:!0,vertical:"vertical"===a,horizontal:"horizontal"===a};return o().createElement("div",{className:we()(b),title:f("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=i.current,n=t.children[0];u({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),je(document,"mousemove",p),je(document,"mouseup",h),r(!0),l.current=document.onselectstart,document.onselectstart=()=>!1}})};Je.displayName="ResizeBar";const et=Je,tt=o().forwardRef(((e,t)=>{const{offset:r,className:n,style:i}=e,{direction:a,dragging:l}=o().useContext(qe),s="vertical"===a?"height":"width",c=Ce("split-pane"),d={[c]:!0,isLocked:l,horizontal:"horizontal"===a,vertical:"vertical"===a,[n]:!!n},u=void 0!==r?{[s]:he(r)}:{flex:1,[s]:0};return o().createElement("div",{ref:t,className:we()(d),style:{...u,...i}},e.children)}));tt.displayName="QmSplitPane";const rt=tt;function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nt.apply(this,arguments)}const it=e=>{const{direction:t="horizontal",defaultValue:r="50%",uniqueKey:n,className:i,style:a,onDragStart:l,onDrag:s=ae,onDragEnd:d}=e,{global:u}=o().useContext(c),p=o().useRef(null),h=o().useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,f=e=>Number.parseInt(e,10),g=e=>{const t=Number.parseInt(e.props?.min||0);return t>=0?t:0},b=o().useMemo((()=>n?`split_${n}`:""),[n]),[y,v]=o().useState(!1),[x,E]=o().useState(m(r));Me((()=>{y?l?.(f(x)):(d?.(f(x)),localStorage.setItem(b,x),C(b,x))}),[y]),o().useEffect((()=>{S()}),[]);const S=()=>{if(!b)return;const e=localStorage.getItem(b);e?E(m(e)):w(b).then((e=>{localStorage.setItem(b,m(e||r)),S()})).catch((()=>{}))},w=async e=>{const t=u?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},C=async(e,t)=>{const r=u?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}},T=o().useMemo((()=>({splitRef:p,direction:t,dragging:y})),[t,y]),I=[];o().Children.map(e.children,(e=>{ne(e)&&!ie(e)&&"QmSplitPane"===e.type?.displayName&&I.push(e)}));const[N,R]=I,P=o().useMemo((()=>[g(N),g(R)]),[N,R]),O=Ce("split"),k={[O]:!0,vertical:"vertical"===t};return o().createElement(qe.Provider,{value:T},o().createElement("div",{ref:p,className:we()(k,i),style:a},o().createElement(rt,nt({},N.props,{ref:h,offset:x})),o().createElement(et,{minValues:P,onDragChange:e=>v(e),onDragging:e=>{E(`${e}px`),s(e)}}),o().createElement(rt,R.props)))};it.Pane=rt,it.displayName="QmSplit";const at=it,ot=require("react-countup");var lt=n.n(ot);function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},st.apply(this,arguments)}function ct(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class dt extends a.Component{constructor(){super(...arguments),ct(this,"context",void 0)}render(){const{size:e,className:t,style:r}=this.props,n=e||this.context.size||"",i=Ce("countup"),a={[i]:!0,[`${i}--lg`]:"large"===n,[`${i}--sm`]:"small"===n};return o().createElement(lt(),st({},this.props,{className:we()(a,t),style:r}),this.props.children)}}ct(dt,"defaultProps",{duration:2}),ct(dt,"contextType",c);const ut=dt;function pt(){return pt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pt.apply(this,arguments)}function ht(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class mt extends a.Component{constructor(){super(...arguments),ht(this,"context",void 0)}render(){const{size:e,className:t}=this.props,r=e||this.context.size||"",n=Ce("empty"),i={...this.props,image:L.Empty.PRESENTED_IMAGE_SIMPLE},a={[n]:!0,[`${n}--lg`]:"large"===r,[`${n}--sm`]:"small"===r};return o().createElement(L.Empty,pt({},i,{className:we()(a,t)}))}}ht(mt,"contextType",c),ht(mt,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")}});const ft=mt;class gt extends a.Component{render(){const{fullHeight:e,className:t,style:r={}}=this.props,n=Ce("spin"),i={[`${n}-full-height`]:e},a={wrapperClassName:we()(i,t),...ue(this.props,["fullHeight"]),style:{...r,maxHeight:"none"}};return o().createElement(L.Spin,a,this.props.children)}}var bt,yt,vt;bt=gt,vt={tip:"Loading...",fullHeight:!1},(yt=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(yt="defaultProps"))in bt?Object.defineProperty(bt,yt,{value:vt,enumerable:!0,configurable:!0,writable:!0}):bt[yt]=vt;const xt=gt,Et=o().createContext(void 0),St=require("resize-observer-polyfill");var wt=n.n(St);const Ct=function(e){for(const t of e){const e=t.target.__resizeListeners__||[];Array.isArray(e)&&e.length&&e.forEach((e=>e(t)))}},Tt=function(e,t){!re&&e&&(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new(wt())(Ct),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},It=function(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||e.__ro__?.disconnect())};function Nt(e){const[t,r]=a.useState({width:0,height:0});return a.useLayoutEffect((()=>{const t=e.current,n=e=>{const{width:t,height:n}=e.contentRect;r({width:t,height:n})};return t&&Tt(t,n),()=>{t&&It(t,n)}}),[e]),t}const Rt=(e,t)=>{const r=a.useRef(!0);a.useLayoutEffect((()=>e(r.current)),t),a.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function Pt(e,t){Rt((t=>{if(!t)return e()}),t)}function Ot(e,t){var r=this;const n=a.useRef(null);a.useEffect((()=>()=>{clearTimeout(n.current),n.current=null}),[]);const i=a.useCallback((function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];n.current&&clearTimeout(n.current),n.current=setTimeout((()=>e.apply(r,a)),t)}),[e,t]);return i}const kt=6,At={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"}},Lt=e=>{const{thumb:t,always:r,className:n,barSize:i=kt,direction:a="vertical",onDrag:l=ae}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=o().useContext(Et),u=At[a],p=o().useRef(t),h=o().useRef(null),m=o().useRef(null),f=o().useRef({}),g=o().useRef(!1),b=o().useRef(!1),y=o().useRef(re?null:document.onselectstart),[v,x]=o().useState(!1);o().useLayoutEffect((()=>{p.current=t}),[t]),o().useEffect((()=>{const e=c.current;return je(e,"mousemove",C),je(e,"mouseleave",T),()=>{w(),Ke(document,"mouseup",S),Ke(e,"mousemove",C),Ke(e,"mouseleave",T)}}),[]);const E=e=>{if(!h.current||!m.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const r=100*(-1*(h.current.getBoundingClientRect()[u.direction]-e[u.client])-(m.current[u.offset]-t))/h.current[u.offset];d.current[u.scroll]=r*d.current[u.scrollSize]/100,l(!0)},S=()=>{g.current=!1,f.current={[u.axis]:0},Ke(document,"mousemove",E),Ke(document,"mouseup",S),w(),b.current&&x(!1),l(!1)},w=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},C=()=>{b.current=!1,x(!!p.current.size)},T=()=>{b.current=!0,x(g.current)},I=Ce("scrollbar"),N={[`${I}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},R={[u.reverse]:i},P={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return o().createElement(Vd,{name:"fade",in:r||s||v,timeout:300},o().createElement("div",{ref:h,className:we()(N,n),style:R},o().createElement("div",{ref:m,className:`${I}__thumb`,style:P,onMouseDown:e=>{e.stopPropagation(),je(document,"mousemove",E),je(document,"mouseup",S),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},_t=20,Ft=o().forwardRef(((e,t)=>{const{wrapClassName:r,wrapStyle:n,barWidth:i,always:a,native:l,showTopScrollbar:s,minSize:c=_t,onScroll:d}=e,u=o().useRef(null),p=o().useRef(null),h=o().useRef(null),[m,f]=o().useState({size:0,offset:0,ratio:1}),[g,b]=o().useState({size:0,offset:0,ratio:1}),[y,x]=o().useState(!1),E=Nt(u),S=Nt(h);Pt((()=>{!l&&w()}),[S.width,S.height,E.width,E.height]);const w=Ot((()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,r=e**2/p.current.scrollHeight,n=t**2/p.current.scrollWidth,i=Math.max(r,c),a=Math.max(n,c),o=r/(e-r)/(i/(e-i)),l=n/(t-n)/(a/(t-a)),s=i+4<e?i:0,d=a+4<t?a:0,u=100*p.current.scrollTop/e*o,h=100*p.current.scrollLeft/t*l;f(Object.assign({},m,{size:d,ratio:l,offset:h})),b(Object.assign({},g,{size:s,ratio:o,offset:u}))}),5),C=e=>{x(e)},T=(e,t)=>{(0,te.isNumber)(e)?t?((e,t)=>{const r=Date.now(),n=e.scrollTop,i=window.requestAnimationFrame,a=()=>{const o=(Date.now()-r)/500;o<1?(e.scrollTop=n+(t-n)*Ze(o),i(a)):e.scrollTop=t};i(a)})(p.current,e):p.current.scrollTop=e:v("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},I=(e,t)=>{(0,te.isNumber)(e)?t?((e,t)=>{const r=Date.now(),n=e.scrollLeft,i=window.requestAnimationFrame,a=()=>{const o=(Date.now()-r)/500;o<1?(e.scrollLeft=n+(t-n)*Ze(o),i(a)):e.scrollLeft=t};i(a)})(p.current,e):p.current.scrollLeft=e:v("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};o().useImperativeHandle(t,(()=>({container:u.current,scrollTop:p.current?.scrollTop||0,scrollLeft:p.current?.scrollLeft||0,SET_SCROLL_TOP:T,SET_SCROLL_LEFT:I})));const N=o().useMemo((()=>({dragging:y,scrollbarElement:u,wrapElement:p})),[y]),R=Ce("scrollbar"),P={[`${R}__wrap`]:!0,[`${R}__wrap--hidden`]:!l};return o().createElement("div",{ref:u,className:we()(R,e.className),style:e.style},o().createElement("div",{ref:p,className:we()(P,r),style:n,onScroll:e=>{const{scrollTop:t,scrollLeft:r}=e.target;!l&&(()=>{if(!p.current)return;const e=p.current.offsetHeight-4,t=p.current.offsetWidth-4,r=100*p.current.scrollTop/e*g.ratio,n=100*p.current.scrollLeft/t*m.ratio;f(Object.assign({},m,{offset:n})),b(Object.assign({},g,{offset:r}))})(),d?.({scrollTop:t,scrollLeft:r})}},o().createElement("div",{ref:h,className:`${R}__view`},e.children)),!l&&o().createElement(Et.Provider,{value:N},s&&o().createElement(Lt,{className:"top",direction:"horizontal",thumb:m,barSize:i,always:a,onDrag:C}),o().createElement(Lt,{direction:"horizontal",thumb:m,barSize:i,always:a,onDrag:C}),o().createElement(Lt,{direction:"vertical",thumb:g,barSize:i,always:a,onDrag:C})))}));Ft.displayName="QmScrollbar";const Ht=Ft,Dt=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const r=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=r,n.download=decodeURI(t),n.click(),n=null}};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(this,arguments)}function qt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt=async(e,t)=>{let{fileName:r,headers:n,params:i}=t;const a=i?new URLSearchParams(i).toString():"",o=a?e.includes("?")?"&":"?":"",l=await fetch(e+`${o+a}`,{method:"GET",headers:n});if(!l.ok)throw new Error(f("qm.download.error"));const s=await l.blob(),c=l.headers.get("content-disposition"),d=r||(c?c.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Dt(s,d)};class jt extends a.Component{constructor(){super(...arguments),qt(this,"context",void 0),qt(this,"beforeUpload",((e,t)=>new Promise((async(r,n)=>{const{fileTypes:i=[],fileSize:a,maxCount:o,fileList:l=[],beforeUpload:s}=this.props,c=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),d=!a||e.size/1024/1024<a,u=!(o>1)||l.length<o,p=c&&d&&u;if(c||L.message.warning(f("qm.upload.tooltip",{type:i.join(",")})),d||L.message.warning(f("qm.upload.sizeLimit",{size:a})),u||L.message.warning(f("qm.upload.countLimit",{count:o})),!p)return L.Upload.LIST_IGNORE;if(s){const i=s(e,t);if(!0===i)return r(e);if(!1===i)return n("not upload");if(i&&"function"==typeof i.then)try{r(await i)}catch(e){n(e)}}else r(e)})))),qt(this,"doDownload",(async e=>{const{downloadWithHeaders:t,headers:r}=this.props;try{e.url&&await Mt(e.url,{fileName:e.name,...t?{headers:r}:null})}catch(e){L.message.error(f("qm.download.error"))}}))}get $size(){return this.context.size??""}render(){const{fileList:e=[],button:t={},fileDirection:r,disabled:n,readOnly:i,className:a,onPreview:l,onChange:s}=this.props,c=Ce("upload-file"),d={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}--horizontal`]:"horizontal"===r};return o().createElement(L.Upload,$t({className:we()(d,a)},ue(this.props,["fileTypes","fileSize","button"]),{beforeUpload:this.beforeUpload,disabled:n||i,onChange:s,onPreview:async e=>{if("function"==typeof l)return l(e,(t=>this.doDownload(t||e)));n||await this.doDownload(e)},onDownload:async e=>{await this.doDownload(e)}}),this.props.children||i&&e.length?this.props.children:o().createElement(L.Button,{type:t.type??"default",icon:t.icon??o().createElement(Te.UploadOutlined,null),disabled:n||i},t.text||f("qm.upload.text")))}}qt(jt,"contextType",c),qt(jt,"defaultProps",{name:"file",multiple:!0,fileDirection:"vertical",showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}});const Kt=jt;function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vt.apply(this,arguments)}function zt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Bt extends a.Component{constructor(){super(...arguments),zt(this,"context",void 0),zt(this,"state",{loading:!1}),zt(this,"downloadHandle",(async()=>{this.setState({loading:!0});try{const{action:e,fileName:t,headers:r,params:n,beforeDownload:i=oe}=this.props,a=(0,te.isString)(e)?e:await this.getActionUrl();if(!a)return v("Download","参数 `action` 有误!");if(!i(a))return;await Mt(a,{fileName:t,headers:r,params:n}),await le(100),this.props.onSuccess?.(),L.message.success(f("qm.download.success"))}catch(e){this.props.onError?.(e),L.message.error(f("qm.download.error"))}this.setState({loading:!1})}))}async getActionUrl(){const e=this.props.action;if(e.api)try{const t=await e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}render(){const{size:e}=this.props,{loading:t}=this.state,r=e||this.context.size||"",n=ue(this.props,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return o().createElement(L.Button,Vt({},n,{size:r,loading:t,onClick:this.downloadHandle}),this.props.children)}}zt(Bt,"propTypes",{action:s().oneOfType([s().string,s().shape({api:s().func.isRequired,params:s().object})]),size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},fileName:s().string,headers:s().object,withCredentials:s().bool,params:s().object,beforeDownload:s().func,onSuccess:s().func,onError:s().func}),zt(Bt,"defaultProps",{icon:o().createElement(Te.DownloadOutlined,null),children:f("qm.download.text"),withCredentials:!1}),zt(Bt,"contextType",c);const Ut=Bt,Wt=require("add-dom-event-listener");var Gt=n.n(Wt);const Yt=require("scroll-into-view-if-needed");var Xt=n.n(Yt);class Qt extends a.Component{renderLabel(){const{activeKey:e,labels:t,onTabClick:r}=this.props;return t.map(((t,n)=>{const i={item:!0,actived:n===e};return o().createElement("div",{key:n,className:we()(i),onClick:e=>r(n,e)},o().createElement("span",null,t))}))}render(){return o().createElement(o().Fragment,null,this.renderLabel())}}const Zt=Qt;class Jt extends a.Component{render(){const{label:e,showDivider:t,className:r,style:n}=this.props,i=Ce("anchor-item"),a={[i]:!0};return o().createElement("div",{className:we()(a,r),style:n},t&&o().createElement(Re,{label:e,style:{marginBottom:10}}),this.props.children)}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Jt,"displayName","QmAnchorItem");const er=Jt;function tr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class rr extends a.Component{get __is_conf(){return!!this.props.labelList?.length}constructor(e){super(e),tr(this,"context",void 0),tr(this,"currentState","ready"),tr(this,"itemsTotal",void 0),tr(this,"timer",void 0),tr(this,"scrollEvent",void 0),tr(this,"scrollRef",(0,a.createRef)()),tr(this,"onScrollHandle",(e=>{if("ready"!==this.currentState)return;const t=this.findCurrentIndex(e.target.scrollTop);-1!==t&&this.setState({activeKey:t})})),tr(this,"onTabClickHandle",(e=>{const t=this.getTargetElement(e);t&&(this.setState({activeKey:e}),this.currentState="stop",this.timer&&clearTimeout(this.timer),Xt()(t,{block:"start",behavior:"smooth",boundary:this.scrollRef.current}),this.timer=setTimeout((()=>this.currentState="ready"),500))})),tr(this,"SCROLL_TO_ITEM",(e=>{e=(e=e<0?0:e)>this.itemsTotal?this.itemsTotal:e,this.onTabClickHandle(e)})),this.state={activeKey:e.defaultActiveIndex||0}}componentDidMount(){this.initialHandle(),this.scrollEvent=Gt()(this.scrollRef.current,"scroll",(0,te.throttle)(this.onScrollHandle,60))}componentWillUnmount(){this.scrollEvent.remove()}initialHandle(){const{activeKey:e}=this.state;e>0&&(this.scrollRef.current.scrollTop=We(this.getTargetElement(e),this.scrollRef.current))}createDistances(){const{labelList:e=[]}=this.props;return(this.__is_conf?e.map((e=>document.getElementById(e.id))):Array.from(this.scrollRef.current?.children||[])).map((e=>We(e,this.scrollRef.current)))}findCurrentIndex(e){const t=Math.abs(e),r=this.createDistances();let n=-1;for(let e=0;e<r.length;e++){const i=r[e],a=r[e+1]||1e4;t>=i-1&&t<a&&(n=e)}return n}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:r,tabPosition:n,labelList:i=[],onTabClick:a,className:l,style:s}=this.props,c=t||this.context.size||"",d=Ce("anchor"),u={[d]:!0,[`${d}-left`]:"left"===n,[`${d}-top`]:"top"===n,[`${d}--lg`]:"large"===c,[`${d}--sm`]:"small"===c},p=[];o().Children.map(this.props.children,(e=>{ne(e)&&!ie(e)&&"QmAnchorItem"===e.type?.displayName&&p.push(e)}));const h=this.__is_conf?i.map((e=>e.label)):p.map((e=>e.props.label)),m=this.__is_conf?i.map((e=>e.id)):p.map(((e,t)=>e.props["data-id"]||t.toString()));return this.itemsTotal=h.length,o().createElement("div",{className:we()(u,l),style:s},o().createElement("div",{className:we()("anchor-nav"),style:{width:r?he(r):""}},o().createElement(Zt,{activeKey:e,labels:h,onTabClick:(e,t)=>{this.onTabClickHandle(e),a?.({label:h[e],id:m[e]},t)}})),o().createElement("div",{ref:this.scrollRef,className:we()("anchor-container")},this.__is_conf?this.props.children:p))}}tr(rr,"Item",er),tr(rr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},labelWidth:(e,t,r)=>{if("number"!=typeof(n=e[t])&&void 0!==n&&!["px","rem","em","vw","vh","%"].some((e=>n.endsWith(e)))&&!n.startsWith("calc"))return y("Anchor","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.");var n},labelList:s().arrayOf(s().shape({id:s().string,label:s().string}))}),tr(rr,"defaultProps",{tabPosition:"left"}),tr(rr,"contextType",c);const nr=rr;class ir extends a.Component{render(){return o().createElement(L.Tabs.TabPane,this.props,this.props.children)}}!function(e,t,r){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(ir,"displayName","QmTabPane");const ar=ir;function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},or.apply(this,arguments)}function lr(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class sr extends a.Component{constructor(){super(...arguments),lr(this,"context",void 0)}render(){const{items:e,size:t,tabPosition:r,tabBarGutter:n,className:i,authConfig:a}=this.props,l=t||this.context.size||"",s=Ce("tabs"),c={[s]:!0,[`${s}--lg`]:"large"===l,[`${s}--sm`]:"small"===l},d={...ue(this.props,["items","authConfig"]),size:l,tabBarGutter:n??(["top","bottom"].includes(r)?30:0)},u=[];o().Children.map(this.props.children,(e=>{ne(e)&&!ie(e)&&"QmTabPane"===e.type?.displayName&&u.push(e)}));const p=e?[...e]:u.map((e=>{let{key:t,props:r}=e;return{key:t,label:r.tab,disabled:r.disabled,closable:r.closable,forceRender:r.forceRender,children:r.children}}));if(a){const{fieldList:e=[]}=a||{};for(let t=0;t<p.length;t++){const r=p[t],n=e.find((e=>e.dataIndex===r.key)),{visible:i=1,disabled:a}=n||{};i?a&&(r.disabled=!0):(p.splice(t,1),t--)}}return o().createElement(L.Tabs,or({},d,{items:p,className:we()(c,i)}))}}lr(sr,"TabPane",ar),lr(sr,"contextType",c),lr(sr,"defaultProps",{tabPosition:"top"});const cr=sr;function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dr.apply(this,arguments)}function ur(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class pr extends a.Component{constructor(){super(...arguments),ur(this,"context",void 0),ur(this,"titleRef",o().createRef()),ur(this,"$drawer",null),ur(this,"opened",!1),ur(this,"state",{fullscreen:!1,spinning:!1,sloading:!1}),ur(this,"afterVisibleChange",(e=>{const{loading:t}=this.props;e?(this.opened=!0,(0,te.isUndefined)(t)&&setTimeout((()=>this.setState({spinning:!1})),100)):(this.props.onClosed?.(),this.setState({fullscreen:!1}))})),ur(this,"toggleHandle",(()=>{this.$drawer=Ye(this.titleRef.current,"ant-drawer-content-wrapper"),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{this.props.onFullChange?.(this.state.fullscreen)}))})),ur(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),ur(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}componentWillUnmount(){this.$drawer=null}componentDidUpdate(e,t){const{visible:r,open:n,loading:i,destroyOnClose:a}=this.props,o=n??r,l=e.open??e.visible,{fullscreen:s}=this.state;o&&o!==l&&(!a&&this.opened||(0,te.isUndefined)(i)&&this.setState({spinning:!0})),this.$drawer&&s!==t.fullscreen&&Be(this.$drawer,s?{width:"100%"}:{width:he(this.props.width||"72%")})}renderTitle(){const{fullscreen:e}=this.state,{title:t,showHeader:r,showFullScreen:n}=this.props;return o().createElement(o().Fragment,null,o().createElement("span",{ref:this.titleRef,className:we()("text")},r&&t),n&&o().createElement("button",{type:"button",className:we()("full-screen"),onClick:this.toggleHandle},o().createElement(e?Te.FullscreenExitOutlined:Te.FullscreenOutlined)))}render(){const{spinning:e,sloading:t}=this.state,{visible:r,open:n,size:i,className:a,loading:l,showHeader:s,maskClosable:c,onClose:d}=this.props,u=this.context.global,p=i||this.context.size||"",h=Ce("drawer"),m={[h]:!0,"no-header":!s,[`${h}--lg`]:"large"===p,[`${h}--sm`]:"small"===p};return o().createElement(L.Drawer,dr({},ue(this.props,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:n??r,maskClosable:c??u?.maskClosable??!1,className:we()(m,a),title:this.renderTitle(),footer:null,onClose:d,afterOpenChange:this.afterVisibleChange}),this.props.children,(l||t||e)&&o().createElement(xt,{spinning:!0,className:we()("spinning")}))}}ur(pr,"contextType",c),ur(pr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Drawer","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},spinning:s().bool}),ur(pr,"defaultProps",{width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null});const hr=pr,mr=require("react-draggable");var fr=n.n(mr);function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gr.apply(this,arguments)}function br(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yr="10vh";var vr=function(e){return e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none",e}(vr||{});class xr extends a.Component{constructor(){super(...arguments),br(this,"context",void 0),br(this,"draggleRef",o().createRef()),br(this,"opened",!1),br(this,"state",{fullscreen:!1,spinning:!1,sloading:!1,disabled:!0,bounds:{left:0,top:0,bottom:0,right:0},position:void 0}),br(this,"onStart",((e,t)=>{const{clientWidth:r,clientHeight:n}=window.document.documentElement,i=this.draggleRef.current.getBoundingClientRect();i&&this.setState({bounds:{left:-i.left+t.x,right:r-(i.right-t.x)-1,top:-i.top+t.y,bottom:n-(i.bottom-t.y)-1}})})),br(this,"toggleHandle",(e=>{const t=Ye(e.target,"ant-modal");if(!t)return;const r=t.querySelector(".ant-modal-body"),{width:n,height:i,showHeader:a}=this.props,{fullscreen:o}=this.state;o?(Be(t,{width:he(n||"60%"),height:"auto",top:yr}),Be(r,{height:i?he(i):this.defaultHeight,maxHeight:"auto"===i?this.defaultHeight:""})):(Be(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Be(r,{height:`calc(100vh - ${vr[a?this.$size:"none"]}px)`,maxHeight:""})),this.setState((e=>({fullscreen:!e.fullscreen})),(()=>{this.props.onFullChange?.(this.state.fullscreen)}))})),br(this,"afterVisibleChange",(()=>{const{onClosed:e}=this.props;e?.(),this.setState({fullscreen:!1})})),br(this,"START_LOADING",(()=>{this.setState({sloading:!0})})),br(this,"STOP_LOADING",(()=>{this.setState({sloading:!1})}))}get $size(){const{size:e}=this.props;return e||this.context.size||""}get defaultHeight(){return`calc(100vh - ${yr} - ${yr} - ${vr[this.props.showHeader?this.$size:"none"]}px)`}componentDidUpdate(e,t){const{visible:r,open:n,loading:i,destroyOnClose:a}=this.props,o=n??r,l=e.open??e.visible,{fullscreen:s}=this.state;if(o&&o!==l){if(!a&&this.opened||(0,te.isUndefined)(i)&&this.setState({spinning:!0}),!a&&this.opened)return;setTimeout((()=>{this.opened=!0,(0,te.isUndefined)(i)&&this.setState({spinning:!1})}),400)}s!==t.fullscreen&&(s?this.setState({position:{x:0,y:0}}):this.setState({position:void 0}))}renderTitle(){const{fullscreen:e,disabled:t}=this.state,{title:r,showHeader:n,showFullScreen:i}=this.props;return o().createElement("div",{onMouseOver:()=>{t&&this.setState({disabled:!1})},onMouseOut:()=>{this.setState({disabled:!0})}},o().createElement("span",{className:we()("text")},n&&r),i&&o().createElement("button",{type:"button",className:we()("full-screen"),onClick:this.toggleHandle},o().createElement(e?Te.FullscreenExitOutlined:Te.FullscreenOutlined)))}render(){const{spinning:e,sloading:t,fullscreen:r,disabled:n,bounds:i,position:a}=this.state,{visible:l,open:s,height:c,className:d,loading:u,draggable:p,showHeader:h,maskClosable:m,bodyStyle:f,onClose:g}=this.props,b=this.context.global,y=Ce("modal"),v={height:c?he(c):this.defaultHeight,maxHeight:"auto"===c?this.defaultHeight:"",overflow:"auto"},x={[y]:!0,"no-header":!h,[`${y}--lg`]:"large"===this.$size,[`${y}--sm`]:"small"===this.$size};return o().createElement(L.Modal,gr({},ue(this.props,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:s??l,maskClosable:m??b?.maskClosable??!1,className:we()(x,d),title:this.renderTitle(),footer:null,bodyStyle:Object.assign({},v,f),onCancel:g,afterClose:this.afterVisibleChange,modalRender:e=>o().createElement(fr(),{nodeRef:this.draggleRef,bounds:i,position:a,disabled:!p||n||r,onStart:(e,t)=>this.onStart(e,t)},o().createElement("div",{ref:this.draggleRef},e))}),this.props.children,(u||t||e)&&o().createElement(xt,{spinning:!0,className:we()("spinning")}))}}br(xr,"contextType",c),br(xr,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Modal","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},spinning:s().bool}),br(xr,"defaultProps",{width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:yr}});const Er=xr,Sr=require("memoize-one");var wr=n.n(Sr);const Cr=(0,a.createContext)(void 0),Tr=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"],Ir={operations:function(e){const t=e.split(" "),r=[];let n=0;r[n]=[];for(let e=0;e<t.length;e++)Tr.includes(t[e])?(r[n]=r[n].join(" "),n++,r[n]=[]):r[n].push(t[e]);return r[n]=r[n].join(" "),r},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 r=0,n=(e=Array.isArray(e)?e:[e]).length;r<n;r++)t+="number"==typeof e[r]?e[r]:"'"+e[r]+"'",r<n-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,r){return e.split(t).join(r)},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 "),this.find_replace(e," NIN "," nin ")}},Nr=["==","<",">","<=",">=","!=","like","likes","in","nin"],Rr=function(e,t){let r="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?r+=" "+e[t]+" ":r+=e[t];const n=r.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)Nr.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),Nr.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return n.join(" ")},Pr=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,Or=["string","number","boolean","symbol"],kr=e=>Or.includes(typeof e),Ar=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Lr=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(Pr,"\\$1"),"i");window.__query__=function(){return((e,t,r)=>{e=e??"";let n=!0;switch(t){case"like":n=null!==e.toString().match(Lr(r));break;case"likes":n=r.split(/,|,/).some((t=>null!==e.toString().match(Lr(t))));break;case"in":kr(r)&&(r=[r]),Array.isArray(r)&&(n=Array.isArray(e)?r.every((t=>e.includes(t))):r.includes(e));break;case"nin":kr(r)&&(r=[r]),Array.isArray(r)&&(n=!(Array.isArray(e)?r.some((t=>e.includes(t))):r.includes(e)));break;case"!=":case"<>":n=(Ar(e)?e.slice(0,10):e)!=r;break;case"<":n=(Ar(e)?e.slice(0,10):e)<r;break;case"<=":n=(Ar(e)?e.slice(0,10):e)<=r;break;case">":n=(Ar(e)?e.slice(0,10):e)>r;break;case">=":n=(Ar(e)?e.slice(0,10):e)>=r;break;default:n=(Ar(e)?e.slice(0,10):e)==r}return n})(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2])};const _r=Ir.stringify,Fr=Ir.array_format,Hr=function(e){let t=0;const r=e.length;for(let n=0;n<r;n++){const r=e.charAt(n);"("===r&&t++,")"===r&&t--}return 0===t},Dr=(e,t,r)=>{let n=[];t=Ir.replace_symbols(t);try{if(r){const r=new Function("record",`return ${Rr(t,"record")};`);n=gn(e,(e=>r(e)))}else{const r=new Function("array","i",`return ${Rr(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)r(e,t)&&n.push(e[t])}}catch(t){v("Table","组件 `initialFilter` 参数有误!"),n=e}return n},$r=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...$r(e.children)):t.push(e)})),t},qr=e=>e.filter((e=>(e.children&&(e.children=qr(e.children)),!e.hidden&&!e.noAuth))),Mr=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Mr(e.children))})),t},jr=(e,t)=>e.map((e=>(e.children&&(e.children=jr(e.children,t)),t?.(e),e))),Kr=(e,t)=>{for(const r of e){if(r.dataIndex===t)return r;if(r.children){const e=Kr(r.children,t);if(e)return e}}return null},Vr=e=>{const t=e.children;return t?t[0].children?Vr(t[0]):t[0]:e},zr=e=>{const t=e.children;return t?t[t.length-1].children?zr(t[t.length-1]):t[t.length-1]:e},Br=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ur=(e,t)=>{for(const r of e){if(r.rowKey===t)return r;if(r.children){const e=Ur(r.children,t);if(e)return e}}return null},Wr=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Wr(e.children))})),t},Gr=e=>{let t=1;const r=(e,n)=>{if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,r(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=e.colSpan??1};e.forEach((e=>{e.level=1,r(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return Mr(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Yr=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){const n=e.parentNode;if(r.top+=e.offsetTop,r.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(r.top-=n.scrollTop,r.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Yr(e.offsetParent,t,r)}return r},Xr=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Qr=(e,t)=>(0,te.transform)(e,((e,r,n)=>{(0,te.isEqual)(r,t[n])||(e[n]=(0,te.isPlainObject)(r)&&(0,te.isPlainObject)(t[n])?Qr(r,t[n]):r)})),Zr=(e,t)=>(0,te.get)(e,t)??"",Jr=(e,t,r,n)=>{n>=0&&null!=r&&(r=Number(r).toFixed(n)),(0,te.set)(e,t,r??"")},en=(e,t)=>{if(!t.includes("|"))return Zr(e,t);const r=[];return t.split("|").forEach((t=>{t&&r.push(Zr(e,t))})),r.every((e=>!e))?"":r.join(" | ")},tn=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),rn=e=>{const t=(e=e.toString()).split("."),r="-"===t[0].charAt(0)?"-":"";let n=r?t[0].slice(1):t[0],i="";for(;n.length>3;)i=`,${n.slice(-3)}${i}`,n=n.slice(0,n.length-3);return n&&(i=n+i),`${r}${i}${t[1]?`.${t[1]}`:""}`},nn=(e,t)=>{const r=e.toString();if(!tn(r)||0===t)return e;const n=Number.parseFloat(r).toString(),i=n.indexOf(".");if(-1===i)return n+"."+"0".repeat(t);const a=Math.max(0,t-(n.length-i-1));return n+"0".repeat(a)},an=(e,t)=>e?u()(e,t):null,on=(e,t)=>e?u()(e).format(t):"",ln=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 r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))},sn=e=>{const t=[];if(o().isValidElement(e)){const{children:r}=e.props;o().Children.forEach(r,(e=>{t.push(...sn(e))}))}else t.push(e);return t},cn=e=>sn(e).join(""),dn=e=>e.filter((e=>!e._group)),un=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="";if(Array.isArray(e)){let n=0;for(let i=0,a=e.length;i<a;i++){const a=e[i];if(!a.fieldName)continue;const o=Array.isArray(a.condition)?Fr(a.condition):_r(a.condition,"^");r+=`${a.bracketLeft} ${t?`${a.fieldName}|${a.fieldType}`:a.fieldName} ${a.expression} ${o} ${a.bracketRight} ${a.logic} `,n=a.logic.length}r=r.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[i,a]=n.includes("|")?n.split("|"):[n,""],o=e[n];for(const e in o)r+=`${t?`${i}|${a}`:i} ${e} ${Array.isArray(o[e])?Fr(o[e]):_r(o[e],"^")} and `}r=r.slice(0,-1*n)}return r.replace(/\s+/g," ").trim()},pn=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((r=>{const n=JSON.stringify((t=>{const r=[];return e.forEach((e=>r.push(Zr(t,e)))),r})(r));t[n]=t[n]||[],t[n].push(r)})),Object.keys(t).map((e=>t[e]))},hn=(e,t)=>{for(let r=0;r<e.length;r++){if(e[r].dataIndex===t)return[e[r]];if(Array.isArray(e[r].children)){const n=hn(e[r].children,t);if(n)return[e[r],n].flat()}}},mn=(e,t)=>{for(let r=0;r<e.length;r++){if(e[r].rowKey===t)return[t];if(Array.isArray(e[r].children)){const n=mn(e[r].children,t);if(n)return[e[r].rowKey,n].flat()}}},fn=(e,t)=>{for(const r of e){if(Array.isArray(r.children)){const e=fn(r.children,t);if(e)return e}if(t(r))return r}return null},gn=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&gn(e.children,t),t(e)||e.children&&e.children.length))),bn=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),yn=80,vn="1",xn="0",En=400,Sn=["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"],wn={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Cn=function(e){return e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year",e}({}),Tn=function(e){return 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",e}({}),In=function(e){return e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss",e}({});const Nn={items:s().arrayOf(s().shape({type:s().string.isRequired,fieldName:s().string.isRequired})),initialValues:s().object,initialExtras:s().object,layout:s().oneOf(["horizontal","vertical"]),size:(e,t,r)=>{if(!x(e[t]||""))return y("Form","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},cols:s().number,customClass:s().string,compactMode:s().bool,labelWidth:s().oneOfType([s().number,s().string]),labelAlign:s().oneOf(["left","right"]),labelWrap:s().bool,formType:s().oneOf(["default","search","onlyShow"]),disabled:s().bool,uniqueKey:s().string,defaultRows:s().number,defaultExpand:s().bool,searchButtonCols:s().number,scrollToFirstError:s().bool,authConfig:s().object,isAutoFocus:s().bool,isCollapse:s().bool,isFieldsDefine:s().bool,isSearchBtn:s().bool,isSubmitBtn:s().bool,fieldsChange:s().func,onValuesChange:s().func,onFieldsChange:s().func,onFinish:s().func,onFinishFailed:s().func,onReset:s().func,onCollapse:s().func},Rn={layout:"horizontal",labelWidth:yn,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:ae,onFieldsChange:ae,onFinish:ae,onFinishFailed:ae,onReset:ae,onCollapse:ae},Pn=(e,t)=>{if(!e)return null;if(t===Tn.week){const t=e.match(/^(\d{4})-(\d+)/);return t?u()().year(Number(t[1])).week(Number(t[2])):null}if(t===Tn.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?u()().year(Number(t[1])).quarter(Number(t[2])):null}return u()(e,t)},On=(e,t)=>e?u()(e).format(t):"",kn=e=>""===e||null==e,An=(e,t)=>{if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let n="";for(let t=0,i=r.length;t<i;t++)n+=(e[r[t].trim()]??"")+(t===i-1?"":" | ");return n},Ln=(e,t,r)=>{for(const n in r)if(Object.keys(t).includes(n)&&t[n]!==r[n])if(t[n].includes("|")){const i=t[n].split("|"),a=r[n].split("|");i.forEach(((t,r)=>e[t]=e[a[r]]))}else e[t[n]]=e[r[n]]},_n=(e,t,r)=>{for(const n in r)if(Object.keys(t).includes(n)&&t[n]!==r[n])if(t[n].includes("|")){const i=t[n].split("|"),a=r[n].split("|");i.forEach(((t,r)=>e[t]=e[a[r]]))}else e[t[n]]=e[r[n]]},Fn=(e,t,r)=>e.map((e=>{const n={value:e[t],text:e[r]};return e.disabled&&(n.disabled=!0),(0,te.isUndefined)(e.isLeaf)||(n.isLeaf=!!e.isLeaf),(0,te.isUndefined)(e.selectable)||(n.selectable=!!e.selectable),Array.isArray(e.children)&&(n.children=Fn(e.children,t,r)),n})),Hn=(e,t)=>{for(const r of e){if(r.value===t)return r;if(Array.isArray(r.children)){const e=Hn(r.children,t);if(e)return e}}return null},Dn=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=[];return e.forEach((e=>{e.value==t.split(",")[r]&&n.push(e),Array.isArray(e.children)&&n.push(...Dn(e.children,t,r+1))})),n},$n=e=>ne(e)||"string"==typeof e,qn=e=>ne(e)?sn(e).join(""):e??"",Mn=(e,t,r,n)=>{const i={};return i.filters=e.filters?.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}))||[],i.table={columns:e.columns||[],rowKey:e.valueName},i.fieldsDefine={valueKey:e.valueKey||e.valueName},i.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(i.table.fetch={api:r(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(i.echoRequest={fetchApi:r(e.echoSetting.api),formatter:t=>Object.assign({},t,{[e.echoSetting.paramKey]:t.key??t.keys}),dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(i.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(i.tree={fetch:{api:r(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{const t={};return e.treeSetting.relativeTable?.forEach((e=>t[e.tableField]=e.treeField)),t}}),e.emmediateSetting&&(i.columns=e.emmediateSetting.columns,i.request={fetchApi:r(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),i},jn={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"}},Kn="阿",Vn="鿿",zn=1,Bn=2,Un=3;let Wn,Gn=null;function Yn(e){return e||null===Gn?("object"==typeof Intl&&Intl.Collator?(Wn=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Gn=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Gn=!1,Gn):Gn}function Xn(e){const t=jn.UNIHANS,r=jn.PINYINS,n=jn.EXCEPTIONS,i={source:e};if(e in n)return i.type=Bn,i.target=n[e],i;let a,o=-1;if(e.charCodeAt(0)<256)return i.type=zn,i.target=e,i;if(a=Wn.compare(e,Kn),a<0)return i.type=Un,i.target=e,i;if(0===a)i.type=Bn,o=0;else{if(a=Wn.compare(e,Vn),a>0)return i.type=Un,i.target=e,i;0===a&&(i.type=Bn,o=t.length-1)}if(i.type=Bn,o<0){let r=0,n=t.length-1;for(;r<=n;){o=~~((r+n)/2);const i=t[o];if(a=Wn.compare(e,i),0===a)break;a>0?r=o+1:n=o-1}}return a<0&&o--,i.target=r[o],i.target||(i.type=Un,i.target=i.source),i}function Qn(e){return"string"==typeof e&&Yn()?e.split("").map((e=>Xn(e))):e}const Zn={isSupported:Yn,parse:Qn,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(jn)})))},genToken:Xn,convertToPinyin:(e,t,r)=>Qn(e).map((e=>t&&e.type===Bn?e.target.toLowerCase():e.target)).join(r||"")},Jn={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}};Zn.isSupported()&&Jn.shouldPatch(Zn.genToken)&&Zn.patchDict(Jn);const ei=Zn,ti=e=>{const{value:t,bordered:r}=e;return o().createElement(L.Input,{value:t,title:t,bordered:r,readOnly:!0})};ti.displayName="FormItemView";const ri=ti;function ni(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}const{Option:ai}=L.Select,oi=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,multiple:i,loading:a,onChange:l,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=f("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,readOnly:g,disabled:b}=e.option,{itemList:y=[],filterable:v=!0,listHeight:x=En,collapseTags:E,maxTagTextLength:S,dropdownStyle:w,openPyt:C=!0}=d,T=de(y)?n:y,I=e=>T.find((t=>t.value===e))?.text||e?.toString()||"",N=e=>i?e?.map((e=>I(e))).join(",")||"":I(e);return t.isOnlyShow?o().createElement(ri,{value:N(r),bordered:h}):o().createElement(L.Select,ii({value:r,mode:i?"multiple":void 0,popupClassName:`form-popper__${c}`,dropdownStyle:w,placeholder:p,style:u,loading:a,bordered:h,allowClear:m,disabled:b,showSearch:v,listHeight:x,maxTagCount:E?"responsive":void 0,maxTagTextLength:S},i?{title:N(r)}:null,{filterOption:(e,t)=>{const r=t?.children?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(C?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{l?.(e),s(e,N(e),T)})(e)}}),T.map((e=>o().createElement(ai,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class li extends a.Component{constructor(){super(...arguments),ni(this,"context",void 0),ni(this,"state",{itemList:[],loading:!1}),ni(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:h,validateTrigger:m,rules:f=[],onChange:g=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(f)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:f,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(oi,{option:this.props.option,items:t,loading:r,multiple:this.props.multiple,onValuesChange:(t,r,n)=>{g(t,r,n),e.setViewValue(l,r)}}))),h&&o().createElement(L.Col,null,e.renderFormItemButton(l,h)),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}ni(li,"contextType",Cr);const si=li;function ci(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const di=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{label:a,options:l={},style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=xn,trueValue:h=vn}=l;return o().createElement(L.Checkbox,{checked:r===h,style:s,disabled:d||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{n?.(e),i(e,f(e===h?"am.form.trueText":"am.form.falseText"))})(t?h:p)}},u?a:null)};class ui extends a.Component{constructor(){super(...arguments),ci(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option,{labelToCheckbox:m}=l;return o().createElement(L.Form.Item,{label:m?" ":e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(di,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}ci(ui,"contextType",Cr);const pi=ui,hi=require("react-sortablejs");function mi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class fi extends a.Component{constructor(){super(...arguments),mi(this,"context",void 0),mi(this,"linkRef",o().createRef()),mi(this,"state",{visible:!1}),mi(this,"getFormFieldsConfig",(async e=>{const t=this.context.global,r=t?.getComponentConfigApi;if(r)try{const t=await r({key:e});if(200===t.code)return t.data}catch(e){}})),mi(this,"saveFormFieldsConfig",(async(e,t)=>{const r=this.context.global,n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}})),mi(this,"resetFieldsHandle",(e=>{const t=e.map((e=>{const t=this.props.items.find((t=>t.fieldName===e.fieldName))||pe(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));return e||this.getFormFieldsConfig(this.formUniqueKey).then((e=>{e?(localStorage.setItem(this.formUniqueKey,JSON.stringify(e)),this.initLocalfields()):this.context.global?.getComponentConfigApi&&this.setLocalFields(this.props.items)})).catch((()=>{})),e?(0,te.xor)(e.map((e=>e.fieldName)),this.props.items.map((e=>e.fieldName))).length>0?this.props.items.map((t=>{const{fieldName:r}=t,n=e.find((e=>e.fieldName===r));return n?((0,te.isUndefined)(n.hidden)||(t.hidden=n.hidden),t):t})):e.map((e=>({...this.props.items.find((t=>t.fieldName===e.fieldName)),...e}))):void 0}setLocalFields(e){if(!this.formUniqueKey)return;const t=e.map((e=>{const t={};return(0,te.isUndefined)(e.hidden)||(t.hidden=e.hidden),{fieldName:e.fieldName,...t}})),r=JSON.parse(localStorage.getItem(this.formUniqueKey));(0,te.isEqual)(t,r)||(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;t?.([...e])}popupRender(){const{items:e}=this.props;return o().createElement(Cr.Consumer,null,(t=>{const r=t.$$form;return o().createElement("div",{className:we()("ant-dropdown-menu","fields-list")},o().createElement("div",{className:"reset"},o().createElement(be,{type:"text",size:"small",onClick:()=>this.resetFieldsHandle(r.getOriginItems())},f("qm.table.columnFilter.reset"))),o().createElement(hi.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:e,setList:t=>{const n=t.map((e=>e.fieldName)),i=e.map((e=>e.fieldName));if((0,te.isEqual)(n,i))return;r.setExpandHandle(!0);const a=bn(t);this.changeHandle(a),this.setLocalFields(a)}},e.map((t=>o().createElement("li",{key:t.fieldName,className:"item",style:t.noAuth?{display:"none"}:void 0},o().createElement(L.Checkbox,{disabled:t.rules?.findIndex((e=>e.required))>-1,checked:!t.hidden,onChange:r=>{const{checked:n}=r.target;t.hidden=!n,this.changeHandle(e),this.setLocalFields(e)}}),o().createElement(Te.HolderOutlined,{className:"handle",title:f("qm.form.draggable")}),o().createElement("span",{className:"title"},r.getFormItemLabel(t.label)))))))}))}render(){const{visible:e}=this.state,t=Ce("form-fields-filter");return o().createElement(Cr.Consumer,null,(r=>{const{$size:n}=r.$$form,i={[t]:!0,[`${t}--lg`]:"large"===n,[`${t}--sm`]:"small"===n};return o().createElement(L.Dropdown,{open:e,trigger:["click"],dropdownRender:()=>this.popupRender(),overlayClassName:we()(i),placement:"bottomRight",overlayStyle:{minWidth:150},getPopupContainer:()=>this.linkRef.current,onOpenChange:e=>{this.setState({visible:e})}},o().createElement("a",{ref:this.linkRef,style:{padding:"5px 0"}},o().createElement(Te.UnorderedListOutlined,null)))}))}}mi(fi,"contextType",c);const gi=fi;function bi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yi=o().forwardRef(((e,t)=>{const{$$form:r}=o().useContext(Cr),{value:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},placeholder:c=f("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h,onBlur:m=ae,onEnter:g=ae}=e.option,{prefix:b,suffix:y,password:v,maxLength:x,pattern:E,toUpper:S,toTrim:w,autoFocus:C,autoComplete:T,secretType:I}=l,N=I&&(p||h),R=o().useRef(),P=e=>{i?.(e),a(e)},O=v?L.Input.Password:L.Input,k=N?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}(n,I):n;return r.isOnlyShow?o().createElement(ri,{value:(e=>e&&v?new Array(e.length).fill("*").join(""):e)(k),bordered:d}):o().createElement(O,{ref:e=>{R.current=e,"function"==typeof t&&t(e)},value:k,autoComplete:v?"new-password":T,autoFocus:C,placeholder:c,style:s,title:v?"":k,prefix:b,suffix:y,maxLength:x,bordered:d,allowClear:u,readOnly:p,disabled:h,onBlur:t=>{let r=t.target.value??"";if(w){const e=r.trim();r!==e&&(r=e,P(r))}(t=>{const{onBlur:r}=e;r?.(t)})(r),m(r)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;g(t),r.isFilterType&&(r.SUBMIT_FORM(),R.current?.blur())}},onChange:e=>{let t=e.target.value;(0,te.isRegExp)(E)&&(t=E.test(t)?t:n??""),S&&(t=t.toUpperCase()),P(t)}})}));yi.displayName="VInput";class vi extends a.Component{constructor(){super(...arguments),bi(this,"context",void 0),bi(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(yi,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(i,t)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(i,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}bi(vi,"contextType",Cr);const xi=vi;function Ei(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Si=e=>{const{$$form:t}=o().useContext(Cr),{value:r=[],onChange:n,onValuesChange:i}=e,{options:a={},placeholder:l=f("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{prefix:p,suffix:h,maxLength:m}=a,g=e=>{const t=e.every((e=>!e))?[]:e;n?.(t),i(t,b(t))},b=e=>e.join(" - ");return t.isOnlyShow?o().createElement(ri,{value:b(r),bordered:s}):o().createElement(L.Input.Group,null,o().createElement(L.Input,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:l[0],prefix:p,suffix:h,maxLength:m,allowClear:c,bordered:s,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),o().createElement(L.Input,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:l[1],prefix:p,suffix:h,maxLength:m,bordered:s,allowClear:c,readOnly:d,disabled:u,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class wi extends a.Component{constructor(){super(...arguments),Ei(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,labelWidth:l=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(s),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(l)},required:e.getFormItemRequired(u)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Si,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(i,t)}}))),c&&o().createElement(L.Col,{flex:he(c.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...c}))))}}Ei(wi,"contextType",Cr);const Ci=wi,Ti=require("big.js");var Ii=n.n(Ti);function Ni(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ri=o().forwardRef(((e,t)=>{const{$$form:r}=o().useContext(Cr),{value:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},placeholder:c=f("qm.form.inputPlaceholder"),bordered:d=!0,readOnly:u,disabled:p,onBlur:h=ae,onEnter:m=ae}=e.option,{step:g=1,min:b,max:y,precision:v,autoFocus:x,stringMode:E,textAlign:S="left",controls:w=!0,formatter:C,parser:T}=l,I=o().useRef(),N=o().useRef(n),R=e=>{const t=kn(e)?"":(0,te.isNumber)(e)?e.toFixed(v):new(Ii())(e).toFixed(v);return"function"==typeof C?C(t):t},P={[S]:!0,controls:w};return r.isOnlyShow?o().createElement(ri,{value:R(n),bordered:d}):o().createElement(L.InputNumber,{ref:e=>{I.current=e,"function"==typeof t&&t(e)},value:n,className:we()(P),placeholder:c,style:{width:"100%",...s},step:g,min:b,max:y,controls:w,precision:v,autoFocus:x,stringMode:E,formatter:C,parser:T,bordered:d,readOnly:u,disabled:p,onBlur:()=>{se((()=>{(t=>{const{onBlur:r}=e;r?.(t)})(N.current),h(N.current)}))},onKeyUp:e=>{13===e.keyCode&&(m(n),r.isFilterType&&(r.SUBMIT_FORM(),I.current?.blur()))},onChange:e=>{const t=e??"";!E&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{N.current=e,i?.(e),a(e,R(e))})(t)}})}));Ri.displayName="VInputNumber";class Pi extends a.Component{constructor(){super(...arguments),Ni(this,"context",void 0),Ni(this,"focus",(()=>{const{type:e}=this.props.option;this[e].focus()}))}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ri,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,r)=>{m(t),e.setViewValue(i,r)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(i,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ni(Pi,"contextType",Cr);const Oi=Pi;function ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ai=e=>{const{$$form:t}=o().useContext(Cr),{value:r=[],onChange:n,onValuesChange:i}=e,{options:a={},placeholder:l=f("qm.form.rangeInputNumberPlaceholder"),bordered:s=!0,allowClear:c,readOnly:d,disabled:u}=e.option,{step:p=1,min:h=0,max:m,textAlign:g="left",controls:b=!0,precision:y,formatter:v,parser:x}=a,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),S(e)},S=e=>{const t=e.every((e=>null===e))?[]:[...e];n?.(t),i(t,w(t))},w=e=>kn(e)?"":e.map((e=>kn(e)?"":Number(e).toFixed(y))),C={[g]:!0,controls:b};return t.isOnlyShow?o().createElement(ri,{value:w(r),bordered:s}):o().createElement(L.Input.Group,null,o().createElement(L.InputNumber,{value:r[0],className:we()("site-input-left",C),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:l[0],step:p,min:h,max:m,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:d,disabled:u,onChange:e=>{S([e,r[1]])},onBlur:()=>{E(r)}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:s,disabled:u,readOnly:!0}),o().createElement(L.InputNumber,{value:r[1],className:we()("site-input-right",C),style:{width:"calc(50% - 5px)"},placeholder:l[1],step:p,min:h,max:m,controls:b,precision:y,formatter:v,parser:x,bordered:s,readOnly:d,disabled:u,onChange:e=>{S([r[0],e])},onBlur:()=>{E(r)}}))};class Li extends a.Component{constructor(){super(...arguments),ki(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,labelWidth:l=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(s),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(l)},required:e.getFormItemRequired(u)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ai,{option:this.props.option,onValuesChange:function(){let t=arguments.length>1?arguments[1]:void 0;p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),e.setViewValue(i,t)}}))),c&&o().createElement(L.Col,{flex:he(c.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...c}))))}}ki(Li,"contextType",Cr);const _i=Li;let Fi=function(e){return e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small",e}({});function Hi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{Search:Di}=L.Input;class $i extends a.Component{constructor(e){var t;super(e),t=this,Hi(this,"context",void 0),Hi(this,"deriveParams",void 0),Hi(this,"valueKey",void 0),Hi(this,"_is_change",!1),Hi(this,"_record",void 0),Hi(this,"_prevValue",null),Hi(this,"state",{visible:!1,loading:!1}),Hi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Hi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Hi(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:r,echoRequest:n}=this.searchHelper;if(t||v("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||v("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&v("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Hi(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Hi(this,"getDerivedSearchHelper",(()=>this.searchHelper)),Hi(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;this.setState({loading:!0});try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e),this.searchHelperChangeHandle(e)}i?.([t])}}}catch(e){}this.setState({loading:!1})})),Hi(this,"todoOpen",(e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)})),Hi(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,{filterAliasMap:r}=this.searchHelper,n=""!==e?e:void 0,i=("function"==typeof r?r():r)||[],a={[t]:n};return(Array.isArray(i)?i:[i]).forEach((e=>{if((0,te.isPlainObject)(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a})),Hi(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:r={}}=this.searchHelper,{beforeFetch:n=oe,formatter:i=(e=>e)}=t.fetch;return new Promise((async(a,o)=>{const l=(0,te.merge)({},this.searchHelper.table.fetch.params,{...r,...i(this.createFilters(e))},{currentPage:1,pageSize:500});if(!n(l))return o();this.setState({loading:!0});try{const e=await t.fetch.api(l);200===e.code?a(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[]):o()}catch(e){o(e)}finally{se((()=>this.setState({loading:!1})))}}))})),Hi(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;for(const n in this.alias){const i=An(e,this.alias[n]);void 0!==i&&(t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i))}for(const r in this.extras){const n=An(e,this.extras[r]);void 0!==n&&t.SET_FIELDS_EXTRA({[r]:n})}})),Hi(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;const{fieldName:n}=t.props.option,i=e.filter((e=>An(e,t.alias[n])?.toString().toLowerCase().includes(r.toLowerCase())));if(1===i.length)return t.closeSearchHelper(i[0]);t.openSearchHelper(r)})),Hi(this,"openSearchHelper",(async(e,t)=>{await this.props.waiting();const{$$form:r}=this.context,{beforeOpen:n}=this.searchHelper,i=(n??oe)(r.state.formData);i?.then?i.then((()=>{this.todoOpen(e),t?.()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),t?.())})),Hi(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias)n!==r&&t.SET_FIELDS_VALUE({[n]:An(e,this.alias[n])});for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])});const n=An(e,this.alias[r]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(e)),200)}))})),Hi(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)})),Hi(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const r in this.alias)r!==t&&e.SET_FIELDS_VALUE({[r]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}})),Hi(this,"searchHelperChangeHandle",(e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,t?.(e,this._record)})),Hi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e)})),Hi(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;t?.(e)})),Hi(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(){if(null===this._prevValue)return;const e=this.getItemValue();this._prevValue!==e&&e!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=e}render(){const{$$form:e}=this.context,{visible:t,loading:r}=this.state,{value:n}=this.props,{type:i,fieldName:a,options:l={},searchHelper:s={},style:c={},placeholder:d=f("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:g,suffix:b,maxLength:y}=l,v={visible:t,title:f("qm.searchHelper.text"),width:s.width??"60%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?o().createElement(ri,{value:n,bordered:u}):o().createElement(o().Fragment,null,o().createElement(Di,{ref:e=>this[`${i}_Ref`]=e,value:n,title:n,loading:r,placeholder:d,style:c,prefix:g,suffix:b,maxLength:y,bordered:u,allowClear:p,readOnly:h,disabled:m,onBlur:e=>{const{value:r}=e.target,{onlySelect:n=!0,table:i}=this.searchHelper;this.triggerBlur(r),this._is_change&&!t&&(r?n?i?.fetch?.api&&this.getSearchHelperTableData(r).then((e=>this.resetSearchHelperValue(e,r))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(r):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:r}=e.target;!t&&this.openSearchHelper(r)}},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"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):se((()=>this.clearSearchHelperValue())))}}),o().createElement(Er,v,o().createElement(ad,x)))}}Hi($i,"contextType",Cr);class qi extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Hi(this,"context",void 0),Hi(this,"promiseRef",void 0),Hi(this,"searchRef",void 0),Hi(this,"state",{searchHelper:{}}),Hi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Hi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[]}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement($i,{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(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Hi(qi,"contextType",Cr);const Mi=qi;function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ji.apply(this,arguments)}function Ki(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=e=>{class t extends a.Component{constructor(){var e;super(...arguments),e=this,Ki(this,"startClick",void 0),Ki(this,"event1",null),Ki(this,"event2",null),Ki(this,"$el",null),Ki(this,"omitClassNames",[]),Ki(this,"state",{clickOutside:!1}),Ki(this,"mousedownHandler",(e=>{this.startClick=e})),Ki(this,"mouseupHandler",(e=>{this.documentHandler(e,this.startClick)})),Ki(this,"documentHandler",((e,t)=>{const r=e.target,n=t?.target,i=!r||!n,a=this.$el?.contains(r)||this.$el?.contains(n),o=this.$el===r,l=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),s=l.some((e=>e?.contains(r)))||l.includes(n);let c;c=!(i||a||o||s),this.setState({clickOutside:c})})),Ki(this,"setCurrentElement",(e=>{e&&(this.$el=e)})),Ki(this,"setOmitClassNames",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.omitClassNames=t}))}componentDidMount(){this.event1=Gt()(document,"mousedown",this.mousedownHandler),this.event2=Gt()(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){this.event1?.remove(),this.event2?.remove()}render(){const{forwardedRef:t}=this.props,{clickOutside:r}=this.state;return o().createElement(e,ji({ref:t},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return Ki(t,"displayName",`OutsideClick(${e.displayName||e.name})`),o().forwardRef(((e,r)=>o().createElement(t,ji({},e,{forwardedRef:r}))))},zi=require("rc-trigger");var Bi,Ui,Wi=n.n(zi);function Gi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Yi=Vi((Ui=class extends a.Component{constructor(e){var t;super(e),t=this,Gi(this,"context",void 0),Gi(this,"searchRef",o().createRef()),Gi(this,"_records",[]),Gi(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),Gi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Gi(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),Gi(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),Gi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Gi(this,"setItemList",(e=>{this.setState({itemList:e})})),Gi(this,"setRecords",(e=>{this._records=e})),Gi(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),Gi(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;t.setViewValue(r,this.createViewText(e))})),Gi(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),Gi(this,"closeSearchHelper",(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:n}=t.alias;t.setRecords((0,te.uniqBy)([...t._records.filter((e=>r.includes(e[n]))),...e],n));const i=t.recordsToDict();t.setItemList(i),t.triggerChange(i.map((e=>e.value)));const{closed:a}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>a?.(t._records)),200)}))})),Gi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),t?.(e),r(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:r=[]}=e,{value:n=[],clickOutside:i}=this.props;(0,te.isEqual)((0,te.intersection)(r,n),n)||(0,te.isEqual)(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,callback:o,fieldAliasMap:l}=this.searchHelper.echoRequest||this.props.option.searchHelper?.request||{},s="function"==typeof l?l():l||{},{value:c}=this.props;if(r&&!de(c)){this.setState({loading:!0});try{const l=await r(i({...n,keys:c}));if(200===l.code){let r=Array.isArray(l.data)?l.data:(0,te.get)(l.data,a)??[];r.forEach((r=>{s?.valueKey&&s.valueKey!==t&&(r[t]=r[s.valueKey]),s?.textKey&&s.textKey!==e&&(r[e]=r[s.textKey])})),r=r.filter((e=>c.includes(e[t])));const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setViewValue(c),o?.(r)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:t,visible2:r,loading:n,itemList:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},searchHelper:c={},style:d={},placeholder:u=f("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{collapseTags:b,maxTagTextLength:y}=s,v={visible:t,title:f("qm.searchHelper.text"),width:c.width??"60%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:(0,te.merge)({},c.initialValue),defaultSelectedKeys:a,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},E=i.filter((e=>a?.includes(e.value))),S=o().createElement("ul",{className:"ant-dropdown-menu"},E.length?E.map((e=>o().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):o().createElement("li",{className:"ant-dropdown-menu-item"},f("qm.table.config.emptyText"))),w=this.searchRef.current?this.searchRef.current.offsetWidth:300,C=Ce("form-multiple-search-helper"),{size:T}=e.context,I={[C]:!0,[`${C}--lg`]:"large"===T,[`${C}--sm`]:"small"===T};this.props.setOmitClassNames?.([`.${C}`]);const N=i.filter((e=>a?.includes(e.value))).map((e=>e.text)).join(",");return e.isOnlyShow?o().createElement(ri,{value:N,bordered:p}):o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},o().createElement(Wi(),{popupVisible:!g&&r,popup:S,popupClassName:we()(I),popupStyle:{minWidth:w},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:wn,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement(L.Select,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:y,open:!1,value:a,placeholder:u,loading:n,bordered:p,allowClear:h,disabled:g,style:{width:"100%",...d},title:N,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;t.classList.contains("ant-select-selection-overflow-item-rest")&&(this.props.setCurrentElement?.(t),this.setState({visible2:!0}))},onDoubleClick:()=>{g||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},i.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:g,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),o().createElement(Er,v,o().createElement(ad,x)))}},Gi(Ui,"contextType",Cr),Bi=Ui))||Bi;class Xi extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Gi(this,"context",void 0),Gi(this,"promiseRef",void 0),Gi(this,"state",{searchHelper:{}}),Gi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Gi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(Yi,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{f(t,n),e.setViewValue(a,r)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Gi(Xi,"contextType",Cr);const Qi=Xi;function Zi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{Search:Ji}=L.Input;class ea extends a.Component{constructor(e){super(e),Zi(this,"context",void 0),Zi(this,"valueKey",void 0),Zi(this,"_record",void 0),Zi(this,"_prevValue",null),Zi(this,"state",{visible:!1,loading:!1}),Zi(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),Zi(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),Zi(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:r,echoRequest:n}=this.searchHelper;if(t||v("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),r){const e=["valueKey","displayKey","extraKey"];for(const t in r)e.includes(t)&&(this[t]=r[t])}Object.keys(this.alias).includes(e)||v("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&v("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),Zi(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Zi(this,"getDerivedSearchHelper",(()=>this.searchHelper)),Zi(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;this.setState({loading:!0});try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e)}i?.([t])}}}catch(e){}this.setState({loading:!1})})),Zi(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;for(const n in this.alias){const i=An(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i)}for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])})})),Zi(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),Zi(this,"closeSearchHelper",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias)n!==r&&t.SET_FIELDS_VALUE({[n]:An(e,this.alias[n])});for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])});const n=An(e,this.alias[r]);this.triggerChange(n);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(e)),200)}))})),Zi(this,"clearSearchHelperValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const r in this.alias)r!==t&&e.SET_FIELDS_VALUE({[r]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")})),Zi(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this._record)})),Zi(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;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(){if(null===this._prevValue)return;const e=this.getItemValue();this._prevValue!==e&&e!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=e}render(){const{$$form:e}=this.context,{visible:t,loading:r}=this.state,{value:n=""}=this.props,{type:i,fieldName:a,options:l={},searchHelper:s={},style:c={},placeholder:d=f("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:m}=this.props.option,{prefix:g,suffix:b,maxLength:y}=l,v={visible:t,title:f("qm.searchHelper.text"),width:s.width??"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:(0,te.merge)({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}};return e.isOnlyShow?o().createElement(ri,{value:n,bordered:u}):o().createElement(o().Fragment,null,o().createElement(Ji,{ref:e=>this[`${i}_Ref`]=e,value:n,title:n,loading:r,placeholder:d,style:c,prefix:g,suffix:b,maxLength:y,bordered:u,allowClear:p,readOnly:h,disabled:m,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"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),o().createElement(Er,v,o().createElement(ud,x)))}}Zi(ea,"contextType",Cr);class ta extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Zi(this,"context",void 0),Zi(this,"promiseRef",void 0),Zi(this,"state",{searchHelper:{}}),Zi(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Zi(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(ea,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r)=>{f(t,r),e.setViewValue(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Zi(ta,"contextType",Cr);const ra=ta;var na,ia;function aa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let oa=Vi((ia=class extends a.Component{constructor(e){var t;super(e),t=this,aa(this,"context",void 0),aa(this,"searchRef",o().createRef()),aa(this,"_records",[]),aa(this,"state",{visible:!1,visible2:!1,loading:!1,itemList:[]}),aa(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),aa(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),aa(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),aa(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),aa(this,"setItemList",(e=>{this.setState({itemList:e})})),aa(this,"setRecords",(e=>{this._records=e})),aa(this,"recordsToDict",(()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))))),aa(this,"setViewValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;t.setViewValue(r,this.createViewText(e))})),aa(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),aa(this,"closeSearchHelper",(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{valueKey:n}=t.alias;t.setRecords((0,te.uniqBy)([...t._records.filter((e=>r.includes(e[n]))),...e],n));const i=t.recordsToDict();t.setItemList(i),t.triggerChange(i.map((e=>e.value)));const{closed:a}=t.searchHelper;t.setVisible(!1,(()=>{setTimeout((()=>a?.(t._records)),200)}))})),aa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),t?.(e),r(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:r=[]}=e,{value:n=[],clickOutside:i}=this.props;(0,te.isEqual)((0,te.intersection)(r,n),n)||(0,te.isEqual)(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||this.props.option.searchHelper?.request||{},l="function"==typeof o?o():o||{},{value:s}=this.props;if(r&&!de(s)){this.setState({loading:!0});try{const o=await r(i({...n,keys:s}));if(200===o.code){let r=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];r.forEach((r=>{l?.valueKey&&l.valueKey!==t&&(r[t]=r[l.valueKey]),l?.textKey&&l.textKey!==e&&(r[e]=r[l.textKey])})),r=r.filter((e=>s.includes(e[t])));const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setViewValue(s)}}catch(e){}this.setState({loading:!1})}}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){const{$$form:e}=this.context,{visible:t,visible2:r,loading:n,itemList:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},searchHelper:c={},style:d={},placeholder:u=f("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{collapseTags:b,maxTagTextLength:y}=s,v={visible:t,title:f("qm.searchHelper.text"),width:c.width??"65%",wrapClassName:`form-popper__${l}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x={...this.getDerivedSearchHelper(),size:e.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${l}`:"",initialValue:(0,te.merge)({},c.initialValue),defaultSelectedKeys:a,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}},E=i.filter((e=>a?.includes(e.value))),S=o().createElement("ul",{className:"ant-dropdown-menu"},E.length?E.map((e=>o().createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):o().createElement("li",{className:"ant-dropdown-menu-item"},f("qm.table.config.emptyText"))),w=this.searchRef.current?this.searchRef.current.offsetWidth:300,C=Ce("form-multiple-tree-table-helper"),{size:T}=e.context,I={[C]:!0,[`${C}--lg`]:"large"===T,[`${C}--sm`]:"small"===T};this.props.setOmitClassNames?.([`.${C}`]);const N=i.filter((e=>a?.includes(e.value))).map((e=>e.text)).join(",");return e.isOnlyShow?o().createElement(ri,{value:N,bordered:p}):o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},o().createElement(Wi(),{popupVisible:!g&&r,popup:S,popupClassName:we()(I),popupStyle:{minWidth:w},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:wn,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement(L.Select,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:y,open:!1,value:a,placeholder:u,loading:n,bordered:p,allowClear:h,disabled:g,style:{width:"100%",...d},title:N,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{const t=e.target;t.classList.contains("ant-select-selection-overflow-item-rest")&&(this.props.setCurrentElement?.(t),this.setState({visible2:!0}))},onDoubleClick:()=>{g||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},i.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:g,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),o().createElement(Er,v,o().createElement(ud,x)))}},aa(ia,"contextType",Cr),na=ia))||na;class la extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),aa(this,"context",void 0),aa(this,"promiseRef",void 0),aa(this,"state",{searchHelper:{}}),aa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),aa(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(oa,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{f(t,n),e.setViewValue(a,r)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}aa(la,"contextType",Cr);const sa=la;function ca(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const da=new Array(2).fill("");class ua extends a.Component{constructor(e){var t;super(e),t=this,ca(this,"context",void 0),ca(this,"_is_change",!1),ca(this,"_ceho_data",void 0),ca(this,"_records",[]),ca(this,"_is_clear",!1),ca(this,"state",{visible:!1,loading:!1,itemList:[],textValue:da}),ca(this,"getSearchHelper",wr()((e=>Object.assign({},this.props.helperConfig,e)))),ca(this,"initialHandle",(async()=>{await this.props.waiting(),this.searchHelper.fieldAliasMap||v("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||v("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),ca(this,"getDerivedSearchHelper",(()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper))),ca(this,"setItemList",(e=>{this.setState({itemList:e})})),ca(this,"setVisible",((e,t)=>{this.setState({visible:e},t)})),ca(this,"setTextValue",(e=>{this.setState({textValue:e})})),ca(this,"setRecords",(e=>{this._records=e})),ca(this,"setViewValue",(()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())})),ca(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;this._is_change=!1,t?.(e),r(e,this.createViewText(),this._records)})),ca(this,"clearSearchHelperValue",(()=>{this.setRecords([]),this.setTextValue(da),this.triggerChange([])})),ca(this,"closeSearchHelper",(e=>{const{valueKey:t,textKey:r}=this.alias,n=e.map((e=>({value:e[t],text:e[r]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>e.text??""))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>i?.(this._records)),200)}))})),ca(this,"openSearchHelper",(async e=>{await this.props.waiting();const{$$form:t}=this.context,{beforeOpen:r}=this.searchHelper,n=(r??oe)(t.state.formData);n?.then?n.then((()=>{this.setVisible(!0),e?.()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),e?.())})),ca(this,"createFilters",(e=>{const{fieldName:t}=this.props.option,r=de(e)?void 0:e;return{[t]:r}})),ca(this,"getSearchHelperTableData",(e=>{const{table:t,initialValue:r={}}=this.searchHelper,{beforeFetch:n=oe,formatter:i=(e=>e)}=t.fetch;return new Promise((async(a,o)=>{const l=(0,te.merge)({},this.searchHelper.table.fetch.params,{...r,...i(this.createFilters(e))},{currentPage:1,pageSize:500});try{if(!n(l))return o();this.setState({loading:!0});const e=await t.fetch.api(l);if(se((()=>this.setState({loading:!1}))),200===e.code)return a(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[])}catch(e){this.setState({loading:!1})}o()}))})),ca(this,"resetSearchHelperValue",(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{textValue:r}=t.state,{textKey:n}=t.alias,i=e.filter((e=>{const t=e[n]?.toString().toLowerCase();return r.some((e=>t?.includes(e.toLowerCase())))}));if(2===i.length)return t.closeSearchHelper(i);t.openSearchHelper()})),ca(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:r=[]}=this.props;(0,te.isEqual)((0,te.intersection)(t,r),r)||(0,te.isEqual)(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:n}=this.context,{fieldName:i}=this.props.option;if(!(0,te.isEqual)(n[i],this._ceho_data)&&(this._ceho_data=n[i],this.setItemList(n[i]),r.length)){const e=da.map(((e,t)=>n[i].find((e=>e.value===r[t]))?.text??""));this.setTextValue(e)}}async getItemList(){await this.props.waiting();const{textKey:e,valueKey:t}=this.alias,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||{},l="function"==typeof o?o():o||{},{value:s}=this.props;if(r&&!de(s)){this.setState({loading:!0});try{const o=await r(i({...n,keys:s}));if(200===o.code){let r=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];r.forEach((r=>{l?.valueKey&&l.valueKey!==t&&(r[t]=r[l.valueKey]),l?.textKey&&l.textKey!==e&&(r[e]=r[l.textKey])})),r=r.filter((e=>s.includes(e[t]))).slice(0,2);const n=r.map((r=>({value:r[t],text:r[e]})));this.setRecords(r),this.setItemList(n),this.setTextValue(n.map((e=>e.text??""))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){const{$$form:e}=this.context,{value:t=[]}=this.props,{visible:r,loading:n,textValue:i}=this.state,{fieldName:a,options:l={},searchHelper:s={},placeholder:c=f("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:h=!0}=this.searchHelper||s,m=i.every((e=>kn(e)))?"":i.join(" - "),g={visible:r,title:f("qm.searchHelper.text"),width:s.width??"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Fi[e.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},b={...this.getDerivedSearchHelper(),size:e.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:(0,te.merge)({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}};return e.isOnlyShow?o().createElement(ri,{value:m,bordered:d}):o().createElement(o().Fragment,null,o().createElement(L.Input.Group,null,o().createElement(L.Input,{value:i[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;this._is_change&&!r&&(t?i.every((e=>!!e))&&this.searchHelper.table?.fetch?.api&&this.getSearchHelperTableData(i).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):i.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;h||(this._is_change=!0,this.setTextValue([t,i[1]]))}}),o().createElement(L.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),o().createElement(L.Input.Search,{value:i[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:n,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{const{value:t}=e.target;this._is_change&&!r&&(t?i.every((e=>!!e))&&this.searchHelper.table?.fetch?.api&&this.getSearchHelperTableData(i).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):i.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:h||(this._is_change=!0,this.setTextValue([i[0],t]))},onSearch:(e,t)=>{"click"===t?.type&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),o().createElement(Er,g,o().createElement(yd,b)))}}ca(ua,"contextType",Cr);class pa extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),ca(this,"context",void 0),ca(this,"promiseRef",void 0),ca(this,"state",{searchHelper:{}}),ca(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),ca(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi,!0);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(c),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(ua,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,r,n)=>{m(t,n),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,null,e.renderFormItemButton(a,u)),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...d}))))}}ca(pa,"contextType",Cr);const ha=pa;function ma(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=l,h=de(p)?n:p,m=e=>h.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?o().createElement(ri,{value:m(r),bordered:c}):o().createElement(L.Checkbox.Group,{value:r,style:{width:"100%",...s},disabled:u,onChange:e=>{(e=>{i?.(e),a(e,m(e))})(e)}},h.map((e=>o().createElement(L.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class ga extends a.Component{constructor(){super(...arguments),ma(this,"context",void 0),ma(this,"state",{itemList:[]})}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}async getItemList(){const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t)try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(fa,{option:this.props.option,items:t,onValuesChange:(t,r)=>{m(t),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}ma(ga,"contextType",Cr);const ba=ga;function ya(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const va=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},style:l={},allowClear:s=!0,readOnly:c,disabled:d=t.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:h}=a;return o().createElement(L.Rate,{value:r,count:p,style:l,allowHalf:u,allowClear:s,tooltips:h,disabled:d||t.isOnlyShow,onChange:e=>{(e=>{var t;n?.(e),i(e,(t=e,h?h[Math.ceil(t)-1]:t.toString()))})(e)}})};class xa extends a.Component{constructor(){super(...arguments),ya(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(va,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}ya(xa,"contextType",Cr);const Ea=xa;function Sa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,onChange:i,onValuesChange:a}=e,{options:l={},style:s={},bordered:c=!1,readOnly:d,disabled:u=t.isFormDisabled}=e.option,{itemList:p=[]}=l,h=de(p)?n:p,m=e=>h.find((t=>t.value===e))?.text??"";return t.isOnlyShow?o().createElement(ri,{value:m(r),bordered:c}):o().createElement(L.Radio.Group,{value:r,style:{width:"100%",...s},disabled:u||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{i?.(e),a(e,m(e))})(t)}},h.map((e=>o().createElement(L.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Ca extends a.Component{constructor(){super(...arguments),Sa(this,"context",void 0),Sa(this,"state",{itemList:[]}),Sa(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t)try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=t.map((e=>({value:e[i],text:e[a]})));this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:h=[],onChange:m=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(h)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:h,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(wa,{option:this.props.option,items:t,onValuesChange:(t,r)=>{m(t),e.setViewValue(a,r)}}))),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Sa(Ca,"contextType",Cr);const Ta=Ca;function Ia(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Na=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{label:a,options:l={},style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=xn,trueValue:h=vn}=l;return o().createElement(o().Fragment,null,o().createElement(L.Switch,{checked:r===h,style:s,disabled:d||t.isOnlyShow,checkedChildren:o().createElement(Te.CheckOutlined,null),unCheckedChildren:o().createElement(Te.CloseOutlined,null),onChange:e=>{(e=>{n?.(e),i(e,f(e===h?"am.form.trueText":"am.form.falseText"))})(e?h:p)}}),u?o().createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},a):null)};class Ra extends a.Component{constructor(){super(...arguments),Ia(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option,{labelToSwitch:m}=l;return o().createElement(L.Form.Item,{label:m?" ":e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Na,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ia(Ra,"contextType",Cr);const Pa=Ra;function Oa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ka=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},style:l={},placeholder:s=f("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p,onBlur:h=ae,onEnter:m=ae}=e.option,{showCount:g,maxLength:b,autoSize:y}=a,v=Object.assign({},{minRows:1,maxRows:3},y);return o().createElement(L.Input.TextArea,{value:r,placeholder:s,style:l,maxLength:b,showCount:g,autoSize:v,bordered:c,allowClear:d,readOnly:u||t.isOnlyShow,disabled:p,onBlur:t=>{const{value:r}=t.target;(t=>{const{onBlur:r}=e;r?.(t)})(r),h(r)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;m(t)}},onChange:e=>{const{value:t}=e.target;(e=>{n?.(e),i(e)})(t)}})};class Aa extends a.Component{constructor(){super(...arguments),Oa(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(ka,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Oa(Aa,"contextType",Cr);const La=Aa;function _a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fa=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.datePlaceholder"),bordered:d=!0,allowClear:p=!0,readOnly:h,disabled:m}=e.option,{dateType:g="date",format:b,disabledDate:y,minDateTime:v,maxDateTime:x,shortCuts:E=!0}=l,S=o().createRef(),w=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),n?.(e),i(e,C(e))},C=e=>kn(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,T=e=>{let t=On(u()().subtract(e,"day"),Tn[g]);"date"===g&&(t=t.slice(0,10)),w(t),S.current.blur(),S.current.focus()};return t.isOnlyShow?o().createElement(ri,{value:C(r),bordered:d}):o().createElement(j,{ref:S,style:{width:"100%",...s},popupClassName:`form-popper__${a}`,picker:Cn[g],format:b,bordered:d,showToday:!1,showTime:"datetime"===g&&{defaultValue:u()("00:00:00","HH:mm:ss")},allowClear:p,disabled:m,inputReadOnly:h,disabledDate:y??(e=>((e,t)=>{let[r,n]=t;return r&&n?e.isBefore(r,"day")||e.isAfter(n,"day"):r?e.isBefore(r,"day"):!!n&&e.isAfter(n,"day")})(e,[v,x])),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():o().createElement(o().Fragment,null,o().createElement(L.Tag,{color:"processing",onClick:()=>T(0)},f("qm.form.datePickers")[0]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(1)},f("qm.form.datePickers")[1]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(7)},f("qm.form.datePickers")[2]),o().createElement(L.Tag,{color:"processing",onClick:()=>T(30)},f("qm.form.datePickers")[3])):void 0,value:Pn(r,Tn[g]),onChange:(e,t)=>{w(On(e,Tn[g]))}})};class Ha extends a.Component{constructor(){super(...arguments),_a(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Fa,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}_a(Ha,"contextType",Cr);const Da=Ha;function $a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qa=e=>[u()().subtract(e,"day"),u()()],Ma=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.daterangePlaceholder"),bordered:d=!0,allowClear:p=!0,readOnly:h,disabled:m=t.isFormDisabled}=e.option,{dateType:g="date",format:b,disableds:y=[!1,!1],allowEmpty:v,disabledDate:x,minDateTime:E,maxDateTime:S,shortCuts:w=!0}=l,C={[f("qm.form.dateRangePickers")[0]]:qa(7),[f("qm.form.dateRangePickers")[1]]:qa(30),[f("qm.form.dateRangePickers")[2]]:qa(90),[f("qm.form.dateRangePickers")[3]]:qa(180)},T=e=>kn(e)?"":e.map((e=>["date","exactdate"].includes(g)?e?.slice(0,10):e)).join(" - ");return t.isOnlyShow?o().createElement(ri,{value:T(r),bordered:d}):o().createElement(j.RangePicker,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,picker:Cn[g],format:b,bordered:d,showTime:"datetime"===g&&{defaultValue:[u()("00:00:00","HH:mm:ss"),u()("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:v,disabled:m?[!0,!0]:y,inputReadOnly:h,disabledDate:x??(e=>((e,t)=>{let[r,n]=t;return r&&n?e.isBefore(r,"day")||e.isAfter(n,"day"):r?e.isBefore(r,"day"):!!n&&e.isAfter(n,"day")})(e,[E,S])),ranges:w&&g.includes("date")?C:void 0,value:de(r)?null:[Pn(r?.[0],Tn[g]),Pn(r?.[1],Tn[g])],onChange:(e,t)=>{(e=>{"date"===g&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),n?.(e),i(e,T(e))})([On(e?.[0],Tn[g]),On(e?.[1],Tn[g])])}})};class ja extends a.Component{constructor(){super(...arguments),$a(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ma,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}$a(ja,"contextType",Cr);const Ka=ja;function Va(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const za=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.timePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h}=e.option,{timeType:m="hour-minute-second",hourStep:g=1,minuteStep:b=1,secondStep:y=1}=l;return t.isOnlyShow?o().createElement(ri,{value:r,bordered:d}):o().createElement(B,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,bordered:d,showNow:!0,hourStep:g,minuteStep:b,secondStep:y,allowClear:u,disabled:h,inputReadOnly:p,format:In[m],value:Pn(r,In[m]),onChange:(e,t)=>{(e=>{const t=On(e,In[m]);n?.(t),i(t)})(e)}})};class Ba extends a.Component{constructor(){super(...arguments),Va(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(za,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Va(Ba,"contextType",Cr);const Ua=Ba;function Wa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ga=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.timerangePlaceholder"),bordered:d=!0,allowClear:u=!0,readOnly:p,disabled:h=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:g=[!1,!1],allowEmpty:b,hourStep:y=1,minuteStep:v=1,secondStep:x=1}=l,E=e=>kn(e)?"":e.join(" - ");return t.isOnlyShow?o().createElement(ri,{value:E(r),bordered:d}):o().createElement(B.RangePicker,{style:{width:"100%",...s},popupClassName:`form-popper__${a}`,bordered:d,showNow:!1,hourStep:y,minuteStep:v,secondStep:x,allowClear:u,allowEmpty:b,disabled:h?[!0,!0]:g,inputReadOnly:p,format:In[m],value:de(r)?null:[Pn(r?.[0],In[m]),Pn(r?.[1],In[m])],onChange:(e,t)=>{(e=>{const t=[On(e?.[0],In[m]),On(e?.[1],In[m])];n?.(t),i(t,E(t))})(e)}})};class Ya extends a.Component{constructor(){super(...arguments),Wa(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Ga,{option:this.props.option,onValuesChange:(t,r)=>{h(t),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Wa(Ya,"contextType",Cr);const Xa=Ya;function Qa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Za extends a.Component{constructor(e){super(e),Qa(this,"context",void 0),Qa(this,"searchRef",o().createRef()),Qa(this,"valueKey",void 0),Qa(this,"_clicking",!1),Qa(this,"_record",void 0),Qa(this,"_prevValue",null),Qa(this,"state",{itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0}),Qa(this,"getSearchHelper",wr()(((e,t)=>Object.assign({},this.props.helperConfig,e,t)))),Qa(this,"initialHandle",(async()=>{await this.props.waiting();const{fieldName:e,options:t,searchHelper:r}=this.props.option,{fieldAliasMap:n,fieldsDefine:i,echoRequest:a}=this.searchHelper;if(n||v("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||v("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),a&&!this.valueKey&&v("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!r&&v("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),Qa(this,"getItemValue",(()=>{const{$$form:e}=this.context;return e.state.other[this.valueKey]??e.state.formData[this.valueKey]})),Qa(this,"getItemText",(async()=>{await this.props.waiting();const{fetchApi:e,params:t={},formatter:r=(e=>e),dataKey:n,callback:i,triggeredChange:a,fieldAliasMap:o,extraAliasMap:l}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},c="function"==typeof l?l():l||{},d=this.getItemValue();if(!e||de(d))return this._prevValue=void 0;try{const o=await e(r({...t,key:d}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,n)??[];if(e[0]){const t=e[0];if(s&&Ln(t,this.alias,s),c&&_n(t,this.extras,c),this._record=t,this.setFieldsValue(t),this._prevValue=d,a){const e=An(t,this.alias[this.props.option.fieldName]);this.triggerChange(e)}i?.([t])}}}catch(e){}})),Qa(this,"setFieldsValue",(e=>{const{$$form:t}=this.context,{fieldName:r}=this.props.option;this._record=e;for(const n in this.alias){const i=An(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:i}),n===r&&t.setViewValue(r,i)}for(const r in this.extras)t.SET_FIELDS_EXTRA({[r]:An(e,this.extras[r])})})),Qa(this,"fetchHandle",(0,te.debounce)(this.getItemList,200)),Qa(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Qa(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this._record)})),Qa(this,"triggerBlur",(e=>{const{onBlur:t}=this.props;t?.(e)})),Qa(this,"clickHandle",((e,t)=>{const{$$form:r}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias)t!==n&&r.SET_FIELDS_VALUE({[t]:An(e,this.alias[t])});for(const t in this.extras)r.SET_FIELDS_EXTRA({[t]:An(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=An(e,this.alias[n]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()})),this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemText()}componentDidUpdate(e){const t=e.option.searchHelper?.request?.params||e.option.request?.params,r=this.props.option.searchHelper?.request?.params||this.props.option.request?.params;if((0,te.isEqual)(t,r)||this.getItemList(),null===this._prevValue)return;const n=this.getItemValue();this._prevValue!==n&&n!==this._record?.[this.alias[this.valueKey]]&&this.getItemText(),this._prevValue=n}async getItemList(e){const{fieldName:t}=this.props.option,{fetchApi:r,params:n={},formatter:i=(e=>e),dataKey:a}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=await r(i({...n,[t]:e}));if(200===o.code){const e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,a)??[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}render(){const{$$form:e}=this.context,{visible:t,loading:r,itemList:n,inputText:i}=this.state,{value:a}=this.props,{fieldName:l,options:s={},style:d={},placeholder:u=f("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:h=!0,readOnly:m,disabled:g}=this.props.option,{listHeight:b=En}=s,{hideHeader:y,onlySelect:v=!0}=this.searchHelper||s,x=this.searchHelper.columns||[],E=Ce("form-immediate"),S=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,w=o().createElement(L.Spin,{spinning:r},n.length?o().createElement("table",{cellSpacing:0,cellPadding:0,className:we()("table")},!y&&o().createElement("thead",null,o().createElement("tr",null,x.filter((e=>!e.hidden)).map((e=>o().createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),o().createElement("tbody",null,n.map(((e,t)=>o().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)))}},x.filter((e=>!e.hidden)).map((t=>o().createElement("td",{key:t.dataIndex},(0,te.get)(e,t.dataIndex))))))))):o().createElement(ft,null));return o().createElement(c.Consumer,null,(r=>{const s={[E]:!0,[`${E}--lg`]:"large"===r?.size,[`${E}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:a,bordered:p}):o().createElement(Wi(),{action:g?[]:["click"],popupVisible:!g&&t,popup:w,popupClassName:we()(s,`form-popper__${l}`),popupStyle:{minWidth:S,maxHeight:b},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:u,allowClear:h,bordered:p,readOnly:m,disabled:g,style:{width:"100%",...d},value:i??a,title:a,onFocus:()=>{!n.length&&this.fetchHandle(a)},onBlur:e=>{v&&!this._clicking&&i!==a&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(n[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const r=40===e.keyCode?++t%n.length:(--t+n.length)%n.length;this.setState({activeIndex:r})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}Qa(Za,"contextType",Cr);class Ja extends a.Component{constructor(e,t){let{$$form:r}=t;super(e),Qa(this,"context",void 0),Qa(this,"promiseRef",void 0),Qa(this,"state",{searchHelper:{}}),Qa(this,"waiting",(async()=>{try{await this.promiseRef}catch(e){y("Form","搜索帮助获取定义信息的接口出错")}})),Qa(this,"getHelperConfig",(e=>{const{global:t}=e,{name:r,fieldsDefine:n}=this.props.option.searchHelper||{};if(!r)return;if(!t?.searchHelper?.getServerConfig||!t?.searchHelper?.createFetchApi)return v("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise((async(e,a)=>{try{const o=await t.searchHelper.getServerConfig({searchHelperId:r});if(200===o.code){const r=Mn(Object.assign({},o.data,n),i,t.searchHelper.createFetchApi);this.setState({searchHelper:r},(()=>e()))}else a()}catch(e){a()}}))})),this.getHelperConfig(r.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:r,label:n,tooltip:i,fieldName:a,invisible:l,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(n),className:we()(d),tooltip:i,hidden:l,labelCol:{flex:e.verticalLayout?"initial":he(c)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:a,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(n)}},o().createElement(Za,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";f(t,arguments.length>1?arguments[1]:void 0),e.setViewValue(a,t)}}))),p&&o().createElement(L.Col,null,e.renderFormItemButton(a,p)),u&&o().createElement(L.Col,{flex:he(u.labelWidth||yn)},e.renderFormItemExtra({fieldName:a,...u}))))}}Qa(Ja,"contextType",Cr);const eo=Ja;function to(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ro extends a.Component{constructor(){super(...arguments),to(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,fieldName:n,className:i,style:a={},collapse:l={}}=this.props.option,{expand:s}=e.state,{showLimit:c,remarkItems:d=[],onCollapse:u=ae}=l,p=[];if(d.length){const t=e.getBlockDerivedItems().find((e=>e[0].fieldName===n))??[],r=c??t.length-1;t.slice(r+1).forEach((t=>{const r=d.find((e=>e.fieldName===t.fieldName));if(!r)return;const n=r.showLabel?`${t.label}:`:"",i=e.getViewValue(t.fieldName)??"";""!==i&&p.push({...t,text:`${n}${i}`})}))}return o().createElement(L.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},o().createElement(Re,{id:n,label:r,className:i,extra:p.map((e=>e.text)).join(" | "),style:{...a},collapse:s[n],onCollapseChange:t=>{e.setState((e=>({expand:Object.assign({},e.expand,{[n]:t})}))),u(t)}}))}}to(ro,"contextType",Cr);const no=ro;function io(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ao(){return ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ao.apply(this,arguments)}const oo=(e,t,r,n)=>e.map((e=>e[r]===t?{...e,children:n}:e.children?{...e,children:oo(e.children,t,r,n)}:e)),lo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,items:n,multiple:i,loading:a,onChange:l,onValuesChange:s}=e,{fieldName:c,options:d={},style:u={},placeholder:p=f("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:m=!0,asyncLoad:g,readOnly:b,disabled:y}=e.option,{itemList:v,filterable:x=!0,listHeight:E=En,checkStrictly:S,checkStrategy:w="SHOW_CHILD",collapseTags:C,defaultExpandAll:T=!g,defaultExpandedKeys:I,dropdownStyle:N,openPyt:R=!0}=d,[P,O]=o().useState(de(v)?n:v),k=o().useRef(P);Me((()=>{const e=de(v)?n:v;g?(0,te.isEqual)(e,k.current)||(O(e),k.current=e):O(e)}),[v,n]);const A=e=>Hn(P,e)?.text||e?.toString()||"",_=e=>i?e?.map((e=>A(e))).join(",")||"":A(e);return t.isOnlyShow?o().createElement(ri,{value:_(r),bordered:h}):o().createElement(L.TreeSelect,ao({fieldNames:{label:"text",value:"value",children:"children"},value:r,multiple:i,treeCheckable:i,treeCheckStrictly:S,showCheckedStrategy:L.TreeSelect[w],popupClassName:`form-popper__${c}`,dropdownStyle:N,placeholder:p,listHeight:E,style:u,loading:a,bordered:h,allowClear:m,disabled:y,treeDefaultExpandAll:T,treeDefaultExpandedKeys:I,showSearch:x,maxTagCount:C?"responsive":void 0,loadData:g?async e=>{let{key:t,children:r}=e;if(!g||r)return;const{fetchApi:n,params:i,dataKey:a,textKey:o="text",valueKey:l="value",callback:s,formatter:c=(e=>e)}=g;if(n)try{const e=await n(c({...i,[l]:t}));if(200===e.code){const r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,a)??[],n=oo(P,t,l,Fn(r,l,o));O(n),s?.(r)}}catch(e){}}:void 0,treeData:P},i?{title:_(r)}:null,{filterTreeNode:(e,t)=>{const r=t?.text?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(R?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{l?.(e),s(e,_(e),P)})(e)}}))};class so extends a.Component{constructor(){super(...arguments),io(this,"context",void 0),io(this,"state",{itemList:[],loading:!1}),io(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=Fn(t,i,a);this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(lo,{option:this.props.option,items:t,loading:r,multiple:this.props.multiple,onValuesChange:(t,r,n)=>{f(t,r,n),e.setViewValue(l,r)}}))),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}io(so,"contextType",Cr);const co=so;function uo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},po.apply(this,arguments)}const ho=e=>{const{$$form:t}=o().useContext(Cr),{value:r,multiple:n,items:i}=e,{fieldName:a,options:l={},style:s={},placeholder:c=f("qm.form.selectPlaceholder"),bordered:d=!0,allowClear:u=!0,asyncLoad:p,readOnly:h,disabled:m}=e.option,{itemList:g,changeOnSelect:b,checkStrictly:y,checkStrategy:v="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:S=!0}=l,[w,C]=o().useState(de(g)?i:g),T=o().useRef(w);Me((()=>{const e=de(g)?i:g;p?(0,te.isEqual)(e,T.current)||(C(e),T.current=e):C(e)}),[g,i]);const I=e=>Dn(w,e??"").map((e=>e.text)).join("/"),N=e=>n?e?.map((e=>I(e))).join(",")||"":I(e);return t.isOnlyShow?o().createElement(ri,{value:N(r),bordered:d}):o().createElement(L.Cascader,po({value:(e=>de(e)?[]:n?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:w,multiple:n,maxTagCount:"responsive",changeOnSelect:b||y,showCheckedStrategy:L.Cascader[v],popupClassName:`form-popper__${a}`,dropdownStyle:E,placeholder:c,style:s,bordered:d,allowClear:u,disabled:m,showSearch:x&&!p&&{filter:(e,t)=>t.some((t=>{const r=t?.text?.toString()||"",n=ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(S?`${r}|${n}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?async e=>{const t=e[e.length-1];if(!p||t.children)return;const{fetchApi:r,params:n,dataKey:i,textKey:a="text",valueKey:o="value",callback:l,formatter:s=(e=>e)}=p;if(r)try{const e=await r(s({...n,[o]:t.value}));if(200===e.code){const r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[],n=oo(w,t.value,o,Fn(r,o,a));C(n),l?.(r)}}catch(e){}}:void 0},n?{title:N(r)}:null,{onChange:t=>{(t=>{const{onChange:r,onValuesChange:n}=e;r?.(t),n(t,N(t),w)})(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n?e.map((e=>e.join(","))):e.join(",")}(t))}}))};class mo extends a.Component{constructor(){super(...arguments),uo(this,"context",void 0),uo(this,"state",{itemList:[],loading:!1}),uo(this,"getItemList",(async()=>{const{request:e={}}=this.props.option,{fetchApi:t,params:r={},dataKey:n,valueKey:i="value",textKey:a="text",callback:o}=e;if(t){this.setState({loading:!0});try{const e=await t(r);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[],r=Fn(t,i,a);this.setState({itemList:r},(()=>o?.(t)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){const t=e.option.request?.params,r=this.props.option.request?.params;(0,te.isEqual)(t,r)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:r}=this.state,{type:n,label:i,tooltip:a,fieldName:l,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:h,rules:m=[],onChange:f=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(i),className:we()(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":he(d)},required:e.getFormItemRequired(m)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:l,noStyle:!0,rules:m,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(i)}},o().createElement(ho,{option:this.props.option,multiple:t,items:r,onValuesChange:(t,r,n)=>{f(t,r,n),e.setViewValue(l,r)}}))),p&&o().createElement(L.Col,{flex:he(p.labelWidth||yn)},e.renderFormItemExtra({fieldName:l,...p}))))}}uo(mo,"contextType",Cr);const fo=mo,go=require("china-area-data");var bo=n.n(go);function yo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vo=["110000","120000","310000","500000"],xo=["810000","820000"],Eo=[{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"}],So=[{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"}],wo=e=>ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Co=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(!(r>2)&&e[t])return("86"===t?Object.keys(e[t]).filter((e=>![...vo,...xo].includes(e))):Object.keys(e[t])).map((n=>({l:wo(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Co(e,n,r+1)})))},To=(e,t)=>t.map((t=>({l:wo(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Io extends a.Component{constructor(e){super(e),yo(this,"context",void 0),yo(this,"searchRef",o().createRef()),yo(this,"scrollRef",o().createRef()),yo(this,"zxsAndGa",void 0),yo(this,"provinces",void 0),yo(this,"allCities",void 0),yo(this,"letterCities",void 0),yo(this,"state",{visible:!1,select_type:"0",active_key:""}),yo(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),yo(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(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(){this.searchRef.current?.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),Xt()(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){return this.allCities.find((t=>t.c===e))?.n||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:To(bo(),vo)},{l:"Z2",n:"港澳",c:"",p:"",children:To(bo(),xo)}]}createProvince(){return(Co(bo(),"86")??[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return So.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...vo,...xo].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return o().createElement(L.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}))}},o().createElement(L.Radio.Button,{value:"0"},f("qm.form.citySelectType.0")),o().createElement(L.Radio.Button,{value:"1"},f("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?Eo:So).map((t=>o().createElement("li",{key:t.value,className:we()({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return o().createElement(L.Select,{size:"small",placeholder:f("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>(t?.children?.toString()||"").toLowerCase().indexOf(e.toLowerCase())>=0,value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>o().createElement(L.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,r)=>o().createElement("div",{key:r},o().createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),o().createElement("dd",null,t.children?.map((t=>o().createElement("li",{key:t.c,className:we()({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:r}=this.props,{fieldName:n,options:i={},style:a={},placeholder:l=f("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:d=!0,readOnly:u,disabled:p}=this.props.option,h=Ce("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,g=this.createTextValue(r),b=o().createElement("div",{className:"container",style:{...a}},o().createElement("div",{className:"city-drop"},o().createElement("div",{className:"city-drop-toper"},o().createElement("div",{className:"city-drop-toper__type"},this.renderType()),o().createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),o().createElement("div",{className:"city-drop-letter"},this.renderLetter()),o().createElement("div",{ref:this.scrollRef,className:"city-drop-list"},o().createElement("dl",null,this.renderCity(r)))));return o().createElement(c.Consumer,null,(r=>{const i={[h]:!0,[`${h}--lg`]:"large"===r?.size,[`${h}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:g,bordered:s}):o().createElement(Wi(),{action:p?[]:["click"],popupVisible:!p&&t,popup:b,popupClassName:we()(i,`form-popper__${n}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:l,allowClear:d,bordered:s,readOnly:u,disabled:p,style:{width:"100%",...a},value:g,title:g,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}yo(Io,"contextType",Cr);class No extends a.Component{constructor(){super(...arguments),yo(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Io,{option:this.props.option,onValuesChange:(t,r)=>{h(t,r),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}yo(No,"contextType",Cr);const Ro=No;function Po(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oo=(e,t)=>{if(e[t])return Object.keys(e[t]).map((r=>({text:e[t][r],value:r,children:Oo(e,r)})))};class ko extends a.Component{constructor(e){super(e),Po(this,"context",void 0),Po(this,"searchRef",o().createRef()),Po(this,"prevText",void 0),Po(this,"handleVisibleChange",(e=>{this.setState({visible:e})})),Po(this,"triggerChange",(e=>{const{onChange:t,onValuesChange:r}=this.props;t?.(e),r(e,this.createTextValue(e)),this.handleVisibleChange(!1)}));const t=Oo(bo(),"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:r}=this.props;t!==r&&this.state.values.join(",")!==(r??"")&&this.initial()}get isFetch(){return!!this.props.option.request?.fetchApi}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){this.searchRef.current?.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>this.state.tabs[t]?.find((t=>t.value===e))?.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 r=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const i=Hn(e,t[n]);if(i&&de(i.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(i?.children)&&(r[n+1]=i?.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:r})}async getStreetList(e){const{request:t={}}=this.props.option,{fetchApi:r,formatter:n=(e=>e),dataKey:i,valueKey:a="value",textKey:o="text"}=t;if(r)try{const t=await r(n({code:e}));if(200===t.code){const e=Array.isArray(t.data)?t.data:(0,te.get)(t.data,i)??[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[a]})))]})))}}catch(e){}}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,r)=>{const n=t.find((t=>t.value===e[r]))?.text||`${f("qm.form.selectPlaceholder").replace("...","")}(${f("qm.form.regionSelectLabel")[r]})`;return o().createElement(cr.TabPane,{key:r.toString(),tab:n},o().createElement("div",{className:"region-box"},t.map((t=>o().createElement("span",{key:t.value,className:we()({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[r]=t.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},t.text)))))}));return t.length?o().createElement(cr,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):o().createElement(ft,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:r}=this.props,{fieldName:n,options:i={},style:a={},placeholder:l=f("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:d=!0,readOnly:u,disabled:p}=this.props.option,h=Ce("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,g=o().createElement("div",{className:"container"},this.renderTabs());let b=this.prevText;if(!t){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(b=e,this.prevText=b)}return o().createElement(c.Consumer,null,(r=>{const i={[h]:!0,[`${h}--lg`]:"large"===r?.size,[`${h}--sm`]:"small"===r?.size};return e.isOnlyShow?o().createElement(ri,{value:b,bordered:s}):o().createElement(Wi(),{action:p?[]:["click"],popupVisible:!p&&t,popup:g,popupClassName:we()(i,`form-popper__${n}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:wn,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("div",null,o().createElement(L.Input,{ref:this.searchRef,placeholder:l,allowClear:d,bordered:s,style:{width:"100%",...a},readOnly:u,disabled:p,value:b,title:b,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&se((()=>this.initial()))}})))}))}}Po(ko,"contextType",Cr);class Ao extends a.Component{constructor(){super(...arguments),Po(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(ko,{option:this.props.option,onValuesChange:(t,r)=>{h(t,r),e.setViewValue(i,r)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Po(Ao,"contextType",Cr);const Lo=Ao;function _o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fileTypes:h,fileSize:m,fileDirection:g,onPreview:b,onRemove:y}=a,{action:v,headers:x,params:E,withCredentials:S=!1,dataKey:w="",downloadWithHeaders:C,fieldAliasMap:T,beforeUpload:I,button:N}=l,R="function"==typeof T?T():T||{};return o().createElement(xl,{name:"file",action:v,multiple:u,headers:x,data:E,withCredentials:S,downloadWithHeaders:C,beforeUpload:I,maxCount:p,fileTypes:h,fileSize:m,fileDirection:g,disabled:c,readOnly:t.isOnlyShow||d,button:N,showUploadList:{showDownloadIcon:!0,downloadIcon:o().createElement(Te.DownloadOutlined,null)},fileList:r,onChange:e=>{let{file:t,fileList:r}=e;(e=>{const t=e.map((e=>{const t=e.response||{},r={};for(const n in R)r[n]=e[n]||t.data?.[R[n]]||"";return e.response&&200!==t.code&&L.message.error(t.message||f("qm.uploadCropper.uploadError")),{uid:e.uid,name:e.name,...r,url:e.url||(w?(0,te.get)(t.data,w):t.data)||"",status:e.status}}));n?.(t),t.every((e=>"done"===e.status&&e.url))&&i(t)})(r)},onPreview:b,onRemove:y})};class Ho extends a.Component{constructor(){super(...arguments),_o(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Fo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,"")}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}_o(Ho,"contextType",Cr);const Do=Ho;function $o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l={},style:s={},disabled:c,readOnly:d}=e.option,{multiple:u=!0,maxCount:p=1,fixedSize:h,quality:m,openCropper:g,fileTypes:b,fileSize:y,onRemove:v}=a,{action:x,headers:E,params:S,withCredentials:w=!1,dataKey:C="",popupClassName:T,fieldAliasMap:I,beforeUpload:N}=l,R="function"==typeof I?I():I||{};return o().createElement(Nl,{name:"file",action:x,multiple:u,headers:E,data:S,withCredentials:w,popupClassName:T,beforeUpload:N,maxCount:p,fixedSize:h,quality:m,openCropper:g,fileTypes:b,fileSize:y,disabled:c,readOnly:t.isOnlyShow||d,fileList:r,onChange:e=>{let{file:t,fileList:r}=e;(e=>{const t=e.map((e=>{const t=e.response||{},r={};for(const n in R)r[n]=e[n]||t.data?.[R[n]]||"";return e.response&&200!==t.code&&L.message.error(t.message||f("qm.uploadCropper.uploadError")),{uid:e.uid,name:e.name,...r,url:e.url||(C?(0,te.get)(t.data,C):t.data)||"",status:e.status}}));n?.(t),t.every((e=>"done"===e.status&&e.url))&&i(t)})(r)},onRemove:v})};class Mo extends a.Component{constructor(){super(...arguments),$o(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(qo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,"")}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}$o(Mo,"contextType",Cr);const jo=Mo;function Ko(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vo=e=>{const{$$form:t}=o().useContext(Cr),{value:r,onChange:n,onValuesChange:i}=e,{options:a={},upload:l,style:s={},readOnly:c,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:h}=a;return o().createElement(ml,{value:r,tinymce:u,upload:l,thresholdSize:p,style:{width:"100%",...s},disabled:d||c||t.isOnlyShow,onResizeEditor:h,onChange:e=>{(e=>{n?.(e),i(e)})(e)}})};class zo extends a.Component{constructor(){super(...arguments),Ko(this,"context",void 0)}render(){const{$$form:e}=this.context,{type:t,label:r,tooltip:n,fieldName:i,invisible:a,options:l={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:h=ae}=this.props.option;return o().createElement(L.Form.Item,{label:e.renderFormLabel(r),className:we()(c),tooltip:n,hidden:a,labelCol:{flex:e.verticalLayout?"initial":he(s)},required:e.getFormItemRequired(p)},o().createElement(L.Row,{wrap:!1,gutter:4},o().createElement(L.Col,{flex:"auto"},o().createElement(L.Form.Item,{name:i,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},o().createElement(Vo,{option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(i,t)}}))),d&&o().createElement(L.Col,{flex:he(d.labelWidth||yn)},e.renderFormItemExtra({fieldName:i,...d}))))}}Ko(zo,"contextType",Cr);const Bo=zo;function Uo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Wo extends a.Component{constructor(e){super(e),Uo(this,"context",void 0),Uo(this,"provide",{$$form:this,echo_data:{}}),Uo(this,"_initialValues",void 0),Uo(this,"_initialOthers",void 0),Uo(this,"_initialExtras",void 0),Uo(this,"_fieldAuth",{}),Uo(this,"wrapperRef",o().createRef()),Uo(this,"formRef",o().createRef()),Uo(this,"originItems",[]),Uo(this,"state",{formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:this.props.cols??4,collapse:!!this.props.defaultExpand}),Uo(this,"resizeObserveHandler",(()=>{const e=this.wrapperRef.current?.offsetWidth;if(void 0===e||0===e||this.props.cols>0)return;let t=Math.floor(e/300);t=24%t==0?t:t-1,t=t<1?1:t,t=t>8?8:t,t!==this.state.flexCols&&this.setState({flexCols:t})})),Uo(this,"resizeListenerHandle",(0,te.debounce)(this.resizeObserveHandler,10)),Uo(this,"getFormItems",wr()((e=>e.filter((e=>!e.noAuth&&!e.hidden))))),Uo(this,"getFlattenItems",wr()((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{(0,te.isPlainObject)(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t}))),Uo(this,"valuesChangeHandle",((e,t)=>{this.props.onValuesChange?.(e,this._initialValues)})),Uo(this,"fieldsChangeHandle",((e,t)=>{this.props.onFieldsChange?.(e,t)})),Uo(this,"finishHandle",(e=>{this.props.onFinish?.(Object.assign({},this.get_fields_other(),this.formatFormValue(e)))})),Uo(this,"finishFailedHandle",(e=>{let{values:t,errorFields:r}=e;this.props.onFinishFailed?.(r)})),Uo(this,"openValidateInfo",(e=>{const t=o().createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return o().createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));L.notification.error({message:f("qm.form.validatePrompt"),description:t,duration:10})})),Uo(this,"scrollToField",(e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Xt()(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})})),this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){return this.props.size??this.context.size??""}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(){const e=this.context.global;return this.props.compactMode??("small"===this.$size&&!!e?.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(){Tt(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){It(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&&v("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)),r={};for(const n in e)t.includes(n)||(r[n]=e[n]);return Object.assign({},r)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>(0,te.isPlainObject)(e.extra))).forEach((r=>{t[r.fieldName]=e[r.fieldName]??""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>(0,te.isPlainObject)(e.collapse))).forEach((t=>{e[t.fieldName]=t.collapse.defaultExpand??!1})),Object.assign({},e)}getInitialValue(e,t){const{type:r,options:n}=e;return t=t??void 0,Sn.includes(r)&&(t=t??[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=t??n?.falseValue??xn),t}createFormValue(e){const t={};return this.flattenItems.forEach((r=>{t[r.fieldName]=this.getInitialValue(r,e[r.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=pe(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((r=>({viewData:Object.assign({},r.viewData,{[e]:t})})))}getViewValue(e){return this.state.viewData[e]??""}setExpandHandle(e){e!==this.state.collapse&&(this.setState({collapse:e}),this.props.onCollapse?.(e),se((()=>this.props.onCollapse?.(e))))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:r}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!r||setTimeout((()=>this.CREATE_FOCUS(r)))}getFormItemLabel(e){if($n(e))return qn(e);if((0,te.isPlainObject)(e)){const{fieldName:t,label:r,options:n={}}=e;if($n(r))return qn(r);const{itemList:i=[]}=n,a=this.formRef.current?.getFieldsValue([t])[t]??this._initialValues[t]??i[0]?.value;return i.find((e=>e.value===a))?.text||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,r=this.dividers.length;t<r;t++){const r=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(r,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay(e){let{type:t,fieldName:r}=e;if("DIVIDER"===t)return!0;const n=this.getBlockDerivedItems();for(let e=0,t=n.length;e<t;e++){const t=n[e],i=this.dividers.find((e=>e.fieldName===t[0].fieldName)),a=i?.collapse?.showLimit??t.length-1;for(let e=1;e<t.length;e++)if(t[e].fieldName===r&&e>a)return this.state.expand[t[0].fieldName]}return!0}formatFormValue(e){for(const t in e){const r=e[t];if(kn(r)&&(e[t]=""),Array.isArray(r)&&r.forEach(((r,n)=>{kn(r)&&(e[t][n]="")})),t.includes("|")&&Array.isArray(r)){const[n,i]=t.split("|");e[n]=r[0]??"",e[i]=r[1]??""}}if(this.isFilterType)for(const t in e)de(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}async createFormAuth(){const{authConfig:e}=this.props;if(!e)return;let t=ue(e,["fetch"]);if(e.fetch){const{api:r,params:n,dataKey:i}=e.fetch;try{const e=await r(n);200===e.code&&(t=(i?(0,te.get)(e.data,i):e.data)??{})}catch(e){}}if(Array.isArray(t.fieldList)){const e=this.props.items.map((e=>{const{fieldName:r}=e,n=t.fieldList.find((e=>e.dataIndex===r));if(n){const t=this.originItems.find((e=>e.fieldName===r)),{visible:i=1,disabled:a,secretName:o}=n;i||(e.noAuth=!0,t.noAuth=!0),a&&(e.disabled=!0,t.disabled=!0),o&&(e.options?e.options.secretType=o:e.options={secretType:o},t.options=Object.assign({},t.options,{secretType:o})),this.setFieldAuth(r,{visible:i,disabled:a,secretName:o})}return e}));this.props.fieldsChange?.(e)}}INPUT(e){return o().createElement(xi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return o().createElement(Ci,{option:e})}INPUT_NUMBER(e){return o().createElement(Oi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return o().createElement(_i,{option:e})}SEARCH_HELPER(e){return o().createElement(Mi,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return o().createElement(Qi,{option:e})}TREE_TABLE_HELPER(e){return o().createElement(ra,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return o().createElement(sa,{option:e})}RANGE_SEARCH_HELPER(e){return o().createElement(ha,{option:e})}CHECKBOX(e){return o().createElement(pi,{option:e})}MULTIPLE_CHECKBOX(e){return o().createElement(ba,{option:e})}RATE(e){return o().createElement(Ea,{option:e})}RADIO(e){return o().createElement(Ta,{option:e})}SWITCH(e){return o().createElement(Pa,{option:e})}TEXT_AREA(e){return o().createElement(La,{option:e})}DATE(e){return o().createElement(Da,{option:e})}RANGE_DATE(e){return o().createElement(Ka,{option:e})}TIME(e){return o().createElement(Ua,{option:e})}RANGE_TIME(e){return o().createElement(Xa,{option:e})}SELECT(e){return o().createElement(si,{option:e})}MULTIPLE_SELECT(e){return o().createElement(si,{option:e,multiple:!0})}IMMEDIATE(e){return o().createElement(eo,{option:e})}DIVIDER(e){return o().createElement(no,{option:e})}TREE_SELECT(e){return o().createElement(co,{option:e})}MULTIPLE_TREE_SELECT(e){return o().createElement(co,{option:e,multiple:!0})}CASCADER(e){return o().createElement(fo,{option:e})}MULTIPLE_CASCADER(e){return o().createElement(fo,{option:e,multiple:!0})}CITY_SELECT(e){return o().createElement(Ro,{option:e})}REGION_SELECT(e){return o().createElement(Lo,{option:e})}UPLOAD_FILE(e){return o().createElement(Do,{option:e})}UPLOAD_IMG(e){return o().createElement(jo,{option:e})}TINYMCE(e){return o().createElement(Bo,{option:e})}renderFormLabel(e){if($n(e)||!(0,te.isPlainObject)(e))return e;const{type:t,fieldName:r,label:n,options:i={},onChange:a=ae}=e,{itemList:l=[]}=i;return"SELECT"===t?o().createElement(L.Form.Item,{name:r,noStyle:!0},o().createElement(oi,{option:e,items:l,loading:!1,onValuesChange:(e,t)=>a(e,t)})):"CHECKBOX"===t?o().createElement(o().Fragment,null,o().createElement("span",{style:{paddingRight:5}},n),o().createElement(L.Form.Item,{name:r,noStyle:!0},o().createElement(di,{option:e,onValuesChange:e=>a(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:r,style:n={},render:i}=e,{extra:a}=this.state;if(r)return o().createElement(L.Tooltip,{className:"extra-tooltip",title:a[t]},o().createElement(Te.ExclamationCircleOutlined,{style:{marginLeft:4}}));const l=this.formItems.find((e=>e.fieldName===t));return o().createElement("div",{className:"extra-text",title:i?"":a[t],style:n},o().createElement("span",{className:"extra-overflow-cut"},i?i(l,this):a[t]))}renderFormItemButton(e,t){const r=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(r):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:r,invisible:n,tooltip:i,className:a,labelWidth:l=this.props.labelWidth,validateTrigger:s,rules:c=[],style:d={},render:u}=e;return de(this.state.formData)?null:o().createElement(L.Form.Item,{label:this.renderFormLabel(t),name:r,rules:c,tooltip:i,hidden:n,className:we()(a),style:{width:"100%",...d},labelCol:{flex:this.verticalLayout?"initial":he(l)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(t)}},u?.(e,this))}createFormItem(e){return(0,te.isFunction)(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(v("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:r,isFieldsDefine:n}=this.props,i=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:r=0}=e;for(let e=0;e<t;e++)i.push({});i.push(e);for(let e=0;e<r;e++)i.push({})}));const a=24/e,l=[],s=i.reduce(((e,t)=>{const{selfCol:r=1}=t,n=e+r;return l.push(n),n}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=i.map(((t,r)=>{let{selfCol:n=1}=t;const{type:i,fieldName:s}=t;n=n>=24||"DIVIDER"===i||"TINYMCE"===i?e:n;const u=!(!this.state.collapse&&this.showFilterCollapse)||l[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(t);return u&&d.push(l[r]),o().createElement(L.Col,{key:s??r,className:s,span:n*a,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},i?this.createFormItem(pe(t)):null)}));return n&&"default"===t&&u.push(o().createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{flexCols:t,collapse:r}=this.state,{searchButtonCols:n,isSearchBtn:i,isFieldsDefine:a=!0}=this.props;if(!this.isFilterType)return null;const l=24/t,s=n||1,c=t-e%t-s;return i?o().createElement(L.Col,{key:"-",span:s*l,offset:c*l,style:{textAlign:"right"}},o().createElement(L.Space,{style:{marginBottom:12}},o().createElement(be,{type:"primary",size:this.$size,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},f("qm.form.search")),o().createElement(be,{size:this.$size,icon:o().createElement(Te.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},f("qm.form.reset")),a?this.createFieldsDefine():null,this.showFilterCollapse&&o().createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)," ",f(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const n=24/e;return r&&"default"===t?o().createElement(L.Row,{gutter:0},o().createElement(L.Col,{key:"-",span:n},o().createElement(L.Form.Item,null,o().createElement(L.Space,{style:{marginBottom:12}},o().createElement(be,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},f("qm.form.save")),o().createElement(be,{size:this.$size,onClick:()=>this.RESET_FORM()},f("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:r}=this.props;return o().createElement(gi,{uniqueKey:e,items:t,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise((async(e,t)=>{const[r,n]=await this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>this[`${e.fieldName}_Ref`]?.searchRef._is_change)).map((e=>({name:[e.fieldName],errors:[f("qm.form.searchHelperTips")],warnings:[]})));r||i.length?t((r||[]).concat(i)):e(n)}))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}async GET_FORM_DATA(){try{const e=await 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]}}async VALIDATE_FIELDS(e){try{return[null,await 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)}async SUBMIT_FORM(){try{await this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}RESET_FORM(){const e=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),t=this.flattenItems.map((e=>e.fieldName)).filter((t=>!e.includes(t)));t.length&&this.formRef.current.resetFields(t),this.setState((e=>{const t=Object.keys(e.other),r=Object.keys(this._initialOthers),n=t.filter((e=>!r.includes(e))),i={};return n.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),this.props.onReset?.()}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){v("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,r){const{items:n,fieldsChange:i}=this.props,a=n.find((t=>t.fieldName===e));if(!a)return v("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!(0,te.isPlainObject)(t))return v("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(a.noAuth)return v("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const r in t)r&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===r||(0,te.set)(a,r,t[r]));r&&(i?i([...n]):v("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:r,disabled:n,labelWidth:i,labelAlign:a,labelWrap:l,customClass:s}=this.props,c=Ce("form"),d={required:"${label}"+f("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return o().createElement("div",{ref:this.wrapperRef,className:we()(u,e),style:t},o().createElement(L.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:a,labelWrap:l,colon:!1,disabled:n,labelCol:{flex:this.verticalLayout?"initial":he(i)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},o().createElement(Cr.Provider,{value:this.provide},o().createElement(L.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}Uo(Wo,"contextType",c),Uo(Wo,"propTypes",Nn),Uo(Wo,"defaultProps",Rn);const Go=Wo,Yo={onActivate:l.func,onAddUndo:l.func,onBeforeAddUndo:l.func,onBeforeExecCommand:l.func,onBeforeGetContent:l.func,onBeforeRenderUI:l.func,onBeforeSetContent:l.func,onBeforePaste:l.func,onBlur:l.func,onChange:l.func,onClearUndos:l.func,onClick:l.func,onContextMenu:l.func,onCommentChange:l.func,onCopy:l.func,onCut:l.func,onDblclick:l.func,onDeactivate:l.func,onDirty:l.func,onDrag:l.func,onDragDrop:l.func,onDragEnd:l.func,onDragGesture:l.func,onDragOver:l.func,onDrop:l.func,onExecCommand:l.func,onFocus:l.func,onFocusIn:l.func,onFocusOut:l.func,onGetContent:l.func,onHide:l.func,onInit:l.func,onKeyDown:l.func,onKeyPress:l.func,onKeyUp:l.func,onLoadContent:l.func,onMouseDown:l.func,onMouseEnter:l.func,onMouseLeave:l.func,onMouseMove:l.func,onMouseOut:l.func,onMouseOver:l.func,onMouseUp:l.func,onNodeChange:l.func,onObjectResizeStart:l.func,onObjectResized:l.func,onObjectSelected:l.func,onPaste:l.func,onPostProcess:l.func,onPostRender:l.func,onPreProcess:l.func,onProgressState:l.func,onRedo:l.func,onRemove:l.func,onReset:l.func,onSaveContent:l.func,onSelectionChange:l.func,onSetAttrib:l.func,onSetContent:l.func,onShow:l.func,onSubmit:l.func,onUndo:l.func,onVisualAid:l.func,onSkinLoadError:l.func,onThemeLoadError:l.func,onModelLoadError:l.func,onPluginLoadError:l.func,onIconsLoadError:l.func,onLanguageLoadError:l.func},Xo={apiKey:l.string,id:l.string,inline:l.bool,init:l.object,initialValue:l.string,onEditorChange:l.func,value:l.string,tagName:l.string,cloudChannel:l.string,plugins:l.oneOfType([l.string,l.array]),toolbar:l.oneOfType([l.string,l.array]),disabled:l.bool,textareaName:l.string,tinymceScriptSrc:l.string,rollback:l.oneOfType([l.number,l.oneOf([!1])]),scriptLoading:l.shape({async:l.bool,defer:l.bool,delay:l.number}),...Yo},Qo=e=>"function"==typeof e,Zo=e=>e in Yo,Jo=e=>e.substr(2),el=(e,t,r,n,i)=>((t,r,n,i,a,o,l)=>{const s=Object.keys(a).filter(Zo),c=Object.keys(o).filter(Zo),d=s.filter((e=>void 0===o[e])),u=c.filter((e=>void 0===a[e]));d.forEach((e=>{const t=Jo(e),r=l[t];n(t,r),delete l[t]})),u.forEach((n=>{const i=((t,r)=>n=>t(r)?.(n,e))(t,n),a=Jo(n);l[a]=i,r(a,i)}))})(i,e.on.bind(e),e.off.bind(e),0,t,r,n);let tl=0;const rl=e=>{const t=Date.now(),r=Math.floor(1e9*Math.random());return tl++,e+"_"+r+tl+String(t)},nl=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),il=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),al=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},ol=()=>({listeners:[],scriptId:rl("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),ll=(()=>{let e=ol();return{load:(t,r,n,i,a,o)=>{const l=()=>((t,r,n,i,a,o)=>{const l=r.createElement("script");l.referrerPolicy="origin",l.type="application/javascript",l.id=t,l.src=n,l.async=i,l.defer=a;const s=()=>{l.removeEventListener("load",s),e.listeners.forEach((e=>e())),e.scriptLoaded=!0};l.addEventListener("load",s),r.head&&r.head.appendChild(l)})(e.scriptId,t,r,n,i);e.scriptLoaded?o():(e.listeners.push(o),e.scriptLoading||(e.scriptLoading=!0,a>0?setTimeout(l,a):l()))},reinitialize:()=>{e=ol()}}})(),sl=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};function cl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class dl extends a.Component{constructor(e){var t;super(e),t=this,cl(this,"editor",void 0),cl(this,"id",void 0),cl(this,"elementRef",void 0),cl(this,"inline",void 0),cl(this,"currentContent",void 0),cl(this,"boundHandlers",void 0),cl(this,"rollbackTimer",void 0),cl(this,"valueCursor",void 0),cl(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})),cl(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){}})),cl(this,"handleBeforeInputSpecial",(e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)})),cl(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))}})),cl(this,"handleEditorChangeSpecial",(e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)})),cl(this,"initialise",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=t.elementRef.current;if(!r)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,r=e.parentNode;for(;null!=r;)t=r,r=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 n=sl(t.view);if(!n)throw new Error("tinymce should have been loaded into global scope");const i={...t.props.init,selector:void 0,target:r,readonly:t.props.disabled,inline:t.inline,plugins:(a=t.props.init?.plugins,o=t.props.plugins,il(a).concat(il(o))),toolbar:t.props.toolbar??t.props.init?.toolbar,setup:e=>{t.editor=e,t.bindHandlers({}),t.inline&&!nl(r)&&e.once("PostRender",(r=>{e.setContent(t.getInitialValue(),{no_events:!0})})),t.props.init&&Qo(t.props.init.setup)&&t.props.init.setup(e)},init_instance_callback:e=>{const r=t.getInitialValue();t.currentContent=t.currentContent??e.getContent(),t.currentContent!==r&&(t.currentContent=r,e.setContent(r),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const n=t.props.disabled??!1;al(t.editor,n?"readonly":"design"),t.props.init&&Qo(t.props.init.init_instance_callback)&&t.props.init.init_instance_callback(e)}};var a,o;t.inline||(r.style.visibility=""),nl(r)&&(r.value=t.getInitialValue()),n.init(i)})),this.id=this.props.id||rl("tiny-react"),this.elementRef=a.createRef(),this.inline=this.props.inline??this.props.init?.inline??!1,this.boundHandlers={}}get view(){return this.elementRef.current?.ownerDocument.defaultView??window}componentDidUpdate(e){if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=this.currentContent??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 r=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,r])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=this.props.disabled??!1;al(this.editor,e?"readonly":"design")}}}componentDidMount(){null!==sl(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&ll.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),this.props.scriptLoading?.async??!1,this.props.scriptLoading?.defer??!1,this.props.scriptLoading?.delay??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(){const e=sl(this.view)?.Env?.browser?.isIE();return e?"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 a.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return a.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){el(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,r=t(e),n=t(this.props);!r&&n?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):r&&!n&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}function ul(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}cl(dl,"propTypes",Xo),cl(dl,"defaultProps",{cloudChannel:"6"});var pl=function(e){return e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en",e}(pl||{});class hl extends a.Component{constructor(){super(...arguments),ul(this,"context",void 0),ul(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(){const{size:e,className:t,style:r,tinymce:n={},upload:i={},thresholdSize:a=.5,tinymceScriptSrc:l,disabled:s,value:c,onResizeEditor:d,onChange:u}=this.props,p=this.context.global,h=this.context.locale,m=e||this.context.size||"",g=Ce("tinymce"),b={[g]:!0,[`${g}--lg`]:"large"===m,[`${g}--sm`]:"small"===m},y={init:{height:n.height||this.defaultOption.height,plugins:n.plugins||this.defaultOption.plugins,toolbar:n.toolbar||this.defaultOption.toolbar,menubar:n.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:pl[h],skin:"tinymce-5",...ue(n,["height","plugins","toolbar","menubar"]),images_upload_handler:e=>new Promise((async(t,r)=>{const{action:n,headers:o,dataKey:l}=i,s=`data:image/jpeg;base64,${e.base64()}`,c=new FormData;c.append("file",e.blob(),e.filename());const d=e.blob().size;if(n&&d/1024/1024>a)try{const e=await fetch(n,{method:"POST",body:c,headers:o});if(!e.ok)throw new Error(f("qm.upload.uploadError"));const r=await e.json();200===r.code&&t(l?(0,te.get)(r.data,l):r.data)}catch(e){L.message.error(f("qm.uploadCropper.uploadError"))}else t(s)})),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:r,offsetHeight:n}=e.editorContainer;d?.({width:r,height:n},t)}))}},value:c,disabled:s,tinymceScriptSrc:l||p?.tinymce?.scriptSrc||void 0,onEditorChange:(e,t)=>{u?.(t.getContent(),t)}};return o().createElement("div",{className:we()(b,t),style:r},o().createElement(dl,y))}}ul(hl,"contextType",c),ul(hl,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Tinymce","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")}});const ml=hl,fl=require("cropperjs");var gl=n.n(fl);function bl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yl extends a.Component{constructor(){super(...arguments),bl(this,"imgRef",o().createRef()),bl(this,"cropper",void 0)}componentDidMount(){const{className:e,style:t,src:r,alt:n,imgStyle:i,...a}=this.props,o={};for(const e in a)void 0!==this.props[e]&&(o[e]=this.props[e]);this.cropper=new(gl())(this.imgRef.current,o)}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:r,alt:n,imgStyle:i}=this.props,a=Ce("cropper"),l={[a]:!0};return o().createElement("div",{className:we()(l,e),style:t},o().createElement("img",{ref:this.imgRef,src:r,alt:n,style:{maxWidth:"100%",...i}}))}}bl(yl,"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});const vl=yl,xl=Kt;function El(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Sl extends a.Component{constructor(){super(...arguments),El(this,"context",void 0),El(this,"cropperRef",o().createRef()),El(this,"beforeUploadRef",void 0),El(this,"fileRef",void 0),El(this,"resolveRef",void 0),El(this,"rejectRef",void 0),El(this,"state",{src:""}),El(this,"confirmHandle",(async()=>{const{quality:e}=this.props,{type:t,name:r,uid:n}=this.fileRef;this.cropperRef.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===t?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((async e=>{let i=new File([e],r,{type:t});Object.assign(i,{uid:n});const{fileTypes:a=[],fileSize:o}=this.props;if(a.length&&!a.includes(i.name.slice(i.name.lastIndexOf(".")+1).toLowerCase()))return L.message.warning(f("qm.upload.tooltip",{type:a.join(",")})),this.rejectRef("file type is error");if("function"!=typeof this.beforeUploadRef)return this.resolveRef(i);const l=this.beforeUploadRef(i,[i]);if("boolean"==typeof l||l){if(!0===l)return this.resolveRef(i);if(!1===l)return this.rejectRef("not upload");if(l&&"function"==typeof l.then)try{const e=await l,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(i=e),this.resolveRef(i)}catch(e){this.rejectRef(e)}}else v("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}),t,e),await le(100),this.onClose()})),El(this,"onOk",(()=>{this.confirmHandle()})),El(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,r=Array.isArray(e)?e[0]:e;if(!r)return null;const{beforeUpload:n,...i}=r.props;return this.beforeUploadRef=n,o().createElement(r.type,{...i,beforeUpload:(e,r)=>new Promise((async(n,i)=>{const a=()=>n(L.Upload.LIST_IGNORE);if(t&&!await t(e,r))return void a();this.fileRef=e,this.resolveRef=n,this.rejectRef=a;const o=new FileReader;o.onload=()=>{this.setSrc(o.result),o.onload=null},o.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 o().createElement("div",{className:"cropper-preview"},o().createElement("div",{className:"cropper-area"},o().createElement("div",{className:"img-cropper"},o().createElement(vl,{ref:this.cropperRef,aspectRatio:e?e[0]/e[1]:e,src:this.state.src,dragMode:"move",preview:".preview"})),o().createElement("div",{className:"actions"},o().createElement(L.Space,{size:"small"},o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.ZoomInOutlined,null),onClick:()=>this.scaleHandle(.2)},f("qm.uploadCropper.zoomIn")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.ZoomOutOutlined,null),onClick:()=>this.scaleHandle(-.2)},f("qm.uploadCropper.zoomOut")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.RotateRightOutlined,null),onClick:()=>this.rotateHandle(90)},f("qm.uploadCropper.rotatePlus")),o().createElement(L.Button,{type:"primary",size:"middle",icon:o().createElement(Te.RotateLeftOutlined,null),onClick:()=>this.rotateHandle(-90)},f("qm.uploadCropper.rotateSubtract"))))),o().createElement("div",{className:"preview-area"},o().createElement("div",{className:"preview",style:this.previewSize})))}render(){const{className:e}=this.props,{src:t}=this.state,r=Ce("cropper-preview");return o().createElement(o().Fragment,null,this.renderUpload(),t&&o().createElement(L.Modal,{open:!0,wrapClassName:we()(r,e),title:f("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:this.onOk,onCancel:this.onClose,maskClosable:!1,destroyOnClose:!0},this.renderCropper()))}}El(Sl,"contextType",c);const wl=Sl;function Cl(){return Cl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cl.apply(this,arguments)}function Tl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Il extends a.Component{constructor(){super(...arguments),Tl(this,"context",void 0),Tl(this,"state",{previewVisible:!1,currentIndex:0}),Tl(this,"isFocused",!1),Tl(this,"beforeUpload",((e,t)=>new Promise((async(r,n)=>{const{fileTypes:i=[],fileSize:a,beforeUpload:o}=this.props,l=!i.length||i.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),s=!a||e.size/1024/1024<a,c=l&&s;if(l||L.message.warning(f("qm.upload.tooltip",{type:i.join(",")})),s||L.message.warning(f("qm.upload.sizeLimit",{size:a})),!c)return L.Upload.LIST_IGNORE;if(o){const i=o(e,t);if(!0===i)return r(e);if(!1===i)return n("not upload");if(i&&"function"==typeof i.then)try{r(await i)}catch(e){n(e)}}else r(e)})))),Tl(this,"handlePreview",(e=>{this.setState({currentIndex:this.props.fileList?.findIndex((t=>t.url===e.url))||0,previewVisible:!0})})),Tl(this,"handlePaste",(async e=>{const{fileList:t=[],action:r,data:n,headers:i,onChange:a}=this.props;if(this.isFocused&&this.showUploadButton&&r)for(const o of e.clipboardData.items)if("file"===o.kind&&o.type.startsWith("image/")){const e=o.getAsFile(),l=Date.now(),s=new File([e],`screenshot-${l}.png`,{type:e.type});Object.assign(s,{uid:`rc-upload-${l}`});try{await this.beforeUpload(s,[...t,s]);const e=new FormData;if(e.append("file",s),n)for(const t in n)e.append(t,n[t]);const o="string"==typeof r?r:await r(s),l=await fetch(o,{method:"POST",body:e,headers:i});if(!l.ok)throw new Error(f("qm.upload.uploadError"));const c=await l.json();a?.({file:s,fileList:[...t,{uid:s.uid,lastModified:s.lastModified,lastModifiedDate:s.lastModifiedDate,name:s.name,type:s.type,size:s.size,response:c,status:"done",percent:100,originFileObj:s}]})}catch(e){}}}))}get $size(){return this.context.size??""}get showUploadButton(){const e=this.props.fileList?.length??0;return!this.props.maxCount||e<this.props.maxCount}componentDidMount(){document.addEventListener("paste",this.handlePaste)}componentDidUpdate(e){const{fileList:t}=e,{fileList:r}=this.props;t===r||this.showUploadButton||(this.isFocused=!1)}componentWillUnmount(){document.removeEventListener("paste",this.handlePaste)}render(){const{previewVisible:e,currentIndex:t}=this.state,{fileList:r=[],fixedSize:n,quality:i,fileTypes:a,fileSize:l,disabled:s,readOnly:c,className:d,popupClassName:u,openCropper:p,beforeCrop:h}=this.props,m=Ce("upload-img"),g={[m]:!0,[`${m}--lg`]:"large"===this.$size,[`${m}--sm`]:"small"===this.$size},b=s||c,y=o().createElement(L.Upload,Cl({className:we()(g,d)},ue(this.props,["fileTypes","fileSize","fixedSize","quality"]),{beforeUpload:this.beforeUpload,disabled:b,onPreview:this.handlePreview,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,r,n)=>o().createElement("div",{className:"upload-item"},e,!b&&o().createElement(Te.CloseOutlined,{title:f("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),!this.showUploadButton||c&&r.length?null:o().createElement(o().Fragment,null,o().createElement("p",{className:"ant-upload-drag-icon"},o().createElement(Te.InboxOutlined,null)),o().createElement("p",{className:"ant-upload-text"},f("qm.uploadCropper.dragableText")),o().createElement("button",{className:we()("ant-upload-button",{disabled:b}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{this.isFocused=!0},onBlur:()=>{this.isFocused=!1}},f("qm.uploadCropper.pasteText"))));return o().createElement(o().Fragment,null,p?o().createElement(wl,{className:u,fixedSize:n,quality:i,fileTypes:a,fileSize:l,beforeCrop:h},y):y,o().createElement("div",{style:{display:"none"}},o().createElement(L.Image.PreviewGroup,{preview:{visible:e,current:t,rootClassName:u,onVisibleChange:e=>{this.setState({previewVisible:e})}}},r.map((e=>o().createElement(L.Image,{key:e.uid,src:e.url,alt:""}))))))}}Tl(Il,"contextType",c),Tl(Il,"defaultProps",{name:"file",multiple:!0,accept:"image/*",listType:"picture-card",quality:1,openCropper:!0});const Nl=Il,Rl=(e,t,r)=>{let n;for(let i=0;i<e.length;i++){const a=e[i];if(a.children)if(a.children.some((e=>e[r]===t)))n=a[r];else{const e=Rl(a.children,t,r);e&&(n=e)}}return n},Pl=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&Pl(e.children,t),t(e)||e.children&&e.children.length))),Ol=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...Ol(e.children,t)),t(e)&&r.push(e)})),r},kl=(e,t)=>{let r=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(r=kl(e[n].children,t)),r)return r;if(t(e[n]))return e[n]}return r},Al=(e,t,r,n)=>e.map((e=>e[r]===t?{...e,children:n}:e.children?{...e,children:Al(e.children,t,r,n)}:e)),Ll=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...Ll(e.children,t)),Array.isArray(e.children)&&e.children.length&&r.push(e[t])})),r},_l=(e,t,r)=>{for(let n=0;n<e.length;n++){if(e[n][r]===t)return[t];if(Array.isArray(e[n].children)){const i=_l(e[n].children,t,r);if(i)return[e[n][r],i].flat()}}},Fl=(e,t)=>{const r=e.children?.map((e=>e[t]))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...Fl(e,t)))),r},Hl=o().forwardRef(((e,t)=>{const{className:r,style:n,filterable:i=!0,multiple:a,draggable:l,dataSource:s,fetch:d,asyncLoad:u,checkStrictly:p,checkStrategy:h="SHOW_CHILD",placeholder:m=f("qm.form.inputPlaceholder"),fieldsDefine:g,value:b,height:y,defaultSelectedKeys:v=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:S=!0,onSelectChange:w,onCheckChange:C,onDragStart:T,onDragChange:I,onExpand:N}=e,{size:R}=o().useContext(c),P=o().useMemo((()=>e.size??R??""),[e.size,R]),O=g?.valueKey||"value",k=g?.textKey||"text",A=o().useRef(null),_=Nt(A),[F,H]=o().useState(y),[D,$]=o().useState(!1),q=Ot((()=>{H(A.current.offsetHeight-Z.current.offsetHeight-10)}),5);Pt((()=>{y||q()}),[_.height]);const[M,j]=o().useState([]),[K,V]=o().useState({}),[z,B]=o().useState([]),[U,W]=o().useState([]),[G,Y]=o().useState(""),[X,Q]=o().useState(x),Z=o().useRef(null),J=o().useRef([]),ee=o().useRef([]);o().useEffect((()=>{Array.isArray(s)&&(re(s),B(ne(s)),V({}))}),[s]),o().useEffect((()=>{oe()}),[]),Me((()=>{oe()}),[d?.params]),Me((()=>{W(ae())}),[K]),o().useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const r=Array.isArray(t)?t:[t],n=kl(M,(t=>e===t[O]));n&&(Array.isArray(n.children)?n.children.push(...r):n.children=[...r],re([...M]))},REMOVE_RECORD:e=>{const t=Rl(M,e,O);if(void 0===t&&M.find((t=>t[O]===e)))re(M.filter((t=>t[O]!==e)));else{const r=kl(M,(e=>t===e[O]));if(!r)return;const n=r.children?.findIndex((t=>e===t[O]));n>=0&&(r.children.splice(n,1),re([...M]))}},UPDATE_RECORD:(e,t)=>{const r=kl(M,(t=>e===t[O]));r&&((0,te.merge)(r,t),re([...M]))}})));const re=e=>{j(e),J.current=e,ee.current=Ll(e,O)},ne=e=>{if(a)return v;const t=Ol(e,(e=>v.includes(e[k])));return 1===t.length?[t[0][O]]:[]},ie=e=>_l(M,e,O)?.slice(0,-1)||[],ae=()=>{if(x)return ee.current;const e=[];return z.forEach((t=>{if(a){if("SHOW_ALL"===h&&!ee.current.includes(t)&&e.push(...ie(t)),"SHOW_CHILD"===h&&e.push(...ie(t)),"SHOW_PARENT"===h){const r=Hn(M,t);if(r){const n=ie(t),i=Fl(r,O);e.push(...n,...[t,...i].filter((e=>ee.current.includes(e))))}}}else e.push(...ie(t))})),[...new Set(e)]},oe=async()=>{if(!d)return;const{api:e,params:t,dataKey:r,afterFetch:n,callback:i}=d;try{$(!0);const a=await e(t);if(200===a.code){let e=Array.isArray(a.data)?a.data:(0,te.get)(a.data,r)??[];e="function"==typeof n?await n(e):e,re(e),B(ne(e)),V({}),i?.(e)}}catch(e){}$(!1)},le=e=>`${e}|${ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,se=Ce("search-tree"),ce={[se]:!0,[`${se}--lg`]:"large"===P,[`${se}--sm`]:"small"===P};return o().createElement("div",{ref:A,className:we()(ce,r),style:n},o().createElement("div",{ref:Z,className:"topper"},E&&o().createElement(L.Input.Search,{value:G,size:P,placeholder:m,allowClear:!0,onChange:e=>(e=>{if(!i)return;const t=Pl(J.current,(t=>{if(!e)return!0;const r=t[k]||"";return-1!==le(r).indexOf(e)}));Y(e),j(t),x||e?W(Ll(t,O)):V({})})(e.target.value)}),S&&o().createElement("a",{className:"trigger",onClick:()=>{Q(!X),W(X?[]:ee.current)}},X?o().createElement(Te.UpOutlined,null):o().createElement(Te.DownOutlined,null)," ",f(X?"qm.form.collect":"qm.form.spread"))),o().createElement(xt,{spinning:D},o().createElement(L.Tree,{fieldNames:{title:k,key:O,children:"children"},multiple:a,draggable:l,blockNode:l,checkable:a,selectable:!a,height:F,disabled:e.disabled,checkStrictly:p,selectedKeys:b??z,checkedKeys:b??z,expandedKeys:U,treeData:M,loadData:u?async e=>{let{key:t,children:r}=e;if(!d||r)return;const{api:n,params:i,dataKey:a,formatter:o=(e=>e),afterFetch:l}=d;try{const e=await n(o({...i,[O]:t}));if(200===e.code){let r=Array.isArray(e.data)?e.data:(0,te.get)(e.data,a)??[];r="function"==typeof l?await l(r):r;const n=Al(J.current,t,O,r);re(n)}}catch(e){}}:void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!G)return!1;const t=e[k]||"";return-1!==le(t).indexOf(G)},onDragStart:T,onDragEnter:e=>{W(e.expandedKeys)},onDrop:e=>{const t=e.node.key,r=e.dragNode.key,n=e.node.pos.split("-"),i=e.dropPosition-Number(n[n.length-1]),a=(e,t,r)=>{for(let n=0;n<e.length;n++){if(e[n][O]===t)return r(e[n],n,e);e[n].children&&a(e[n].children,t,r)}},o=[...M];let l;if(a(o,r,((e,t,r)=>{r.splice(t,1),l=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)a(o,t,(e=>{e.children=e.children||[],e.children.unshift(l)}));else{let e,r=[];a(o,t,((t,n,i)=>{r=i,e=n})),-1===i?r.splice(e,0,l):r.splice(e+1,0,l)}else a(o,t,(e=>{e.children=e.children||[],e.children.unshift(l)}));re(o)},onDragEnd:e=>{I?.(e,M)},onExpand:(e,t)=>{de(e)&&Q(!1),ee.current.every((t=>e.includes(t)))&&Q(!0),W(e),N?.(e,t)},onSelect:e=>{B(e);const t=Ol(J.current,(t=>e.includes((0,te.get)(t,O))));w?.(a?t:t[0])},onCheck:e=>{p&&(e=e.checked),B(e),"SHOW_CHILD"===h&&(e=e.filter((e=>!ee.current.includes(e)))),"SHOW_PARENT"===h&&(e=e.filter(((e,t,r)=>!r.includes(Rl(M,e,O)))));const t=Ol(J.current,(t=>e.includes((0,te.get)(t,O))));C?.(a?t:t[0])}})))}));Hl.displayName="QmSearchTree";const Dl=Hl,$l=(0,a.createContext)(void 0),ql={dataIndex:s().string.isRequired,title:s().string.isRequired,description:s().string,colSpan:s().number,width:s().number,minWidth:s().number,fixed:s().oneOf(["left","right"]),align:s().oneOf(["left","center","right"]),theadAlign:s().oneOf(["left","center","right"]),printFixed:s().bool,hidden:s().bool,noAuth:s().bool,noFixed:s().bool,ellipsis:s().bool,className:s().string,theadClassName:s().string,children:s().array,sorter:s().oneOfType([s().bool,s().func]),filter:s().shape({type:s().oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:s().arrayOf(s().shape({text:s().string,value:s().oneOfType([s().string,s().number])})),style:s().object}),precision:s().number,displayPrecision:s().number,formatType:s().oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:s().bool,canCopy:s().bool,editRender:s().func,dictItems:s().arrayOf(s().shape({text:s().string,value:s().oneOfType([s().string,s().number])})),summation:s().shape({sumBySelection:s().bool,displayWhenNotSelect:s().bool,dataKey:s().string,unit:s().string,render:s().func}),groupSummary:s().shape({dataKey:s().string,unit:s().string,render:s().func}),shouldCellUpdate:s().func,headRender:s().func,render:s().func},Ml=(s().arrayOf(s().shape(ql)).isRequired,s().func,s().array,s().oneOfType([s().string,s().func]).isRequired,s().number,s().bool,s().bool,s().shape({api:s().func.isRequired,params:s().object.isRequired,formatter:s().func,beforeFetch:s().func,afterFetch:s().func,stopToFirst:s().bool,dataKey:s().string,callback:s().func}),s().bool,s().bool,s().string,s().string,s().bool,s().bool,s().bool,s().bool,s().oneOfType([s().object,s().func]),s().oneOfType([s().object,s().func]),s().array,s().func,s().bool,s().object,s().object,s().shape({type:s().oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:s().array,selectedRowKeys:s().array,hideSelectAll:s().bool,checkStrictly:s().bool,filterable:s().bool,selectByClickRow:s().bool,selectFirstRowOnChange:s().bool,clearableAfterFetched:s().bool,selectAllOnCurrentPage:s().bool,fetchSelectedRows:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),fetchAllRowKeys:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),disabled:s().func,onChange:s().func,onSelect:s().func,onSelectAll:s().func}),s().shape({currentRowKey:s().oneOfType([s().number,s().string]),disabled:s().func,onChange:s().func}),s().shape({virtual:s().bool,doubleXScrollbar:s().bool}),s().shape({virtual:s().bool,expandIconColumn:s().string}),s().shape({defaultExpandAllRows:s().bool,defaultExpandedRowKeys:s().array,expandedRowKeys:s().array,hideExpandAll:s().bool,rowExpandable:s().func,expandedRowClassName:s().string,expandedRowRender:s().func,onExpand:s().func,onChange:s().func}),s().shape({cellMerge:s().bool,onCellMerge:s().func,onSelectChange:s().func}),s().shape({groupItems:s().arrayOf(s().shape({dataIndex:s().string.isRequired,titleIndex:s().string,color:s().string,backgroundColor:s().string})),fetch:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),onChange:s().func}),s().func,s().bool,s().bool,s().bool,s().bool,s().shape({current:s().number,pageSize:s().number,pageSizeOptions:s().array,showSizeChanger:s().bool,showQuickJumper:s().bool}),s().shape({fileName:s().string,fetch:s().shape({api:s().func.isRequired,params:s().object}),beforeExport:s().func,cellStyle:s().bool,hideIcon:s().bool}),s().shape({showLogo:s().bool}),s().shape({fetch:s().shape({api:s().func.isRequired,params:s().object,dataKey:s().string}),fieldList:s().arrayOf(s().object)}),s().shape({position:s().oneOf(["top","bottom"]),hideAlert:s().bool,hideClearButton:s().bool}),s().oneOf(["left","right"]),s().func,s().func,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().bool,s().func,s().func,s().func,s().func,s().func,s().func,s().func,s().func,s().func,{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}),jl=10,Kl="1",Vl="0",zl="YYYY-MM-DD",Bl="YYYY-MM-DD HH:mm:ss",Ul="YYYYMMDDHHmmss",Wl={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};let Gl=function(e){return e.left="flex-start",e.right="flex-end",e}({});function Yl(e){const t=a.useRef();t.current=e;const r=a.useCallback((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current?.(...r)}),[]);return r}const Xl={...a}.useId;let Ql=0;const Zl=Xl?function(e){const t=Xl();return e||t}:function(e){const[t]=a.useState(`qm_unique_${Ql}`);return a.useEffect((()=>{Ql+=1}),[]),e||t};let Jl=[];const es={getFocusInstance:function(){return Jl[0]??null},getInstance:function(e){return Jl.find((t=>t.id===e))??null},focus:function(e){const t=this.getInstance(e);t&&0!==Jl.findIndex((e=>e===t))&&(this.deregister(e),Jl=[t,...Jl])},register:function(e,t){e&&t&&(null!==this.getInstance(e)&&this.deregister(e),Jl=[{id:e,vm:t},...Jl])},deregister:function(e){e&&(Jl=Jl.filter((t=>t.id!==e)))}};function ts(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rs=class{constructor(){ts(this,"state",{required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]}),ts(this,"addToRequired",(e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)})),ts(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)})),ts(this,"addToValidate",(e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)})),ts(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)})),ts(this,"addToEdited",(e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)})),ts(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)})),ts(this,"addToInserted",(e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)})),ts(this,"removeFromInserted",(e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)})),ts(this,"addToUpdated",(e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)})),ts(this,"removeFromUpdated",(e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)})),ts(this,"addToRemoved",(e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)})),ts(this,"removeFromRemoved",(e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)})),ts(this,"clearAllLog",(()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}))}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}},ns={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"};function is(e){return void 0!==e}function as(e,t){const{defaultValue:r,value:n,onChange:i,postState:o}=t||{},[l,s]=a.useState((()=>is(n)?n:is(r)?"function"==typeof r?r():r:"function"==typeof e?e():e)),c=is(n)?n:l,d=o?o(c):c,u=Yl(i),[p,h]=a.useState([c]);return Pt((()=>{const e=p[0];l!==e&&u(l,e)}),[p]),Pt((()=>{is(n)||s(n)}),[n]),[d,Yl((e=>{s(e),h([c])}))]}let os;const ls=()=>{if(re)return 0;if(void 0!==os)return os;const e=document.createElement("div");e.className="qm-scrollbar__wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",e.appendChild(r);const n=r.offsetWidth;return e.parentNode?.removeChild(e),os=t-n,os},ss=e=>e.map((e=>{const t={...e};return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=ss(t.children)),t})),cs=(e,t)=>{const{fetch:r,columns:n,height:i,minHeight:a,maxHeight:l,border:s=!0,rowSelection:c,summation:d,expandable:u,treeConfig:p,webPagination:h,scrollPagination:m,showSuperSearch:g,showFastSearch:b,showGroupSummary:y,showTableImport:v,showClipboard:x,showSelectCollection:E,footRender:S}=e,{tableRef:w,getRowKey:C,tableFullData:T,tableData:I,selectionKeys:N,sorter:R,filters:P,superFilters:O,pagination:k,mergedTdCells:A}=t,{selectionRows:L,summaries:_}=w.current,{expandIconColumn:F=""}=p||{},H=o().useMemo((()=>!!r?.api),[r?.api]),D=o().useMemo((()=>!H&&!!h),[H,h]),$=o().useMemo((()=>H&&!!m),[H,m]),q=o().useMemo((()=>(H||D)&&!$),[H,D,$]),M=o().useMemo((()=>!!(i||a||l)),[i,a,l]),j=o().useMemo((()=>(e=>{const t=(e=>{const t=[],r=[],n=[];for(let i=0;i<e.length;i++){const a=e[i];"left"===a.fixed?t.push(a):"right"===a.fixed?r.push(a):n.push(a)}return[...t,...n,...r]})(ss(e)),r=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:ns.selectionColumn,title:"radio"===t?f("qm.table.config.selectionText"):"",width:ns.selectionColumnWidth,fixed:"left",type:t}})(c),n=(i=u,i?.expandedRowRender?{dataIndex:ns.expandableColumn,title:"",width:ns.selectionColumnWidth,fixed:"left",type:"expand"}:null);var i;return r&&t.unshift(r),n&&t.unshift(n),qr(t)})(n)),[n]),K=o().useMemo((()=>$r(j)),[j]),V=o().useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),z=o().useMemo((()=>K.filter((e=>!!e.summation))),[K]),B=o().useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),U=o().useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),W=o().useMemo((()=>(e=>{const t=[];return e.forEach((e=>{const r=T.find((t=>C(t,t.index)===e.rowKey)),n=K.findIndex((t=>t.dataIndex===e.dataIndex));if(!r||n<0)return;const i={row:r.index,col:n,rowSpan:e.rowSpan,colSpan:e.colSpan};t.push(i);for(let r=1;r<e.colSpan;r++)for(let n=0;n<e.rowSpan;n++)t.push({row:i.row+n,col:i.col+r,rowSpan:0,colSpan:0});for(let r=1;r<e.rowSpan;r++)for(let n=0;n<e.colSpan;n++)t.push({row:i.row+r,col:i.col+n,rowSpan:0,colSpan:0})})),t})(A)),[A,K,T]),G=o().useMemo((()=>{const e=K.filter((e=>![ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(e.dataIndex)));return F&&e.some((e=>e.dataIndex===F))?F:e[0]?.dataIndex??""}),[K,F]),Y=o().useMemo((()=>z.length>0),[z]),X=o().useMemo((()=>!!S||Y),[S,Y]),Q=o().useMemo((()=>Gr(j).length>1),[j]),Z=o().useMemo((()=>s||Q),[s,Q]),J=o().useMemo((()=>K.some((e=>e.sorter))),[K]),ee=o().useMemo((()=>K.some((e=>e.filter))),[K]),te=o().useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),re=o().useMemo((()=>!H&&!!v),[H,v]),ne=o().useMemo((()=>!!x&&V.length>0),[x,V]),ie=o().useMemo((()=>!!E&&"checkbox"===c?.type),[E,c]),ae=o().useMemo((()=>!!g&&ee),[g,ee]),oe=o().useMemo((()=>!H&&!!b&&ee),[H,b,ee]),le=o().useMemo((()=>!!y&&K.some((e=>!!e.groupSummary))),[K]),se=o().useMemo((()=>!!d?.groupItems?.length),[d]),ce=o().useMemo((()=>T.some((e=>Array.isArray(e.children)))),[T]),de=o().useMemo((()=>!I.length),[I]),ue=o().useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:r,precision:n,displayPrecision:i,summation:a}=t,{sumBySelection:o,displayWhenNotSelect:l,unit:s}=a,c=se?dn(w.current.tableFullData):w.current.tableFullData,d=!L.length&&!!l;let u=(!o||d?c:L).reduce(((e,t)=>{if(t?.[ns.summaryIgnore])return e;const n=Zr(t,r);return tn(n)?e.plus(n):e}),new(Ii())(0));!Object.keys(_).includes(r)||o&&!d||(u=new(Ii())(Zr(_,r))),Jr(e,r,u.toNumber());let p=n>=0?u.toFixed(n):u.toString();i>=0&&""!==p&&(p=nn(p,i)),p=rn(p),Jr(e,`${r}_text`,s?`${p} ${s}`:p)})),[e]})()),[I,N,_]),pe=o().useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),he=o().useMemo((()=>{const e=(e=>{const t=[];return Object.keys(e).forEach((r=>{null!==e[r]&&t.push(`${r}|${e[r]}`)})),t.join(",")})(R),t=((e,t)=>{const r=[];if(Object.keys(e).length)for(const t in e){const[n,i]=ns.showFilterType?t.split("|"):[t,""],a=e[t];Object.keys(a).forEach((e=>{r.push({type:i,bracketLeft:"",fieldName:n,expression:e,value:a[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{r.push({type:ns.showFilterType?e.fieldType:"",bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),r.length&&(r[r.length-1].logic=""),r})(P,O);return{...e?{[ns.sorterFieldName]:e}:null,...t.length?{[ns.filterFieldName]:t}:null,...pe?{[ns.groupSummary.summaryFieldName]:pe,usedJH:1}:null,...r?.params??null,[ns.currentPageName]:k.current,[ns.pageSizeName]:k.pageSize}}),[r?.params,k.current,k.pageSize,R,P,O,pe]);return{isFetch:H,isWebPagination:D,isScrollPagination:$,showPagination:q,shouldUpdateHeight:M,tableColumns:j,flattenColumns:K,editableColumns:V,summationColumns:z,leftFixedColumns:B,rightFixedColumns:U,derivedMergeCells:W,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Q,bordered:Z,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ie,isTableImport:re,isTableClipboard:ne,isSuperSearch:ae,isFastSearch:oe,isGroupSummary:le,isGroupSubtotal:se,isTreeTable:ce,isTableEmpty:de,summationRows:ue,fetchParams:he}},ds=require("react-dom");var us=n.n(ds);const ps=(e,t)=>{const{rowKey:r,height:n,dataSource:i,summation:a,fetch:l,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,treeConfig:h,authConfig:m,ignorePageIndex:f,columnsChange:g,onChange:b,onDataChange:y,onDataLoad:x,onScrollEnd:E,onFetchError:S}=e,{getRowKey:w,tableRef:C,tableElementRef:T,tableBodyRef:I,$size:N,tableColumns:R,flattenColumns:P,tableFullData:O,pagination:k,layout:A,filters:L,sorter:_,superFilters:F,fetchParams:H,selectionKeys:D,rowExpandedKeys:$,highlightKey:q,summationColumns:M,shouldUpdateHeight:j,isFetch:K,isTreeTable:V,isWebPagination:z,isScrollPagination:B,isServiceSummation:U,isGroupSubtotal:W,doLayout:G,setTableData:Y,setTableFlatColumns:X,setTableFullData:Q,setTableOriginData:Z,setTableFlatData:J,setAllTableData:ee,setDeriveRowKeys:re,setPagination:ne,setSpinning:ie,setSorter:ae,setFilters:le,setSuperFilters:se,setSelectionKeys:ce,setRowExpandedKeys:pe,setHighlightKey:he,setSelectionRows:me,setScrollXLoad:fe,setScrollYLoad:ge,setScrollXStore:be,setScrollYStore:ye,computeVirtualX:ve,computeVirtualY:xe,setFieldAuth:Ee,setResizeState:Se,setSummaries:we,setPermission:Ce,setRecordsMap:Te,resetTableScroll:Ie,clearElementStore:Ne,clearRecordsMap:Re}=t,{store:Pe,scrollBarRef:Oe}=C.current,ke=Number.parseInt(o().version)>=18?us().flushSync:null,Ae=o().useRef({...H}),Le=o().useRef(new Map),_e=o().useRef(!1),Fe=Nt(T);Pt((()=>{je(),C.current.scrollXLoad?Ve(Oe.current.scrollLeft):ze(),G()}),[R]),Pt((()=>{He()}),[Fe,N,n,A.tableAutoHeight]),Me((()=>{It(),Rt(),kt(),K||(z&>(),dt(i)),s&&ae(s),c&&le(c)}),[i,l?.params]),Me((()=>{const e=ot(H,Ae.current);e||K&&d?.clearableAfterFetched&&At(),!e&&H[ns.currentPageName]>1&&!l?.stopToFirst?gt():K&&st(),Ae.current=H}),[H]),Me((()=>{z&&St(),B||Ie(),nt()}),[k.current,k.pageSize]),Me((()=>{C.current.scrollYLoad&&We(Oe.current.scrollTop),K||De(O.length),G()}),[O]),Me((()=>{V&&C.current.scrollYLoad&&(bt(),St())}),[$]);const He=()=>{const{scrollXLoad:e,scrollYLoad:t,resizeState:r}=C.current,{width:n,height:i}=r,{width:a,height:o}=Fe,l=a!==n,s=o!==i;G(),l&&e&&ze(),s&&j&&t&&Ge(),Se(Object.assign({},r,{width:a,height:o}))},De=e=>{e!==k.total&&ne((t=>Object.assign({},t,{total:e})))},$e=e=>{_e.current=e},qe=Ot((e=>{ht(),E?.(e)})),je=()=>{fe(P.length>ns.virtualScrollX)},Ke=function(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).length>ns.virtualScrollY;p?.virtual&&(e=!0),h?.virtual&&(e=!0),ge(e)},Ve=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollXStore:t}=C.current,{startIndex:r,endIndex:n,offsetSize:i}=t,{toVisibleIndex:a,visibleSize:o}=ve(e,A.tableWidth),l=Math.max(0,a-1-i),s=a+o+i;(a<=r||a>=n-o-1)&&(r===l&&n===s||(be(Object.assign({},t,{startIndex:l,endIndex:s})),ze()))},ze=()=>{Be(),Ue()},Be=()=>{const{scrollXLoad:e,scrollXStore:t}=C.current;if(!e)return;const r=[],n=[],i=[];for(let e=0;e<P.length;e++){const a=P[e];a.fixed?"left"===a.fixed?r.push(a):i.push(a):e>=t.startIndex&&e<t.endIndex&&n.push(a)}ke?queueMicrotask((()=>ke((()=>X([...r,...n,...i]))))):X([...r,...n,...i])},Ue=()=>{const{elementStore:e,scrollXStore:t,scrollXLoad:r}=C.current,{tableBodyWidth:n,gutterWidth:i}=A;let a="",o="";r&&(a=`${P.slice(0,t.startIndex).filter((e=>!e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)}px`,o=`${scrollY?n-i:n}px`),e.$tableBody.style.marginLeft=a,e.$tableXspace.style.width=o},We=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const{scrollYStore:t}=C.current,{startIndex:r,endIndex:n,offsetSize:i,visibleSize:a,rowHeight:o}=t,{toVisibleIndex:l}=xe(e,o),s=Math.max(0,l-1-i),c=l+a+i;(l<=r||l>=n-a-1)&&(r===s&&n===c||(ye(Object.assign({},t,{startIndex:s,endIndex:c})),Ge()))},Ge=()=>{const{tableFlatData:e}=C.current;Et(e),(e=>{const{elementStore:t,scrollYStore:r,scrollYLoad:n}=C.current,{startIndex:i,rowHeight:a}=r;let o="",l="";n&&(o=`${Math.max(0,i*a)}px`,l=e.length*a+"px"),t.$tableBody.style.marginTop=o,t.$tableYspace.style.height=l})(e)},Ye=e=>W?Xe(Qe(e,0)):e,Xe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Xe(e.children)),delete e.children,t.push(e)})),t},Qe=(e,t)=>{const n=a.groupItems?.[t];return n?pn(e,[n.dataIndex]).map((e=>{const i={children:Qe(e,t+1),_group:n.dataIndex};return"function"!=typeof r&&Jr(i,r.toString(),ln()),n.titleIndex&&Jr(i,n.titleIndex,Zr(e[0],n.titleIndex)),Jr(i,n.dataIndex,Zr(e[0],n.dataIndex)),M.forEach((e=>{const{dataIndex:t}=e,r=i.children?.reduce(((e,r)=>{if(r[ns.summaryIgnore])return e;const n=Number(Zr(r,t));return Number.isNaN(n)?e:e+n}),0);Jr(i,t,r)})),i})):(e.forEach(((t,r)=>{t._rowSpan=0===r?e.length:0,t._colSpan=1})),e)},Ze=e=>{ce(e),me((e=>{const{selectionRows:t,recordsMap:r}=C.current,n=new Map;t.forEach((e=>n.set(w(e,e.index),e)));const i=[];for(let t=0,a=e.length;t<a;t++){const a=n.get(e[t])||r.get(e[t]);a&&i.push(a)}return i})(e))},Je=e=>{const{type:t,checkStrictly:r=!0}=d||{},n=Array.isArray(e)?e:D;let i=[];return C.current.treeTable&&!r&&n.forEach((e=>{i.push(...((e,t)=>{const{disabled:r}=d||{},{deriveRowKeys:n,recordsMap:i}=C.current,a=Ur(n,e);let o=[];if(!a)return o;let l=tt(a?.children||[]);return r&&(l=l.filter((e=>!i.has(e)||!r(i.get(e))))),o=[...new Set([...t,...l])],(mn(n,e)?.slice(0,-1).reverse()||[]).forEach((e=>{const t=Ur(n,e),r=t?.children?.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),i="radio"===t?n.slice(0,1):[...new Set([...n,...i])],i},et=e=>{const{allRowKeys:t,flattenRowKeys:r,deriveRowKeys:n}=C.current,{defaultExpandAllRows:i,expandedRowRender:a}=u||{},o=Array.isArray(e)?e:$;if(C.current.treeTable){a&&v("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];q&&e.unshift(q);let l=[];return e.forEach((e=>{const t=mn(n,e)||[];l.push(...t.length>1?t.slice(0,-1).reverse():t)})),l=i?t:[...new Set([...o,...l])],l.filter((e=>!r.includes(e)))}return u?i?t.slice(0):[...o]:[]},tt=e=>{const t=[];for(let r=0;r<e.length;r++)Array.isArray(e[r].children)&&t.push(...tt(e[r].children)),t.push(e[r].rowKey);return t},rt=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...rt(e.children,t)),e.rowKey===t&&e.parentRowKey&&r.push(e.parentRowKey)})),r.length&&r.push(...rt(e,r[r.length-1])),r},nt=Ot((()=>{b?.(k,at(L),it(_),F,{currentDataSource:xt()})})),it=e=>{const t={};for(const r in e)null!==e[r]&&(t[r]=e[r]);return t},at=e=>{const t={};for(const r in e){if(!r.includes("|"))continue;const[n,i]=r.split("|");t[ns.showFilterType?`${n}|${i}`:n]=e[r]}return t},ot=(e,t)=>{const r=Object.keys(Qr(e,t));return 1===r.length&&(r.includes(ns.currentPageName)||r.includes(ns.pageSizeName))},lt=async()=>{if(!l)return;const{formatter:e=(e=>e),beforeFetch:t=oe,afterFetch:r,callback:n}=l;if(!t(H))return;const i=!!a?.fetch?.api;ie(!0);try{const[t,o]=i?await Promise.all([l.api(e(H)),a.fetch.api(e(H))]):[await l.api(e(H))];if(C.current.unMounted)return;if(i?200===t.code&&200===o.code:200===t.code){const e=l.dataKey??ns.dataKey;let i=(0,te.get)(t.data,e)??[];i="function"==typeof r?await r(i):i;const a=(0,te.get)(t.data,e.replace(/[^.]+$/,ns.totalKey))||i.length||0,s=Math.max(Math.ceil(a/k.pageSize),1);if(H[ns.currentPageName]>s)return mt({...k,current:s});dt(_e.current?C.current.tableFullData.concat(i):i),De(a),ut(o?.data||t.data),n?.(t.data,t)}}catch(e){S?.(e)}((e,t)=>Object.prototype.hasOwnProperty.call(e,"stopToFirst"))(l)&&(l.stopToFirst=!1),ie(!1),$e(!1)},st=Ot(lt),ct=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=ct(e.children)),e.index=t,f||(e.pageIndex=(e=>{const{current:t,pageSize:r}=k;return!K||B?e:(t-1)*r+e})(t)),e))),dt=e=>{const t=Ye(ct(e));wt(t),Ct(t),Ze(Je()),pe(et()),pt(),x?.(t)},ut=e=>{if(!U)return;const t=a?.fetch?.dataKey??ns.summationKey,r=(t?(0,te.get)(e,t):e)??{},n={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{Jr(n,e.dataIndex,Number(Zr(r,e.summation.dataKey)))})),we(n)},pt=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=xt();if(e.length){const t=w(e[0],e[0].index);Ze([t])}else Ze([])}},ht=()=>{if(!B)return;const e=ft();_e.current||k.current>=e||($e(!0),mt({...k,current:k.current+1}))},mt=e=>{let{current:t,pageSize:r}=e;ne((e=>Object.assign({},e,{current:t,pageSize:r})))},ft=()=>{const{pageSize:e,total:t}=k;return Math.ceil(t/e)||1},gt=()=>{mt(Object.assign({},k,{current:1}))},bt=()=>{const{scrollYLoad:e,deriveRowKeys:t}=C.current;if(!C.current.treeTable||!e)return;const r=yt(t,(()=>{const{allTableData:e,allRowKeys:t}=C.current,{rowExpandable:r}=u||{},n=[];return"function"==typeof r&&e.forEach(((e,i)=>!r(e)&&n.push(t[i]))),n.length?$.filter((e=>!n.includes(e))):$})());Le.current.clear(),r.forEach(((e,t)=>Le.current.set(e,t)))},yt=(e,t)=>{const r=[];return e.forEach((e=>{e.children&&r.push(...yt(e.children,t)),(void 0===e.parentRowKey||t.includes(e.parentRowKey)&&e.rowKeyPath.split("#").slice(0,-1).every((e=>t.findIndex((t=>t==e))>-1)))&&r.push(e.rowKey)})),r},vt=()=>{const{current:e,pageSize:t}=k;return C.current.tableFullData.slice((e-1)*t,e*t)},xt=()=>z?vt():C.current.tableFullData,Et=e=>{const{scrollYLoad:t,scrollYStore:r}=C.current;if(!t)return Y(e);const{startIndex:n,endIndex:i}=r;ke?queueMicrotask((()=>ke((()=>Y(e.slice(n,i)))))):Y(e.slice(n,i))},St=()=>{(()=>{let e=xt();C.current.treeTable&&h?.virtual&&(e=(e=>{const{recordsMap:t,allRowKeys:r}=C.current,n=[];for(let e=0,i=r.length;e<i;e++){const i=r[e];Le.current.has(i)&&n.push(t.get(i))}return n})()),Ke(e),J(e)})(),Ge()},wt=e=>{Q(e),ee(e),re(e),Tt(),bt(),St()},Ct=e=>{Z(e)},Tt=()=>{Re(),C.current.allTableData.forEach((e=>Te(w(e,e.index),e)))},It=()=>{ae({})},Rt=()=>{le({})},kt=()=>{se([])},At=()=>{Ze([])};return{initialTable:()=>{(async()=>{if(!m)return;let t=ue(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:n}=m.fetch;try{const i=await e(r);200===i.code&&(t=(n?(0,te.get)(i.data,n):i.data)??{})}catch(e){}}if(Object.keys(t).length){const{isExport:e=1,isImport:r=1,isPrint:n=1}=t;Ce((t=>Object.assign({},t,{export:!!e,import:!!r,print:!!n})))}if(Array.isArray(t.fieldList)){const{originColumns:r}=C.current,n=jr(e.columns,(e=>{const{dataIndex:n}=e,i=t.fieldList.find((e=>e.dataIndex===n));if(i){const{visible:t=1,disabled:a,secretName:o}=i,l=Kr(r,n);Ee(n,{visible:t,disabled:a,secretName:o}),t||(e.noAuth=!0,l.noAuth=!0),o&&(e.formatType=`secret-${o}`,l.formatType=`secret-${o}`)}}));g?.(n)}})(),q&&I.current.setClickedValues([q,""]),"radio"===d?.type&&D.length&&I.current.setClickedValues([D[0],""]),je(),Ke(),K?lt():dt(i)},checkDataIndex:()=>{const e=P.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&v("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:wt,getTableData:lt,handleTableData:Et,createWebPageData:vt,createTableData:dt,createGroupData:Ye,createSelectionKeys:Je,createRowExpandedKeys:et,setSelectionKeysEffect:Ze,findParentRowKeys:rt,getAllChildRowKeys:tt,doFieldValidate:(e,t,r,n)=>{if(!Array.isArray(e))return v("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(Pe.removeFromRequired({x:r,y:n}),Pe.removeFromValidate({x:r,y:n}),e.forEach((e=>{e.required&&de(t)&&Pe.addToRequired({x:r,y:n,text:e.message}),"function"!=typeof e.validator||e.validator?.(t)||Pe.addToValidate({x:r,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:r,updated:n,removed:i}=Pe.state,a=(0,te.intersection)(r,i),o=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:o(e),validate:o(t),inserted:r.filter((e=>!a.includes(e))),updated:n.filter((e=>![...(0,te.intersection)(n,r),...(0,te.intersection)(n,i)].includes(e))),removed:i.filter((e=>!a.includes(e)))}},dataChange:()=>{y?.(C.current.tableFullData)},tableChange:nt,toLastPage:()=>{const e=ft();k.current!==e&&mt(Object.assign({},k,{current:e}))},toFirstPage:gt,getPageCount:ft,pagerChangeHandle:mt,triggerScrollXEvent:e=>{Ve(e)},triggerScrollYEvent:e=>{We(e)},scrollBottomDebouncer:qe,clearTableSorter:It,clearTableFilter:Rt,clearSuperFilters:kt,clearRowSelection:At,clearRowHighlight:()=>{he("")},clearTableLog:()=>{Pe.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=C.current;Ne(),Pe.destroy(),e.deregister(t)}}},hs=(e,t)=>{const{height:r,minHeight:n,maxHeight:i,ellipsis:a,showHeader:l,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,$size:h,tableColumns:m,flattenColumns:f,leftFixedColumns:g,derivedMergeCells:b,layout:y,scrollX:v,scrollY:x,showFooter:E,showPagination:S,isFullScreen:w,setLayout:C,setScrollX:T,setScrollY:I,setElementStore:N,setScrollXStore:R,setScrollYStore:P,setShouldToTop:O}=t,k=o().useRef(x),A=o().useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=y,a={};return n&&Object.assign(a,{minHeight:`${Xr(n)}px`}),i&&Object.assign(a,{maxHeight:`${Xr(i)}px`}),w?{...a,maxHeight:"",minHeight:"",height:`${e}px`}:r?{...a,height:"auto"!==r?`${Xr(r)}px`:`${t}px`}:a}),[r,i,n,w,y]),L=()=>{const{elementStore:e,scrollYLoad:t,resizeState:r}=d.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,i=l?e.$header.offsetHeight:y.headerHeight,a=E?e.$footer.offsetHeight:y.footerHeight,o=n-i-a,s=e.$tableBody.offsetHeight,c=t||s>o;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+jl:0,n=e.$pager?e.$pager.offsetHeight+jl:0;u=r.winHeight-t-n-20}(t||o!==y.viewportHeight)&&F(o),k.current=c,I(c),C((e=>Object.assign({},e,{headerHeight:i,footerHeight:a,viewportHeight:o,tableBodyHeight:s,tableFullHeight:u})))},_=(e,t)=>{const r=e+t;let n=-1,i=0,a=0;for(let t=0,o=f.length;t<o;t++){const o=f[t];if(i+=o.width||o.renderWidth,-1===n&&e<i&&(n=t),n>=0&&(a++,i>r))break}return{toVisibleIndex:Math.max(0,n),visibleSize:Math.max(8,a)}},F=e=>{const{scrollBarRef:t,scrollYStore:r,isIE:n}=d.current,i=t.current.scrollTop,{rowHeight:a}=r,{toVisibleIndex:o}=H(i,a),l=Math.max(8,Math.ceil(e/a)+2),s=n?5:0,c=Math.max(0,o-1-s),u=Math.max(o+l+s,r.endIndex);P(Object.assign({},r,{visibleSize:l,offsetSize:s,startIndex:c,endIndex:u}))},H=(e,t)=>{const r=Math.floor(e/t);return{toVisibleIndex:Math.max(0,r)}},D=(e,t)=>{const{scrollBarRef:r,elementStore:n,scrollYStore:i,scrollYLoad:a,tableFlatData:o}=d.current;if(void 0!==t&&t>=0)r.current.SET_SCROLL_TOP(t*i.rowHeight);else if(a){const t=o.findIndex((t=>e===c(t,t.index)));t>=0&&r.current.SET_SCROLL_TOP(t*i.rowHeight)}else{const t=n.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);t&&r.current.SET_SCROLL_TOP(t.offsetTop)}};return{createElementStore:()=>{N("$toper",u.current),N("$table",p.current)},tableStyles:A,getSpan:(e,t,r,n,i)=>{let a=1,o=1;if("function"==typeof s){const l=s({row:e,column:t,rowIndex:r,columnIndex:n,tableData:i});Array.isArray(l)?(a=l[0],o=l[1]):(0,te.isPlainObject)(l)&&(a=l.rowSpan,o=l.colSpan)}if(b.length>0){const e=b.find((e=>e.row===r&&e.col===n));e&&(a=e.rowSpan,o=e.colSpan)}return{rowSpan:a,colSpan:o}},getStickyLeft:e=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=Vr(Kr(m,e)).dataIndex);let t=0;for(let r=0;r<f.length;r++){const n=f[r];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{f.findIndex((t=>t.dataIndex===e))<0&&(e=zr(Kr(m,e)).dataIndex);const r="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let r=[];return e.forEach((e=>{e.colSpan>0&&r.length>0&&(t.push(r),r=[]),r.push(e)})),r.length>0&&t.push(r),t.map((e=>{const[t,r]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...r,...t.reverse()]})).flat()})(f):f;let n=0;for(let t=r.length-1;t>=0;t--){const i=r[t];if(i.dataIndex===e)break;n+=i.width||i.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const{scrollBarRef:r}=d.current,n=void 0===t?f.findIndex((t=>t.dataIndex===e)):t;if(n<0)return;const i=g.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),a=f.slice(0,n).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);r.current.SET_SCROLL_LEFT(a-i)},scrollYToRecord:D,rowInViewport:e=>{const{scrollBarRef:t,scrollYStore:r}=d.current,{viewportHeight:n,gutterWidth:i}=y,a=e*r.rowHeight;return!(a<t.current.scrollTop||a+r.rowHeight>t.current.scrollTop+(v?n-i:n))},calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current,n=t.winHeight-e.$table.getBoundingClientRect().top-(S?Fi["small"!==h?"middle":h]+jl:0)-jl;C((e=>Object.assign({},e,{tableAutoHeight:n})))},resetTableScroll:()=>{const{shouldToTop:e}=d.current;e&&D("",0),O(!0)},computeVirtualX:_,computeVirtualY:H,doLayout:()=>{a?L():se((()=>L())),(()=>{const{elementStore:e,scrollXLoad:t}=d.current,r=e.$table.clientWidth,n=k.current?y.gutterWidth:0,{defaultColumnWidth:i}=ns,a=[];let o=0;if(f.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,o+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=f.reduce(((e,t)=>e+(t.width||t.minWidth||i)),0);if(e<=r-n){T(!1);const t=r-n-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||i)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||i)),0);let r=0;a.forEach(((t,n)=>{if(0===n)return;const a=Math.floor((t.minWidth||i)*e);r+=a,t.renderWidth=(t.minWidth||i)+a})),a[0].renderWidth=(a[0].minWidth||i)+t-r}}else T(!0),a.forEach((e=>{e.renderWidth=e.minWidth||i}));C((t=>({...t,tableBodyWidth:Math.max(e,r)})))}else o=f.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||i)),0),T(o>r),C((e=>({...e,tableBodyWidth:o})));C((e=>({...e,tableWidth:r}))),t&&(e=>{const{scrollXStore:t,isIE:r,scrollBarRef:n}=d.current,i=n.current.scrollLeft,{toVisibleIndex:a,visibleSize:o}=_(i,e),l=r?5:0,s=Math.max(0,a-1-l),c=Math.max(a+o+l,t.endIndex);R(Object.assign({},t,{visibleSize:o,offsetSize:l,startIndex:s,endIndex:c}))})(r)})()}}},ms=e=>{const{total:t}=e,{tableRef:r,selectionKeys:n,isHeadSorter:i,isHeadFilter:a,isTreeTable:l,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p}=o().useContext($l),{infoBarConfig:h,rowSelection:m,rowHighlight:g}=r.current.props,{allTableData:b,invalidRowKeys:y}=r.current,{hideAlert:v,hideClearButton:x}=h||{},E=o().useMemo((()=>!v),[v]),S=o().useMemo((()=>!x&&!!(i||a||m||g)),[x,i,a,m,g]),w=Ce("table"),C={[`${w}__alert`]:!0};return E?o().createElement("div",{className:we()(C)},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.InfoCircleFilled,null)),o().createElement("span",null,f("qm.table.alert.total",{total:l?b.length:t}),m?`,${f("qm.table.alert.selected",{total:Math.max(n.length-y.length,0)})}`:""),S&&o().createElement("em",{onClick:()=>{c(),d(),u(),p(),se((()=>s()))}},f("qm.table.alert.clear"))):null},fs=o().forwardRef(((e,t)=>{const{isFullScreen:r,open:n=!0}=e,{setFullScreen:i}=o().useContext($l),a=()=>{i(!r)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table");return n?o().createElement("span",{className:`${l}-full-screen`,title:f(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},r?o().createElement(Te.FullscreenExitOutlined,null):o().createElement(Te.FullscreenOutlined,null))):null}));fs.displayName="FullScreen";const gs=fs,bs=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{getTableData:n}=o().useContext($l),i=()=>{n()};o().useImperativeHandle(t,(()=>({clickHandle:i})));const a=Ce("table");return r?o().createElement("span",{className:`${a}-reload`,title:f("qm.table.refresh.text"),onClick:()=>i()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.ReloadOutlined,null))):null}));bs.displayName="Reload";const ys=bs,vs=()=>{const e={dateFormat:e=>{const t=e?u()(e).format(zl):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?u()(e).format(Bl):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?u()(e).format(Bl.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>tn(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>rn(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,r,n)=>{const{dictItems:i,precision:a,displayPrecision:o,formatType:l,editRender:s}=r,c=i||s?.(n,r)?.items||[];let d=c.find((e=>e.value==t))?.text??t??"";if(Array.isArray(t)&&(d=t.map((e=>c.find((t=>t.value==e))?.text??e)).join(",")),a>=0&&""!==d&&(d=tn(d)?new(Ii())(d).toFixed(a):d),o>=0&&""!==d&&(d=nn(d,o)),l){const t=e[`${ce(l)}Format`];t?d=t(d):v("Table","字段的格式化类型 `formatType` 配置不正确")}return d},r=e=>ne(e)?sn(e).join(""):e??"";return{renderText:t,getTitleFromCellNode:r,getTitleFromCellValue:(e,n,i,a)=>{const o=Zr(e,n.dataIndex),l=n.render?n.render(o,e,n,i,a):t(o,n,e);return r(l)}}},xs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,{global:i}=o().useContext(c),{tableRef:a,flattenColumns:l,summationRows:s,showSummary:d,getSpan:u}=o().useContext($l),{tablePrint:p,showHeader:h}=a.current.props,{getTitleFromCellValue:m}=vs(),g=i?.print?.leftLogo??"",b=i?.print?.rightLogo??"",y=!(!g&&!b),v=o().useMemo((()=>pe(Br(r,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn]))),[r]),x=o().useMemo((()=>pe(Br(l,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn]))),[l]),E=o().useMemo((()=>pe(r.filter((e=>e.printFixed)))),[r]),S=e=>{const t=Object.assign({},hn(v,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?S(t):t},w=(e,t)=>(0,te.map)((0,te.groupBy)((0,te.flatten)(e),t),(0,te.spread)((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,te.mergeWith)(...r,((e,r)=>{if(Array.isArray(e))return w(e.concat(r),t)}))}))),C=()=>{const{allTableData:e}=a.current,t=(e=>{const t=[];let r=[],n=0,i=0;for(;i<e.length;){const a=e[i];n+=a.width||a.renderWidth||a.minWidth||ns.defaultColumnWidth,n<=ns.printWidth?(r.push(a),i===e.length-1&&t.push(r),i++):i>0?(e.splice(0,i),E.length&&e.unshift(...E),t.push(r),r=[],n=0,i=0):(a.width=ns.printWidth,r.push(a),t.push(r),i++)}return t})([...x]),r=(e=>{const t=[];return e.forEach((e=>{let r=[];e.forEach((e=>{1===e.level?r.push(e):r.push(S(e))})),r=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const r=e.filter((e=>e.dataIndex===t));return r.length<=1?r[0]:w(r,"dataIndex")[0]})))(r),t.push(Gr(r))})),t})(t);let n=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let i=0;i<t.length;i++)n+=T(r[i],t[i],e),n+='<div class="page-break"></div>';return n+"</body></html>"},T=(e,t,r)=>{const{showLogo:n=!0}=p;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((e=>{let{width:t,minWidth:r,renderWidth:n}=e;return`<col style="width:${t||n||r||ns.defaultColumnWidth}px">`})).join("")}</colgroup>`,h&&(i+=["<thead>",n&&y?`<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">',g?`<img src="${g}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',b?`<img src="${b}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:r}=e;return 0===r?null:`<th colspan="${r}" rowspan="${t}">${cn(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),r.length&&(i+=`<tbody>${r.map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:i,colSpan:a}=u(e,t,e.index,n,r);return i&&a?`<td rowspan="${i}" colspan="${a}">${m(e,t,e.index,n)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),d&&s.length&&(i+=["<tfoot>",s.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:i,summation:a}=t,o=a?.render?a.render(r):Zr(e,`${i}_text`);return`<td>${0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},I=()=>{((e,t)=>{const{filename:r,type:n,isDownload:i}={filename:"print",type:"html",isDownload:!1},a=`${r}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!i)return Promise.resolve({type:n,content:t,blob:e});Dt(e,a)}})(0,C())?.then((e=>{let{content:t,blob:r}=e,n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.setAttribute("height","0"),n.style.display="none",document.body.appendChild(n),a.current.isIE?(n.contentDocument.write(t),n.contentDocument.execCommand("print"),n.parentNode.removeChild(n),n=null):(n.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{n.parentNode.removeChild(n),n=null}))},n.src=URL.createObjectURL(r))}))};o().useImperativeHandle(t,(()=>({clickHandle:I})));const N=Ce("table");return n?o().createElement("span",{className:`${N}-print`,title:f("qm.table.print.text"),onClick:()=>I()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.PrinterOutlined,null))):null}));xs.displayName="TablePrint";const Es=xs,Ss=require("exceljs");var ws=n.n(Ss);const Cs="606060",Ts="thin",Is="d4d4d4",Ns=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Rs=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Ps=()=>({top:{style:Ts,color:{argb:Is}},left:{style:Ts,color:{argb:Is}},bottom:{style:Ts,color:{argb:Is}},right:{style:Ts,color:{argb:Is}}}),Os=e=>{const{children:t}=e;return t&&t.length?Os(t[0]):e},ks=e=>{const{precision:t,formatType:r}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===r?{numFmt:n?`0${n}%`:"0%"}:"finance"===r?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},As=()=>{const{tableRef:e,getSpan:t,showSummary:r,isHeadGroup:n}=o().useContext($l),{spanMethod:i,showHeader:a}=e.current.props,l=(e,t)=>e.find((e=>e.text==t))?.value??t??"";return{exportXLSX:async(o,l,s,c)=>{const{columns:d,footSummation:u}=o,{scrollYStore:{rowHeight:p}}=e.current,h=$r(d),m=Gr(d),g=[],b=[],y=[],v=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,width:r,minWidth:n,renderWidth:i}=e;E[t]=cn(e.title),y.push({key:t,width:(r||i||n||ns.defaultColumnWidth)/8})})),a&&(n?m.forEach(((e,t)=>{const r={};e.forEach((e=>{const{colSpan:n,rowSpan:i}=e,a=Os(e),o=h.findIndex((e=>{let{dataIndex:t}=e;return t===a.dataIndex}));r[a.dataIndex]=cn(e.title),0!==n&&(n>1||i>1)&&v.push({s:{r:t,c:o},e:{r:t+i-1,c:o+n-1}})})),g.push(r)})):(h.forEach(((e,t)=>{const{colSpan:r,rowSpan:n}=e;(r>1||n>1)&&v.push({s:{r:x,c:t},e:{r:x+n-1,c:t+r-1}})})),g.push(E)),x+=g.length);const S=l.map(((e,r)=>{const n={};return h.forEach(((a,o)=>{if("function"==typeof i){const{rowSpan:n,colSpan:i}=t(e,a,r,o,l);(i>1||n>1)&&v.push({s:{r:r+x,c:o},e:{r:r+x+n-1,c:o+i-1}})}const s=["percent","finance"].includes(a.formatType);n[a.dataIndex]=s?Zr(e,a.dataIndex):c(e,r,a,o)})),n}));x+=S.length,r&&u&&s(h,l).forEach(((e,t)=>{const r={};h.forEach(((t,n)=>{const{dataIndex:i,summation:a}=t,o=a?.render?a.render(l):Zr(e,i);r[i]=0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o})),b.push(r)}));const{sheetName:w,useStyle:C}=o,T=new(ws().Workbook),I=T.addWorksheet(w);I.columns=y,a&&I.addRows(g).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n,theadAlign:i}=r;Rs(e,i||n),C&&Object.assign(e,{font:{bold:!0,color:{argb:Cs}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Ps()})}))})),I.addRows(S).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n}=r;Rs(e,n),Object.assign(e,ks(r)),C&&Object.assign(e,{font:{color:{argb:Cs}},border:Ps()})}))})),r&&u&&I.addRows(b).forEach((e=>{C&&Ns(e,p),e.eachCell((e=>{const t=I.getColumn(e.col),r=Kr(d,t.key),{align:n}=r;Rs(e,n),Object.assign(e,ks(r)),C&&Object.assign(e,{font:{color:{argb:Cs}},border:Ps()})}))})),v.forEach((e=>{let{s:t,e:r}=e;I.mergeCells(t.r+1,t.c+1,r.r+1,r.c+1)}));const N=await T.xlsx.writeBuffer();return new Blob([N],{type:"application/octet-stream"})},exportCSV:(e,t)=>{const r=e=>{let t=e;const r=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),n=-1!==e.indexOf('"');return n&&(t=t.replace(/"/g,'""')),(r||n)&&(t='"'+t+'"'),t},n="\ufeff"+(e=>{let t,n,i,a,o="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],n=0;n<i.cells.length;n+=1)a=i.cells[n],o=o+(n?",":"")+r(a.textContent.trim());o+="\r\n"}return o})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,r)=>{t=t||"",r=r||512;const n=window.atob(e),i=[];let a;for(a=0;a<n.length;a+=r){const e=n.slice(a,a+r),t=new Array(e.length);let o;for(o=0;o<e.length;o+=1)t[o]=e.charCodeAt(o);const l=new window.Uint8Array(t);i.push(l)}return new window.Blob(i,{type:t})})((i=n,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:r,file:n}=e,i=$r(r),a=new FileReader;a.onerror=()=>{L.message.error(f("qm.table.import.error"))},a.onload=e=>{const r=i.map((e=>cn(e.title))),n=new(ws().Workbook),a=e.target;a?n.xlsx.load(a.result).then((e=>{const n=e.worksheets[0];if(n){const e=n.getSheetValues(),a=e.findIndex((e=>e&&e.length>0)),o=e[a],s=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(r,o);if(s){const n=e.slice(a+1).map((e=>{const t={};e.forEach(((e,r)=>{let n=e;Array.isArray(n?.richText)&&(n=n.richText.map((e=>e.text)).join("")),(0,te.isPlainObject)(n)&&"text"in n&&(n=n.text),(0,te.isDate)(n)&&(n=on(n,Bl)),n?.formula&&(n=n.result??n.value),t[o[r]]=n}));const n={};return r.forEach(((e,r)=>{const{dataIndex:a,dictItems:o}=i[r];Array.isArray(o)&&(t[e]?.toString().includes(",")?t[e]=t[e].split(",").map((e=>l(o,e))).filter((e=>""!==e)):t[e]=l(o,t[e])),Jr(n,a,t[e])})),n}));t?.(n)}else L.message.error(f("qm.table.import.error"))}else L.message.error(f("qm.table.import.error"))})):L.message.error(f("qm.table.import.error"))},a.readAsArrayBuffer(n)}}},Ls=e=>{const{fileType:t,onChange:r}=e;let n,i;const a=Ce("table"),l=e=>{const t=e.name,r=t.lastIndexOf("."),n=t.substring(r+1,t.length);return{filename:t.substring(0,r),type:n}};return o().createElement(be,{onClick:()=>(async()=>{try{const e=await(e=>{const t=Object.assign({},e);return n||(n=document.createElement("form"),i=document.createElement("input"),n.className=`${a}--file-form`,i.name="file",i.type="file",n.appendChild(i),document.body.appendChild(n)),new Promise(((e,r)=>{const a=!t.type;i.multiple=!!t.multiple,i.accept=a?"":`.${t.type}`,i.onchange=o=>{const{files:s}=o.target,c=s[0];let d="";if(!a)for(let e=0;e<s.length;e++){const{type:r}=l(s[e]);if(t.type!==r){d=r;break}}d?(L.message.warning(f("qm.upload.notType",{type:d})),r()):e(c),document.body.removeChild(n),n=null,i=null},n.reset(),i.click()}))})({type:t});r?.(e.name,e)}catch(e){}})()},f("qm.upload.text"))},_s=e=>{const{columns:t,onClose:r}=e,{tableRef:n,createTableData:i,dataChange:a}=o().useContext($l),{beforeTableImport:l}=n.current.props,{importXLSX:s}=As(),c=o().useRef(null),[d,u]=o().useState(!1),[p,h]=o().useState(!0),m=e=>e.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))),[g,b]=o().useState([{type:"INPUT",label:f("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:r}=t.GET_FIELDS_VALUE(["fileName"]);return o().createElement(o().Fragment,null,r?o().createElement("span",null,r):o().createElement(Ls,{fileType:t.state.formData.fileType,onChange:(e,r)=>{t.SET_FIELDS_VALUE({fileName:e,file:r}),r&&h(!1)}}))}},{type:"SELECT",label:f("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:f("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:f("qm.table.import.fillText"),value:"fill"},{text:f("qm.table.import.addText"),value:"add"},{text:f("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{g.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,b([...g])}},{type:"INPUT_NUMBER",label:f("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:1,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]),y=Ce("table");return o().createElement("div",{className:`${y}-import__setting`},o().createElement(Go,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:{posIndex:"条"},items:g,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:d,disabled:p,onClick:()=>(async()=>{const[e,o]=await c.current.GET_FORM_DATA();e||(u(!0),s({columns:m(t),file:o.file},(async e=>{const{tableFullData:t,store:s}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof l)try{e=await l(e)}catch(e){}if("fill"===o.importType&&i(e),"add"===o.importType&&i([...t,...e]),"insert"===o.importType){const{tableFullData:t}=n.current,r=o.posIndex,a=t.slice(0,r).concat(e).concat(t.slice(r));i(a)}e.forEach((e=>{s.addToInserted(e)})),a(),L.message.success(f("qm.table.import.success",{total:e.length})),u(!1),r()})))})()},f("qm.table.import.text"))))},Fs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,[i,a]=o().useState(!1),l=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:l})));const s=Ce("table"),c={[`${s}-import`]:!0},d={visible:i,title:f("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:we()(c),title:f("qm.table.import.textNoSpace"),onClick:()=>l()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.ImportOutlined,null))),o().createElement(Er,d,o().createElement(_s,{columns:r,onClose:()=>a(!1)})))}));Fs.displayName="TableImport";const Hs=Fs,Ds=e=>{const{columns:t,onChange:r}=e,{$size:n}=o().useContext($l),i=o().useRef([]),[a,l]=o().useState(!1),[s,c]=o().useState(t);Me((()=>{u()}),[s]),o().useEffect((()=>{d()}),[t]);const d=()=>{const e=[];t.forEach(((r,n)=>{const i=r.colSpan;i>1&&t.slice(n+1,n+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&e.push(t.slice(n,n+i))})),i.current=e},u=()=>{const e=[];s.forEach((t=>{const{colSpan:r,dataIndex:n}=t;if(0===r)return;if(1===r)return e.push(t);const a=i.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...i.current[a].map(((e,r)=>{let{dataIndex:n}=e;const i=s.find((e=>e.dataIndex===n));return r>0&&void 0!==t.hidden&&(i.hidden=t.hidden),i})))})),r?.(e)},p=Ce("table"),h={[`${p}__popper`]:!0,"column-filter__popper":!0,[`${p}--lg`]:"large"===n,[`${p}--sm`]:"small"===n},m=[`${p}-column-filter`,{selected:a}];return o().createElement(Wi(),{action:["click"],popupVisible:a,popup:o().createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},o().createElement("div",{className:"main"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:s,setList:e=>{const t=e.map((e=>e.dataIndex)),r=s.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||c(bn(e))}},s.map((e=>((e,t)=>{const{colSpan:r}=e;if(0===r)return o().createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle","main-handle"];return o().createElement("li",{key:e.dataIndex,className:"item"},o().createElement(L.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:r}=t.target;e.hidden=!r,c([...s])}}),o().createElement("i",{className:we()(n),title:f("qm.table.columnFilter.draggable")},o().createElement(Te.HolderOutlined,null)),o().createElement("span",{className:"text"},cn(e.title)))})(e)))))),popupClassName:we()(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{l(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},o().createElement("span",{className:we()(m),title:f("qm.table.columnFilter.text")},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.SettingOutlined,null)),o().createElement("span",null,f("qm.table.columnFilter.text"))))},$s=e=>{const{defaultValue:t,onClose:r,onOk:n}=e,{tableRef:i,selectionKeys:a,pagination:l,showSummary:s}=o().useContext($l),{rowSelection:c}=i.current.props,d=o().useRef(null),[p,h]=o().useState(!1),m=o().useMemo((()=>Object.assign({},{fileName:`${u()().format(Ul)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:a.length?"selected":"all","startIndex|endIndex":[1,l.total],footSummation:s?1:0,useStyle:0},t,{columns:pe(t.columns||[])})),[]),[g,b]=o().useState([{type:"INPUT",label:f("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:f("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:f("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:f("qm.table.export.all"),value:"all"},{text:f("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==c?.type},{text:f("qm.table.export.custom"),value:"custom"}]},onChange:e=>{g.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,b([...g])}},options:{min:1},disabled:!0},{type:"INPUT",label:f("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>o().createElement(Ds,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:f("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:f("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]),y=Ce("table");return o().createElement("div",{className:`${y}-export__setting`},o().createElement(Go,{ref:d,initialValues:m,items:g,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:p,onClick:()=>(async()=>{const[e,t]=await d.current.GET_FORM_DATA();if(!e){h(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),await le(1e3),h(!1),r()}})()},f("qm.table.export.text"))))},qs=o().forwardRef(((e,t)=>{const{tableColumns:r,open:n=!0}=e,{global:i}=o().useContext(c),{tableRef:a,flattenColumns:l,pagination:s,fetchParams:d,isFetch:p,isGroupSubtotal:h,showSummary:m,getSpan:g}=o().useContext($l),{exportExcel:b,fetch:y,showHeader:v}=a.current.props,{getTitleFromCellValue:x}=vs(),[E,S]=o().useState(!1),[w,C]=o().useState(!1),T=o().useMemo((()=>!!b?.fetch?.api),[b]),I=o().useMemo((()=>!s.total||w),[s.total,w]),N=o().useMemo((()=>Br(r,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn])),[r]),R=o().useMemo((()=>Br(l,[ns.expandableColumn,ns.selectionColumn,ns.operationColumn])),[l]),P=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.map(((e,n)=>{const i={...e,index:n,pageIndex:n},a=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=a,i._level=r,Array.isArray(e.children)&&(i.children=P(e.children,a,r+1)),R.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&Jr(i,t,Zr(i,t))})),i}))},O=(e,t)=>{const r={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,i=(h?dn(t):t).reduce(((e,t)=>{if(t?.[ns.summaryIgnore])return e;const r=Number(Zr(t,n));return Number.isNaN(r)?e:e+r}),0);Jr(r,n,i)})),[r]},k=(e,t,r,n)=>{const{precision:i,formatType:a}=r;let o=x(e,r,t,n);return i>=0&&!a&&""!==o&&(o=Number(o)),o},{exportXLSX:A,exportCSV:_}=As(),F=async e=>{const{api:t,formatter:r=(e=>e),afterFetch:n,dataKey:i}=y;let a=[];try{C(!0);const o=await t({...r(d),[ns.currentPageName]:1,[ns.pageSizeName]:e??s.total});if(200===o.code){let e=Array.isArray(o.data)?o.data:(0,te.get)(o.data,i)??[];e="function"==typeof n?await n(e):e,a=Wr(P(e))}}catch(e){}return C(!1),a},H=e=>{const t=i?.table?.recordExportLog;try{t?.({fileName:e})}catch(e){}},D=b?.fileName??`${u()().format(Ul)}.xlsx`,$=D.slice(D.lastIndexOf(".")+1).toLowerCase(),q=()=>{if(I)return L.message.warning(f("qm.table.export.warnText"));T?(async e=>{C(!0);try{const{api:t,params:r}=b.fetch,n=await t({columns:R.map((e=>{const{title:t,dataIndex:r,hidden:n}=e,{type:i}=e.filter||{};return{title:t,dataIndex:r,type:i,hidden:n}})),...d,...r,tsortby:void 0,tsummary:void 0,tgroupby:void 0,[ns.currentPageName]:void 0,[ns.pageSizeName]:void 0});n.data&&(Dt(n.data,e),H(e))}catch(e){}C(!1)})(D):S(!0)};o().useImperativeHandle(t,(()=>({clickHandle:q})));const M=Ce("table"),j={[`${M}-export`]:!0},K={visible:E,title:f("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},V={fileName:D.slice(0,D.lastIndexOf(".")),fileType:$,columns:N,useStyle:b?.cellStyle?1:0};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:we()(j),title:f("qm.table.export.textNoSpace"),onClick:()=>q()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.DownloadOutlined,null))),o().createElement(Er,K,o().createElement($s,{defaultValue:V,onClose:()=>S(!1),onOk:e=>{(async e=>{const{fileName:t,fileType:r,exportType:n,startIndex:i=1,endIndex:o}=e,{allTableData:l,selectionRows:s}=a.current;let c=[];if(p?("all"===n&&(c=await F()),"custom"===n&&(c=await F(o),c=c.slice(i-1))):("all"===n&&(c=l.slice(0)),"custom"===n&&(c=l.slice(i-1,o||void 0))),"selected"===n&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof b?.beforeExport)try{c=b?.beforeExport(c)}catch(e){}if("xlsx"===r){const r=await A(e,c,O,k);Dt(r,`${t}.xlsx`),H(`${t}.xlsx`)}if("csv"===r){const r=_(e,((e,t)=>{const{columns:r,footSummation:n}=e,i=Gr(r),a=$r(r);let o='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return o+=`<colgroup>${a.map((e=>{let{width:t,minWidth:r,renderWidth:n}=e;return`<col style="width:${t||n||r||ns.defaultColumnWidth}px">`})).join("")}</colgroup>`,v&&(o+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:r}=e;return 0===r?null:`<th colspan="${r}" rowspan="${t}">${cn(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(o+=`<tbody>${t.map((e=>`<tr>${a.map(((r,n)=>{const{rowSpan:i,colSpan:a}=g(e,r,e.index,n,t);return i&&a?`<td rowspan="${i}" colspan="${a}">${k(e,e.index,r,n)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),m&&n&&(o+=["<tfoot>",O(a,t).map((e=>`<tr>${a.map(((r,n)=>{const{dataIndex:i,summation:a}=r,o=a?.render?a.render(t):Zr(e,i);return`<td>${0===n&&""===o?f("qm.table.config.summaryText"):ne(o)?sn(o).join(""):o}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),o+="</table>",o})(e,c));Dt(r,`${t}.csv`),H(`${t}.csv`)}})(Object.assign({},e,{columns:qr(e.columns)}))}})))}));qs.displayName="TableExport";const Ms=qs,js=e=>{const{columns:t,onClose:r}=e,{tableRef:n,tableBodyRef:i,dataChange:a}=o().useContext($l),{beforeClipboard:l}=n.current.props,s=o().useRef(null),[c,d]=o().useState([{type:"INPUT_NUMBER",label:f("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:f("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:cn(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:f("qm.table.clipboard.content"),fieldName:"content",placeholder:f("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[u,p]=o().useState(!1),h=Ce("table");return o().createElement("div",{className:`${h}-clipboard__setting`},o().createElement("h3",{className:"info"},f("qm.table.clipboard.supportText")),o().createElement(Go,{ref:s,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r(),style:{marginRight:8}},f("qm.table.export.closeButton")),o().createElement(be,{type:"primary",loading:u,onClick:()=>(async()=>{const[e,o]=await s.current.GET_FORM_DATA();if(e)return;const{tableFullData:c,store:d}=n.current;p(!0);const u=o.content.trim().replace(/(\r|\n)$/,"");let h=u.replace(/"[^"]+"/g,"^");(u.match(/"[^"]+"/g)?.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," ")))||[]).forEach((e=>{h=h.replace(/\^/,e)}));let m=h.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof l)try{m=await l(m,m[0].map(((e,r)=>t[o.colIndex+r].dataIndex)))}catch(e){}m.forEach(((e,r)=>{e.forEach(((e,i)=>{const a=c[o.rowIndex-1+r],l=t[o.colIndex+i];if(a&&l){let t=!1;if(l.editRender){const e=l.editRender(a,l);t=!(e.disabled||e.extra?.disabled||n.current.fieldAuth[l.dataIndex]?.disabled)}t&&l.dictItems&&(t=l.dictItems.some((t=>t.value==e))),t&&(Jr(a,l.dataIndex,e),d.addToUpdated(a))}}))})),i.current.forceUpdate(),a(),L.message.success(f("qm.table.clipboard.success",{total:m.length})),p(!1),r()})()},f("qm.table.clipboard.text"))))},Ks=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{flattenColumns:n}=o().useContext($l),[i,a]=o().useState(!1),l=o().useMemo((()=>(e=>e.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))))(n)),[n]),s=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:s})));const c=Ce("table"),d={[`${c}-clipboard`]:!0},u={visible:i,title:f("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:we()(d),title:f("qm.table.clipboard.textNoSpace"),onClick:()=>s()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.CopyOutlined,null))),o().createElement(Er,u,o().createElement(js,{columns:l,onClose:()=>a(!1)})))}));Ks.displayName="TableClipboard";const Vs=Ks,zs=e=>{const{columns:t,onClose:r}=e,{tableRef:n,$size:i,selectionKeys:a,setSelectionKeysEffect:l}=o().useContext($l),{rowKey:s,rowSelection:c}=n.current.props,d=o().useRef(null),u=Nt(d),p=e=>e.map((e=>{const t={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:e.dictItems??[],render:e.render};return Array.isArray(e.children)&&(t.children=p(e.children)),t})),[h,m]=o().useState([{title:f("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...p(t.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))))]),[g]=o().useState((()=>{const{disabled:e}=c||{},t=n.current.selectionRows.map((e=>({...e,children:void 0})));return e?t.filter((t=>!e(t))):t})()),[b,y]=o().useState(300),v=Ot((()=>{const e=d.current;y(e.offsetHeight-2*Fi[i]-30)}),5);return Pt((()=>{v()}),[u.width]),o().createElement("div",{ref:d,style:{height:"100%"}},o().createElement(td,{size:i,columns:h,dataSource:g,rowKey:s,height:b,rowSelection:{type:"checkbox",selectedRowKeys:a,onChange:e=>l(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),o().createElement("div",{style:{height:10}}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>r()},f("qm.table.selectCollection.closeButton"))))},Bs=o().forwardRef(((e,t)=>{const{columns:r,open:n=!0}=e,{tableRef:i,getRowKey:a,selectionKeys:l,isFetch:s,isTableEmpty:c,setSelectionKeysEffect:d,setSelectionRows:u}=o().useContext($l),{rowSelection:p}=i.current.props,[h,m]=o().useState(!1),g=o().useRef(!1);Me((()=>{!g.current&&b()}),[c]);const b=async()=>{const{fetchSelectedRows:e,disabled:t=(e=>!1)}=p;if(s&&e)try{const r=await e.api(Object.assign({},{selectedKeys:l},e.params));if(200===r.code){let n=Array.isArray(r.data)?r.data:(0,te.get)(r.data,e.dataKey)??[];n=n.filter((e=>!t(e))),d(n.map(((e,t)=>a(e,t)))),u(n),g.current=!0}}catch(e){}},y=()=>{m(!0)};o().useImperativeHandle(t,(()=>({clickHandle:y})));const v=Ce("table"),x={visible:h,title:f("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>m(!1)};return o().createElement(o().Fragment,null,n&&o().createElement("span",{className:`${v}-select-collection`,title:f("qm.table.selectCollection.text"),onClick:()=>y()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.CheckSquareOutlined,null))),o().createElement(Er,x,o().createElement(zs,{columns:r,onClose:()=>m(!1)})))}));Bs.displayName="SelectCollection";const Us=Bs,Ws=require("localforage");var Gs=n.n(Ws);const Ys=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s\d{2}:\d{2}:\d{2})?$/.test(e),Xs=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,getRowKey:i,$size:a,flattenColumns:l,pagination:s,createWebPageData:d,setPagination:u,scrollYToRecord:p,setHighlightKey:h,setShouldToTop:m,isTreeTable:g,isWebPagination:b}=o().useContext($l),{uniqueKey:y}=n.current.props,x=o().useRef(null),E=o().useRef(null),S=o().useRef([]),w=o().useRef(""),C=o().useRef(-1),T=o().useRef("stop");Me((()=>{const e=Wr(d()).findIndex((e=>i(e,e.index)===w.current));p("",e)}),[s.current]);const I=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},N=e=>e.filter((e=>e?.dataIndex)).map((e=>({type:I(e.filter.type),fieldName:e.dataIndex,label:cn(e.title),tooltip:e.description,options:{dateType:"exactdate",itemList:e.dictItems??[]},onChange:async()=>{const[e,t]=await x.current.GET_FORM_DATA(),[r,n]=await E.current.GET_FORM_DATA(),i=(0,te.omitBy)(Object.assign({},t,n),de);k(i)}}))),R={case:0,fullchar:0},P=o().useMemo((()=>l.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex))).filter((e=>e.filter))),[l]),[O,k]=o().useState({}),[A,_]=o().useState(R),[F]=o().useState(N([P[0]])),[H]=o().useState(N(P.slice(1))),[D,$]=o().useState(0),q=o().useMemo((()=>!Object.keys(O).length),[O]);Me((()=>{T.current="ready"}),[O,A]);const M=e=>{_(Object.assign({},A,e))},j=(e,t,r)=>new Promise(((n,i)=>{L.Modal.confirm({title:f("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{r(),n()}})})),K=async e=>{if(!Object.keys(O).length)return L.Modal.warning({title:f("qm.button.confirmPrompt"),content:f("qm.table.fastSearch.queryCondition")});if("ready"===T.current&&(T.current="stop",S.current=(e=>{const{allTableData:t}=n.current,r=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];let a=!0;for(const t in e){const{type:r}=P.find((e=>e.dataIndex===t)).filter;let n=Zr(i,t),o=!0;if("text"===r||"textarea"===r?o=new RegExp(A.fullchar?`^${e[t]}$`:e[t],A.case?"":"i").test(n):(n=Ys(n)?n.slice(0,10):n,o=n==e[t]),!o){a=!1;break}}a&&r.push(i)}return r})(O),$(S.current.length)),!S.current.length)return h(""),L.Modal.warning({title:f("qm.button.confirmPrompt"),content:f("qm.table.fastSearch.notMatch")});"next"===e&&(C.current=C.current<0?0:C.current+1,C.current>S.current.length-1&&await j(f("qm.table.fastSearch.toTheEnd"),(()=>C.current=0),(()=>C.current=S.current.length-1))),"prev"===e&&(C.current=C.current<0?S.current.length-1:C.current-1,C.current<0&&await j(f("qm.table.fastSearch.toStart"),(()=>C.current=S.current.length-1),(()=>C.current=0)));const t=S.current[C.current],r=i(t,t.index);let a=t.index;if(g&&b){const e=mn(n.current.deriveRowKeys,r)[0];a=n.current.tableFullData.findIndex((t=>i(t,t.index)===e))}((e,t)=>{if(w.current=e,b){const{pageSize:e}=s,r=Math.ceil((t+1)/e);m(!1),u(Object.assign({},s,{current:r}))}else p(e)})(r,a),h(r)},V=()=>{x.current.RESET_FORM(),E.current.RESET_FORM()},z=o().useMemo((()=>y?`fastSearch_${y}`:""),[y]),[B,U]=o().useState([]),[W,G]=o().useState(""),[Y,X]=o().useState("");Me((()=>{if(Y){const{filters:e,config:t}=B.find((e=>e.value===Y)).list;x.current.SET_FIELDS_VALUE(ue(e,H.map((e=>e.fieldName)))),E.current.SET_FIELDS_VALUE(ue(e,F.map((e=>e.fieldName)))),k(e),_(t)}else V(),k({}),_(R)}),[Y]),o().useEffect((()=>{Q()}),[]);const Q=async()=>{if(!z)return;let e=await Gs().getItem(z);e||(e=await Z(z),Array.isArray(e)&&await Gs().setItem(z,e)),Array.isArray(e)&&e.length&&(U(e),X(e[0].value))},Z=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},J=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},ee=Ce("table");return o().createElement("div",{className:`${ee}-fast-search__setting`},o().createElement("div",{className:"main"},o().createElement("div",{className:"top"},o().createElement("div",{className:"container"},o().createElement(cr,{defaultActiveKey:"1",size:"small",tabBarExtraContent:o().createElement("span",null,f("qm.table.alert.total",{total:D}))},o().createElement(cr.TabPane,{tab:f("qm.table.fastSearch.tabPanes.0"),key:"1",forceRender:!0},o().createElement(Go,{ref:x,items:F,cols:1,labelWidth:110})),o().createElement(cr.TabPane,{tab:f("qm.table.fastSearch.tabPanes.1"),key:"2",forceRender:!0},o().createElement(Go,{ref:E,items:H,cols:1,labelWidth:110})))),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:a,value:W,placeholder:f("qm.table.highSearch.configText"),disabled:q,onChange:e=>{const{value:t}=e.target;G(t)}}),o().createElement(be,{type:"primary",disabled:!W||q,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!z)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...B,{text:W,value:e,list:{filters:O,config:A}}];U(t),X(e),G(""),await Gs().setItem(z,t),await J(z,t)})()},f("qm.table.highSearch.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[a]}px`}},o().createElement("span",null,f("qm.table.fastSearch.savedSetting"))),o().createElement("ul",null,B.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===Y}),title:e.text,onClick:()=>(e=>{X(e!==Y?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=B.filter((t=>t.value!==e));U(t),e===Y&&X(""),await Gs().setItem(z,t),await J(z,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!B.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement("div",{className:"bottom"},o().createElement("div",null,o().createElement(L.Checkbox,{checked:!!A.case,onChange:e=>M({case:e.target.checked})},f("qm.table.fastSearch.matchCase")),o().createElement(L.Checkbox,{checked:!!A.fullchar,onChange:e=>M({fullchar:e.target.checked})},f("qm.table.fastSearch.matchFullchar"))),o().createElement("div",null,o().createElement(be,{onClick:()=>V()},f("qm.table.fastSearch.clear"))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,height:`${Fi[a]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.fastSearch.closeButton")),o().createElement(be,{type:"primary",style:{marginRight:8},onClick:()=>K("prev")},f("qm.table.fastSearch.queryPrev")),o().createElement(be,{type:"primary",onClick:()=>K("next")},f("qm.table.fastSearch.queryNext"))))},Qs=o().forwardRef(((e,t)=>{const{open:r=!0}=e,{$size:n}=o().useContext($l),[i,a]=o().useState(!1),l=()=>{a(!0)};o().useImperativeHandle(t,(()=>({clickHandle:l})));const s=Ce("table"),c={visible:i,title:f("qm.table.fastSearch.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:`${Fi[n]+20}px`},onClose:()=>a(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${s}-super-search`,title:f("qm.table.fastSearch.text"),onClick:()=>l()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.MonitorOutlined,null))),o().createElement(Er,c,o().createElement(Xs,{onClose:()=>a(!1)})))}));Qs.displayName="FastSearch";const Zs=Qs,Js=e=>{const{columns:t,group:r,summary:n}=e,{tableRef:i,$size:a,pagination:l,fetchParams:s,isFetch:c}=o().useContext($l),{fetch:d}=i.current.props,p=e=>{const r=t.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:r.dictItems??[]}},h=r.map((e=>({dataIndex:e.group,...p(e.group)}))),m=n.map((e=>e.summary===ns.groupSummary.total.value?{dataIndex:e.summary,title:ns.groupSummary.total.text,formula:e.formula}:{dataIndex:e.summary,...p(e.summary),formula:e.formula})),g=o().useMemo((()=>Object.assign({},s,{[ns.sorterFieldName]:void 0,[ns.groupSummary.summaryFieldName]:n.map((e=>`${e.formula}|${e.summary}`)).join(","),[ns.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[ns.currentPageName]:1})),[s,r,n]),[b,y]=o().useState(((e,r)=>[{title:f("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...r.map((e=>{const r=t.find((t=>t.dataIndex===e.dataIndex))?.groupSummary;let n=r?{summation:r}:null;return e.dataIndex===ns.groupSummary.total.value&&(n={dataIndex:ns.groupSummary.recordTotalIndex,summation:{render:()=>l.total}}),{...e,..."count"===e.formula||"sum"===e.formula?n:null}}))])(h,m)),[v]=o().useState(c?[]:(e=>{const t=pn(e,r.map((e=>e.group))),i=[];return t.forEach((e=>{const t={};b.forEach((r=>{const{dataIndex:n}=r;"index"!==n&&Jr(t,n,Zr(e[0],n))})),n.forEach((r=>{const n=r.summary!==ns.groupSummary.total.value?r.summary:ns.groupSummary.recordTotalIndex,i=r.formula;"count"===i&&Jr(t,n,e.length),"sum"===i&&Jr(t,n,(0,te.sumBy)(e,n)),"max"===i&&Jr(t,n,(0,te.maxBy)(e,n)[n]),"min"===i&&Jr(t,n,(0,te.minBy)(e,n)[n]),"avg"===i&&Jr(t,n,((0,te.sumBy)(e,n)/e.length).toFixed(2))})),i.push(t)})),i})(i.current.tableFullData)),x={size:a,height:400,...c?{fetch:{api:d.api,params:g,dataKey:d?.dataKey}}:{dataSource:v},columns:b,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${u()().format(Ul)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)};return o().createElement(td,x)},ec=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,$size:i,flattenColumns:a}=o().useContext($l),{uniqueKey:l}=n.current.props,s=o().useRef(null),d=o().useRef(null),[u,p]=o().useState(!1),[h,m]=o().useState([]),[g,b]=o().useState(""),[y,x]=o().useState("");Me((()=>{if(y){const{group:e,summary:t}=h.find((e=>e.value===y)).list;N(e),k(t)}else{const e=H();N(e?.group||[]),k(e?.summary||[])}}),[y]),o().useEffect((()=>{D()}),[]);const E=o().useMemo((()=>l?`summary_${l}`:""),[l]),S=o().useMemo((()=>a.filter((e=>![ns.expandableColumn,ns.selectionColumn,"index","pageIndex",ns.operationColumn].includes(e.dataIndex)))),[a]),w=S.filter((e=>!e.groupSummary)).map((e=>({text:cn(e.title),value:e.dataIndex}))),C=[ns.groupSummary.total,...S.filter((e=>!!e.groupSummary)).map((e=>({text:cn(e.title),value:e.dataIndex})))],T=[{text:f("qm.table.groupSummary.sumText"),value:"sum"},{text:f("qm.table.groupSummary.maxText"),value:"max"},{text:f("qm.table.groupSummary.minText"),value:"min"},{text:f("qm.table.groupSummary.avgText"),value:"avg"},{text:f("qm.table.groupSummary.countText"),value:"count"}],[I,N]=o().useState([]),[R,P]=o().useState([{title:f("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{s.current.REMOVE_RECORDS(t)}},f("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:f("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>({...e,disabled:I.findIndex((t=>t.group===e.value))>-1})))})}]),[O,k]=o().useState([]),[A,_]=o().useState([{title:f("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(t)}},f("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:f("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>({...e,disabled:O.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:f("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===ns.groupSummary.total.value?T.slice(T.length-1):T})}]),F=o().useMemo((()=>{const e=I.length&&I.every((e=>Object.values(e).every((e=>""!==e)))),t=O.length&&O.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[I,O]),H=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},D=async()=>{if(!E)return;const e=H();if(e){const{group:t,summary:r}=e;N(t),k(r)}let t=await Gs().getItem(E);t||(t=await $(E),Array.isArray(t)&&await Gs().setItem(E,t)),Array.isArray(t)&&t.length&&(m(t),!e&&x(t[0].value))},$=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},q=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},M=Ce("table"),j={visible:u,title:f("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return o().createElement("div",{className:`${M}-group-summary__setting`},o().createElement("div",{className:"main"},o().createElement("div",{style:{width:"30%"}},o().createElement(td,{ref:s,size:i,columns:R,dataSource:I,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{N(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{s.current.INSERT_RECORDS({})},style:{marginRight:0}}))),o().createElement("div",{className:"container line"},o().createElement(td,{ref:d,size:i,columns:A,dataSource:O,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>_(e),onDataChange:e=>{k(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:i,value:g,placeholder:f("qm.table.groupSummary.configText"),disabled:F,onChange:e=>{const{value:t}=e.target;b(t)}}),o().createElement(be,{type:"primary",disabled:!g||F,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!E)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...h,{text:g,value:e,list:{group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))}}];m(t),x(e),b(""),await Gs().setItem(E,t),await q(E,t)})()},f("qm.table.groupSummary.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[i]}px`}},o().createElement("span",null,f("qm.table.groupSummary.savedSetting"))),o().createElement("ul",null,h.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===y}),title:e.text,onClick:()=>(e=>{x(e!==y?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.groupSummary.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=h.filter((t=>t.value!==e));m(t),e===y&&x(""),await Gs().setItem(E,t),await q(E,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!h.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement(Er,j,o().createElement(Js,{columns:S,group:I,summary:O})),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.groupSummary.closeButton")),o().createElement(be,{type:"primary",disabled:F,onClick:()=>(E&&sessionStorage.setItem(E,JSON.stringify({group:I.filter((e=>!!e.group)),summary:O.filter((e=>!!e.summary))})),void p(!0))},f("qm.table.groupSummary.confirmButton"))))},tc=o().forwardRef(((e,t)=>{const{open:r=!0}=e,[n,i]=o().useState(!1),a=()=>{i(!0)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table"),s={visible:n,title:f("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${l}-group-summary`,title:f("qm.table.groupSummary.text"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.PieChartOutlined,null))),o().createElement(Er,s,o().createElement(ec,{onClose:()=>i(!1)})))}));tc.displayName="GroupSummary";const rc=tc,nc=e=>{const{onClose:t}=e,{global:r}=o().useContext(c),{tableRef:n,$size:i,flattenColumns:a,setSuperFilters:l,clearTableFilter:s}=o().useContext($l),{uniqueKey:d}=n.current.props,u=o().useRef(null),[p,h]=o().useState([]),[m,g]=o().useState([]),[b,y]=o().useState(""),[x,E]=o().useState("");Me((()=>{h(x?m.find((e=>e.value===x)).list:H()||[])}),[x]),o().useEffect((()=>{D()}),[]);const S=o().useMemo((()=>d?`superSearch_${d}`:""),[d]),w=o().useMemo((()=>a.filter((e=>!!e.filter))),[a]),C=un(p),T=o().useMemo((()=>!(C&&Hr(C))),[C]),I=o().useMemo((()=>!!p.length&&T),[p,T]),N=[{value:"and",text:f("qm.table.highSearch.andText")},{value:"or",text:f("qm.table.highSearch.orText")}],R=a.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:cn(e.title)}))),P=e=>["in","nin"].includes(e),O=(e,t)=>{let r;switch(e){case"number":r="number";break;case"date":r="date";break;case"checkbox":case"radio":r=t?"select-multiple":"select";break;default:r="text"}return r},k=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:f("qm.table.highSearch.gtText")},{value:"<",text:f("qm.table.highSearch.ltText")},{value:">=",text:f("qm.table.highSearch.gteText")},{value:"<=",text:f("qm.table.highSearch.lteText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":t=[{value:"in",text:f("qm.table.highSearch.inText")},{value:"nin",text:f("qm.table.highSearch.ninText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:f("qm.table.highSearch.likeText")},{value:"==",text:f("qm.table.highSearch.eqText")},{value:"!=",text:f("qm.table.highSearch.neqText")}]}return t},[A,_]=o().useState([{title:f("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>o().createElement("div",null,o().createElement(be,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},f("qm.table.highSearch.removeText")))},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>o().createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,editRender:e=>({type:"select",editable:!0,items:R,rules:[{required:!0,message:f("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{const r=Object.values(t)[0],n=w.find((e=>e.dataIndex===r))?.filter.type,i=k(n);e.fieldType=n,e.expression=r?i[0]?.value:"",e.condition=P(e.expression)?[]:"",r||(e.bracketLeft=e.bracketRight="")}})},{title:f("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:f("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{const t=w.find((t=>t.dataIndex===e.fieldName))?.filter.type;return{type:"select",editable:!0,items:k(t),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=P(e.expression)?[]:""}}}},{title:f("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{const t=w.find((t=>t.dataIndex===e.fieldName)),r=t?.filter.type,n=t?.filter?.items??t?.dictItems??[];return{type:O(r,P(e.expression)),editable:!0,items:n,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:f("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>o().createElement("span",{style:{fontSize:"20px"}},e)},{title:f("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,editRender:e=>({type:"select",editable:!0,items:N,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),F=()=>{S&&sessionStorage.setItem(S,JSON.stringify(p.filter((e=>!!e.fieldName))))},H=()=>{if(!S)return;const e=sessionStorage.getItem(S);return e?JSON.parse(e):null},D=async()=>{if(!S)return;const e=H();e&&h(e);let t=await Gs().getItem(S);t||(t=await $(S),Array.isArray(t)&&await Gs().setItem(S,t)),Array.isArray(t)&&t.length&&(g(t),!e&&E(t[0].value))},$=async e=>{const t=r?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},q=async(e,t)=>{const n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}},M=Ce("table");return o().createElement("div",{className:`${M}-super-search__setting`},o().createElement("div",{className:"main"},o().createElement("div",{className:"container"},o().createElement(td,{ref:u,size:i,columns:A,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>_(e),onRowClick:(e,t)=>{const{dataIndex:r}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(r)&&("bracketLeft"===r&&(e[r]=e[r]?"":"("),"bracketRight"===r&&(e[r]=e[r]?"":")"),h([...p]))},onDataChange:e=>{h(e)}},o().createElement(be,{type:"primary",icon:o().createElement(Te.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),ns.highSearch.showSQL&&C&&o().createElement("code",{className:"lang-js"},C)),o().createElement("div",{className:"saved line"},o().createElement("div",{className:"form-wrap"},o().createElement(L.Input,{size:i,value:b,placeholder:f("qm.table.highSearch.configText"),disabled:T,onChange:e=>{const{value:t}=e.target;y(t)}}),o().createElement(be,{type:"primary",disabled:!b||T,style:{marginLeft:"10px"},onClick:()=>(async()=>{if(!S)return v("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=ln(),t=[...m,{text:b,value:e,list:p.filter((e=>!!e.fieldName))}];g(t),E(e),y(""),await Gs().setItem(S,t),await q(S,t)})()},f("qm.table.highSearch.saveButton"))),o().createElement("div",{className:"card-wrap"},o().createElement("h5",{style:{height:`${ns.rowHeightMaps[i]}px`}},o().createElement("span",null,f("qm.table.highSearch.savedSetting"))),o().createElement("ul",null,m.map((e=>o().createElement("li",{key:e.value,className:we()({selected:e.value===x}),title:e.text,onClick:()=>(e=>{E(e!==x?e:"")})(e.value)},o().createElement("span",{className:"title"},e.text),o().createElement("i",{className:"svgicon close",title:f("qm.table.highSearch.removeText"),onClick:t=>{t.stopPropagation(),(async e=>{if(!e)return;const t=m.filter((t=>t.value!==e));g(t),e===x&&E(""),await Gs().setItem(S,t),await q(S,t)})(e.value)}},o().createElement(Te.CloseCircleOutlined,null))))),!m.length&&o().createElement("div",{style:{padding:jl}},o().createElement(ft,null)))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>t(),style:{marginRight:8}},f("qm.table.highSearch.closeButton")),o().createElement(be,{type:"primary",disabled:I,onClick:()=>(s(),l(p.map((e=>ue(e,["index","pageIndex"])))),F(),void t())},f("qm.table.highSearch.searchButton"))))},ic=o().forwardRef(((e,t)=>{const{open:r=!0}=e,[n,i]=o().useState(!1),a=()=>{i(!0)};o().useImperativeHandle(t,(()=>({clickHandle:a})));const l=Ce("table"),s={visible:n,title:f("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return o().createElement(o().Fragment,null,r&&o().createElement("span",{className:`${l}-super-search`,title:f("qm.table.highSearch.text"),onClick:()=>a()},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.FunnelPlotOutlined,null))),o().createElement(Er,s,o().createElement(nc,{onClose:()=>i(!1)})))}));ic.displayName="SuperSearch";const ac=ic,oc=o().forwardRef(((e,t)=>{const{tableColumns:r,showFullScreen:n,showReload:i,showPrint:a,showImport:l,showExport:s,showClipboard:d,showCollection:u,showFastSearch:p,showSuperSearch:h,showGroupSummary:m,showToolBox:g}=e,{global:b}=o().useContext(c),{tableRef:y,isFullScreen:x,$size:E}=o().useContext($l),{uniqueKey:S,exportExcel:w}=y.current.props,C=o().useRef(null),T=o().useRef(null),I=o().useRef(null),N=o().useRef(null),R=o().useRef(null),P=o().useRef(null),O=o().useRef(null),k=o().useRef(null),A=o().useRef(null),_=o().useRef(null),F=o().useRef(!1),H=o().useMemo((()=>S?`toolBox_${S}`:""),[S]),[D,$]=o().useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,groupSummary:!1}),q={fullScreen:n,reload:i,print:a,import:l,export:s&&!w?.hideIcon,clipboard:d,collection:u,fastSearch:p,superSearch:h,groupSummary:m},[M,j]=o().useState(!1);Me((()=>{F.current&&(V(),F.current=!1)}),[D]),o().useEffect((()=>{K()}),[]),o().useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return v("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const K=()=>{if(!H||!g)return;const e=JSON.parse(localStorage.getItem(H));e||z(H).then((e=>{e&&($(Object.assign({},D,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},D,e))},V=()=>{if(!H||!g)return;const e={};for(const t in D)D[t]&&(e[t]=D[t]);localStorage.setItem(H,JSON.stringify(e)),B(H,e)},z=async e=>{const t=b?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},B=async(e,t)=>{const r=b?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}},U=async e=>{j(!1),await le(100),e.current.clickHandle()},W=(e,t)=>{F.current=!0,$(Object.assign({},D,{[t]:e}))},G=Ce("table"),Y={"top-toolbox__popper":!0,[`${G}--lg`]:"large"===E,[`${G}--sm`]:"small"===E};return o().createElement(o().Fragment,null,n&&o().createElement(gs,{ref:C,isFullScreen:x,open:!g||D.fullScreen}),i&&o().createElement(ys,{ref:T,open:!g||D.reload}),a&&o().createElement(Es,{ref:I,tableColumns:r,open:!g||D.print}),l&&o().createElement(Hs,{ref:N,tableColumns:r,open:!g||D.import}),s&&o().createElement(Ms,{ref:R,tableColumns:r,open:(!g||D.export)&&!w?.hideIcon}),d&&o().createElement(Vs,{ref:P,open:!g||D.clipboard}),u&&o().createElement(Us,{ref:O,columns:r,open:!g||D.collection}),p&&o().createElement(Zs,{ref:k,open:!g||D.fastSearch}),m&&o().createElement(rc,{ref:A,open:!g||D.groupSummary}),h&&o().createElement(ac,{ref:_,open:!g||D.superSearch}),g&&o().createElement(L.Dropdown,{open:M,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.fullScreen,style:{marginRight:6},onChange:e=>W(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.screen.full"))),onClick:()=>U(C)},{key:"reload",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.reload,style:{marginRight:6},onChange:e=>W(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.refresh.text"))),onClick:()=>U(T)},{key:"print",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.print,style:{marginRight:6},onChange:e=>W(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.print.text"))),onClick:()=>U(I)},{key:"import",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.import,style:{marginRight:6},onChange:e=>W(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.import.textNoSpace"))),onClick:()=>U(N)},{key:"export",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.export,style:{marginRight:6},onChange:e=>W(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.export.textNoSpace"))),onClick:()=>U(R)},{key:"clipboard",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.clipboard,style:{marginRight:6},onChange:e=>W(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.clipboard.textNoSpace"))),onClick:()=>U(P)},{key:"collection",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.collection,style:{marginRight:6},onChange:e=>W(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.selectCollection.text"))),onClick:()=>U(O)},{key:"fastSearch",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.fastSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.fastSearch.text"))),onClick:()=>U(k)},{key:"groupSummary",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.groupSummary,style:{marginRight:6},onChange:e=>W(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.groupSummary.text"))),onClick:()=>U(A)},{key:"superSearch",label:o().createElement(o().Fragment,null,o().createElement(L.Checkbox,{checked:D.superSearch,style:{marginRight:6},onChange:e=>W(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),o().createElement("span",null,f("qm.table.highSearch.text"))),onClick:()=>U(_)}];return o().createElement(L.Menu,{items:e.filter((e=>q[e.key]))})})(),overlayClassName:we()(Y),overlayStyle:{minWidth:120},onOpenChange:e=>{j(e)}},o().createElement("span",{className:`${G}-toolbox`,title:f("qm.table.toolbox.text")},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.AppstoreAddOutlined,null)))))}));oc.displayName="ToolBox";const lc=oc,sc=(e,t)=>e.map((e=>(e.children&&(e.children=sc(e.children,t)),t(e)))),cc=o().forwardRef(((e,t)=>{const{columns:r}=e,{global:n}=o().useContext(c),{tableRef:i,$size:a}=o().useContext($l),{showColumnDefine:l,uniqueKey:s,onlyShowIcon:d,columnsChange:u}=i.current.props,p=o().useRef([]),[h,m]=o().useState(!1),g=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),b=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),y=o().useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),v=o().useMemo((()=>s?`table_${s}`:""),[s]);Me((()=>{E(r)}),[r]),o().useLayoutEffect((()=>{S()}),[]),o().useImperativeHandle(t,(()=>({initialHandler:S})));const x=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=x(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),{dataIndex:e.dataIndex,...t}})),E=e=>{if(!v)return;const t=x(e),r=JSON.parse(localStorage.getItem(v));i.current.columnsDefined&&!(0,te.isEqual)(t,r)&&(localStorage.setItem(v,JSON.stringify(t)),(async(e,t)=>{const r=n?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})(v,t))},S=()=>{const e=(()=>{if(!v)return;const e=JSON.parse(localStorage.getItem(v));return e||(async e=>{const t=n?.getComponentConfigApi;if(t)try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}})(v).then((e=>{e?(localStorage.setItem(v,JSON.stringify(e)),S()):n?.getComponentConfigApi&&E(r)})).catch((()=>{})),e?(0,te.xor)(Mr(e).map((e=>e.dataIndex)),Mr(r).map((e=>e.dataIndex))).length>0?sc(r,(t=>{const r=Kr(e,t.dataIndex);return r&&(void 0!==r.hidden&&(t.hidden=r.hidden),void 0!==r.fixed&&(t.fixed=r.fixed),void 0!==r.width&&(t.width=r.width),void 0!==r.renderWidth&&(t.renderWidth=r.renderWidth)),t})):sc(e,(e=>{const t=Kr(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)})):void 0})();var t;e&&(t=w(e),p.current=t,u?.(e))},w=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((r,n)=>{const i=r.colSpan;i>1&&e.slice(n+1,n+i).every((e=>{let{colSpan:t}=e;return 0===t}))&&t.push(e.slice(n,n+i))})),t},C=e=>{const t=[];e.forEach((r=>{const{colSpan:n,dataIndex:i}=r;if(0===n)return;if(1===n)return t.push(r);const a=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===a)return t.push(r);t.push(...p.current[a].map(((t,n)=>{let{dataIndex:i}=t;const a=e.find((e=>e.dataIndex===i));return n>0&&(void 0!==r.hidden&&(a.hidden=r.hidden),void 0!==r.fixed?a.fixed=r.fixed:a.fixed&&delete a.fixed),a})))})),r.forEach(((e,r)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(r,0,e)})),u?.(t)},T=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,C(r))},I=(e,t)=>{const{colSpan:n,noFixed:i}=e;if(0===n)return o().createElement("li",{key:e.dataIndex,style:{display:"none"}});const a=cn(e.title),l=["svgicon","handle",`${t}-handle`],s=o().createElement("li",{key:e.dataIndex,className:"item"},o().createElement(L.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,C(r)}}),o().createElement("i",{className:we()(l),title:f("qm.table.columnFilter.draggable")},o().createElement(Te.HolderOutlined,null)),o().createElement("span",{className:"text",title:a},a),"main"===t?o().createElement("span",{className:we()("fixed",i?"disabled":"")},o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedLeft"),onClick:()=>T(e,"left")},o().createElement(Te.StepBackwardOutlined,null)),o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedRight"),onClick:()=>T(e,"right")},o().createElement(Te.StepForwardOutlined,null))):"sub"!==t?o().createElement("span",{className:we()("fixed",i?"disabled":"")},o().createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.cancelFixed"),onClick:()=>T(e)},o().createElement(Te.CloseCircleOutlined,null))):null);return!e.hidden&&e.children?.length?o().createElement(L.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:N(e.children,e.dataIndex)},s):s},N=(e,t)=>o().createElement("div",{className:"column-filter--wrap"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:n=>{const i=n.map((e=>e.dataIndex)),a=e.map((e=>e.dataIndex));(0,te.isEqual)(i,a)||((e,t)=>{Kr(r,t).children=e,u?.([...r])})(bn(n),t)}},e.map((e=>I(e,"sub"))))),R=Ce("table"),P={[`${R}__popper`]:!0,"column-filter__popper":!0,[`${R}--lg`]:"large"===a,[`${R}--sm`]:"small"===a},O=[`${R}-column-filter`,{selected:h}];return l?o().createElement(Wi(),{action:["click"],popupVisible:h,popup:o().createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},o().createElement("div",{className:"reset"},o().createElement(be,{type:"text",size:"small",onClick:()=>{const e=t=>t.map((t=>{const n=Kr(r,t.dataIndex)||pe(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));u?.(e(i.current.originColumns))}},f("qm.table.columnFilter.reset"))),o().createElement("div",{className:"left"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),r=g.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...bn(e),...y,...b])}},g.map((e=>I(e,"left"))))),o().createElement("div",{className:"divider"}),o().createElement("div",{className:"main"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),r=y.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...g,...bn(e),...b])}},y.map((e=>I(e,"main"))))),o().createElement("div",{className:"divider"}),o().createElement("div",{className:"right"},o().createElement(hi.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),r=b.map((e=>e.dataIndex));(0,te.isEqual)(t,r)||C([...g,...y,...bn(e)])}},b.map((e=>I(e,"right")))))),popupClassName:we()(P),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},o().createElement("span",{className:we()(O),title:d?f("qm.table.columnFilter.text"):void 0},o().createElement("i",{className:"svgicon icon"},o().createElement(Te.SettingOutlined,null)),!d&&o().createElement("span",null,f("qm.table.columnFilter.text")))):null}));cc.displayName="ColumnFilter";const dc=cc,uc=()=>o().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"}));function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pc.apply(this,arguments)}const hc=e=>{const{column:t,filters:r}=e,{$size:n,setFilters:i,clearSuperFilters:a}=o().useContext($l),l=o().useRef(null),s=o().useRef(null),c=o().useRef(null),[d,u]=o().useState(!1),[p,h]=o().useState(!1),[m,g]=o().useState({}),b=o().useMemo((()=>{const{dataIndex:e,filter:r}=t;return`${e}|${r.type}`}),[t]),y=o().useMemo((()=>{let e=!1;for(const t in r[b])if(!de(r[b][t])||p){e=!0;break}return e}),[b,r,p]);o().useLayoutEffect((()=>{d&&setTimeout((()=>x()),20)}),[d]),o().useEffect((()=>{(0,te.isEqual)(m[b],r[b])||g({[b]:r[b]||{}}),h(""===r[b]?.["=="])}),[r]);const x=()=>{switch(t.filter.type){case"text":l.current.focus();break;case"number":s.current.focus();break;case"textarea":c.current.focus()}},E=e=>{e&&g(e),a(),i((e=>{for(const t in e){for(const r in e[t])if(de(e[t][r])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][r])continue;delete e[t][r]}Object.keys(e[t]).length||delete e[t]}return e})({...r,...m,...e})),u(!1)},S={text:e=>o().createElement(o().Fragment,null,o().createElement(L.Input,{ref:l,size:n,placeholder:f("qm.table.filter.searchText",{text:cn(e.title)}),style:{width:"180px"},value:m[b]?.like??"",disabled:p,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&E()}}),o().createElement("div",{style:{marginTop:8}},o().createElement(L.Checkbox,{checked:p,onChange:e=>{const{checked:t}=e.target,r=t?"":null;g((e=>Object.assign({},e,{[b]:{"==":r,like:null}}))),h(t)}},f("qm.table.filter.nullValue")))),textarea:e=>o().createElement(o().Fragment,null,o().createElement(L.Input.TextArea,{ref:c,size:n,placeholder:f("qm.table.filter.searchAreaText",{text:cn(e.title)}),style:{width:"220px"},value:m[b]?.likes??"",disabled:p,onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),E())}}),o().createElement("div",{style:{marginTop:8}},o().createElement(L.Checkbox,{checked:p,onChange:e=>{const{checked:t}=e.target,r=t?"":null;g((e=>Object.assign({},e,{[b]:{"==":r,like:null}}))),h(t)}},f("qm.table.filter.nullValue")))),number:e=>{const t=e=>({value:m[b]?.[e]??"",size:n,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||g((r=>Object.assign({},r,{[b]:Object.assign({},r[b],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&E()}});return o().createElement("ul",null,o().createElement("li",null,o().createElement("span",null,"> "),o().createElement(L.InputNumber,pc({ref:s},t(">"),{placeholder:f("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"< "),o().createElement(L.InputNumber,pc({},t("<"),{placeholder:f("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"= "),o().createElement(L.InputNumber,pc({},t("=="),{placeholder:f("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"!="),o().createElement(L.InputNumber,pc({},t("!="),{placeholder:f("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>({value:an(m[b]?.[e],zl),format:zl,size:n,onChange:t=>{g((r=>Object.assign({},r,{[b]:Object.assign({},r[b],{[e]:on(t,zl)})})))},onKeyDown:e=>{13===e.keyCode&&E()}});return o().createElement("ul",null,o().createElement("li",null,o().createElement("span",null,"> "),o().createElement(j,pc({},t(">"),{placeholder:f("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"< "),o().createElement(j,pc({},t("<"),{placeholder:f("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"= "),o().createElement(j,pc({},t("=="),{placeholder:f("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),o().createElement("li",null,o().createElement("span",null,"!="),o().createElement(j,pc({},t("!="),{placeholder:f("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("ul",null,o().createElement(L.Radio.Group,{style:{width:"100%"},value:m[b]?.["=="],onChange:e=>{const{value:t}=e.target;g((e=>Object.assign({},e,{[b]:{"==":t}})))}},n.map((e=>o().createElement("li",{key:e.value},o().createElement(L.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("ul",null,o().createElement(L.Checkbox.Group,{style:{width:"100%"},value:m[b]?.in,onChange:e=>{g((t=>Object.assign({},t,{[b]:{in:e}})))}},n.map((e=>o().createElement("li",{key:e.value},o().createElement(L.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{const{filter:t,dictItems:r=[]}=e,n=t.items||r;return o().createElement("div",{style:{height:200,...t.style}},o().createElement(Dl,{multiple:!0,value:m[b]?.in||[],dataSource:n,onCheckChange:e=>{const t=e.map((e=>e.value));g((e=>Object.assign({},e,{[b]:{in:t}})))}}))}},w=Ce("table"),C={"head-filter__popper":!0,[`${w}--lg`]:"large"===n,[`${w}--sm`]:"small"===n},T=["cell--filter",{selected:d,actived:y}];return o().createElement(Wi(),{action:["click"],popupVisible:d,popup:(()=>{const e=t.filter.type,r=S[e];return r?o().createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},o().createElement("div",null,r(t)),o().createElement(L.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},o().createElement(be,{size:n,onClick:()=>(E({[b]:{}}),void h(!1))},f("qm.table.filter.reset")),o().createElement(be,{type:"primary",size:n,onClick:()=>E()},f("qm.table.filter.search")))):(v("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:we()(C),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{u(e)},builtinPlacements:Wl,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},o().createElement("div",{className:we()(T),title:f("qm.table.filter.text"),onClick:e=>e.stopPropagation()},o().createElement("span",{className:"svgicon icon"},o().createElement(uc,null))))},mc=e=>{const{column:t}=e,{tableRef:r,bordered:n}=o().useContext($l),{columns:i,resizable:a,columnsChange:l=ae}=r.current.props,s=o().useMemo((()=>zr(t)),[t]),c={resizable:!0,"is--line":a&&!n};return o().createElement("div",{className:we()(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n}=r.current,a=n.$resizableBar,o=t.offsetWidth/2,c=e.clientX,d=Yr(t,n.$table).left-n.$tableBody.parentNode.parentNode.scrollLeft+o;n.$table.classList.add("c--resize"),a.style.left=`${d}px`,a.style.display="block";const u=s.width||s.renderWidth;let p=u;return document.onmousemove=function(e){if("number"!=typeof u)return;const t=e.clientX-c,r=u+t;r<(s.minWidth||ns.defaultColumnWidth)||(p=Math.floor(r),a.style.left=`${t+d}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),a.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(Kr(i,s.dataIndex).width=p,l([...i]))},!1}})},fc=e=>{const{selectionKeys:t}=e,{tableRef:r,getRowKey:n,fetchParams:i,createWebPageData:a,setSelectionKeysEffect:l,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=o().useContext($l),{rowSelection:p}=r.current.props,{fetchAllRowKeys:h,selectAllOnCurrentPage:m,filterable:g,onSelectAll:b}=p,y=o().useRef([]),v=o().useMemo((()=>d&&!!h),[d,h]),x=o().useMemo((()=>!v&&!!m),[v,m]),E=o().useMemo((()=>(g??!0)&&!x),[g,x]),S=()=>u?a():r.current.tableFullData,w=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>n(e,e.index)))},C=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:i}=p;if(v)return y.current.length?y.current:(0,te.union)(t,w());if(!x)return i?t.filter((t=>!i(e.get(t)))):t;const a=i?S().filter((e=>!i(e))).map((e=>n(e,e.index))):S().map((e=>n(e,e.index)));return(0,te.union)(a,w())})(),T=t.filter((e=>!C.includes(e))),I=t.length-T.length,N=I>0&&I<C.length,R=!!I&&I===C.length;s(T);const P=async()=>{const e=h;let t=[];c(!0);try{const r=await e.api(i);if(200===r.code){t=Array.isArray(r.data)?r.data:(0,te.get)(r.data,e.dataKey)??[];const{disabled:i}=p;i&&(t=(0,te.xor)(t,S().filter((e=>i(e))).map((e=>n(e,e.index))))),y.current=t}}catch(e){}return c(!1),t},O=async e=>{let t=[];t=v?e?await P():[]:e?C.slice(0):[],t=[...new Set([...t,...T])],l(t),b?.(e,t)};return o().createElement("div",{className:"cell--selection"},o().createElement(L.Checkbox,{checked:R,indeterminate:N,disabled:!C.length,onChange:e=>O(e.target.checked)}),E&&o().createElement(L.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>(()=>{const e=[{key:1,label:f("qm.table.selection.all"),onClick:()=>{O(!0)}},{key:2,label:f("qm.table.selection.invert"),onClick:()=>(async()=>{let e=[];e=v?(0,te.xor)(t,await P()):(0,te.xor)(t,C),e=[...new Set([...e,...T])],l(e)})()},{key:3,label:f("qm.table.selection.clear"),onClick:()=>{O(!1)}}];return o().createElement(L.Menu,{items:e})})()},o().createElement(Te.DownOutlined,{className:"svgicon icon"})),x&&o().createElement(L.Tooltip,{placement:"top",title:f("qm.table.selection.currentPage")},o().createElement(Te.InfoCircleOutlined,{className:"info"})))},gc=e=>{const{style:t}=e,{tableRef:r,isTreeTable:n,setRowExpandedKeys:i}=o().useContext($l),{expandable:a}=r.current.props,[l,s]=o().useState(a?.defaultExpandAllRows||!1);Me((()=>{const{allRowKeys:e,flattenRowKeys:t}=r.current;i(l?e.filter((e=>!(n&&t.includes(e)))):[])}),[l]);const c=Ce("expand"),d={[`${c}--icon`]:!0,expanded:l,collapsed:!l};return o().createElement("span",{className:we()(d),title:"",onClick:e=>{e.stopPropagation(),s(!l)},style:t})},bc=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),yc=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),vc=e=>{const{tableColumns:t,sorter:r,filters:n}=e,{tableRef:i,layout:a,scrollY:l,flattenColumns:s,superFilters:c,selectionKeys:d,rightFixedColumns:u,treeExpandIndex:p,isFetch:h,isTreeTable:m,isGroupSubtotal:g,tableChange:b,setSorter:y,setElementStore:v,resetTableScroll:x,getStickyLeft:E,getStickyRight:S,createGroupData:w,createTableFullData:C}=o().useContext($l),{ellipsis:T,resizable:I,multipleSort:N,rowSelection:R,expandable:P}=i.current.props,[O,k]=ns.sortDirections,{tableOriginData:A}=i.current,_=o().useRef(null),F=o().useMemo((()=>A.some((e=>Array.isArray(e.children)))),[A]),H=o().useMemo((()=>!h),[h]),D=o().useMemo((()=>!h),[h]),$=o().useMemo((()=>!P?.hideExpandAll),[P]),q=o().useMemo((()=>!(!R||(h?!R.selectAllOnCurrentPage&&!R.fetchAllRowKeys:R.hideSelectAll))),[h,R]);Me((()=>{B(),b(),x()}),[r]),Me((()=>{G(),b(),x()}),[n]),Me((()=>{G(),b(),x()}),[c]),o().useEffect((()=>{!de(r)&&se((()=>B())),!de(n)&&se((()=>G()))}),[]),o().useLayoutEffect((()=>{M()}),[]);const M=()=>{v("$header",_.current)},j=e=>{const{dataIndex:t,type:n,sorter:i,title:a,description:l}=e;if(t===ns.selectionColumn&&"checkbox"===n){if("checkbox"===n)return o().createElement("div",{className:"cell"},q?o().createElement(fc,{selectionKeys:d}):f("qm.table.config.selectionText"));if("radio"===n)return o().createElement("div",{className:"cell"},a)}const s=[];return s.push(o().createElement("div",{key:0,className:"cell",title:cn(a)},m&&t===p&&$?o().createElement(gc,null):null,t===ns.expandableColumn&&$?o().createElement(gc,null):a)),l&&s.push(o().createElement(L.Tooltip,{key:1,placement:"top",title:l},o().createElement(Te.InfoCircleOutlined,{className:"tip"}))),i&&s.push(K(r[t])),s},K=e=>{const t=["svgicon cell--sorter__asc",{actived:e===O}],r=["svgicon cell--sorter__desc",{actived:e===k}];return o().createElement("div",{key:2,className:"cell--sorter",title:f("qm.table.sorter.text")},o().createElement("span",{className:we()(t)},o().createElement(bc,null)),o().createElement("span",{className:we()(r)},o().createElement(yc,null)))},V=e=>o().createElement(hc,{column:e,filters:n}),z=(e,t)=>{const{sorter:n,dataIndex:i}=t;if(n){const e=r[i],t=e?e===k?null:k:O;N?(delete r[i],y(Object.assign({},r,{[i]:t}))):y(Object.assign({},{[i]:t}))}},B=()=>{H&&U()},U=e=>{const t=(0,te.pickBy)(r,(e=>null!==e));for(const e in t){const r=s.find((t=>t.dataIndex===e));r?W(r,t[e]):delete t[e]}e||Object.keys(t).length||W({dataIndex:"index"},O)},W=(e,t)=>{const{tableFullData:r}=i.current,{dataIndex:n,sorter:a}=e,o=(e,r)=>{const i=Zr(e,n),a=Zr(r,n);return Number.isNaN(i-a)?t===O?i.toString().localeCompare(a.toString()):a.toString().localeCompare(i.toString()):t===O?i-a:a-i},l=g?w(dn(r).sort("function"==typeof a?a:o)):r.sort("function"==typeof a?a:o).slice(0);C(l)},G=()=>{D&&Y()},Y=()=>{const e=c.length?un(c):un(n),t=""!==e?g?w(Dr(dn(A),e,F)):Dr(A,e,F):A;C(t),U(!0)},X=Gr(t),Q=Ce("table"),{tableBodyWidth:Z}=a;return o().createElement("div",{ref:_,className:`${Q}--header-wrapper`},o().createElement("table",{className:`${Q}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Z?`${Z}px`:""}},(()=>{const{gutterWidth:e}=a;return o().createElement("colgroup",null,s.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})})),l&&o().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),o().createElement("thead",null,(e=>{const{isIE:t}=i.current,n=["gutter",{"cell-fix-right":!!u.length}],s=t?null:{right:u.length?0:""};return e.map(((e,t)=>o().createElement("tr",{key:t,className:"header--row"},e.map(((t,n)=>((e,t,n)=>{const{isIE:s}=i.current,{gutterWidth:c}=a,{dataIndex:d,colSpan:u,rowSpan:p,fixed:h,align:m,theadAlign:f,theadClassName:g="",sorter:b,filter:y,required:v,headRender:x}=e;if(0===u)return null;const w=f||m,C=["header--column",{"col--ellipsis":e.ellipsis??T,"col--center":"center"===w,"col--right":"right"===w,"column--required":!!v,"column-has-sorter":b,"column-has-filter":y,"column--sort":!!r[d],"cell-fix-left":!s&&"left"===h,"cell-fix-right":!s&&"right"===h,"cell-fix-left-last":!s&&"left"===h&&!n[t+(u??1)]?.fixed,"cell-fix-right-first":!s&&"right"===h&&!n[t-1]?.fixed,[g]:!!g}],N=s?null:{left:"left"===h?`${E(d)}px`:"",right:"right"===h?`${S(d,"thead")+(l?c:0)}px`:""},R=I&&![ns.expandableColumn,ns.selectionColumn].includes(d);return o().createElement("th",{key:d,className:we()(C),colSpan:u,rowSpan:p,style:{...N},onClick:t=>z(t,e)},o().createElement("div",{className:"cell--wrapper"},x?o().createElement("div",{className:"cell--text cell"},x(e,i.current.tableFullData)):o().createElement(o().Fragment,null,o().createElement("div",{className:"cell--text"},j(e)),y?V(e):null)),R&&o().createElement(mc,{column:e}))})(t,n,e))),l&&o().createElement("th",{className:we()(n),style:{...s}}))))})(X))))},xc=o().createContext([]),Ec=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Sc=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>t?.contains(e.target))),wc=(e,t)=>{const r=e.target;return!("button"in e&&e.button>0||r&&!Ec(r).contains(r)||t.current?.contains(r))};function Cc(e){let{ref:t,handler:r,enabled:n=!0,omitClassNames:i=[]}=e;const o=Yl(r),l=a.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});a.useEffect((()=>{if(!n)return;const e=e=>{wc(e,t)&&(l.current.isPointerDown=!0)},a=e=>{l.current.ignoreEmulatedMouseEvents?l.current.ignoreEmulatedMouseEvents=!1:r&&l.current.isPointerDown&&wc(e,t)&&Sc(e,i)&&(l.current.isPointerDown=!1,o(e))},s=e=>{l.current.ignoreEmulatedMouseEvents=!0,r&&l.current.isPointerDown&&wc(e,t)&&Sc(e,i)&&(l.current.isPointerDown=!1,o(e))},c=Ec(t.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",a,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",a,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[r,t,o,l,n])}function Tc(){const[,e]=a.useReducer((e=>e+1),0);return e}function Ic(){const{locale:e}=a.useContext(c);return{t:f,$locale:e}}const Nc=e=>{const{selectionKeys:t,column:r,record:n,rowKey:i}=e,{tableRef:a,isTreeTable:l,getAllChildRowKeys:s}=o().useContext($l),{rowSelection:c}=a.current.props,d=o().useMemo((()=>r.type||""),[r.type]),u=e=>{const r=c.checkStrictly??!0;if(!l||r)return!1;const n=Ur(a.current.deriveRowKeys,e);return((e,t)=>{const r=new Set(t);let n=!1,i=!1;for(const t of e)if(r.has(t)?n=!0:i=!0,n&&i)break;return n&&i})(s(n?.children??[]),t)};return"radio"===d?(()=>{const e=c.disabled,r=e?.(n),a=!r&&t[0]===i;return o().createElement(L.Radio,{checked:a,disabled:r})})():(()=>{const e=c.disabled,r=e?.(n),a=!!t.includes(i);return o().createElement(L.Checkbox,{checked:a,indeterminate:u(i),disabled:r})})()},Rc=e=>{const{record:t,rowKey:r,style:n}=e,{tableRef:i,rowExpandedKeys:a,setRowExpandedKeys:l}=o().useContext($l),{expandable:s={}}=i.current.props,[c]=o().useState("function"==typeof s.rowExpandable&&!s.rowExpandable(t)),d=o().useMemo((()=>a.includes(r)),[a,r]);Me((()=>{s.onExpand?.(d,t)}),[d]);const u=Ce("expand"),p={[`${u}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return o().createElement("span",{className:we()(p),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?a.filter((e=>e!==r)):[...a,r];l(t)},style:n})},Pc=o().forwardRef(((e,t)=>{const{size:r,defaultValue:n,value:i,min:a,max:l,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:h,allowClear:m,readOnly:f,disabled:g,formatter:b=(e=>e.toString()),parser:y=(e=>e),onFocus:v}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>l&&(t=l.toString()),t&&Number(t)<a&&(t=a.toString()),p>=0&&""!==t&&(t=new(Ii())(t).toFixed(p)),t},E=void 0!==i,[S,w]=o().useState(n??""),C=b(E?i:S),T=y(C);return Me((()=>{e.onChange?.(T)}),[S]),o().createElement(L.Input,{ref:t,size:r,value:C,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:m,readOnly:f,disabled:g,onChange:t=>{const r=y(t.target.value);let n=/^-?\d*(\.\d*)?$/.test(r)||""===r||"-"===r;if(0===p&&r.includes(".")&&(n=!1),a>=0&&r.startsWith("-")&&(n=!1),n){if(!h&&(Number(r)>Number.MAX_SAFE_INTEGER||Number(r)<Number.MIN_SAFE_INTEGER))return;(t=>{E?e.onChange?.(t):w(t)})(r)}},onFocus:v,onBlur:()=>{const t=x(T);e.onBlur?.(t,T)},onKeyUp:t=>{13===t.keyCode&&e.onEnter?.(x(T),T)}})}));Pc.displayName="InputNumber";const Oc=Pc;function kc(){return kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kc.apply(this,arguments)}const{Search:Ac}=L.Input,Lc=o().forwardRef(((e,t)=>{const{column:r,record:n,rowKey:i,columnKey:a}=e,{tableRef:l,tableBodyRef:s,$size:c,flattenColumns:d,updateTableData:u,doFieldValidate:p,dataChange:h}=o().useContext($l),m=o().useContext(xc),g=Tc(),{store:b,fieldAuth:y}=l.current,x=r.editRender?.(n,r)||{},E=o().useRef(null),S=o().useRef(null),w=o().useRef(null),C=o().useRef(null),T=o().useRef(null),I=o().useRef(!1),N=o().useRef({}),R=o().useRef({}),P=o().useRef([]),[O,k]=o().useState(!1),[A,_]=o().useState(!1),[F,H]=o().useState(!1),[D,$]=o().useState(x.items||[]),[q,M]=o().useState(),K=(x.editable||(0,te.isEqual)(m,[i,a]))&&!x.disabled&&!y[a]?.disabled,V=`${i}|${a}`,z=2===m.length?`${m[0]}|${m[1]}`:"",U=![...b.state.required,...b.state.validate].some((e=>{let{x:t,y:r}=e;return t===i&&r===a})),W=b.state.required.find((e=>{let{x:t,y:r}=e;return t===i&&r===a}))?.text||"",G=b.state.validate.find((e=>{let{x:t,y:r}=e;return t===i&&r===a}))?.text||"",Y=b.state.edited.some((e=>{let{x:t,y:r}=e;return t===i&&r===a})),X=K||!U||O||F||A,Q=!!x.helper?.combinedDataIndex&&("search-helper"===x.type||"tree-helper"===x.type),Z=x.type?.endsWith("multiple");o().useLayoutEffect((()=>{X&&z===V&&ne()}),[m]),o().useLayoutEffect((()=>{const{items:e}=x;Z&&e&&re(e.map((e=>({[R.current.valueKey]:e.value,[R.current.textKey]:e.text}))))}),[]);const J=()=>{u(),h()},ee=(e,t)=>{k(e),t?.()},re=e=>{P.current=e},ne=()=>{const{type:e}=x;switch(e){case"text":S.current?.focus();break;case"number":w.current?.select();break;case"search-helper":C.current?.focus();break;case"tree-helper":T.current?.focus()}};o().useImperativeHandle(t,(()=>({focus:ne})));const ie=e=>{e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0}))},ae=(e,t,r)=>{const{cornerSign:n=!0}=x.extra||{};b.addToUpdated(e),n&&b.addToEdited({x:t,y:r})},le=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",ce={text:(e,t,r)=>{const{dataIndex:n}=t,{type:l,extra:s={},rules:d=[],onInput:u,onChange:h,onEnter:m,onBlur:b}=x,y=Zr(e,n),v=Object.assign({},{minRows:1,maxRows:4},s.autoSize),E=r?{rows:v.minRows,autoSize:v}:null,w=s.password?L.Input.Password:r?L.Input.TextArea:L.Input;return o().createElement(w,kc({ref:S,size:c,value:y,maxLength:s.maxLength,showCount:s.showCount},E,{autoComplete:s.password?"new-password":"off",placeholder:s.placeholder||f("qm.table.editable.inputPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,suffix:s.suffix,onChange:t=>{const r=t.target.value??"";Jr(e,n,r),p(d,r,i,a),g(),u?.({[V]:r}),I.current=!0},onFocus:()=>_(!0),onBlur:t=>{_(!1);const r=t.target.value??"";I.current&&(I.current=!1,ae(e,i,a),h?.({[V]:r},e),b?.({[V]:r},e),J())},onKeyUp:t=>{if(13===t.keyCode&&!t.shiftKey){const r=t.target.value??"";m?.({[V]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&m&&e.preventDefault()}}))},textarea:(e,t)=>ce.text(e,t,!0),number:(e,t)=>{const{dataIndex:r,precision:n,formatType:l}=t,{type:s,extra:d={},rules:u=[],onInput:h,onChange:m,onEnter:b,onBlur:y}=x,v=Zr(e,r);let E,S;return"finance"===l&&(E=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},S=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===l&&(E=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new(Ii())(e).times(100).toNumber()}`,S=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new(Ii())(e).times(.01).toString()),o().createElement(Oc,{ref:w,size:c,value:v,min:d.min,max:d.max,precision:n,stringMode:d.stringMode,prefix:d.prefix,suffix:d.suffix??("percent"===l?"%":void 0),placeholder:d.placeholder||f("qm.table.editable.inputPlaceholder"),maxLength:d.maxLength,allowClear:d.allowClear,readOnly:d.readOnly,disabled:d.disabled,formatter:E,parser:S,onChange:t=>{Jr(e,r,t),p(u,t,i,a),g(),h?.({[V]:t}),I.current=!0},onFocus:()=>_(!0),onBlur:(t,n)=>{if(_(!1),!I.current)return;I.current=!1;let o=d.stringMode?t:le(t);"percent"===l&&"."===n.charAt(n.length-1)&&(o=Number(t)/100),Jr(e,r,o),ae(e,i,a),m?.({[V]:o},e),y?.({[V]:o},e),J()},onEnter:(t,r)=>{let n=d.stringMode?t:le(t);"percent"===l&&"."===r.charAt(r.length-1)&&(n=Number(t)/100),b?.({[V]:n},e)}})},select:(e,t,r)=>{const{dataIndex:n,dictItems:l=[]}=t,{type:s,extra:d={},rules:u=[],items:h,onChange:m,onEnter:g}=x,b=h||l,y=Zr(e,n);let v=y;return o().createElement(L.Select,{mode:r?"multiple":void 0,size:c,popupClassName:"table-editable__popper",value:y||void 0,placeholder:d.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:d.allowClear,listHeight:d.listHeight,maxTagCount:d.collapseTags?"responsive":void 0,maxTagTextLength:d.maxTagTextLength,disabled:d.disabled,style:{width:"100%"},showSearch:d.filterable??!0,filterOption:(e,t)=>{const r=t?.children?.toString()||"";return`${r}|${ei.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:t=>{Jr(e,n,t),p(u,t,i,a),ae(e,i,a),m?.({[V]:t},e),J()},onSelect:e=>{v=e},onInputKeyDown:t=>{13===t.keyCode&&se((()=>g?.({[V]:v},e)))}},b.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>ce.select(e,t,!0),date:(e,t,r)=>{const{dataIndex:n}=t,{type:l,extra:s={},rules:d=[],onChange:u}=x,h=r||"exactdate",m=Zr(e,n);return o().createElement(j,{size:c,popupClassName:"table-editable__popper",value:an(m,Tn[h])??void 0,picker:Cn[h],format:s.format,showTime:"datetime"===h,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:r}=s;return t&&r?e.isBefore(t,"day")||e.isAfter(r,"day"):t?e.isBefore(t,"day"):!!r&&e.isAfter(r,"day")})(e),placeholder:s.placeholder,allowClear:s.allowClear,disabled:s.disabled,style:{width:"100%"},onChange:t=>{const r=on(t,Tn[h]);Jr(e,n,r),p(d,r,i,a),ae(e,i,a),u?.({[V]:r},e),J()}})},datetime:(e,t)=>ce.date(e,t,"datetime"),month:(e,t)=>ce.date(e,t,"month"),year:(e,t)=>ce.date(e,t,"year"),time:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:d}=x,u="HH:mm:ss",h=Zr(e,r);return o().createElement(B,{size:c,popupClassName:"table-editable__popper",value:an(h,u)??void 0,format:l.format||u,placeholder:l.placeholder,allowClear:l.allowClear,disabled:l.disabled,style:{width:"100%"},onChange:t=>{const n=on(t,u);Jr(e,r,n),p(s,n,i,a),ae(e,i,a),d?.({[V]:n},e),J()}})},checkbox:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:c}=x,{trueValue:d=Kl,falseValue:u=Vl,disabled:h}=l,m=Zr(e,r);return o().createElement(L.Checkbox,{checked:m===d,disabled:h,onChange:t=>{const n=t.target.checked?d:u;Jr(e,r,n),p(s,n,i,a),ae(e,i,a),c?.({[V]:n},e),J()}})},switch:(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},rules:s=[],onChange:c}=x,{trueValue:d=Kl,falseValue:u=Vl,disabled:h}=l,m=Zr(e,r);return o().createElement(L.Switch,{checked:m===d,disabled:h,onChange:t=>{const n=t?d:u;Jr(e,r,n),p(s,n,i,a),ae(e,i,a),c?.({[V]:n},e),J()}})},"search-helper":(e,t)=>{const{dataIndex:r,precision:n}=t,{type:l,extra:s={},rules:u=[],helper:h={},onInput:m,onChange:g,onEnter:b}=x,y=en(e,Q?h.combinedDataIndex:r),S=h.fieldAliasMap;S||v("Table","helper 需要配置 `fieldAliasMap` 选项");const w="function"==typeof S?S():S||{};Object.keys(w).includes(r)||v("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),Q&&(h.combinedDataIndex.split("|").every((e=>Object.keys(w).includes(e)))||v("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),w[r].includes("|")&&v("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const T=e=>{const{filterAliasMap:t}=h,n=""!==e?e:void 0,i=("function"==typeof t?t():t)||[],a={[r]:n};return(Array.isArray(i)?i:[i]).forEach((e=>{if((0,te.isPlainObject)(e))for(const t in e)a[t]="function"==typeof e[t]?e[t](n):n;else a[e]=n})),a},R=e=>{const{autoQueryAssign:t=!0}=h;t&&(N.current=T(e)),k(!0)},P=(r,n)=>{const{beforeOpen:i}=h,a=(i??oe)({[V]:y},e,t);a?.then?a.then((()=>{R(r),n?.()})).catch((()=>{})):!1!==a&&(R(r),n?.())},A=e=>{const t={};for(const n in w){const i=w[n];n!==r&&(t[n]=en(e,i))}const n=w[r]?en(e,w[r]):"";_(n,t);const{closed:i}=h;ee(!1,(()=>ie(E.current))),ne(),i?.(e)},L=()=>{const{onlySelect:e=!0}=h;I.current&&_(e?"":y),ee(!1,(()=>ie(E.current)))},_=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;if((0,te.isPlainObject)(o)&&Object.keys(o).length)for(const t in o){const r=o[t],n=d.find((e=>e.dataIndex===t));if(n){Jr(e,t,r,n.precision);const a=n.editRender?.(e,n);a&&Array.isArray(a.rules)&&p(a.rules,r,i,t)}else Jr(e,t,r)}Q&&!t&&((e,t,r,n)=>{if(!t.includes("|"))return Jr(e,t,"",void 0);const i="".split("|")||[];t.split("|").forEach(((t,r)=>{t&&Jr(e,t,i[r]?.trim())}))})(e,h.combinedDataIndex),Jr(e,r,t,n),p(u,t,i,a),ae(e,i,a),g?.({[V]:t},e),J(),N.current={},I.current=!1,M(void 0)},F={visible:O,title:f("qm.searchHelper.text"),width:h.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{L()}},D={...h,size:c,initialValue:Object.assign({},N.current,h.initialValue),onClose:e=>{e?A(e):L()}};return o().createElement(o().Fragment,null,o().createElement(Ac,{ref:C,value:q??y,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,onBlur:e=>{const{value:t}=e.target,{onlySelect:n=!0,table:i}=h;if(I.current&&!O)return t&&n&&i?.fetch?.api?(e=>{const{table:t,initialValue:r={}}=h,{beforeFetch:n=oe}=t.fetch;return new Promise((async(i,a)=>{const o=(0,te.merge)({},t.fetch.params,{...r,...T(e)},{currentPage:1,pageSize:500});if(!n(o))return a();H(!0);try{const e=await t.fetch.api(o);200===e.code?i(Array.isArray(e.data)?e.data:(0,te.get)(e.data,t.fetch.dataKey)??[]):a()}catch(e){a(e)}finally{se((()=>H(!1)))}}))})(t).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=>en(t,w[r]).toString().includes(e)));if(1===t.length)return A(t[0]);P(e)}(e,t))).catch((()=>_(""))):void _(t)},onChange:e=>{const{value:t}=e.target;m?.({[V]:t}),I.current=!0,M(t)},onKeyUp:t=>{if(13===t.keyCode){const r=t.target.value??"";b?.({[V]:r},e)}},onDoubleClick:e=>{const{value:t}=e.target;P(t)},onSearch:(e,t)=>{"click"===t?.type&&"INPUT"!==t.target.tagName&&P(e)}}),o().createElement(Er,F,o().createElement(ad,D)))},"search-helper-multiple":(e,t)=>{const{dataIndex:r}=t,{type:n,items:l=[],extra:s={},rules:d=[],helper:u={},onInput:h,onChange:m,onEnter:g}=x,b=Zr(e,r),y=u.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes("valueKey")&&Object.keys(S).includes("textKey")||v("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),R.current=S;const w=r=>{const{beforeOpen:n}=u,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},T=t=>{Jr(e,r,t),p(d,t,i,a),ae(e,i,a),m?.({[V]:t},e,P.current),J()},I={visible:O,title:f("qm.searchHelper.text"),width:u.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},N={...u,size:c,multiple:!0,initialValue:(0,te.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:r,valueKey:n}=S;re((0,te.uniqBy)([...P.current.filter((e=>t.includes(e[n]))),...e],n));const i=P.current.map((e=>({text:e[r],value:e[n]}))),a=(0,te.uniqBy)([...i,...l],"value").filter((e=>t.includes(e.value)));$(a),T(a.map((e=>e.value)));const{closed:o}=u;ee(!1,(()=>ie(E.current))),o?.(P.current)})(e,t):C()}};return o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{className:"ant-input-wrapper ant-input-group"},o().createElement(L.Select,{mode:"multiple",open:!1,value:b,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&g?.({[V]:b},e)},onDoubleClick:()=>{s.disabled||w()},onChange:e=>{const{valueKey:t}=S;re(P.current.filter((r=>e.includes(r[t])))),T(e)}},D.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text)))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:s.disabled,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{w()}})))),o().createElement(Er,I,o().createElement(ad,N)))},"tree-helper":(e,t)=>{const{dataIndex:r,precision:n}=t,{type:l,extra:s={},rules:u=[],helper:h={},onChange:m,onEnter:g}=x,b=en(e,Q?h.combinedDataIndex:r),y=h.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes(r)||v("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),Q&&(h.combinedDataIndex.split("|").every((e=>Object.keys(S).includes(e)))||v("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),S[r].includes("|")&&v("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const w=r=>{const{beforeOpen:n}=h,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},I=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;if((0,te.isPlainObject)(o)&&Object.keys(o).length)for(const t in o){const r=o[t],n=d.find((e=>e.dataIndex===t));if(n){Jr(e,t,r,n.precision);const a=n.editRender?.(e,n);a&&Array.isArray(a.rules)&&p(a.rules,r,i,t)}else Jr(e,t,r)}Jr(e,r,t,n),p(u,t,i,a),ae(e,i,a),m?.({[V]:t},e),J()},N={visible:O,title:f("qm.searchHelper.text"),width:h.width??"30%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},R={...h,defaultSelectedKeys:[b],size:c,onClose:e=>{e?(e=>{const t={};for(const n in S){const i=S[n];n!==r&&(t[n]=en(e,i))}const n=S[r]?en(e,S[r]):"";I(n,t);const{closed:i}=h;ee(!1,(()=>ie(E.current))),ne(),i?.(e)})(e):C()}};return o().createElement(o().Fragment,null,o().createElement(Ac,{ref:T,value:b,allowClear:s.allowClear??!0,readOnly:s.readOnly,disabled:s.disabled,placeholder:s.placeholder||f("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyUp:t=>{if(13===t.keyCode){const r=t.target.value??"";g?.({[V]:r},e)}},onDoubleClick:()=>{w()},onSearch:(e,t)=>{"click"===t?.type&&("INPUT"!==t.target.tagName?w():I(""))}}),o().createElement(Er,N,o().createElement(hd,R)))},"tree-helper-multiple":(e,t)=>{const{dataIndex:r}=t,{type:n,extra:l={},items:s=[],rules:d=[],helper:u={},onInput:h,onChange:m,onEnter:g}=x,b=Zr(e,r),y=u.fieldAliasMap;y||v("Table","helper 需要配置 `fieldAliasMap` 选项");const S="function"==typeof y?y():y||{};Object.keys(S).includes("valueKey")&&Object.keys(S).includes("textKey")||v("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),R.current=S;const w=r=>{const{beforeOpen:n}=u,i=(n??oe)({[V]:b},e,t);i?.then?i.then((()=>{k(!0),r?.()})).catch((()=>{})):!1!==i&&(k(!0),r?.())},C=()=>{ee(!1,(()=>ie(E.current)))},T=t=>{Jr(e,r,t),p(d,t,i,a),ae(e,i,a),m?.({[V]:t},e,P.current),J()},I={visible:O,title:f("qm.searchHelper.text"),width:u.width??"60%",loading:!1,wrapClassName:"table-editable__popper",bodyStyle:{paddingBottom:`${Fi[c]+20}px`},onClose:()=>{C()}},N={...u,size:c,multiple:!0,initialValue:(0,te.merge)({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:r}=S;re(e);const n=P.current.map((e=>({text:e[t],value:e[r]})));$(n),T(n.map((e=>e.value)));const{closed:i}=u;ee(!1,(()=>ie(E.current))),i?.(P.current)})(e):C()}};return o().createElement(o().Fragment,null,o().createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},o().createElement("span",{className:"ant-input-wrapper ant-input-group"},o().createElement(L.Select,{mode:"multiple",open:!1,value:b,placeholder:l.placeholder||f("qm.table.editable.selectPlaceholder"),allowClear:l.allowClear,maxTagCount:l.collapseTags?"responsive":void 0,maxTagTextLength:l.maxTagTextLength,disabled:l.disabled,style:{width:"100%"},onKeyUp:t=>{13===t.keyCode&&g?.({[V]:b},e)},onDoubleClick:()=>{l.disabled||w()},onChange:e=>{const{valueKey:t}=S;re(P.current.filter((r=>e.includes(r[t])))),T(e)}},D.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text)))),o().createElement("span",{className:"ant-input-group-addon"},o().createElement(L.Button,{className:"ant-input-search-button",disabled:l.disabled,icon:o().createElement(Te.SearchOutlined,null),onClick:()=>{w()}})))),o().createElement(Er,I,o().createElement(hd,N)))}};return o().createElement(o().Fragment,null,X?(()=>{const{type:e}=x,t=ce[e];if(!t)return v("Table","单元格编辑的类型 `type` 配置不正确"),null;const i=["cell--edit",{"is-error":!U}];return o().createElement("div",{ref:E,className:we()(i)},t(n,r),!U&&o().createElement("div",{className:"cell-error"},W||G))})():(()=>{const{extra:t={}}=x;return o().createElement("span",{style:{color:t.disabledColor}},e.children)})(),Y&&o().createElement("i",{className:"cell--sign"}))}));Lc.displayName="CellEdit";const _c=Lc,Fc=require("copy-to-clipboard");var Hc=n.n(Fc);const Dc=function(e){if(!o().isValidElement(e))return null;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return o().cloneElement(e,...r)},$c=e=>{const{text:t,options:r,showMessage:n=!0,onCopy:i}=e;return Dc(e.children,{onClick:a=>{const l=o().Children.only(e.children),s=Hc()(t,r);i?.(t,s),s&&n&&L.message.success(f("qm.clipboard.success")),l&&l.props&&"function"==typeof l.props.onClick&&l.props.onClick(a)}})};$c.displayName="QmCopyToClipboard";const qc=$c,Mc=o().forwardRef(((e,t)=>{const{column:r,row:n,rowIndex:i,columnIndex:l,rowKey:s,showTitle:c}=e,{selectionKeys:d,treeExpandIndex:u,updateMark:p,isTreeTable:h}=o().useContext($l),{dataIndex:m,canCopy:f,render:g,editRender:b,shouldCellUpdate:y}=r,{t:v}=Ic(),{renderText:x,getTitleFromCellNode:E}=vs(),S=o().useRef(null),w=Zr(n,m),[C,T]=function(e,c,d){const u=a.useRef({});return"value"in u.current&&!((e,t)=>{if(y){const[,r]=e,[,i]=t;return y(i,r,n)}return m===ns.operationColumn||!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=new Set;return function e(t,i){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n.has(t))return!1;if(t===i)return!0;if(r&&a>1)return!1;n.add(t);const o=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],i[r],o))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const r=Object.keys(t);return r.length===Object.keys(i).length&&r.every((r=>e(t[r],i[r],o)))}return!1}(e,t)}(e,t,!0)})(u.current.condition,c)||(u.current.value=(()=>{const e=g?g(w,n,r,i,l):x(w,r,n);return[e,b?o().createElement(_c,{ref:t,column:r,record:n,rowKey:s,columnKey:m},e):null]})(),u.current.condition=c),u.current.value}(0,[p,w,g,b]);o().useEffect((()=>{if([ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(m))return;const e=S.current.parentNode;c?e.title=E(C):e.removeAttribute("title")}),[c,C]);const I=e=>Array.isArray(e.children);return o().createElement("div",{ref:S,className:"cell"},(()=>{if(m===ns.expandableColumn)return o().createElement(Rc,{record:n,rowKey:s});if(m===ns.selectionColumn)return o().createElement(Nc,{selectionKeys:d,column:r,record:n,rowKey:s});if(T)return T;if(h&&m===u)return o().createElement(o().Fragment,null,(e=n._level)?o().createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*ns.treeTable.textIndent+"px"}}):null,o().createElement(Rc,{key:"expand",record:n,rowKey:s,style:I(n)?{}:{visibility:"hidden"}}),C);var e;if(f){const e=E(C);return o().createElement("div",{className:"cell--copy"},o().createElement("span",{className:"text"},C),e&&o().createElement(qc,{text:e},o().createElement(Te.CopyOutlined,{className:"icon",title:v("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return C})())}));Mc.displayName="Cell";const jc=Mc,Kc={startX:0,startY:0,startOffsetX:0,startOffsetY:0,containerSizeX:0,containerSizeY:0},Vc={open:!1,offsetX:0,offsetY:0},zc=o().forwardRef(((e,t)=>{const{tableRef:r,getRowKey:n,flattenColumns:i,mergedTdCells:a,setMergedCells:l}=o().useContext($l),{areaSelection:s={}}=r.current.props,{elementStore:c,tableFlatData:d}=r.current,{t:u}=Ic(),p=o().useRef(document.onselectstart),h=o().useRef(null),m=o().useRef(null),[f,g]=o().useState(null),[b,y]=o().useState(null),[v,x]=o().useState(null);Cc({ref:h,handler:()=>D()});const E=o().useRef(Kc),S=e=>{E.current=Object.assign({},E.current,e)};o().useEffect((()=>{const e=Gt()(c.$tableBody,"mousedown",k),t=Gt()(c.$tableBody,"contextmenu",P),r=Gt()(document,"keydown",O);return()=>{e.remove(),t.remove(),r.remove()}}),[]);const w=()=>{g(null),y(null),x(null)};o().useImperativeHandle(t,(()=>({blur:w})));const C=()=>c.$tableBody.parentNode,T=e=>{const{offsetLeft:t,offsetTop:r,offsetWidth:n,offsetHeight:i}=e;return{rowKey:e.parentNode.getAttribute("data-row-key"),colIndex:Number(e.getAttribute("data-col-index")),l:t,t:r,w:n,h:i}},I=Ot(((e,t)=>{let r=null;const n=c.$tableBody.querySelectorAll("tbody > tr");for(let i=0;i<n.length;i++){if(n[i].offsetTop>t||n[i].offsetTop+n[i].offsetHeight<t)continue;const a=n[i].querySelectorAll("td");for(let t=0;t<a.length;t++)if(!(a[t].offsetLeft>e||a[t].offsetLeft+a[t].offsetWidth<e)){r=a[t];break}break}r&&y(T(r))}),5),N=Yl((()=>{const e=[];if(!f||!b)return e;const[t,r]=[f.colIndex,b.colIndex],[a,o]=[f.rowKey,b.rowKey];let[l,s]=[0,0];for(let e=0;e<d.length;e++){const t=n(d[e],d[e].index);if(t==a&&(l=e),t==o){s=e;break}}const c=i.slice(Math.min(t,r),Math.max(t,r)+1);return d.slice(l,s+1).forEach((t=>{for(let r=0;r<c.length;r++){const{dataIndex:i}=c[r];e.push({rowKey:n(t,t.index),dataIndex:i,cellValue:Zr(t,i)})}})),e})),R=e=>{l(e),s.onCellMerge?.(e),se((()=>w()))},P=Yl((e=>{s.cellMerge&&f&&F(e.clientX,e.clientY)?(e.preventDefault(),H(e)):v?.open&&D()})),O=e=>{27===e.keyCode&&w()},k=Yl((e=>{e.stopPropagation();const t=(e=>{let t=e;for(;t;){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null})(e.target);if(1!==e.buttons||!t)return;D(),setTimeout((()=>{g(T(t)),y(T(t))}));const[r,n]=[c.$tableBody.getBoundingClientRect().top,C().getBoundingClientRect().left],{offsetWidth:i,offsetHeight:a}=C();S({startX:e.clientX,startY:e.clientY,startOffsetX:e.clientX-n,startOffsetY:e.clientY-r,containerSizeX:i,containerSizeY:a}),document.addEventListener("mousemove",A),document.addEventListener("mouseup",L),p.current=document.onselectstart,document.onselectstart=()=>!1})),A=e=>{const t=e.clientX-E.current.startX,r=e.clientY-E.current.startY,n=E.current.startOffsetX+t,i=E.current.startOffsetY+r;I(Math.min(n,E.current.containerSizeX),Math.min(i,E.current.containerSizeY))},L=()=>{S(Kc),s.onSelectChange?.(N()),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",L),_()},_=()=>{document.onselectstart!==p.current&&(document.onselectstart=p.current)},F=(e,t)=>{const{top:r,left:n}=C().getBoundingClientRect(),[i,a]=[e-n,t-r],{el:o,et:l,ew:s,eh:c}=M();return!(i<o||i>o+s||a<l||a>l+c)},H=e=>{const{top:t,left:r,height:n}=m.current.getBoundingClientRect();x({open:!0,offsetX:e.clientX-r,offsetY:-1*(n-(e.clientY-t))})},D=()=>{x((e=>({...e,open:!1})))},$=()=>{if(!f||!b||(t=b,(e=f).rowKey===t.rowKey&&e.colIndex===t.colIndex))return w();var e,t;const[r,o]=f.t<=b.t?[f.rowKey,b.rowKey]:[b.rowKey,f.rowKey],[l,s]=[f.colIndex,b.colIndex];let[c,u]=[0,0],p=r;for(let e=0;e<d.length;e++){const t=d[e],i=n(t,t.index);if(i==r&&(p=i,c=e),i==o){u=e;break}}const h={rowKey:p,dataIndex:i[Math.min(l,s)].dataIndex,rowSpan:u-c+1,colSpan:Math.abs(s-l+1)};R([...a.filter((e=>!(e.rowKey===h.rowKey&&e.dataIndex===h.dataIndex))),h])},q=()=>{let e=f.rowKey;const t=f.colIndex;for(let t=0;t<d.length;t++){const r=d[t],i=n(r,r.index);if(i==e){e=i;break}}const r=e,o=i[t].dataIndex;R(a.filter((e=>!(e.rowKey===r&&e.dataIndex===o))))},M=()=>{const{w:e,h:t,l:r,t:n}=f;let{w:i,h:a,l:o,t:l}=b;return i=o-r>0?o-r+i:Math.abs(o-r)+e,a=l-n>0?l-n+a:Math.abs(l-n)+t,o=o>r?r:o,l=l>n?n:l,{sl:r,st:n,sw:e,sh:t,el:o,et:l,ew:i,eh:a}},j=Ce("table");return o().createElement("div",{className:`${j}--area-select`},(()=>{if(!f||!b)return null;const{sl:e,st:t,sw:r,sh:n,el:i,et:a,ew:l,eh:s}=M(),{open:c,offsetX:d,offsetY:p}=v||Vc,g=o().createElement("ul",{ref:h,className:"ant-dropdown-menu"},o().createElement("li",{className:"ant-dropdown-menu-item",onClick:$},u("qm.table.areaSelect.mergeCell")),o().createElement("li",{className:"ant-dropdown-menu-item",onClick:q},u("qm.table.areaSelect.cancelMerge")));return o().createElement(o().Fragment,null,o().createElement("div",{className:"active-area",style:{left:e,top:t,width:r,height:n}}),o().createElement(Wi(),{popupVisible:c,popup:g,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:"table-editable__popper",builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,p+4],overflow:{adjustX:1,adjustY:1}}}},o().createElement("div",{ref:m,className:"checked-area",style:{left:i,top:a,width:l,height:s}})))})())}));zc.displayName="AreaSelect";const Bc=zc,Uc=o().forwardRef(((e,t)=>{const{tableFlatColumns:r,tableData:n}=e,{getRowKey:i,tableRef:a,flattenColumns:l,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:h,showFooter:m,scrollX:f,scrollY:g,selectionKeys:b,rowExpandedKeys:y,highlightKey:v,isPingLeft:x,isPingRight:E,isTableEmpty:S,isTreeTable:w,isGroupSubtotal:C,isWebPagination:T,setElementStore:I,createTableFullData:N,setSelectionKeysEffect:R,setHighlightKey:P,getStickyLeft:O,getStickyRight:k,scrollXToColumn:A,scrollYToRecord:L,rowInViewport:_,dataChange:F,setPingLeft:H,setPingRight:D,setFullScreen:$,findParentRowKeys:q,getAllChildRowKeys:M,triggerScrollXEvent:j,triggerScrollYEvent:K,scrollBottomDebouncer:V}=o().useContext($l),{height:z,minHeight:B,maxHeight:U,rowHeight:W,rowSelection:G,rowHighlight:Y,expandable:X,stripe:Q,summation:Z,rowStyle:J,cellStyle:ee,spanMethod:re,tableConfig:ne,areaSelection:ie,nativeScrollBar:le,ellipsis:se,showHeader:ce,rowDraggable:de,onRowClick:ue,onRowDblclick:pe,onRowContextmenu:he,onRowEnter:me}=a.current.props,fe=o().useRef(null),ge=o().useRef({}),be=o().useRef(null),ye=o().useRef(null),ve=o().useRef(null),xe=o().useRef({prevST:0,prevSL:0}),Ee=a.current.scrollXLoad?r:l,Se=o().useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:r,tableFullHeight:n,tableAutoHeight:i}=h,a={};return S&&Object.assign(a,{minHeight:"100px"}),B&&Object.assign(a,{minHeight:Xr(B)-e-r+"px"}),U&&Object.assign(a,{maxHeight:Xr(U)-e-r+"px"}),z||n||i?{...a,maxHeight:"",minHeight:"",height:`${t}px`}:a}),[z,U,B,S,h]),Te=o().useMemo((()=>{const{scrollYStore:e}=a.current,{viewportHeight:t,gutterWidth:r}=h;return Math.floor((f?t-r:t)/e.rowHeight)}),[h,f]),[Ie,Ne]=o().useState([]),Re=Tc();Cc({ref:fe,omitClassNames:[".table-editable__popper"],handler:()=>{Ae([]),ve.current?.blur()}}),o().useImperativeHandle(t,(()=>({setClickedValues:Ae,createFocus:ke,forceUpdate:Re}))),Me((()=>{Ie.length&&a.current.tableManager.focus(a.current.uid)}),[Ie]),o().useLayoutEffect((()=>{Oe();const e=Gt()(document,"keydown",Pe);return()=>e.remove()}),[]);const Pe=Yl((e=>{const{keyCode:t}=e;if(a.current.uid===a.current.tableManager.getFocusInstance()?.id&&(27===t&&(Ae([]),P(""),$(!1)),Ie.length&&(Xe(document.activeElement,fe.current)||"INPUT"!==document.activeElement?.tagName))){if(13===t&&("radio"===G?.type||Y)){const t=b[0]??v??null,r=n.find((e=>i(e,e.index)===t))??null;r&&me?.(r,e)}if(38===t||40===t){Ve(e);const{allTableData:r}=a.current,o=T?Wr(n):r,l=o.length;let s=o.findIndex((e=>i(e,e.index)===Ie[0]));const c=38===t?(--s+l)%l:++s%l,d=o[c],u=i(d,d.index);"radio"!==G?.type||G.disabled?.(d)||R([u]),Y&&!Y.disabled?.(d)&&P(u),_(c)||(38===t&&L(u,c),40===t&&L(u,Te>c+1?0:c+1-Te)),Ae([u,Ie[1]])}if(9===t){if(Ve(e),!s.length)return Ae([]);const t=s.length;let r=s.findIndex((e=>e.dataIndex===Ie[1]));const n=++r%t,i=s[n].dataIndex;Ae([Ie[0],i]),A(i)}}})),Oe=()=>{I("$tableBody",fe.current),I("$tableXspace",be.current),I("$tableYspace",ye.current)},ke=(e,t)=>{ge.current[`${e}-${t}`]?.focus()},Ae=e=>{(0,te.isEqual)(e,Ie)||Ne(e)},Le=(e,t,r)=>r?[...t,e]:t.filter((t=>t!==e)),_e=(e,t,r)=>{const{disabled:n}=G||{},{deriveRowKeys:i,recordsMap:o}=a.current,l=Ur(i,e);let s=[],c=M(l?.children||[]);return n&&(c=c.filter((e=>!o.has(e)||!n(o.get(e))))),s=r?[...new Set([...t,e,...c])]:t.filter((t=>![e,...c].includes(t))),(mn(i,e)?.slice(0,-1).reverse()||[]).forEach((e=>{const t=Ur(i,e),r=t?.children?.every((e=>s.includes(e.rowKey)));s=r?[...s,e]:s.filter((t=>t!==e))})),s},Fe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=[];return e.forEach((e=>{const n=e.index,l=i(e,e.index);if(r.push(He(e,n,l,t)),X?.expandedRowRender){const{expandedRowClassName:t,rowExpandable:i=oe}=X;y.includes(l)&&i(e)&&r.push(o().createElement("tr",{key:`expand_${l}`,className:"body--row-expanded"},o().createElement("td",{colSpan:Ee.length,className:"body--column",style:{paddingLeft:G?2*ns.selectionColumnWidth:ns.selectionColumnWidth}},o().createElement("div",{className:we()("cell",t)},X.expandedRowRender(e,n)))))}if(!a.current.scrollYLoad&&(e=>Array.isArray(e.children))(e)){const n="function"!=typeof X?.rowExpandable||X.rowExpandable(e);y.includes(l)&&n&&r.push(...Fe(e.children,t+1))}})),r},He=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const{disabled:i}=G||{},a=["body--row",{"body--row-striped":Q&&t%2!=0,"body--row-selected":b.includes(r)&&!i?.(e),"body--row-current":v===r,...C?je(e._group):null}];return o().createElement("tr",{key:r,"data-row-key":r,className:we()(a)},Ee.map(((i,a)=>De(i,a,e,t,r,n))))},De=(e,t,r,n,s,u)=>{const{isIE:h}=a.current,{dataIndex:m,fixed:f,align:g,className:y="",editRender:v}=e;a.current.scrollXLoad&&(t=l.findIndex((e=>e.dataIndex===m)));const{rowSpan:x,colSpan:E}=$e(r,e,n,t);if(!x||!E)return null;const S=e.ellipsis??se,T=!h&&"left"===f,I=!h&&"right"===f,N=["body--column",{"col--ellipsis":S,"col--center":"center"===g,"col--right":"right"===g,"column--sort":!!p[m],"cell-fix-left":T,"cell-fix-right":I,"cell-fix-left-last":T&&c[c.length-E]?.dataIndex===m,"cell-fix-right-first":I&&d[0]?.dataIndex===m,[y]:!!y}],A=I&&E>1?l.slice(t+1,t+E).reduce(((e,t)=>e+(t.width||t.renderWidth||0)),0):0,L=h?null:{left:T?`${O(m)}px`:"",right:I?k(m)-A+"px":""},_=J?"function"==typeof J?J(r,n):J:null,F=ee?"function"==typeof ee?ee(r,e,n,t):ee:null,H=C?qe(r._group):null,D=Object.assign({},L,W?{height:W}:null,H,_,F);if(v){const{extra:t}=v(r,e)||{};t?.disabledBackgroundColor&&Object.assign(D,{backgroundColor:t?.disabledBackgroundColor})}return o().createElement("td",{key:m,"data-col-index":t,rowSpan:x>1?x:void 0,colSpan:E>1?E:void 0,className:we()(N),style:D,onClick:t=>((e,t,r)=>{const{dataIndex:n}=r;if([ns.expandableColumn,ns.operationColumn].includes(n))return;const a=i(t,t.index);Ae([a,n]);const o=r.editRender?.(t,r),l=o&&!o.disabled,{type:s,selectByClickRow:c=!0,disabled:d=ae}=G||{};!s||d(t)||l||(c||n===ns.selectionColumn)&&((e,t)=>{const{type:r,checkStrictly:n=!0,onSelect:i}=G||{};if("radio"===r&&R([e]),"checkbox"===r){const r=!b.includes(e),a=w&&!n?_e(e,b,r):Le(e,b,r);R(a),i?.(r,t,a)}})(a,t),[ns.selectionColumn].includes(n)||(!Y||Y.disabled?.(t)||l||P(a),ue?.(t,r,e))})(t,r,e),onDoubleClick:t=>((e,t,r)=>{const{dataIndex:n}=r;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(n)||pe?.(t,r,e)})(t,r,e),onContextMenu:t=>((e,t,r)=>{const{dataIndex:n}=r;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(n)||he?.(t,r,e)})(t,r,e)},o().createElement(jc,{ref:e=>ge.current[`${s}-${m}`]=e,row:r,column:e,rowIndex:n,columnIndex:t,rowKey:s,depth:u,showTitle:S}))},$e=(e,t,r,i)=>{let a=1,o=1;if("function"==typeof re){const l=re({row:e,column:t,rowIndex:r,columnIndex:i,tableData:n});if(Array.isArray(l)?(a=l[0],o=l[1]):(0,te.isPlainObject)(l)&&(a=l.rowSpan,o=l.colSpan),e===n[0]&&0===a){a=1;for(let e=1;e<n.length;e++){const{rowSpan:r}=$e(n[e],t,n[e].index,i);if(r>0)break;a++}}}if(u.length>0){const e=u.find((e=>e.row===r&&e.col===i));e&&(a=e.rowSpan,o=e.colSpan)}return{rowSpan:a,colSpan:o}},qe=e=>{const{backgroundColor:t,color:r}=Z.groupItems.find((t=>t.dataIndex===e))??{};return{backgroundColor:t,color:r}},je=e=>{const t=Z.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ke=Ce("table");return o().createElement(o().Fragment,null,o().createElement(Ht,{ref:a.current.scrollBarRef,wrapClassName:`${Ke}--body-wrapper`,wrapStyle:Se,native:le,showTopScrollbar:ne?.doubleXScrollbar,onScroll:e=>{const{elementStore:t,scrollXLoad:r,scrollYLoad:n}=a.current,{prevST:i,prevSL:o}=xe.current,l=g?h.gutterWidth:0,{scrollTop:s,scrollLeft:c}=e;if(c!==o){ce&&(t.$header.scrollLeft=c),m&&(t.$footer.scrollLeft=c);const e=c>0,r=Math.ceil(c)+h.tableWidth<h.tableBodyWidth+l;x!==e&&H(e),E!==r&&D(r)}if(n&&s!==i&&K(s),r&&c!==o&&j(c),g&&s!==i){const r=t.$tableYspace.offsetHeight||t.$tableBody.offsetHeight;Math.ceil(s)+h.viewportHeight-l>=r&&V({type:"scroll",target:e,preventDefault:ae,stopPropagation:ae})}xe.current.prevST=s,xe.current.prevSL=c}},o().createElement("div",{ref:ye,className:"body--y-space"}),o().createElement("div",{ref:be,className:"body--x-space",style:{width:g?h.tableBodyWidth-h.gutterWidth:h.tableBodyWidth}}),o().createElement(xc.Provider,{value:Ie},o().createElement("table",{ref:fe,className:`${Ke}--body`,tabIndex:-1,cellSpacing:"0",cellPadding:"0",style:{width:0}},o().createElement("colgroup",null,Ee.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})}))),de?o().createElement(hi.ReactSortable,{itemKey:e=>i(e,e.index),tag:"tbody",animation:200,list:n,setList:e=>{const t=e.map((e=>i(e,e.index))),r=n.map((e=>i(e,e.index)));if((0,te.isEqual)(t,r))return;const o=bn(e),l=[];a.current.tableFullData.forEach((e=>{n.includes(e)?l.push(o.shift()):l.push(e)})),N(l),F()}},n.map((e=>He(e,e.index,i(e,e.index))))):o().createElement("tbody",null,Fe(n)))),!!ie&&o().createElement(Bc,{ref:ve})))}));Uc.displayName="TableBody";const Wc=Uc,Gc=e=>{const{summationRows:t}=e,{tableRef:r,sorter:n,layout:i,scrollY:a,flattenColumns:l,leftFixedColumns:s,rightFixedColumns:c,setElementStore:d,getStickyLeft:u,getStickyRight:p}=o().useContext($l),{footRender:h}=r.current.props,m=o().useRef(null);o().useLayoutEffect((()=>{g()}),[]);const g=()=>{d("$footer",m.current)},b=Ce("table"),{tableBodyWidth:y}=i;return o().createElement("div",{ref:m,className:`${b}--footer-wrapper`},h?h(l,r.current.tableFullData):o().createElement("table",{className:`${b}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:y?`${y}px`:""}},(()=>{const{gutterWidth:e}=i;return o().createElement("colgroup",null,l.map((e=>{const{dataIndex:t,width:r,renderWidth:n}=e;return o().createElement("col",{key:t,style:{width:`${r||n}px`,minWidth:`${r||n}px`}})})),a&&o().createElement("col",{style:{width:`${e}px`,minWidth:`${e}px`}}))})(),o().createElement("tfoot",null,(()=>{const{isIE:e}=r.current,d=["gutter",{"cell-fix-right":!!c.length}],h=e?null:{right:c.length?0:""};return t.map(((e,t)=>o().createElement("tr",{key:t,className:"footer--row"},l.map(((t,l)=>((e,t,l)=>{const{isIE:d}=r.current,{gutterWidth:h}=i,{dataIndex:m,fixed:g,align:b,summation:y}=e,v=["footer--column","col--ellipsis",{"col--center":"center"===b,"col--right":"right"===b,"column--sort":!!n[m],"cell-fix-left":!d&&"left"===g,"cell-fix-right":!d&&"right"===g,"cell-fix-left-last":!d&&"left"===g&&s[s.length-1]?.dataIndex===m,"cell-fix-right-first":!d&&"right"===g&&c[0]?.dataIndex===m}],x=d?null:{left:"left"===g?`${u(m)}px`:"",right:"right"===g?`${p(m)+(a?h:0)}px`:""},E=y?.render?y.render(r.current.tableFullData):Zr(t,`${m}_text`),S=0===l&&""===E?f("qm.table.config.summaryText"):E;return o().createElement("td",{key:m,title:S,className:we()(v),style:{...x}},o().createElement("div",{className:"cell"},S))})(t,e,l))),a&&o().createElement("td",{className:we()(d),style:{...h}}))))})())))};var Yc=function(e){return e.small="small",e.middle="default",e.large="default",e}(Yc||{});const Xc=e=>{const{current:t,pageSize:r,total:n,onChange:i}=e,{global:a}=o().useContext(c),{tableRef:l,$size:s,setElementStore:d}=o().useContext($l),{uniqueKey:u,paginationConfig:p,infoBarConfig:h}=l.current.props,m=o().useRef(null),f=o().useMemo((()=>u?`tablePager_${u}`:""),[u]);o().useLayoutEffect((()=>{g(),x()}),[]);const g=()=>{d("$pager",m.current)},b=p?.showSizeChanger??ns.pagination.showSizeChanger,y=p?.showQuickJumper??ns.pagination.showQuickJumper,v=p?.pageSizeOptions||a?.table?.pagination?.pageSizeOptions||ns.pagination.pageSizeOptions,x=async()=>{if(!f)return;const e=await E(f);e&&e!==r&&(i(t,e),localStorage.setItem(f,e.toString()))},E=async e=>{const t=a?.getComponentConfigApi;if(t&&!localStorage.getItem(f))try{const r=await t({key:e});if(200===r.code)return r.data}catch(e){}},S=Ce("table"),w={[`${S}-pager`]:!0};return o().createElement("div",{ref:m,className:we()(w)},o().createElement("div",{className:"pager-alert"},"bottom"===h?.position&&o().createElement(ms,{total:n})),o().createElement(L.Pagination,{size:Yc[s],showSizeChanger:b,showQuickJumper:y,pageSizeOptions:v,current:t,pageSize:r,total:n,onChange:(e,t)=>{i(e,t)},onShowSizeChange:(e,t)=>{f&&((async(e,t)=>{const r=a?.saveComponentConfigApi;if(r)try{await r({[e]:t})}catch(e){}})(f,t),localStorage.setItem(f,`${t}`))}}))},Qc=()=>{const{layout:e}=o().useContext($l),t=o().useMemo((()=>{const{headerHeight:t,viewportHeight:r}=e;return{top:`${t}px`,height:`${r}px`}}),[e]),r=Ce("table");return o().createElement("div",{className:`${r}--empty`,style:t},o().createElement(ft,null))},Zc=()=>{const{setElementStore:e}=o().useContext($l),t=o().useRef(null);o().useLayoutEffect((()=>{r()}),[]);const r=()=>{e("$resizableBar",t.current)},n=Ce("table");return o().createElement("div",{ref:t,className:`${n}--resizable-bar`})};function Jc(){return Jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jc.apply(this,arguments)}const ed=o().forwardRef(((e,t)=>{const r=((e,t)=>({...e,...Object.keys(t).reduce(((r,n)=>(r[n]=void 0!==t[n]?t[n]:e[n],r)),{})}))(Ml,e),{rowKey:n,columns:i,loading:a,resizable:l,customClass:s,areaSelection:d,tablePrint:u,exportExcel:p,infoBarConfig:h,topSpaceAlign:m,showTableInfo:f,showFullScreen:g,showRefresh:b,showToolBox:y,showHeader:x}=r,{size:E}=o().useContext(c),S=o().useMemo((()=>r.size??E??""),[r.size,E]),w=o().useRef(null),C=o().useRef(null),T=o().useRef(null),I=o().useRef(null),N=o().useRef(null),R=Yl(((e,t)=>{const r="function"==typeof n?n(e,t):e?.[n];return void 0===r?(v("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):r})),{tableRef:P,tableFullData:O,setElementStore:k,setOriginColumns:A,setTableFullData:L,setTableOriginData:_,setTableFlatData:F,setAllTableData:H,setDeriveRowKeys:D,setInvalidRowKeys:$,setFieldAuth:q,setColumnsDefined:M,setScrollXStore:j,setScrollYStore:K,setScrollXLoad:V,setScrollYLoad:z,setResizeState:B,setHandleState:U,setSummaries:W,setSelectionRows:G,setShouldToTop:Y,setRecordsMap:X,setUnMounted:Q,clearElementStore:Z,clearRecordsMap:J}=((e,t)=>{let{getRowKey:r,$size:n}=t;const{rowHeight:i,dynamicThead:a}=e,l=o().useRef({props:e,uid:Zl(),tableManager:es,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],tableFlatData:[],allTableData:[],allRowKeys:[],deriveRowKeys:[],flattenRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:o().createRef(),scrollXStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0},scrollYStore:{startIndex:0,endIndex:0,offsetSize:0,visibleSize:0,rowHeight:i||ns.rowHeightMaps[n]},store:new rs,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,isIE:!re&&/MSIE|Trident/.test(navigator.userAgent)});(e=>{l.current.props=e})(e);const s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return e.map((e=>{const o=r(e,e.index),l=n?`${n}#${o}`:`${o}`,c=i?`${i}.${e.index+1}`:`${e.index+1}`,d={level:a,rowKey:o,rowKeyPath:l,indexPath:c};return e.indexPath=c,e._level=a,Array.isArray(e.children)&&(d.children=s(e.children,o,l,c,a+1)),t?Object.assign({},d,{parentRowKey:t}):d}))},c=e=>{const t=[];return e.forEach((e=>{Array.isArray(e.children)?t.push(...c(e.children)):t.push(e.rowKey)})),t};return{tableRef:l,...l.current,setElementStore:(e,t)=>{l.current.elementStore[e]=t},setOriginColumns:e=>{l.current.originColumns=e},setTableFullData:e=>{l.current.tableFullData=e},setTableFlatData:e=>{l.current.tableFlatData=e},setTableOriginData:e=>{l.current.tableOriginData=e},setAllTableData:e=>{const t=Wr(e);l.current.allTableData=t,l.current.allRowKeys=t.map((e=>r(e,e.index)))},setDeriveRowKeys:e=>{const t=l.current.tableFullData.some((e=>Array.isArray(e.children)));l.current.treeTable=t,l.current.deriveRowKeys=t?s(e,""):[],l.current.flattenRowKeys=t?c(l.current.deriveRowKeys):[]},setInvalidRowKeys:e=>{l.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{l.current.fieldAuth[e]=t},setColumnsDefined:e=>{l.current.columnsDefined=e},setScrollXStore:e=>{l.current.scrollXStore=e},setScrollYStore:e=>{l.current.scrollYStore=e},setResizeState:e=>{l.current.resizeState=e},setHandleState:e=>{l.current.handleState=e},setSummaries:e=>{l.current.summaries=e},setScrollXLoad:e=>{l.current.scrollXLoad=e},setScrollYLoad:e=>{l.current.scrollYLoad=e},setShouldToTop:e=>{l.current.shouldToTop=e},setSelectionRows:e=>{l.current.selectionRows=e},setRecordsMap:(e,t)=>{l.current.recordsMap.set(e,t)},setUnMounted:e=>{l.current.unMounted=e},clearElementStore:()=>{for(const e in l.current.elementStore)l.current.elementStore[e]=null},clearRecordsMap:()=>{l.current.recordsMap.clear()}}})(r,{getRowKey:R,$size:S}),{tableData:ee,setTableData:ne,tableFlatColumns:ie,setTableFlatColumns:ae,filters:oe,setFilters:le,sorter:ce,setSorter:de,superFilters:ue,setSuperFilters:he,pagination:me,setPagination:fe,selectionKeys:ge,setSelectionKeys:be,rowExpandedKeys:ye,setRowExpandedKeys:ve,highlightKey:xe,setHighlightKey:Ee,updateMark:Se,forceUpdate:Te,mergedTdCells:Ie,setMergedCells:Ne,layout:Re,setLayout:Pe,permission:Oe,setPermission:ke,spinning:Ae,setSpinning:Le,scrollX:_e,setScrollX:Fe,scrollY:He,setScrollY:De,isPingLeft:$e,setPingLeft:qe,isPingRight:je,setPingRight:Ke,isFullScreen:Ve,setFullScreen:ze,updateTableData:Be}=(e=>{const{uniqueKey:t,nativeScrollBar:r,initialSorter:n={},initialFilter:i={},paginationConfig:a,rowSelection:l,expandable:s,rowHighlight:d,mergedCells:u}=e,{global:p}=o().useContext(c),h={current:a?.current??ns.pagination.current,pageSize:(()=>{if(t)return Number(localStorage.getItem(`tablePager_${t}`))||void 0})()??a?.pageSize??p?.table?.pagination?.pageSize??ns.pagination.pageSize,total:0},m=l?.selectedRowKeys??l?.defaultSelectedRowKeys??[],f=s?.expandedRowKeys??s?.defaultExpandedRowKeys??[],[g,b]=o().useState([]),[y,v]=o().useState([]),[x,E]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),i),[S,w]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),n),[C,T]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),[]),[I,N]=o().useState(h),[R,P]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),m),[O,k]=o().useReducer(((e,t)=>(0,te.isEqual)(e,t)?e:t),f),[A,L]=o().useState(d?.currentRowKey??""),[_,F]=o().useReducer((e=>e+1),0),[H,D]=as([],{value:u}),[$,q]=o().useState({gutterWidth:r?ls():0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[M,j]=o().useState({export:!0,import:!0,print:!0}),[K,V]=o().useState(!1),[z,B]=o().useState(!1),[U,W]=o().useState(!1),[G,Y]=o().useState(!1),[X,Q]=o().useState(!1),[Z,J]=o().useState(!1);return{tableData:g,setTableData:b,tableFlatColumns:y,setTableFlatColumns:v,filters:x,setFilters:E,sorter:S,setSorter:w,superFilters:C,setSuperFilters:T,pagination:I,setPagination:N,selectionKeys:R,setSelectionKeys:P,rowExpandedKeys:O,setRowExpandedKeys:k,highlightKey:A,setHighlightKey:L,updateMark:_,forceUpdate:F,mergedTdCells:H,setMergedCells:D,layout:$,permission:M,setPermission:j,setLayout:q,spinning:K,setSpinning:V,scrollX:z,setScrollX:B,scrollY:U,setScrollY:W,isPingLeft:G,setPingLeft:Y,isPingRight:X,setPingRight:Q,isFullScreen:Z,setFullScreen:J,updateTableData:()=>b([...g])}})(r),{isFetch:Ue,isWebPagination:We,isScrollPagination:Ge,showPagination:Ye,shouldUpdateHeight:Xe,tableColumns:Qe,flattenColumns:Ze,editableColumns:Je,summationColumns:et,leftFixedColumns:tt,rightFixedColumns:rt,derivedMergeCells:nt,treeExpandIndex:it,showSummary:at,showFooter:ot,isHeadGroup:lt,bordered:st,isHeadSorter:ct,isHeadFilter:dt,isServiceSummation:ut,isSelectCollection:pt,isTableImport:ht,isTableClipboard:mt,isSuperSearch:ft,isFastSearch:gt,isGroupSummary:bt,isGroupSubtotal:yt,isTreeTable:vt,isTableEmpty:Et,summationRows:St,fetchParams:wt}=cs(r,{getRowKey:R,tableRef:P,tableFullData:O,tableData:ee,sorter:ce,filters:oe,superFilters:ue,selectionKeys:ge,pagination:me,mergedTdCells:Ie}),{createElementStore:Ct,tableStyles:Tt,getSpan:It,getStickyLeft:Nt,getStickyRight:Rt,scrollXToColumn:Pt,scrollYToRecord:Ot,rowInViewport:kt,calcTableHeight:At,resetTableScroll:Lt,computeVirtualX:_t,computeVirtualY:Ft,doLayout:Ht}=hs(r,{getRowKey:R,tableRef:P,topElementRef:w,tableElementRef:C,$size:S,tableColumns:Qe,flattenColumns:Ze,leftFixedColumns:tt,derivedMergeCells:nt,layout:Re,scrollX:_e,scrollY:He,showFooter:ot,showPagination:Ye,isFullScreen:Ve,setLayout:Pe,setScrollX:Fe,setScrollY:De,setElementStore:k,setScrollXStore:j,setScrollYStore:K,setShouldToTop:Y}),{initialTable:Dt,checkDataIndex:$t,createTableFullData:qt,getTableData:Mt,handleTableData:jt,createWebPageData:Kt,createTableData:Vt,createGroupData:zt,createSelectionKeys:Bt,createRowExpandedKeys:Ut,setSelectionKeysEffect:Wt,findParentRowKeys:Gt,getAllChildRowKeys:Yt,doFieldValidate:Xt,getTableLog:Qt,dataChange:Zt,tableChange:Jt,toLastPage:er,toFirstPage:tr,getPageCount:rr,pagerChangeHandle:nr,triggerScrollXEvent:ir,triggerScrollYEvent:ar,scrollBottomDebouncer:or,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearRowSelection:dr,clearRowHighlight:ur,clearTableLog:pr,destroy:hr}=ps(r,{getRowKey:R,tableRef:P,tableElementRef:C,tableBodyRef:T,$size:S,tableColumns:Qe,flattenColumns:Ze,tableFullData:O,pagination:me,layout:Re,filters:oe,sorter:ce,superFilters:ue,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,summationColumns:et,shouldUpdateHeight:Xe,isFetch:Ue,isTreeTable:vt,isWebPagination:We,isScrollPagination:Ge,isServiceSummation:ut,isGroupSubtotal:yt,doLayout:Ht,setTableData:ne,setTableFlatColumns:ae,setTableFullData:L,setTableOriginData:_,setTableFlatData:F,setAllTableData:H,setDeriveRowKeys:D,setPagination:fe,setSpinning:Le,setSorter:de,setFilters:le,setSuperFilters:he,setSelectionKeys:be,setRowExpandedKeys:ve,setHighlightKey:Ee,setSelectionRows:G,setScrollXLoad:V,setScrollYLoad:z,setScrollXStore:j,setScrollYStore:K,computeVirtualX:_t,computeVirtualY:Ft,setFieldAuth:q,setResizeState:B,setSummaries:W,setPermission:ke,setRecordsMap:X,resetTableScroll:Lt,clearElementStore:Z,clearRecordsMap:J});((e,t)=>{const{columns:r,summation:n,rowSelection:i,expandable:a,rowHighlight:l}=e,{tableRef:s,tableBodyRef:c,$size:d,scrollX:u,pagination:p,selectionKeys:h,rowExpandedKeys:m,highlightKey:f,summationRows:g,showSummary:b,isWebPagination:y,isScrollPagination:x,isTreeTable:E,checkDataIndex:S,toLastPage:w,toFirstPage:C,getPageCount:T,setHandleState:I,scrollYToRecord:N,setSelectionKeysEffect:R,setOriginColumns:P,setRowExpandedKeys:O,setHighlightKey:k,setResizeState:A,setPingRight:L,setUnMounted:_,calcTableHeight:F,createSelectionKeys:H,createRowExpandedKeys:D,initialTable:$,destroy:q}=t,M=o().useRef(g);Me((()=>{if(!i)return;const{onChange:e}=i;"radio"===i.type&&c.current.setClickedValues(h.length?[h[0],""]:[]),h.__prevent__||e?.(h,s.current.selectionRows),delete h.__prevent__}),[h]),Me((()=>{if(!a)return;const{onChange:e}=a;m.__prevent__||e?.(m,m.map((e=>s.current.recordsMap.get(e)))),delete m.__prevent__}),[m]),Me((()=>{E&&O(D()),l&&(c.current.setClickedValues(f?[f,""]:[]),l.onChange?.(f,s.current.recordsMap.get(f)??null))}),[f]),Me((()=>{(0,te.isEqual)(g,M.current)||(M.current=g,b&&n&&n.onChange?.(g))}),[g]),Me((()=>{const e=H(i.selectedRowKeys);(0,te.isEqual)(e,h)||(e.__prevent__=!0,R(e),E&&O(D()))}),[i?.selectedRowKeys]),Me((()=>{const e=D(a.expandedRowKeys);(0,te.isEqual)(e,m)||(e.__prevent__=!0,O(e))}),[a?.expandedRowKeys]),Me((()=>{const{currentRowKey:e}=l;e!==f&&k(e??"")}),[l?.currentRowKey]),Me((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(y&&("after"===e?w():C()),N("","after"===e?1e5:0)),t&&p.current>T()&&w(),(e||t)&&I({insert:null,remove:!1})}),[p.total]),Me((()=>{L(u)}),[u]),Me((()=>{F()}),[d]),Me((()=>{s.current.scrollYLoad&&(e.height||e.maxHeight||v("Table","必须设置组件参数 `height` 或 `maxHeight`"),e.ellipsis||v("Table","必须设置组件参数 `ellipsis`")),x&&(e.height||e.maxHeight||v("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,x]);const j=Yl((()=>{const{resizeState:e}=s.current,{winHeight:t}=e,r=window.innerHeight;r!==t&&(A(Object.assign({},e,{winHeight:r})),F())}));o().useEffect((()=>(P(pe(r)),$(),window.addEventListener("resize",j,!1),S(),se((()=>F())),()=>{q(),window.removeEventListener("resize",j),_(!0)})),[])})(r,{tableRef:P,tableBodyRef:T,$size:S,scrollX:_e,pagination:me,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,showSummary:at,summationRows:St,isWebPagination:We,isScrollPagination:Ge,isTreeTable:vt,checkDataIndex:$t,toLastPage:er,toFirstPage:tr,getPageCount:rr,setHandleState:U,scrollYToRecord:Ot,setOriginColumns:A,setSelectionKeysEffect:Wt,setRowExpandedKeys:ve,setHighlightKey:Ee,setResizeState:B,setPingRight:Ke,setUnMounted:Q,calcTableHeight:At,createSelectionKeys:Bt,createRowExpandedKeys:Ut,initialTable:Dt,destroy:hr});const mr=o().useMemo((()=>({getRowKey:R,tableRef:P,tableBodyRef:T,$size:S,flattenColumns:Ze,editableColumns:Je,leftFixedColumns:tt,rightFixedColumns:rt,treeExpandIndex:it,sorter:ce,filters:oe,superFilters:ue,layout:Re,bordered:st,showFooter:ot,showSummary:at,summationRows:St,scrollX:_e,scrollY:He,pagination:me,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,mergedTdCells:Ie,derivedMergeCells:nt,updateMark:Se,isFetch:Ue,isPingLeft:$e,isPingRight:je,isHeadSorter:ct,isHeadFilter:dt,isFullScreen:Ve,isTableEmpty:Et,isHeadGroup:lt,isTreeTable:vt,isGroupSubtotal:yt,isWebPagination:We,dataChange:Zt,tableChange:Jt,getTableData:Mt,setElementStore:k,createWebPageData:Kt,createTableFullData:qt,updateTableData:Be,setSorter:de,setFilters:le,setSuperFilters:he,setHighlightKey:Ee,setRowExpandedKeys:ve,setSelectionRows:G,setSelectionKeysEffect:Wt,setInvalidRowKeys:$,setMergedCells:Ne,getSpan:It,getStickyLeft:Nt,getStickyRight:Rt,scrollXToColumn:Pt,scrollYToRecord:Ot,rowInViewport:kt,setPagination:fe,setPingLeft:qe,setPingRight:Ke,setSpinning:Le,setFullScreen:ze,setShouldToTop:Y,doFieldValidate:Xt,createTableData:Vt,createGroupData:zt,findParentRowKeys:Gt,getAllChildRowKeys:Yt,triggerScrollXEvent:ir,triggerScrollYEvent:ar,scrollBottomDebouncer:or,resetTableScroll:Lt,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearRowSelection:dr,clearRowHighlight:ur})),[S,Ze,Je,tt,rt,it,ce,oe,ue,Re,st,ot,at,St,_e,He,me,wt,ge,ye,xe,nt,Se,Ue,$e,je,ct,dt,Ve,Et,lt,vt,yt,We]);((e,t)=>{const{getRowKey:r,tableRef:n,toolBoxRef:i,tableBodyRef:a,columnFilterRef:l,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:h,highlightKey:m,isFetch:f,dataChange:g,getTableData:b,handleTableData:y,createTableData:x,createTableFullData:E,calcTableHeight:S,scrollXToColumn:w,scrollYToRecord:C,doFieldValidate:T,setTableOriginData:I,setHandleState:N,setColumnsDefined:R,setSelectionKeysEffect:P,setRowExpandedKeys:O,setHighlightKey:k,setSelectionRows:A,setOriginColumns:L,forceUpdate:_,getTableLog:F,clearRowSelection:H,clearRowHighlight:D,clearTableSorter:$,clearTableFilter:q,clearSuperFilters:M,clearTableLog:j}=t,{columns:K,columnsChange:V}=n.current.props,z=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=z(e.children,t,n));const a=t.includes(i);return a&&n?.(e,i),!a}));o().useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{S()},DO_REFRESH:async e=>{f&&(await b(),e?.())},GET_LOG:()=>F(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(H(),D(),$(),q(),M(),j(),x([]))},CLEAR_LOG:()=>{j()},CREATE_FOCUS:(e,t)=>{a.current.createFocus(e,t)},FORCE_UPDATE:()=>{_()},DO_EXPORT:()=>{i.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{w(e)},SET_SELECTION:(e,t)=>{const r=[...e];t&&(r.__prevent__=!0),P(r)},SET_EXPANDABLE:(e,t)=>{const r=[...e];t&&(r.__prevent__=!0),O(r)},SET_HIGHLIGHT:e=>{k(e)},SET_SELECTION_ROWS:e=>{A(e)},SET_TABLE_DATA:e=>{y(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),R(!0),l.current.initialHandler()},SET_TABLE_COLUMN:(e,t,r)=>{const n=Kr(K,e);if(!n)return v("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!(0,te.isPlainObject)(t))return v("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(n.noAuth)return v("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&(0,te.set)(n,e,t[e]);r&&(V?V([...K]):v("Table","需要设置 `columnsChange` 参数"),_())},INSERT_RECORDS:(e,t)=>{const{store:i,tableFullData:a}=n.current,o=(Array.isArray(e)?e:[e]).filter((e=>(0,te.isPlainObject)(e)));if(!o.length)return;o.forEach((e=>{s.forEach((t=>{const{dataIndex:r}=t;[ns.expandableColumn,ns.selectionColumn,ns.operationColumn].includes(r)||Jr(e,r,Zr(e,r))})),i.addToInserted(e)}));const l="before"===t?.mode,c=void 0===t?.parentRowKey,d=a;if(c)l?d.unshift(...o):d.push(...o);else{const e=fn(a,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?l?e.children.unshift(...o):e.children.push(...o):e.children=o)}c&&N(Object.assign({},n.current.handleState,{insert:l?"before":"after"})),x(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:i}=n.current,a=(Array.isArray(e)?e:[e]).map((e=>(0,te.isPlainObject)(e)?r(e,e.index):e));if(!a.length)return;let o=!1;const l=z(i,a,((e,r)=>{t.addToRemoved(e),c.forEach((n=>{const{dataIndex:i,editRender:a}=n,o=a?.(e,n);if(!o)return;const{rules:l=[],disabled:s}=o;!s&&l.length&&(t.removeFromRequired({x:r,y:i}),t.removeFromValidate({x:r,y:i}),t.removeFromEdited({x:r,y:i}))})),o=!0}));o&&(N(Object.assign({},n.current.handleState,{remove:!0})),E(l),P(p.filter((e=>!a.includes(e)))),a.includes(m)&&D(),O(h.filter((e=>!a.includes(e)))),g(),se((()=>{I(z(n.current.tableOriginData,a))})))},VALIDATE_FIELDS:(e,t)=>{n.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:a,editRender:o}=i,l=o?.(n,i);if(!l)return;const s=r(n,n.index);if(e&&!e.includes(s))return;if(t&&!t.includes(a))return;const{rules:c=[],disabled:d}=l;!d&&c.length&&T(c,Zr(n,a),s,a)}))}));const{required:i,validate:a}=F(),o=[...i,...a];return o.length&&C(o[0].rowKey),_(),{required:i,validate:a}}})))})(t,{getRowKey:R,tableRef:P,toolBoxRef:I,tableBodyRef:T,columnFilterRef:N,flattenColumns:Ze,editableColumns:Je,pagination:me,fetchParams:wt,selectionKeys:ge,rowExpandedKeys:ye,highlightKey:xe,isFetch:Ue,dataChange:Zt,getTableData:Mt,handleTableData:jt,createTableData:Vt,createTableFullData:qt,calcTableHeight:At,scrollXToColumn:Pt,scrollYToRecord:Ot,doFieldValidate:Xt,setTableOriginData:_,setHandleState:U,setColumnsDefined:M,setSelectionKeysEffect:Wt,setRowExpandedKeys:ve,setHighlightKey:Ee,setSelectionRows:G,setOriginColumns:A,forceUpdate:Te,getTableLog:Qt,clearRowSelection:dr,clearRowHighlight:ur,clearTableSorter:lr,clearTableFilter:sr,clearSuperFilters:cr,clearTableLog:pr}),o().useLayoutEffect((()=>{Ct(),P.current.tableManager.register(P.current.uid,t??{current:null})}),[]);const fr=Ce("table"),gr={[`${fr}--wrapper`]:!0,[`${fr}--lg`]:"large"===S,[`${fr}--sm`]:"small"===S,[`${fr}--maximize`]:Ve,[s]:!!s},br={[fr]:!0,"is--border":st,"is--fixed":tt.length||rt.length,"is--sortable":ct,"is--filterable":dt,"is--head-group":lt,"is--area-select":!!d,"is--ping-left":$e,"is--ping-right":je};return o().createElement($l.Provider,{value:mr},o().createElement("div",{className:we()(gr)},f&&o().createElement("div",{ref:w,className:`${fr}-top`},o().createElement("div",{className:`${fr}-top__space`},"bottom"!==h?.position&&o().createElement(ms,{total:me.total}),o().createElement("div",{className:`${fr}-top__space-slot`,style:{justifyContent:Gl[m]}},r.children)),o().createElement("div",{className:`${fr}-top__actions`},o().createElement(lc,{ref:I,showFullScreen:g,showReload:b&&Ue,showPrint:Oe.print&&!!u,showImport:Oe.import&&ht,showExport:Oe.export&&!!p,showClipboard:mt,showCollection:pt,showFastSearch:gt,showSuperSearch:ft,showGroupSummary:bt,showToolBox:y,tableColumns:Qe}),o().createElement(dc,{ref:N,columns:i}))),o().createElement(xt,{spinning:a??Ae},o().createElement("div",{ref:C,className:we()(br),style:Tt},o().createElement("div",{className:`${fr}--main-wrapper`},x&&o().createElement(vc,{tableColumns:Qe,sorter:ce,filters:oe}),o().createElement(Wc,{ref:T,tableFlatColumns:ie,tableData:ee}),ot&&o().createElement(Gc,{summationRows:St})),st&&o().createElement("div",{className:`${fr}--border-line`}),Et&&o().createElement(Qc,null),l&&o().createElement(Zc,null))),Ye&&o().createElement(Xc,Jc({},me,{onChange:(e,t)=>nr({current:e,pageSize:t})}))))}));ed.displayName="QmTable";const td=ed,rd=td;function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}const id=e=>{const{uniqueKey:t,multiple:r,initialValue:n,selectionRows:i,defaultSelectedKeys:a=[],filters:l=[],table:s={},className:d,style:u,onClose:p}=e,{size:h}=o().useContext(c),m=o().useMemo((()=>e.size??h??""),[e.size,h]),g=o().useRef(null),b=o().useRef(null),y=o().useRef(null),v=Nt(g),[x,E]=o().useState(s),[S,w]=o().useState(),[C,T]=o().useState(a),[I,N]=o().useState(!1),[R,P]=o().useState(300),[O,k]=o().useState(l),[A,L]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},...s.columns||[]]),[_,F]=o().useState((0,te.merge)({},s.fetch?.params,n)),[H,D]=o().useState([]),$=()=>{const e=g.current,t=e.querySelector(".form-wrap");P(e.offsetHeight-t.offsetHeight-2*Fi[m]-30)},q=Ot($,5);Pt((()=>{q()}),[v.width]),Me((()=>{(0,te.isEqual)(l,O)||k(l)}),[l]),o().useEffect((()=>{M()}),[_]),o().useEffect((()=>{i&&y.current.SET_SELECTION_ROWS(i)}),[i]),o().useEffect((()=>{n&&b.current?.SET_FIELDS_VALUE(n)}),[]);const M=async()=>{const{webPagination:e,fetch:t}=x;if(!e||!t?.api)return;const{api:n,dataKey:i,beforeFetch:a=oe}=t;if(a(_)){N(!0);try{const e=await n(_);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[];r||(T([]),await le(0)),D(t)}}catch(e){}N(!1)}},j=e=>{r||(w(e),p(e))},K=e=>{F(Object.assign({},_,e))},V=Ce("search-helper"),z={[`${V}--wrapper`]:!0},B=x.webPagination?{dataSource:H,loading:I,webPagination:!0}:{fetch:{...x.fetch,params:_}};return o().createElement("div",{ref:g,className:we()(z,d),style:u},o().createElement("div",{className:"form-wrap"},O.length?o().createElement(Go,{ref:b,items:O,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>$(),onFinish:e=>K(e),onReset:async()=>{const[e,t]=await b.current.GET_FORM_DATA();e||K(t)}}):null),o().createElement("div",null,o().createElement(rd,nd({ref:y,uniqueKey:t,height:R,columns:A,rowKey:x.rowKey||"pageIndex"},B,{rowSelection:{type:r?"checkbox":"radio",clearableAfterFetched:!r,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{T(e),w(r?t:t[0])}},paginationConfig:x.paginationConfig,columnsChange:e=>L(e),onRowDblclick:j,onRowEnter:j}))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>p(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!S,onClick:()=>p(S,r?C:void 0)},f("qm.dialog.confirm"))))};id.displayName="SearchHelper";const ad=id;function od(){return od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},od.apply(this,arguments)}const ld=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...ld(e.children)),e.children&&t.push(e.value)})),t},sd=(e,t)=>{let r=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(r=sd(e[n].children,t)),r)return r;if(t(e[n]))return e[n]}return r},cd=(e,t)=>e.map((e=>({...e}))).filter((e=>(e.children=e.children&&cd(e.children,t),t(e)||e.children&&e.children.length))),dd=e=>{const{uniqueKey:t,multiple:r,initialValue:n,selectionRows:i,defaultSelectedKeys:a=[],filters:l=[],table:s={},tree:d={},className:u,style:p,onClose:h}=e,{size:m}=o().useContext(c),g=o().useMemo((()=>e.size??m??""),[e.size,m]),b=o().useRef(null),y=o().useRef(null),x=o().useRef(null),E=Nt(b),[S,w]=o().useState(s),[C,T]=o().useState(),[I,N]=o().useState(a),[R,P]=o().useState(!1),[O,k]=o().useState(300),[A,_]=o().useState(300),[F,H]=o().useState(l),[D,$]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},...s.columns||[]]),[q,M]=o().useState((0,te.merge)({},s.fetch?.params,n)),[j,K]=o().useState([]),V=()=>{const e=b.current,t=e.querySelector(".form-wrap"),r=e.querySelector(".input-wrap");k(e.offsetHeight-r.offsetHeight-10),_(e.offsetHeight-t.offsetHeight-2*Fi[g]-30)},z=Ot(V,5);Pt((()=>{z()}),[E.width]),Me((()=>{(0,te.isEqual)(l,F)||H(l)}),[l]),o().useEffect((()=>{B()}),[q]),o().useEffect((()=>{i&&x.current.SET_SELECTION_ROWS(i)}),[i]),o().useEffect((()=>{n&&y.current?.SET_FIELDS_VALUE(n),ne()}),[]);const B=async()=>{const{webPagination:e,fetch:t}=S;if(!e||!t?.api)return;const{api:n,dataKey:i,beforeFetch:a=oe}=t;if(a(q)){P(!0);try{const e=await n(q);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,i)??[];r||(N([]),await le(0)),K(t)}}catch(e){}P(!1)}},U=e=>{r||(T(e),h(e))},W=e=>{M(Object.assign({},q,e))},[G,Y]=o().useState([]),[X,Q]=o().useState([]),[Z,J]=o().useState(""),ee=o().useRef(G),re=o().useRef([]);Me((()=>{Q(ld(G))}),[G]);const ne=async()=>{if(!d.fetch)return;const{api:e,params:t,dataKey:r,valueKey:n="value",textKey:i="text"}=d.fetch;try{const a=await e(t);if(200===a.code){const e=Array.isArray(a.data)?a.data:(0,te.get)(a.data,r)??[],t=Fn(e,n,i);Y(t),ee.current=t,re.current=e}}catch(e){}},ie=e=>`${e}|${ei.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ae=Ce("tree-table-helper"),se={[`${ae}--wrapper`]:!0},ce=S.webPagination?{dataSource:j,loading:R,webPagination:!0}:{fetch:{...S.fetch,params:q}};return o().createElement("div",{ref:b,className:we()(se,u),style:p},o().createElement(at,{defaultValue:200,style:{height:"100%"}},o().createElement(at.Pane,{min:100,style:{overflowY:"auto"}},o().createElement(L.Input.Search,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:f("qm.form.inputPlaceholder"),allowClear:!0,onChange:e=>(e=>{const t=cd(ee.current,(t=>{if(!e)return!0;const r=t.text||"";return-1!==ie(r).indexOf(e)}));J(e),Y(t)})(e.target.value)}),o().createElement(L.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:O,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ie(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return v("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,r={};for(const n in t)r[n]=(0,te.get)(e,t[n]);W(r)})(sd(re.current,(r=>(0,te.get)(r,t)===e[0]))||{})}})),o().createElement(at.Pane,{className:"split-pane"},o().createElement("div",{className:"form-wrap"},F.length?o().createElement(Go,{ref:y,items:F,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>H(e),onCollapse:()=>V(),onFinish:e=>W(e),onReset:async()=>{const[e,t]=await y.current.GET_FORM_DATA();e||W(t)}}):null),o().createElement("div",null,o().createElement(rd,od({ref:x,uniqueKey:t,height:A,columns:D,rowKey:S.rowKey||"pageIndex"},ce,{rowSelection:{type:r?"checkbox":"radio",clearableAfterFetched:!r,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:I,onChange:(e,t)=>{N(e),T(r?t:t[0])}},paginationConfig:S.paginationConfig,columnsChange:e=>$(e),onRowDblclick:U,onRowEnter:U}))))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[g]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>h(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!C,onClick:()=>h(C,r?I:void 0)},f("qm.dialog.confirm"))))};dd.displayName="TreeTableHelper";const ud=dd,pd=e=>{const{multiple:t,tree:r={},defaultSelectedKeys:n,className:i,style:a,onClose:l}=e,{size:s}=o().useContext(c),d=o().useMemo((()=>e.size??s??""),[e.size,s]),[u,p]=o().useState(),[h]=o().useState(r.fetch?.params),m=Ce("tree-helper"),g={[`${m}--wrapper`]:!0},b=r.fetch?{...ue(r.fetch,["params","valueKey","textKey"]),params:h}:void 0;return o().createElement("div",{className:we()(g,i),style:a},o().createElement(Dl,{multiple:t,fetch:b,fieldsDefine:{valueKey:r.fetch?.valueKey,textKey:r.fetch?.textKey},asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:n,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[d]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>l(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!u,onClick:()=>l(u)},f("qm.dialog.confirm"))))};pd.displayName="TreeHelper";const hd=pd;function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},md.apply(this,arguments)}const fd="_startSign",gd="_endSign",bd=e=>{const{uniqueKey:t,initialValue:r,filters:n=[],table:i={},onClose:a}=e,{size:l}=o().useContext(c),s=o().useMemo((()=>e.size??l??""),[e.size,l]),d=o().useRef(null),u=o().useRef(null),p=o().useRef(null),h=Nt(d),[m,g]=o().useState(i),[b,y]=o().useState(!1),[v,x]=o().useState([]),[E,S]=o().useState(300),[w,C]=o().useState(n),[T,I]=o().useState([{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>o().createElement("span",null,e+1)},{title:f("qm.form.rangeSearchHelper")[0],dataIndex:fd,width:80,align:"right",render:(e,t)=>o().createElement("span",{className:"icon-sign"},e)},...i.columns||[],{title:f("qm.form.rangeSearchHelper")[1],dataIndex:gd,fixed:"right",width:80,render:(e,t)=>o().createElement("span",{className:"icon-sign"},e)}]),[N,R]=o().useState((0,te.merge)({},i.fetch?.params,r)),[P,O]=o().useState([]),k=o().useMemo((()=>v.map((e=>e?.pageIndex))),[v]),A=o().useMemo((()=>2===k.length&&k.every((e=>void 0!==e))),[k]),_=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");S(e.offsetHeight-t.offsetHeight-2*Fi[s]-30)},F=Ot(_,5);Pt((()=>{F()}),[h.width]),Me((()=>{(0,te.isEqual)(n,w)||C(n)}),[n]),o().useEffect((()=>{H()}),[N]);const H=async()=>{const{webPagination:e,fetch:t}=m;if(!e||!t?.api)return;const{api:r,dataKey:n,beforeFetch:i=oe}=t;if(i(N)){y(!0);try{const e=await r(N);if(200===e.code){const t=Array.isArray(e.data)?e.data:(0,te.get)(e.data,n)??[];O(t)}}catch(e){}y(!1)}},D=(e,t)=>{delete e[t]},$=()=>{v.forEach((e=>{e&&(D(e,fd),D(e,gd))})),x([])},q=e=>{$(),R(Object.assign({},N,e))},M=Ce("range-helper"),j=m.webPagination?{dataSource:P,loading:b,webPagination:!0}:{fetch:{...m.fetch,params:N}};return o().createElement("div",{ref:d,className:`${M}--wrapper`},o().createElement("div",{className:"form-wrap"},w.length?o().createElement(Go,{ref:u,items:w,initialValues:r,uniqueKey:t,formType:"search",isAutoFocus:!1,fieldsChange:e=>C(e),onCollapse:()=>_(),onFinish:e=>q(e),onReset:async()=>{const[e,t]=await u.current.GET_FORM_DATA();e||q(t)}}):null),o().createElement("div",null,o().createElement(rd,md({ref:p,height:E,columns:T,rowKey:m.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=k[0]&&e.pageIndex<=k[1]?{backgroundColor:"#f5f5f5"}:{}},j,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:r}=t;[fd,gd].includes(r)&&(r===fd&&(e[r]?(D(e,r),x([void 0,v[1]])):e.pageIndex>k[1]?L.message.warning(f("qm.searchHelper.rangeStartTip")):(v[0]&&D(v[0],r),e[r]="[",x([e,v[1]]))),r===gd&&(e[r]?(D(e,r),x([v[0],void 0])):e.pageIndex<k[0]?L.message.warning(f("qm.searchHelper.rangeEndTip")):(v[1]&&D(v[1],r),e[r]="]",x([v[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===k[0]&&(e[fd]="["),e.pageIndex===k[1]&&(e[gd]="]")}))}}),o().createElement(be,{type:"primary",icon:o().createElement(Te.ClearOutlined,null),title:f("qm.table.alert.clear"),onClick:()=>$()}))),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Fi[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},o().createElement(be,{onClick:()=>a(null),style:{marginRight:8}},f("qm.dialog.cancel")),o().createElement(be,{type:"primary",disabled:!A,onClick:()=>a(v.map((e=>(e=>{const t={};for(const r in e)[fd,gd].includes(r)||(t[r]=e[r]);return t})(e))))},f("qm.dialog.confirm"))))};bd.displayName="RangeTableHelper";const yd=bd,vd=e=>null!=e;function xd(e,t,r,n){const[i,a]=o().useState(void 0);o().useLayoutEffect((()=>{const t="function"==typeof e?e():e;a(t||null)}));const[l,s]=o().useState(null),c=Yl((()=>{if(i){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,{top:n,right:i,bottom:a,left:o}=e.getBoundingClientRect();return n>=0&&o>=0&&i<=t&&a<=r})(i)&&t&&i.scrollIntoView(n);const{left:e,top:r,width:a,height:o}=i.getBoundingClientRect(),l={left:e,top:r,width:a,height:o,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(l)?l:e))}else s(null)}));return o().useLayoutEffect((()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[i,t,c]),[o().useMemo((()=>{if(!l)return l;const e=r?.offset||6,t=r?.radius||2;return{left:l.left-e,top:l.top-e,width:l.width+2*e,height:l.height+2*e,radius:t}}),[l,r]),i]}const Ed={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"]}},Sd={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"]}},wd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Cd(e){const{arrowWidth:t,autoAdjustOverflow:r,arrowPointAtCenter:n,offset:i,borderRadius:a,visibleFirst:o}=e,l=t/2,s={};return Object.keys(Ed).forEach((e=>{const c={...n&&Sd[e]||Ed[e],offset:[0,0],dynamicInset:!0};switch(s[e]=c,wd.has(e)&&(c.autoArrow=!1),e){case"top":case"topLeft":case"topRight":c.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":c.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":c.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":c.offset[0]=l+i}const d=function(e){const{contentRadius:t,limitVerticalRadius:r}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:r?8:n}}({contentRadius:a,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":c.offset[0]=-d.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":c.offset[0]=d.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":c.offset[1]=-d.arrowOffsetHorizontal-l;break;case"leftBottom":case"rightBottom":c.offset[1]=d.arrowOffsetHorizontal+l}c.overflow=function(e,t,r,n){if(!1===n)return{adjustX:!1,adjustY:!1};const i=n&&"object"==typeof n?n:{},a={};switch(e){case"top":case"bottom":a.shiftX=2*t.arrowOffsetHorizontal+r,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=2*t.arrowOffsetVertical+r,a.shiftX=!0,a.adjustX=!0}const o={...a,...i};return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}(e,d,t,r),o&&(c.htmlRegion="visibleFirst")})),s}const Td=require("@rc-component/portal");var Id=n.n(Td);const Nd=require("@rc-component/trigger");var Rd=n.n(Nd);function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pd.apply(this,arguments)}const Od={fill:"transparent",pointerEvents:"auto"},kd=e=>{const{prefixCls:t,rootClassName:r,pos:n,showMask:i,style:a={},fill:l="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${t}-mask-${Zl()}`,p="object"==typeof c?c?.placeholder:c;return o().createElement(Id(),{open:s,autoLock:!0},o().createElement("div",{className:we()(`${t}-mask`,r),style:{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none",...a}},i?o().createElement("svg",{style:{width:"100%",height:"100%"}},o().createElement("defs",null,o().createElement("mask",{id:u},o().createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&o().createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:p?`${t}-placeholder-animated`:""}))),o().createElement("rect",Pd({},n?null:Od,{x:"0",y:"0",width:"100%",height:"100%",fill:l,mask:`url(#${u})`})),n&&o().createElement(o().Fragment,null,o().createElement("rect",Pd({},Od,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),o().createElement("rect",Pd({},Od,{x:"0",y:"0",width:n.left,height:"100%"})),o().createElement("rect",Pd({},Od,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),o().createElement("rect",Pd({},Od,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},Ad=e=>{const{prefixCls:t,zIndex:r,open:n,onPause:i,onPlay:a}=e,[l,s]=as(void 0,{value:n,postState:e=>e??!0}),c=o().useRef(null),d=o().useRef(!1),u=Yl((e=>{p(e),e.shiftKey&&32===e.keyCode&&h()}));o().useEffect((()=>{const e=Gt()(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},h=()=>{d.current?d.current=!1:(s(!l),l?i?.():a?.())};return o().createElement("div",{ref:c,className:`${t}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,r=t.offsetWidth,n=t.offsetHeight,i=window.innerWidth,a=window.innerHeight,o=e.clientX-Ge(t).x,l=e.clientY-Ge(t).y;return document.onmousemove=e=>{let s=e.clientX-o,c=e.clientY-l;s<0&&(s=0),s>i-r-1&&(s=i-r-1),c<0&&(c=0),c>a-n-1&&(c=a-n-1),Be(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>h()},l?o().createElement(Te.PauseOutlined,null):o().createElement(Te.CaretRightOutlined,null))},Ld=e=>{const{prefixCls:t,current:r,total:n=0,cover:i,title:a,description:l,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:h,onFinish:m,className:f,indicatorsRender:g}=e,{t:b}=Ic(),y="primary"!==c?"primary":"default",v=Yl((e=>{w(e),40===e.keyCode&&(r<n-1?h?.():m?.()),38===e.keyCode&&r>0&&p?.()}));o().useEffect((()=>{const e=Gt()(document,"keyup",v);return()=>e.remove()}),[]);const x=vd(i)?o().createElement("div",{className:`${t}-cover`},i):null,E=vd(l)?o().createElement("div",{className:`${t}-description`},l):null;let S;S=g?g(r,n):[...Array.from({length:n}).keys()].map(((e,n)=>o().createElement("span",{key:e,className:we()(n===r&&`${t}-indicator-active`,`${t}-indicator`)})));const w=e=>{e.stopPropagation(),e.preventDefault()};return o().createElement("div",{className:we()(`${t}-content`,f)},o().createElement("div",{className:`${t}-inner`},o().createElement(Te.CloseOutlined,{className:`${t}-close`,onClick:u}),s.content&&o().createElement(L.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},o().createElement(Te.QuestionCircleOutlined,{className:we()(`${t}-close`,"help-icon")})),x,o().createElement("div",{className:`${t}-header`},o().createElement("div",{className:`${t}-title`},a)),E,o().createElement("div",{className:`${t}-footer`},n>1&&o().createElement("div",{className:`${t}-indicators`},S),o().createElement(Ee,{className:`${t}-buttons`},0!==r?o().createElement(be,{className:`${t}-prev-btn`,size:"small",onMouseDown:w,onClick:p},b("qm.tour.prevStep")):null,r===n-1?o().createElement(be,{className:`${t}-finish-btn`,type:y,size:"small",onClick:m},b("qm.tour.finish")):o().createElement(be,{className:`${t}-next-btn`,type:y,size:"small",onMouseDown:w,onClick:h},b("qm.tour.nextStep"))))))},_d=e=>{const{current:t,renderPanel:r}=e;return o().createElement(o().Fragment,null,"function"==typeof r?r(e,t):o().createElement(Ld,e))};function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fd.apply(this,arguments)}const Hd={left:"50%",top:"50%",width:1,height:1},Dd=o().forwardRef(((e,t)=>{const{steps:r=[],defaultCurrent:n,current:i,onChange:a,onClose:l,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:h=!0,overlayClassName:m,overlayStyle:f,placement:g,helper:b,zIndex:y,renderPanel:v,indicatorsRender:x,gap:E,animated:S=!0,scrollIntoViewOptions:w=!0,...C}=e,T=o().useRef(),[I,N]=as(0,{value:i,defaultValue:n}),[R,P]=as(void 0,{value:c,postState:e=>!(I<0||I>=r.length)&&(e??!1)}),[O,k]=as(1051,{value:y,defaultValue:y}),[A,L]=o().useState(),_=o().useRef(R);o().useLayoutEffect((()=>{R&&!_.current&&N(0),_.current=R,L(R)}),[R]),o().useImperativeHandle(t,(()=>({OPEN:()=>P(!0),CLOSE:()=>P(!1),SET_ZINDEX:e=>k(e)})));const{target:F,type:H,placement:D,trigger:$,delay:q,style:M,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:B,action:U}=r[I]||{},W=B||O,G=H||d,Y=R&&(V??u),X=z??w,[Q,Z]=xd(F,!!c,E,X),J=((e,t,r)=>r??t??(null===e?"center":"bottom"))(Z,g,D),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;o().useLayoutEffect((()=>{T.current?.forceAlign()}),[te,I]),Me((()=>{R&&(ie(),U?.(Z,I))}),[R,Z]);const re=e=>{N(e),a?.(e)},ne=()=>{P(!1),l?.(I)},ie=()=>{if(!Z)return;const e=[];!function t(r){if(1===r.nodeType){var n;"INPUT"!==r.tagName&&"TEXTAREA"!==r.tagName||"none"===ze(n=r,"display")||"hidden"===ze(n,"visibility")||"0"===ze(n,"opacity")||e.push(r);for(const e of Array.from(r.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ae=async()=>{if(!$||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),r=Z.offsetWidth,n=Z.offsetHeight,[i,a]=[e+r/2,t+n/2],o=new MouseEvent($,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:a}),l=document.elementFromPoint(i,a);l&&(l.dispatchEvent(o),await le(q??320))},oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,ce=Object.assign({},f,M),de=Ce("tour"),ue=[{[`${de}-primary`]:"primary"===G},m,K],pe=Cd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return o().createElement(o().Fragment,null,o().createElement(kd,{zIndex:W,prefixCls:de,pos:Q,showMask:oe,style:se?.style,fill:se?.color,open:A,animated:S,rootClassName:m}),o().createElement(Id(),{open:A,autoLock:!0},o().createElement(Rd(),Fd({ref:T},C,{zIndex:W,builtinPlacements:pe,popupStyle:ce,popupPlacement:J,popupVisible:A,popupClassName:we()(ue),prefixCls:de,popup:()=>o().createElement(_d,Fd({key:"content",arrow:ee,prefixCls:de,total:r.length,helper:b,renderPanel:v,indicatorsRender:x,onPrev:async()=>{await ae(),re(I-1)},onNext:async()=>{await ae(),re(I+1)},onClose:ne,current:I,onFinish:()=>{ne(),s?.()}},Object.assign({},r[I],{zIndex:W,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),o().createElement("div",{className:we()(m,`${de}-target-placeholder`),style:{...Q||Hd,position:"fixed",pointerEvents:"none"}}))),h&&o().createElement(Id(),{open:R},o().createElement(Ad,{zIndex:W,prefixCls:de,onPause:()=>L(!1),onPlay:()=>L(!0)})))}));Dd.displayName="QmTour";const $d=Dd,qd=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Md=e=>({_s:e,status:qd[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),jd=e=>e?6:5,Kd=(e,t,r,n,i)=>{clearTimeout(n.current);const a=Md(e);t(a),r.current=a,i?.({current:a})},Vd=e=>{const{name:t,in:r,timeout:n,preEnter:i=!0,preExit:l}=e,[s,c]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{enter:t=!0,exit:r=!0,preEnter:n,preExit:i,timeout:o,initialEntered:l,mountOnEnter:s,unmountOnExit:c,onStateChange:d}=e||{},[u,p]=(0,a.useState)((()=>Md(l?2:jd(s)))),h=(0,a.useRef)(u),m=(0,a.useRef)(),[f,g]=(e=>(0,te.isPlainObject)(e)?[e.enter,e.exit]:[e,e])(o),b=(0,a.useCallback)((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return jd(t)}})(h.current._s,c);e&&Kd(e,p,h,m,d)}),[d,c]),y=(0,a.useCallback)((e=>{const a=e=>{switch(Kd(e,p,h,m,d),e){case 1:f>=0&&(m.current=setTimeout(b,f));break;case 4:g>=0&&(m.current=setTimeout(b,g));break;case 0:case 3:m.current=setTimeout((()=>a(e+1)),0)}},o=h.current.isEnter;"boolean"!=typeof e&&(e=!o),e?!o&&a(t?n?0:1:2):o&&a(r?i?3:4:jd(c))}),[b,d,t,r,n,i,f,g,c]);return(0,a.useEffect)((()=>()=>clearTimeout(m.current)),[]),[u,y,b]}({timeout:n,preEnter:i,preExit:l,initialEntered:r});return Pt((()=>{c()}),[r]),o().createElement(o().Fragment,null,o().Children.map(e.children,(e=>o().isValidElement(e)?Dc(e,{className:we()(e.props.className,t,s.status)}):e)))},zd={previewWidth:1100,defaultDistance:.45,logoHeight:60},Bd=(0,a.createContext)(void 0);var Ud=null;function Wd(){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),r=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),a=e.match(/x64/i);if(!t&&!r&&a)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||a)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!r){var o=e.match(/Chrome\D?\d+/i);if(o&&(o=o[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Gd(e,t){var r;try{var n=navigator.userAgent,i=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(Wd()){try{r=getCLodop()}catch(e){}if(!r&&"complete"!==document.readyState)return void L.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!r)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else if(i&&n.match(/x64/i),e||t?r=i?e:t:Ud?r=Ud:((r=document.createElement("object")).setAttribute("width",0),r.setAttribute("height",0),r.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?r.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):r.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(r),Ud=r),!r||!r.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),r;return r.VERSION<"6.2.2.6"&&Wd(),r}catch(e){L.message.error("getLodop 出错:"+e)}}Wd();const Yd=e=>{const t=e/25.4*(()=>{const e=[],{deviceXDPI:t,deviceYDPI:r}=window.screen;if(t&&r)e[0]=t,e[1]=r;else{let t=document.createElement("DIV");t.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(t),e[0]=parseInt(t.offsetWidth.toString()),e[1]=parseInt(t.offsetHeight.toString()),t.parentNode?.removeChild(t),t=null}return e})()[0];return Math.ceil(t)},Xd=o().forwardRef(((e,t)=>{const{templateRender:r,directPrint:n}=e,{global:i}=o().useContext(c),{$$preview:a}=o().useContext(Bd),{state:l,isWindowsPrinter:s,pageSize:d}=a,u=o().useRef(null),p=o().useRef({}),h=o().useRef([]),m=o().useRef([]),f=o().useRef([]),[g,b]=o().useState(!0);o().useImperativeHandle(t,(()=>({createPreviewDom:k,createExportHtml:L,createPrintHtml:A,SHOW_PREVIEW:_,DIRECT_PRINT:F}))),Me((()=>{O()}),[l.form.printerType,l.form.setting.direction,l.form.setting.distance,l.form.setting.fixedLogo]),o().useEffect((()=>{p.current.templateEl=u.current.querySelector(".origin-template").children[0],p.current.previewEl=u.current.querySelector(".workspace")}),[]);const y=o().useMemo((()=>{const{form:{setting:{direction:e}}}=l,t=s?10*zd.defaultDistance+10*zd.defaultDistance:0;return("vertical"===e?d[0]:d[1])-t}),[l,s,d]),x=o().useMemo((()=>{const{form:{setting:{direction:e}}}=l,t=s?10*zd.defaultDistance+10*zd.defaultDistance:0;return("vertical"===e?d[1]:d[0])-t}),[l,s,d]),E=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return Yd(y-10*(e.left-zd.defaultDistance)-10*(e.right-zd.defaultDistance))}),[l,y]),S=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return Yd(x-10*(e.top-zd.defaultDistance)-10*(e.bottom-zd.defaultDistance))}),[l,x]),w=l.form.scale,C=o().useMemo((()=>{const{form:{setting:{distance:e}}}=l;return{left:Yd(10*e.left),right:Yd(10*e.right),top:Yd(10*e.top),bottom:Yd(10*e.bottom)}}),[l]),T=o().useMemo((()=>{const{form:{printerType:e}}=l,{left:t,right:r,top:n,bottom:i}=C,a=E+t+r,o=zd.previewWidth-a<=0?0:(zd.previewWidth-a)/2,s=Math.abs((1-w)*a/2);let c=0;return w>1&&(c=s>o?-1*o:-1*s),w<1&&(c=a-2*s>zd.previewWidth?0:o>0?s:(zd.previewWidth-(a-2*s))/2),{width:`${E}px`,height:"stylus"===e?"auto":S+"px",paddingLeft:`${t}px`,paddingRight:`${r}px`,paddingTop:`${n}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${w})`,opacity:g?0:1}}),[l,g,C,w,S,E]),I=(h.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e))),()=>{const e=i?.print?.leftLogo??"",t=i?.print?.rightLogo??"";return[`<tr style="height: ${zd.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',e?`<img src="${e}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',t?`<img src="${t}" border="0" height="46" />`:"","</td>","</tr>"].join("")}),N=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},R=()=>{let e=document.createElement("tr");var t,r;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(r=p.current.templateEl.children[0]).children[0]?r.insertBefore(t,r.children[0]):r.appendChild(t),e=null},P=()=>{const e=p.current.templateEl.children[0].children,t=[],r=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const i=e[n].clientHeight;e[n].style.height=i+"px",r.push(i),t.push(e[n].outerHTML)}m.current=r,h.current=t},O=()=>{if(!h.current.length)return;const{form:{setting:e,printerType:t}}=l;if(n)return f.current.push([N(),I(),...h.current]);const r=e.fixedLogo?S-zd.logoHeight:S;let i=[];if(f.current=[],"stylus"===t)f.current.push([N(),...e.fixedLogo?[I()]:[],...h.current]);else{let t=0;for(let n=0,a=m.current.length;n<a;n++){const o=h.current[n],l=m.current[n];e.fixedLogo||0!==n||(t+=zd.logoHeight),t+=l,t<=r?i.push(o):(f.current.push([N(),...e.fixedLogo?[I()]:[],...i]),i=[],t=0,n-=1),n===a-1&&i.length&&f.current.push([N(),...e.fixedLogo?[I()]:[],...i])}}e.fixedLogo||f.current[0]?.splice(1,0,I());for(let e=0,t=f.current.length;e<t&&e!==t-1;e++)f.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');a.setState({currentPage:1,totalPage:f.current.length}),k()},k=()=>{const{currentPage:e}=l;let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;t+=f.current[e-1]?.join("")??"",t+="</table>",p.current.previewEl.innerHTML=t,p.current.previewEl.parentNode.scrollTop=0},A=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${p.current.templateEl.className}">`;if(void 0!==e)t+=[...f.current[e-1]].join("");else for(let e=0;e<f.current.length;e++)t+=f.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<h.current.length;t++)e[t]=h.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+I()+N()+e.join("")+"</table>"},_=async()=>{if("TABLE"!==p.current.templateEl?.tagName)return H();p.current.previewEl.innerHTML||(R(),await le(0),P(),O(),b(!1))},F=async()=>{if("TABLE"!==p.current.templateEl?.tagName)return H();R(),await le(0),P(),O(),b(!1),a.doPrint(A()),await le(0),a.doClose()},H=()=>{v("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D=Ce("print-container"),$={[D]:!0,"no-visible":n};return o().createElement("div",{ref:u,className:we()($)},o().createElement(xt,{wrapperClassName:"spin",spinning:g,tip:"Loading..."},o().createElement("div",{className:"preview"},o().createElement("div",{className:"origin-template",style:{width:`${E}px`,marginLeft:`-${Math.floor(E/2)}px`}},r?.()),o().createElement("div",{className:"workspace",style:T}))))}));Xd.displayName="Container";const Qd=Xd;function Zd(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Jd extends a.Component{constructor(){super(...arguments),Zd(this,"context",void 0),Zd(this,"formRef",o().createRef()),Zd(this,"createFormList",(()=>[{type:"DIVIDER",fieldName:"_1",label:f("qm.print.setPanel.printParameter")},{type:"SELECT",label:f("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:f("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:f("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:f("qm.print.setPanel.vertical"),value:"vertical"},{text:f("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:f("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:f("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:f("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:f("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:f("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:zd.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:f("qm.print.setPanel.noEmpty")}]}])),Zd(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})})),Zd(this,"getInitialExtra",(()=>({disleft:f("qm.print.setPanel.sizeUnit"),disright:f("qm.print.setPanel.sizeUnit"),distop:f("qm.print.setPanel.sizeUnit"),disbottom:f("qm.print.setPanel.sizeUnit")}))),Zd(this,"state",{formList:this.createFormList()}),Zd(this,"confirmHandle",(async()=>{const[e,t]=await 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())})),Zd(this,"cancelHandle",(()=>{this.props.onClose()}))}render(){const{formList:e}=this.state;return o().createElement(o().Fragment,null,o().createElement(Go,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),o().createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},o().createElement(be,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},f("qm.dialog.close")),o().createElement(be,{type:"primary",onClick:()=>this.confirmHandle()},f("qm.dialog.confirm"))))}}Zd(Jd,"contextType",c);const eu=Jd;function tu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class ru extends a.Component{constructor(){super(...arguments),tu(this,"context",void 0),tu(this,"provide",{$$preview:this}),tu(this,"containRef",o().createRef()),tu(this,"state",{visible:!1,form:{printerName:-1,printerType:this.props.defaultConfig?.printerType||"laser",copies:this.props.defaultConfig?.copies||1,scale:1,setting:{distance:{left:zd.defaultDistance,right:zd.defaultDistance,top:zd.defaultDistance,bottom:zd.defaultDistance},pageSize:"210*297",direction:this.props.defaultConfig?.direction||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0}),tu(this,"pageChangeHandle",(e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))})),tu(this,"exportClickHandle",(()=>{this.doExport(this.containRef.current.createExportHtml())})),tu(this,"printClickHandle",(async()=>{if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e={...this.state.form,printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text};await Gs().setItem(this.printerKey,e),await this.savePrintConfig(this.printerKey,e)}catch(e){}})),tu(this,"doClose",(()=>{this.props.onClose?.()})),tu(this,"getPrintConfig",(async e=>{const t=this.context.global,r=t?.getComponentConfigApi;if(r)try{const t=await r({key:e});if(200===t.code)return t.data}catch(e){}})),tu(this,"savePrintConfig",(async(e,t)=>{const r=this.context.global,n=r?.saveComponentConfigApi;if(n)try{await n({[e]:t})}catch(e){}})),tu(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 ')),tu(this,"doPrint",(e=>{const t=Gd();if(!t)return;const{uniqueKey:r,closeAfterPrint:n}=this.props,{form:{setting:i,printerName:a,printerType:o,copies:l}}=this.state,{pageSize:s}=this,{defaultDistance:c}=zd,{left:d,right:u,top:p,bottom:h}=i.distance;t.PRINT_INIT(r??Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(a),t.SET_PRINT_COPIES(l),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===o&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===o&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*h*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==o?10*(h-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():L.message.error(f("qm.print.printError"))},t.PRINT()})),tu(this,"doExport",(e=>{const t=Gd();if(!t)return;const{uniqueKey:r,closeAfterPrint:n}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(r??Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():L.message.error(f("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${u()().format("YYYYMMDDHHmmss")}.xlsx`)}))}get printerTypeItems(){return[{text:f("qm.print.laserPrinter"),value:"laser"},{text:f("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Gd(),t=[{text:f("qm.print.defaultPrinter"),value:-1}];try{const r=e.GET_PRINTER_COUNT();for(let n=0;n<r;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){v("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}`:""}async componentDidMount(){if(this.props.uniqueKey)try{let e=await Gs().getItem(this.printerKey);e||(e=await this.getPrintConfig(this.printerKey),(0,te.isPlainObject)(e)&&await Gs().setItem(this.printerKey,e)),(0,te.isPlainObject)(e)&&Object.keys(e).length&&(0,te.merge)(this.state.form,{...e,printerName:this.printerItems.find((t=>t.text===e.printerName))?.value??-1})}catch(e){}}render(){const{preview:e,templateRender:t}=this.props,{visible:r,form:n,currentPage:i,totalPage:a,printPage:l}=this.state,s=Ce("print-preview"),c={visible:r,title:f("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?o().createElement(o().Fragment,null,o().createElement("div",{className:we()(d)},o().createElement("div",{className:"outer"},o().createElement("div",{className:"header"},o().createElement("span",null,f("qm.print.printer"),":",o().createElement(L.Select,{value:n.printerName,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",null,f("qm.print.type"),":",o().createElement(L.Select,{value:n.printerType,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>o().createElement(L.Select.Option,{key:e.value,value:e.value},e.text))))),o().createElement("span",null,f("qm.print.copies"),":",o().createElement(L.InputNumber,{value:n.copies,min:1,precision:0,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{copies:e??1}})))},style:{width:"50px"}})),o().createElement("span",null,f("qm.print.printPage.0"),o().createElement(L.InputNumber,{value:l,min:1,max:a,precision:0,onChange:e=>{this.setState({printPage:e??void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),f("qm.print.printPage.1")),o().createElement("span",null,o().createElement(L.Pagination,{size:"small",current:i,pageSize:1,total:a,onChange:this.pageChangeHandle})),o().createElement("span",null,o().createElement(be,{type:"text",icon:o().createElement(Te.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},f("qm.print.setting"))),o().createElement("span",null,o().createElement(be,{type:"text",icon:o().createElement(Te.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},f("qm.print.export"))),o().createElement("span",null,o().createElement(be,{icon:o().createElement(Te.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},f("qm.print.print")))),o().createElement("div",{className:"main"},o().createElement(Bd.Provider,{value:this.provide},o().createElement(Qd,{ref:this.containRef,templateRender:t,directPrint:!1}))),o().createElement("div",{className:"footer"},o().createElement("span",null,f("qm.print.scale"),":",o().createElement(L.Slider,{value:n.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{scale:e}})))}}),o().createElement("em",{className:"scale-text"},`${Math.floor(100*n.scale)}%`)),o().createElement("span",null,f("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),o().createElement("span",null,f("qm.print.pageNumber"),":",f("qm.print.pagination",{currentPage:i,totalPage:a}))))),o().createElement(Er,c,o().createElement(eu,{setting:n.setting,onChange:e=>{this.setState((t=>(0,te.merge)({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):o().createElement(Bd.Provider,{value:this.provide},o().createElement(Qd,{ref:this.containRef,templateRender:t,directPrint:!0}))}}tu(ru,"contextType",c);const nu=ru;function iu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class au extends a.Component{constructor(){super(...arguments),iu(this,"context",void 0),iu(this,"previewRef",o().createRef()),iu(this,"state",{visible:!1,loading:!1}),iu(this,"clickHandle",(async()=>{this.setState({loading:!0});try{const e=await(this.props.click?.());if(this.setState({loading:!1}),"boolean"==typeof e&&!e)return;await this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),iu(this,"createRender",(()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:r,defaultConfig:n,preview:i,closeAfterPrint:a}=this.props,l={visible:e,title:f("qm.print.preview"),width:`${zd.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:t,uniqueKey:r,defaultConfig:n,preview:i,closeAfterPrint:a,onClose:()=>{this.setState({visible:!1})}};return i?o().createElement(Er,l,o().createElement(nu,s)):e?o().createElement(nu,s):null})),iu(this,"DO_PRINT",(async()=>{const{preview:e}=this.props;await le(0),this.setState({visible:!0}),await le(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:r,type:n,disabled:i,shape:a}=this.props,l={size:t||this.context.size||"",type:n,shape:a,icon:r,loading:e,disabled:i,click:this.clickHandle};return o().createElement(o().Fragment,null,this.props.children&&o().createElement(be,l,this.props.children),this.createRender())}}iu(au,"propTypes",{size:(e,t,r)=>{if(!x(e[t]||""))return y("Print","Invalid prop `"+t+"` supplied to `"+r+"`. Validation failed.")},templateRender:s().elementType}),iu(au,"defaultProps",{preview:!0,type:"primary",icon:o().createElement(Te.PrinterOutlined,null)}),iu(au,"contextType",c);const ou=au;function lu(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function su(e){const t=lu(e);return t?t.frameElement:null}function cu(e){const t=pu(e);return du([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function du(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 uu(e,t){const r=su(e);if(r&&r!==t){const n=[e.getBoundingClientRect()];let i=r,a=!1;for(;i;){const e=cu(i);if(n.push(e),i=su(i),a)break;i&&lu(i)===t&&(a=!0)}return du(n)}return e.getBoundingClientRect()}function pu(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)}}function hu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mu=Object.assign;class fu{constructor(e,t){hu(this,"node",void 0),hu(this,"border",void 0),hu(this,"padding",void 0),hu(this,"content",void 0),this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=vu.border,this.padding.style.borderColor=vu.padding,this.content.style.backgroundColor=vu.background,mu(this.node.style,{borderColor:vu.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){yu(t,"margin",this.node),yu(t,"border",this.border),yu(t,"padding",this.padding),mu(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"}),mu(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class gu{constructor(e,t){hu(this,"tip",void 0),hu(this,"nameSpan",void 0),hu(this,"dimSpan",void 0),this.tip=e.createElement("div"),mu(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),mu(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),mu(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,r){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(r)+"px"}updatePosition(e,t){const r=this.tip.getBoundingClientRect(),n=function(e,t,r){const n=Math.max(r.height,20),i=Math.max(r.width,60);let a;a=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+5:e.top+e.height+5:e.top-n<=t.top+t.height?e.top-n-5<t.top+5?t.top+5:e.top-n-5:t.top+t.height-n-5;let o=e.left+5;return e.left<t.left&&(o=t.left+5),e.left+i>t.left+t.width&&(o=t.left+t.width-i-5),a+="px",o+="px",{style:{top:a,left:o}}}(e,t,{width:r.width,height:r.height});mu(this.tip.style,n.style)}}class bu{constructor(){hu(this,"window",void 0),hu(this,"tipBoundsWindow",void 0),hu(this,"container",void 0),hu(this,"tip",void 0),hu(this,"rects",void 0);const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const r=e.document;this.container=r.createElement("div"),this.container.style.zIndex="10000000",this.tip=new gu(r,this.container),this.rects=[],r.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 r=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>r.length;){const e=this.rects.pop();e?.remove()}if(0===r.length)return;for(;this.rects.length<r.length;)this.rects.push(new fu(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};r.forEach(((e,t)=>{const r=uu(e,this.window),i=pu(e);n.top=Math.min(n.top,r.top-i.marginTop),n.right=Math.max(n.right,r.left+r.width+i.marginRight),n.bottom=Math.max(n.bottom,r.top+r.height+i.marginBottom),n.left=Math.min(n.left,r.left-i.marginLeft),this.rects[t].update(r,i)})),t||(t=r[0].nodeName.toLowerCase(),r[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const i=uu(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function yu(e,t,r){mu(r.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const vu={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 xu=null,Eu=null;function Su(){null!=window.document&&(xu=null,null!==Eu&&(Eu.remove(),Eu=null))}function wu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Cu{constructor(e){wu(this,"_isRunning",void 0),wu(this,"_selectIgnore",void 0),wu(this,"_lastHoveredNode",null),wu(this,"excludeSelectors",void 0),wu(this,"onSelect",void 0),wu(this,"iframesListeningTo",new Set),wu(this,"onClick",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"onMouseEvent",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"onPointerDown",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))})),wu(this,"onPointerMove",(e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Xe(t,window.document.querySelector(e)))))return this._selectIgnore=!0,Su();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 r;r=[t],null,!1,null!=window.document?(null!==xu&&clearTimeout(xu),null!=r&&(null===Eu&&(Eu=new bu),Eu.inspect(r,null))):null!=r&&null!=r[0]&&console.error("showNativeHighlight",r[0])}})),wu(this,"onPointerUp",(e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())})),wu(this,"selectFiberForNode",(0,te.throttle)((e=>{this._selectIgnore||this.onSelect?.(e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let r=e;const n=[];for(;r!==t&&null!==r;){let e=r.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(r.classList).reverse();e<n.length;e++)t.test(n[e])&&r.classList.remove(n[e]);if(r.id&&/^rc-\w+/.test(r.id)&&r.removeAttribute("id"),r.id)e+=`#${r.id}`;else{const t=Array.from(r.parentElement.children).filter((e=>e.tagName===r.tagName)),n=r.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let r="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(r+=`.${t[e]}`);e+=r}}else r.getAttribute("name")?e+=`[name=${r.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(r)+1})`}r.nodeType!==Node.TEXT_NODE&&n.unshift(e),r=r.parentElement}return n.join(" > ")}(e))}),200,{leading:!1})),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){Su(),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 Tu(e){return document.querySelector(e)}const Iu=e=>{const{action:t,onConfirm:r,onCancel:n,onFinish:i}=e,{t:a}=Ic();return o().createElement(o().Fragment,null,o().createElement("div",{style:{height:100}},a("qm.table.config.emptyText")),o().createElement(Ee,{style:{width:"100%",justifyContent:"flex-end"}},o().createElement(be,{size:"small",onClick:()=>n?.()},a("qm.guideTracker.closeButton")),o().createElement(be,{size:"small",onClick:()=>r?.()},a("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),o().createElement(be,{size:"small",onClick:()=>i?.()},a("qm.guideTracker.finishButton"))))},Nu={left:"50%",top:"50%",width:1,height:1},Ru=o().forwardRef(((e,t)=>{const{open:r,current:n,defaultCurrent:i,steps:a=[],placement:l="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:h,helper:m={},selectFilter:f=(e=>e),onSelect:g,onChange:b,onClose:y,onFinish:v}=e,{t:x}=Ic(),E=o().useRef(),S=o().useRef(a.length),[w,C]=as(0,{value:n,defaultValue:i}),[T,I]=as(void 0,{value:r,postState:e=>e??!1}),[N,R]=as(1051,{value:h,defaultValue:h}),[P,O]=o().useState({}),[k,A]=o().useState(!1),[_,F]=o().useState(T),[H,D]=o().useState(!1),[$,q]=xd(P.node,!!r),[M,j]=o().useState(22),K=o().useRef(!1),V=o().useMemo((()=>w>=a.length?"add":"edit"),[w,a]),z=o().useMemo((()=>`${w+1} / ${a.length}`),[w,a]);o().useLayoutEffect((()=>{E.current=new Cu({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),O({id:ln(),node:e,path:t}),C(S.current),A(!0),U(),g?.(t,e)}})}),[]),o().useEffect((()=>(T?B():U(),T?setTimeout((()=>F(!0)),16):F(!1),()=>{U()})),[T]),o().useEffect((()=>{S.current=a.length}),[a]);const B=()=>{E.current.startHandle()},U=()=>{E.current.stopHandle()},W=e=>{e.stopPropagation(),e.preventDefault()};o().useImperativeHandle(t,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:w,selector:P.path})})));const G=Ce("guide-tracker"),Y=[{[`${G}-primary`]:!0}],X=Cd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return o().createElement(o().Fragment,null,o().createElement(Id(),{open:T&&k,autoLock:!0},o().createElement(Rd(),{zIndex:N,builtinPlacements:X,popupPlacement:l,popupVisible:T&&k,popupClassName:we()(Y,c),popupStyle:d,prefixCls:G,popup:()=>{const e=()=>{A(!1),B()};return o().createElement("div",{className:`${G}-content`},o().createElement("div",{className:`${G}-inner`},o().createElement(Te.CloseOutlined,{className:`${G}-close`,onClick:()=>{y?.(w),e()}}),o().createElement(L.Dropdown,{open:H,trigger:["click"],dropdownRender:()=>a.length?o().createElement("div",{className:"ant-dropdown-menu step-list"},o().createElement(hi.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.id)),r=a.map((e=>e.id));if((0,te.isEqual)(t,r))return;const n=t.findIndex((e=>e===P.id)),i=-1!==n?n:w;C(i),b?.(bn(e),i)}},a.map(((e,t)=>o().createElement("li",{key:t,className:we()("item",{actived:e.id===P.id})},o().createElement(Te.HolderOutlined,{className:"handle",title:x("qm.form.draggable")}),o().createElement("span",{className:"box"},o().createElement("span",{className:"title",title:e.title,onClick:()=>{t!==w&&(O({id:e.id,node:Tu(e.selector),path:e.selector}),C(t),j(22===M?M+1:M-1),b?.(a,t))}},e.title),o().createElement(L.Popconfirm,{title:x("qm.button.confirmTitle"),zIndex:N+1,onConfirm:()=>{const r=a.filter((t=>t.id!==e.id)),n=t===w;let i=t<=w?w-1:w;if(i=i<0?0:i,i=i>r.length?r.length:i,n&&r[i]){const{id:e,selector:t}=r[i];O({id:e,node:Tu(t),path:t})}C(i),b?.(r,i)}},o().createElement(Te.CloseOutlined,{className:"close-icon"})))))))):o().createElement(o().Fragment,null),overlayClassName:`${G}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:N},onOpenChange:e=>D(e)},o().createElement(Te.MenuOutlined,{className:we()(`${G}-close`,"menu-icon"),style:{width:M}})),m.content&&o().createElement(L.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:N},content:m.content,title:m.title},o().createElement(Te.QuestionCircleOutlined,{className:we()(`${G}-close`,"help-icon")})),o().createElement("div",{className:"panel-label"},o().createElement("span",{className:"title"},x("qm.guideTracker.label")),o().createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),z)),p?p({id:P.id,selector:P.path,actionStatus:V,DO_CLOSE:e},w):o().createElement(Iu,{action:V,onConfirm:()=>{b?.("add"===V?[...a,{id:P.id,selector:P.path,title:"Guide Title"}]:[...a],w),e()},onCancel:()=>{y?.(w),e()},onFinish:()=>{e(),y?.(w),v?.()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},o().createElement("div",{className:we()(`${G}-target-placeholder`),style:{...$||Nu,position:"fixed",zIndex:N-1,backgroundColor:"rgba(120, 170, 210, 0.7)"},onMouseDown:W,onClick:W}))),s&&o().createElement(Id(),{open:_},o().createElement(Ad,{zIndex:N,prefixCls:G,onPause:()=>{K.current=k,A(!1),U()},onPlay:()=>{K.current?A(!0):B()}})))}));Ru.displayName="QmGuideTracker";const Pu=Ru,Ou=e=>{const{content:t,image:r,width:n,height:i,font:l={},gap:s=[100,100],offset:c=[50,50],rotate:d=-22,zIndex:u=9,alpha:p=1,antiTamper:h=!0,grayscale:m,className:f,style:g}=e,b=o().useRef(null),y=o().useRef(new Map),v=l.fontSize??16,x=l.fontWeight??"normal",E=l.fontStyle??"normal",S=l.fontFamily??"sans-serif",w=l.color??"rgba(0, 0, 0, 0.15)",C=l.textAlign??"center",T=Array.isArray(t)?t:[t],I=s[0],N=s[1],R=I/2,P=N/2,O=c[0]??R,k=c[1]??P,A=o().useMemo((()=>{const e=O-R,t=k-P;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:u}}),[R,P,O,k,u]),L=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const a=(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),[o,l]=(e=>{let t=120,a=64;if(!r&&e.measureText){e.font=`${v}px ${S}`;const r=T.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),a=v*T.length+3*(T.length-1)}return[n??t,i??a]})(t),s=o*a,c=l*a,u=(I+o)*a,h=(N+l)*a,f=I/2*a,g=N/2*a,R=u/2,P=h/2,O=2*(I+o);e.width=2*u,e.height=2*h,t.globalAlpha=p,t.save(),t.translate(R,P),t.rotate(Math.PI/180*d),t.translate(-R,-P);const k=()=>{t.restore(),t.drawImage(e,0,0,u,h,u,h,u,h),m&&(e=>{const t=e.getContext("2d");if(!t)return;const r=t.getImageData(0,0,e.width,e.height),{data:n}=r;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(r,0,0)})(e),((e,t)=>{if(b.current){const r=y.current.get(b.current);r&&(b.current.contains(r)&&b.current.removeChild(r),y.current.delete(b.current));const n=document.createElement("div");n.setAttribute("style",(e=>Object.entries(e).map((e=>{let[t,r]=e;return`${n=t,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${r}`;var n})).join(";"))({...A,backgroundImage:`url('${e}')`,backgroundSize:`${t}px`})),b.current?.append(n),y.current.set(b.current,n)}})(e.toDataURL(),O)},L=()=>{const e=Number(v)*a;t.font=`${E} normal ${x} ${e}px/${l}px ${S}`,t.fillStyle=w,t.textAlign=C,t.textBaseline="top",t.translate(s/2,0),T.forEach(((r,n)=>{t.fillText(r??"",f,g+n*(e+3*a))})),k()};if(r){const e=new Image;e.onload=()=>{t.drawImage(e,f,g,s,c),k()},e.onerror=()=>{L()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=r}else L()},_=e=>Array.from(y.current.values()).includes(e);o().useEffect((()=>{L()}),[t,r,n,i,l,s,c,d,u,p,h,m]),function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=window&&"MutationObserver"in window,i=a.useRef(),o=()=>{i.current&&(i.current.disconnect(),i.current=void 0)};a.useLayoutEffect((()=>(o(),n&&e.current&&(i.current=new MutationObserver(t),i.current.observe(e.current,r)),()=>o())),[e])}(b,(e=>{if(h)for(const t of e){const e=Array.from(t.removedNodes).some((e=>_(e))),r="attributes"===t.type&&_(t.target);if(e||r){L();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const F=Ce("watermark");return o().createElement("div",{ref:b,className:we()(F,f),style:{position:"relative",...g}},e.children)},ku=new Map,Au=new WeakMap;let Lu=0;function _u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:undefined;if(void 0===window.IntersectionObserver&&void 0!==n){const i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:a,elements:o}=function(e){const t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(r=e.root,r?(Au.has(r)||(Lu+=1,Au.set(r,Lu.toString())),Au.get(r)):"0"):e[t]}`;var r})).toString()}(e);let r=ku.get(t);if(!r){const n=new Map;let i=[];const a=new IntersectionObserver((t=>{t.forEach((t=>{const r=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),n.get(t.target)?.forEach((e=>{e(r,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:n},ku.set(t,r)}return r}(r),l=o.get(e)||[];return o.has(e)||o.set(e,l),l.push(t),a.observe(e),function(){l.splice(l.indexOf(t),1),0===l.length&&(o.delete(e),a.unobserve(e)),0===o.size&&(a.disconnect(),ku.delete(i))}}const Fu=e=>{const{forceRender:t,height:r,placeholder:n=null,unmountIfInvisible:i,className:a,style:l}=e,{ref:s,inView:c,entry:d}=function(){let{root:e,rootMargin:t,threshold:r,triggerOnce:n,fallbackInView:i,trackVisibility:a,skip:l,delay:s,onChange:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[d,u]=o().useState(null),[p,h]=o().useState({inView:!1,entry:void 0}),m=o().useRef(c);o().useEffect((()=>{if(l||!d)return;let o;return o=_u(d,((e,t)=>{h({inView:e,entry:t}),m.current?.(e,t),t.isIntersecting&&n&&o&&(o(),o=void 0)}),{root:e,rootMargin:t,threshold:r,trackVisibility:a,delay:s},i),()=>{o&&o()}}),[Array.isArray(r)?r.toString():r,d,e,t,n,l,a,i,s]);const f=p.entry?.target,g=o().useRef();d||!f||n||l||g.current===f||(g.current=f,h({inView:!1,entry:void 0}));const b=[u,p.inView,p.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}(Object.assign({},e,{triggerOnce:!i}));o().useEffect((()=>{r||v("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u=Ce("lazy-load"),p={[u]:!0};return o().createElement("div",{ref:s,className:we()(p,a),style:l},t||c?e.children:o().createElement("div",{className:"placeholder",style:{height:r}},n))},Hu=require("html2canvas");var Du=n.n(Hu);function $u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class qu{constructor(e,t,r,n){if($u(this,"x",void 0),$u(this,"y",void 0),$u(this,"pressure",void 0),$u(this,"time",void 0),isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=r||0,this.time=n||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Mu{static fromPoints(e,t){const r=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Mu(e[1],r,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,r){const n=e.x-t.x,i=e.y-t.y,a=t.x-r.x,o=t.y-r.y,l=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+r.x)/2,d=(t.y+r.y)/2,u=Math.sqrt(n*n+i*i),p=Math.sqrt(a*a+o*o),h=p/(u+p),m=c+(l-c)*h,f=d+(s-d)*h,g=t.x-m,b=t.y-f;return{c1:new qu(l+g,s+b),c2:new qu(c+g,d+b)}}constructor(e,t,r,n,i,a){this.startPoint=e,this.control2=t,this.control1=r,this.endPoint=n,this.startWidth=i,this.endWidth=a}length(){let e,t,r=0;for(let n=0;n<=10;n+=1){const i=n/10,a=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),o=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=a-e,i=o-t;r+=Math.sqrt(n*n+i*i)}e=a,t=o}return r}point(e,t,r,n,i){return t*(1-e)*(1-e)*(1-e)+3*r*(1-e)*(1-e)*e+3*n*(1-e)*e*e+i*e*e*e}}function ju(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ku{constructor(e,t){var r=this;ju(this,"canvas",void 0),ju(this,"ctx",void 0),ju(this,"textInput",void 0),ju(this,"width",320),ju(this,"height",200),ju(this,"ratio",Math.max(window.devicePixelRatio||1,1)),ju(this,"penColor","rgba(0,0,0,1)"),ju(this,"backgroundColor","rgba(0,0,0,0)"),ju(this,"canAddHistory",!1),ju(this,"mode",void 0),ju(this,"openSmooth",!0),ju(this,"dotSize",0),ju(this,"throttle",16),ju(this,"minDistance",5),ju(this,"velocityFilterWeight",.7),ju(this,"compositeOperation","source-over"),ju(this,"minWidth",.5),ju(this,"maxWidth",2.5),ju(this,"fontSize",16),ju(this,"eraserSize",20),ju(this,"lineHeight",1.25),ju(this,"degreeOfBlur",5),ju(this,"textInputPos",{x:0,y:0}),ju(this,"onStart",(()=>{})),ju(this,"onEnd",(()=>{})),ju(this,"_drawingStroke",!1),ju(this,"_lastPoints",[]),ju(this,"_data",[]),ju(this,"_historyList",[]),ju(this,"_lastVelocity",0),ju(this,"_lastWidth",0),ju(this,"_strokeMoveUpdate",void 0),ju(this,"setCanvasSize",(()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)})),ju(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))})),ju(this,"isTouchEvent",(e=>"touches"in e)),ju(this,"addListener",(()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)})),ju(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)})),ju(this,"_isLeftButtonPressed",((e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:!(1&~e.buttons))),ju(this,"_pointerEventToSignatureEvent",(e=>({event:e,type:e.type,x:this.isTouchEvent(e)?e.touches[0]?.clientX:e.clientX,y:this.isTouchEvent(e)?e.touches[0]?.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}))),ju(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}))),ju(this,"_strokeBegin",(e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),r={...t,points:[]};this._data.push(r),this._reset(t),this._strokeUpdate(e,!1)})),ju(this,"_strokeUpdate",(function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!r._drawingStroke)return;if(0===r._data.length)return void r._strokeBegin(e);const n=r._createPoint(e.x,e.y,e.pressure),i=r._data[r._data.length-1],a=i.points,o=a.length>0&&a[a.length-1],l=!!o&&n.distanceTo(o)<=r.minDistance,s=r._getPointGroupOptions(i);if(!o||!o||!l){const e=r._addPoint(n,s);t&&(o?e&&r._drawCurve(e,s):r._drawDot(n,s)),a.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}})),ju(this,"_strokeEnd",(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r._drawingStroke&&(t&&r._strokeUpdate(e),r._drawingStroke=!1)})),ju(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})),ju(this,"_drawDot",((e,t)=>{const r=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;r.beginPath(),this._drawCurveSegment(e.x,e.y,n),r.closePath(),r.fillStyle=t.penColor,r.fill()})),ju(this,"_drawCurve",((e,t)=>{const r=this.ctx,n=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());r.beginPath(),r.fillStyle=t.penColor;for(let r=0;r<i;r+=1){const a=r/i,o=a*a,l=o*a,s=1-a,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*a*e.control1.x,u+=3*s*o*e.control2.x,u+=l*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*a*e.control1.y,p+=3*s*o*e.control2.y,p+=l*e.endPoint.y;const h=Math.min(e.startWidth+l*n,t.maxWidth);this._drawCurveSegment(u,p,h)}r.closePath(),r.fill()})),ju(this,"_drawCurveSegment",((e,t,r)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,r,0,2*Math.PI,!1)})),ju(this,"_createPoint",((e,t,r)=>{const n=this.canvas.getBoundingClientRect();return new qu(e-n.left,t-n.top,r,(new Date).getTime())})),ju(this,"_createPointByEvent",(e=>this._createPoint(e.x,e.y,e.pressure))),ju(this,"_addPoint",((e,t)=>{const{_lastPoints:r}=this;if(r.push(e),r.length>2){3===r.length&&r.unshift(r[0]);const e=this._calculateCurveWidths(r[1],r[2],t),n=Mu.fromPoints(r,e);return r.shift(),n}return null})),ju(this,"_strokeWidth",((e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth))),ju(this,"_calculateCurveWidths",((e,t,r)=>{const n=r.velocityFilterWeight*t.velocityFrom(e)+(1-r.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(n,r),a={end:i,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=i,a})),ju(this,"onDrawStart",(e=>{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),this.onStart?.(e))})),ju(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)))})),ju(this,"onDrawEnd",(e=>{this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),this.onEnd?.(e))})),ju(this,"onInputBlur",(e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()})),ju(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})),ju(this,"drawSquare",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,r,n-t,i-r),this.ctx.stroke(),this.ctx.restore()})),ju(this,"drawRound",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=Math.min(n,t),o=Math.min(i,r),l=.5*(Math.max(n,t)-a),s=.5*(Math.max(i,r)-o),c=a+l,d=o+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,l,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()})),ju(this,"drawArrow",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0],{x:n,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),a=180*Math.atan2(r-i,t-n)/Math.PI,o=(a+25)*Math.PI/180,l=(a-25)*Math.PI/180,s=15*Math.cos(o),c=15*Math.sin(o),d=15*Math.cos(l),u=15*Math.sin(l);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,r),this.ctx.lineTo(n,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,i);const p=n+s,h=i+c;this.ctx.lineTo(p,h);const m=n+d,f=i+u;this.ctx.lineTo(m,f),this.ctx.lineTo(n,i),this.ctx.fill(),this.ctx.restore()})),ju(this,"getAxisColor",((e,t,r)=>{const n=e.width,i=e.data,a=[];return a[0]=i[4*(r*n+t)],a[1]=i[4*(r*n+t)+1],a[2]=i[4*(r*n+t)+2],a[3]=i[4*(r*n+t)+3],a})),ju(this,"setAxisColor",((e,t,r,n)=>{const i=e.width,a=e.data;a[4*(r*i+t)]=n[0],a[4*(r*i+t)+1]=n[1],a[4*(r*i+t)+2]=n[2],a[4*(r*i+t)+3]=n[3]})),ju(this,"drawMosaic",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,r*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=n.width,a=n.height,o=i/this.degreeOfBlur,l=a/this.degreeOfBlur;for(let e=0;e<l;e++)for(let t=0;t<o;t++){const r=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let a=0;a<this.degreeOfBlur;a++)this.setAxisColor(n,t*this.degreeOfBlur+a,e*this.degreeOfBlur+i,r)}this.ctx.putImageData(n,t*this.ratio,r*this.ratio)})),ju(this,"drawText",(e=>{const{x:t,y:r}=this.textInputPos;if(0===t&&0===r)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,i=this.width-t,a=e.target.innerText,o=[];let l="";for(let e=0;e<a.length;e++){const t=l+a[e];this.ctx.measureText(t).width>i&&l.length>0?(o.push(l),l=a[e]):l=t}o.push(l),o.forEach(((e,i)=>{this.ctx.fillText(e,t+1,r+i*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}})),ju(this,"createPencil",(e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,r)})),ju(this,"drawPencil",(e=>{const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,r),this.ctx.stroke(),this.ctx.restore()})),ju(this,"createEraser",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,r)})),ju(this,"drawEraser",(e=>{const{x:t,y:r}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,r),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"})),ju(this,"drawLine",(e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)})),ju(this,"createTextInput",(e=>{if(!this._lastPoints.length)return;const{x:t,y:r}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=r?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())})),ju(this,"setInputStyle",(()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}})),ju(this,"drawBgColor",(()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))})),ju(this,"clearWorkSpace",(()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)})),ju(this,"addHistory",(()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))})),ju(this,"getLastHistory",(()=>this._historyList[this._historyList.length-1])),ju(this,"setLastHistory",(()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()})),ju(this,"clear",(()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())})),ju(this,"undo",(()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()})),ju(this,"setDrawMode",(e=>{this.mode=e})),ju(this,"setLineWidth",(e=>{this.maxWidth=e})),ju(this,"setPenColor",(e=>{this.penColor=e})),ju(this,"setFontSize",(e=>{this.fontSize=e})),ju(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()})),ju(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(r.canvas.width===r.width)return r.canvas.toDataURL(e,t);const n=document.createElement("canvas");return n.width=r.width,n.height=r.height,n.getContext("2d").drawImage(r.canvas,0,0,n.width,n.height),n.toDataURL(e,t)})),ju(this,"getPNG",(()=>this.toDataURL())),ju(this,"getJPG",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;return r.toDataURL("image/jpeg",e)})),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,r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,a=0,o=null;const l=()=>{a=Date.now(),o=null,t=e.apply(r,n),o||(r=null,n=[])};return function(){const s=Date.now(),c=i-(s-a);r=this;for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];return n=u,c<=0||c>i?(o&&(clearTimeout(o),o=null),a=s,t=e.apply(r,n),o||(r=null,n=[])):o||(o=window.setTimeout(l,c)),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()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}ju(Ku,"dataURLToBlob",(e=>{const t=e.split(";base64,"),r=t[0].split(":")[1],n=window.atob(t[1]),i=n.length,a=new Uint8Array(i);for(let e=0;e<i;++e)a[e]=n.charCodeAt(e);return new Blob([a],{type:r})})),ju(Ku,"canvasToDataURL",(e=>e.toDataURL("image/png",1))),ju(Ku,"canvasToBlob",(e=>new Promise(((t,r)=>{e.toBlob((e=>e?t(e):r(null)),"image/png",1)}))));const Vu=Ku,zu=()=>o().createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Bu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Uu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Wu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Gu=()=>o().createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},o().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"})),Yu=o().forwardRef(((e,t)=>{const{open:r,width:n,height:i,imageName:a,penColor:l,minWidth:s,maxWidth:c,backgroundColor:d,className:p,style:h,onOk:m,onCancel:f}=e,{t:g}=Ic(),b=o().useRef(),y=o().useRef(null),x=o().useRef(null),E=o().useRef(null),S=[2,4,6],w=[14,16,18,20,24,28],C=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[T,I]=as(void 0,{value:r,postState:e=>e??!1}),N=o().useMemo((()=>!!e.children),[e.children]),[R,P]=o().useState(N?"square":"line"),[O,k]=o().useState(S[0]),[A,_]=o().useState(N?C[0]:C[4]),[F,H]=o().useState(w[1]),[D,$]=o().useState("bottomLeft"),[q,M]=o().useState(!1),[j,K]=o().useState(!1);o().useEffect((()=>{const e={width:n??x.current?.offsetWidth,height:i??x.current?.offsetHeight,maxWidth:O,mode:R,penColor:A,fontSize:F,backgroundColor:d,openSmooth:!N};return e.openSmooth&&Object.assign(e,{penColor:l,minWidth:s,maxWidth:c}),b.current=new Vu(y.current,e),()=>b.current.destroy()}),[]);const V=e=>{const[t,r]=[n??x.current?.offsetWidth,i??x.current?.offsetHeight],{width:a,height:o}=b.current;let l=!1;t&&t!==a&&(b.current.width=t,l=!0),r&&r!==o&&(b.current.height=r,l=!0),(l||e)&&b.current.update()};Me((()=>{N&&T&&V()}),[T,N]),Me((()=>{b.current.setDrawMode(R)}),[R]),Me((()=>{b.current.setLineWidth(O)}),[O]),Me((()=>{b.current.setPenColor(A)}),[A]),Me((()=>{b.current.setFontSize(F)}),[F]);const z=async()=>{const e=N?x.current.parentNode:y.current;if(e)try{const t=await Du()(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return Vu.canvasToDataURL(t)}catch(e){v("Signature","生成合成图片失败!")}},B=()=>{b.current.clear(),f?.()};o().useImperativeHandle(t,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),CLEAR:()=>b.current.clear(),IS_EMPTY:()=>b.current.isEmpty(),UPDATE:V,GET_DATE_URL:z})));const U=e=>{e&&$((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},W=e=>o().createElement("div",{className:we()("ant-dropdown-menu","content")},"text"!==e?o().createElement("div",{className:"lineWidth"},S.map((e=>o().createElement("span",{key:e,className:we()("dot",`s${e}`,{active:e===O}),onClick:()=>k(e)})))):o().createElement("div",{className:"fontSize"},o().createElement(L.Select,{size:"small",value:F,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>H(e)})),o().createElement("span",{className:"divider"}),o().createElement("div",{className:"penColor"},C.map((e=>o().createElement("span",{key:e,className:we()("dot",{active:e===A}),style:{backgroundColor:e},onClick:()=>_(e)},o().createElement(Te.CheckOutlined,{className:"icon"})))))),G=Ce("signature"),Y={[G]:!0,"is-annotation":N},X=n?{...h,width:n}:h;return o().createElement("div",{className:we()(Y,p),style:X},N&&o().createElement(o().Fragment,null,o().createElement("div",{ref:x,className:"content"},e.children),j&&o().createElement(xt,{spinning:!0,className:"spinning"})),o().createElement("div",{className:we()("signature",{show:T})},o().createElement("canvas",{ref:y,className:R}),N&&o().createElement("div",{ref:E,className:"signature__tool-bar"},o().createElement("div",{className:"wrapper"},o().createElement("div",{className:we()("actions",{hidden:q})},o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("square")},o().createElement(Te.BorderOutlined,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("round")},o().createElement(zu,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("arrow")},o().createElement(Uu,null))),o().createElement(L.Dropdown,{dropdownRender:W,overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("line")},o().createElement(Te.EditOutlined,null))),o().createElement(L.Dropdown,{dropdownRender:()=>W("text"),overlayClassName:`${G}__popper`,placement:D,trigger:["click"],onOpenChange:U},o().createElement("button",{className:"btn",onClick:()=>P("text")},o().createElement(Bu,null))),o().createElement("button",{className:"btn",onClick:async()=>{await(async()=>{K(!0);const e=await z();if(e){const t=a?a.slice(0,a.lastIndexOf(".")>0?a.lastIndexOf("."):void 0):u()().format(Ul);Dt(Vu.dataURLToBlob(e),`${t}.png`)}K(!1)})(),B()}},o().createElement(Te.DownloadOutlined,null)),o().createElement("button",{className:"btn",onClick:()=>P("eraser")},o().createElement(Wu,null)),o().createElement("button",{className:"btn",onClick:()=>b.current.undo()},o().createElement(Gu,null)),o().createElement("button",{className:"btn",onClick:()=>b.current.clear()},o().createElement(Te.ClearOutlined,null)),o().createElement("span",{className:"divider"}),o().createElement("button",{className:"btn",onClick:()=>f?.()},o().createElement(Te.CloseOutlined,null)),o().createElement("button",{className:"btn",onClick:async()=>{K(!0),await le(10);const e=await z();K(!1),B(),m?.(e)}},o().createElement(Te.CheckOutlined,null))),o().createElement("button",{className:"btn btn-fold",title:g(q?"qm.divider.spread":"qm.divider.collect"),onClick:()=>M(!q)},q?o().createElement(Te.LeftOutlined,null):o().createElement(Te.RightOutlined,null))))))}));Yu.displayName="QmSignature";const Xu=Yu,Qu="1.10.0";return i})()));
|