@ys-knife-crud/antd 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("react/jsx-runtime"),o=require("react"),f=require("antd"),ee=require("@ys-knife-crud/react"),Vs=require("react-dom"),P=require("@ys-knife-crud/core");function $i(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:i,isSelected:l,onCheck:c,onContextMenu:u,card:d,empty:y}=e;return a.jsxs("div",{className:"yk-table__cards",children:[t.map((p,w)=>{const k=r&&l(p);return a.jsxs("div",{className:`yk-table__card${k?" is-selected":""}${i?" has-actions":""}`,title:i?"右键查看行操作":void 0,onContextMenu:C=>u(C,p),children:[r?a.jsx(f.Checkbox,{className:"yk-table__card-checkbox",checked:k,onChange:C=>c(p,C.target.checked)}):null,d?d(p,w):a.jsx("pre",{className:"yk-table__card-json",children:JSON.stringify(p,null,2)})]},String(p[n]))}),!s&&t.length===0?a.jsx(a.Fragment,{children:y??a.jsx(f.Empty,{className:"yk-table__cards-empty",description:"暂无数据"})}):null]})}function js(e,t,n){return e.map((r,s)=>s===t?{...r,...n}:r)}function Ui({open:e,drafts:t,onCancel:n,onSave:r,onReset:s,onMove:i,onDraftsChange:l}){return a.jsx(f.Modal,{open:e,title:"列设置",width:480,destroyOnClose:!0,onCancel:n,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{onClick:s,children:"重置"}),a.jsx(f.Button,{onClick:n,children:"取消"}),a.jsx(f.Button,{type:"primary",className:"yk-col-config-save",onClick:()=>void r(),children:"保存"})]}),children:a.jsx("div",{className:"yk-col-config",children:t.map((c,u)=>a.jsxs("div",{className:"yk-col-config-row",children:[a.jsx(f.Checkbox,{className:"yk-col-config-name",checked:c.visible,onChange:d=>l(js(t,u,{visible:d.target.checked})),children:c.displayName}),a.jsx(f.Input,{className:"yk-col-config-width",size:"small",value:c.width,placeholder:"宽度(如 120)",onChange:d=>l(js(t,u,{width:d.target.value}))}),a.jsx(f.Button,{type:"link",disabled:u===0,onClick:()=>i(u,-1),children:"上移"}),a.jsx(f.Button,{type:"link",disabled:u===t.length-1,onClick:()=>i(u,1),children:"下移"})]},c.propertyPath))})})}function Hn(e){return e==null||e===!1?null:o.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="function"?o.createElement(e):null}function zi({menu:e,actions:t,isEnabled:n,onClose:r,onSelect:s}){return o.useEffect(()=>{if(!e)return;const i=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,r]),!e||typeof document>"u"?null:Vs.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"yk-table__menu-mask",onClick:r,onContextMenu:i=>{i.preventDefault(),r()}}),a.jsx("ul",{className:"yk-table__context-menu",style:{left:e.x,top:e.y},children:t.map(i=>{const l=n(i,e.row);return a.jsxs("li",{className:`yk-table__context-menu-item${l?"":" is-disabled"}`,onClick:()=>{l&&s(i)},children:[i.icon?a.jsx("span",{className:"yk-table__context-menu-icon",children:Hn(i.icon)}):null,i.desc]},i.name)})})]}),document.body)}function Gi(e){if(e==null)return null;if(e<60)return`${e} 秒`;const t=Math.floor(e/60),n=e%60;return n>0?`${t} 分 ${n} 秒`:`${t} 分`}function $s({open:e,options:t,exporting:n,fetched:r,total:s,totalKnown:i,percent:l,etaSeconds:c,cancelledVisible:u,cancelledRows:d,onExport:y,onCancelExport:p,onKeepPartial:w,onDiscardPartial:k,onClose:C}){const A=Gi(c);return a.jsxs(a.Fragment,{children:[a.jsx(f.Modal,{open:e,title:"导出 Excel",width:420,destroyOnClose:!0,onCancel:C,footer:null,children:a.jsx("div",{className:"yk-export-options",children:t.map(O=>a.jsx(f.Button,{block:!0,className:"yk-export-option","data-scope":O.value,disabled:O.disabled,onClick:()=>y(O.value),children:O.label},O.value))})}),a.jsxs(f.Modal,{open:n,title:"正在导出",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:a.jsx(f.Button,{onClick:p,children:"取消"}),children:[a.jsx(f.Progress,{percent:l}),a.jsxs("p",{className:"yk-export-progress-text",children:["已加载 ",r,i?` / ${s}`:""," 条",A?`,预计剩余约 ${A}`:""]})]}),a.jsx(f.Modal,{open:u,title:"导出已取消",width:420,destroyOnClose:!0,onCancel:k,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{className:"yk-export-discard",onClick:k,children:"丢弃"}),a.jsx(f.Button,{className:"yk-export-keep",type:"primary",onClick:w,children:"保留部分文件"})]}),children:a.jsxs("p",{className:"yk-export-cancelled-text",children:["已写入 ",d," 条数据,是否保留已导出的部分文件?"]})})]})}function Qi(e){if(e==null)return null;if(e<60)return`${e} 秒`;const t=Math.floor(e/60),n=e%60;return n>0?`${t} 分 ${n} 秒`:`${t} 分`}function qi({open:e,title:t,options:n,collecting:r,fetched:s,total:i,totalKnown:l,percent:c,etaSeconds:u,maxCount:d,onCollect:y,onCancelCollect:p,onClose:w}){const k=Qi(u);return a.jsxs(a.Fragment,{children:[a.jsxs(f.Modal,{open:e,title:t??"收集数据",width:420,destroyOnClose:!0,onCancel:w,footer:null,children:[a.jsx("div",{className:"yk-collect-options",children:n.map(C=>a.jsx(f.Button,{block:!0,className:"yk-collect-option","data-scope":C.value,disabled:C.disabled,onClick:()=>y(C.value),children:C.label},C.value))}),a.jsxs("p",{className:"yk-collect-limit-hint",children:["单次最多 ",d," 条,超出将被截断。"]})]}),a.jsxs(f.Modal,{open:r,title:"正在处理数据",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:a.jsx(f.Button,{onClick:p,children:"取消"}),children:[a.jsx(f.Progress,{percent:c}),a.jsxs("p",{className:"yk-collect-progress-text",children:["已处理 ",s,l?` / ${i}`:""," 条",k?`,预计剩余约 ${k}`:""]})]})]})}function Zi(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:i,isSelected:l,onCheck:c,onContextMenu:u,list:d,empty:y}=e;return a.jsxs("div",{className:"yk-table__list",children:[t.map((p,w)=>{const k=r&&l(p);return a.jsxs("div",{className:`yk-table__list-item${k?" is-selected":""}${i?" has-actions":""}`,title:i?"右键查看行操作":void 0,onContextMenu:C=>u(C,p),children:[r?a.jsx(f.Checkbox,{className:"yk-table__list-item-checkbox",checked:k,onChange:C=>c(p,C.target.checked)}):null,a.jsx("div",{className:"yk-table__list-item-body",children:d?d(p,w):a.jsx("pre",{className:"yk-table__list-item-json",children:JSON.stringify(p,null,2)})})]},String(p[n]))}),!s&&t.length===0?a.jsx(a.Fragment,{children:y??a.jsx(f.Empty,{description:"暂无数据"})}):null]})}function Nr(e,t){return e==="danger"?{type:t?"default":"primary",danger:!0}:e==="primary"?{type:"primary"}:{type:"default"}}function Ki({actions:e,table:t,row:n}){return a.jsx("div",{className:"yk-row-actions",children:ee.visibleActions(e,n).map(r=>{const s=Nr(r.type,!0);return a.jsxs(f.Button,{type:"link",size:"small",danger:s.danger,disabled:!ee.isEnabled(r,n),className:"yk-row-action",onClick:()=>void r.execute(n,t),children:[r.icon?a.jsx("span",{className:"yk-row-action__icon",children:Hn(r.icon)}):null,r.desc]},r.name)})})}function Ji({actions:e,table:t}){return e.length===0?null:{key:"__actions",title:"操作",fixed:"right",width:e.length*34+(e.length-1)*12+30,render:(r,s)=>a.jsx(Ki,{actions:e,table:t,row:s})}}const Xi=20,el=[10,20,50,100],tl=1e3,nl=1e3,rl=1e4;function sl(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function Os(e){return e==null?null:o.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="boolean"?e?"true":"false":String(e)}const Us=o.forwardRef(function(t,n){const r=t.pageSize??Xi,s=t.pageSizes??el,i=t.rowKey??"id",l=t.exportPageSize??tl,c=t.collectPageSize??nl,u=t.maxCollectCount??rl,d=o.useRef(t);d.current=t;const{meta:y,paged:p,rows:w,metaLoading:k,dataLoading:C,currentPage:A,total:O,totalKnown:q,loadMeta:W,setPaged:ie,setDataLoading:S,setCurrentPage:I}=ee.useDefault({metaFun:t.metaFun,dataFun:t.dataFun,pageSize:r,pageSizes:s}),{selectedRows:H,selectedRowKeys:Me,onSelectionChange:ve,isRowSelected:pe,toggleRowSelection:Oe,clearSelection:ne,selectAllOnPage:ue,invertSelectionOnPage:ce}=ee.useSelection({rows:w,rowKey:i});o.useEffect(()=>{var _,D;(D=(_=d.current).onSelectionChange)==null||D.call(_,H)},[H]);const{actions:J,actionsLoading:me,loadActions:G}=ee.useRowActions({rowActionsFunc:t.rowActionsFunc}),{customConfigs:h,customConfigLoading:N,defaultPageSize:T,configDialogVisible:U,columns:de,loadCustomConfigs:Z,updateDefaultPageSize:te,updateColumnWidth:F,openConfigDialog:Ce,closeConfigDialog:De}=ee.useCustomConfig({loadCustomConfigFun:t.loadCustomConfigFun,saveCustomConfigFun:t.saveCustomConfigFun},y),je=T??r,R=O>Math.min(je,...s)||((p==null?void 0:p.hasNext)??!1),X=t.viewMode,[m,$]=o.useState(X??"table");o.useEffect(()=>{X!==void 0&&$(X)},[X]);const He=m,yt=t.showCheckbox,[tn,fe]=o.useState(yt??!1);o.useEffect(()=>{yt!==void 0&&fe(yt)},[yt]);const Ye=tn,st=t.columnResizable,[nn,gt]=o.useState(st??!0);o.useEffect(()=>{st!==void 0&&gt(st)},[st]);const at=nn,B=t.stickyHeader,[he,re]=o.useState(B??!1);o.useEffect(()=>{B!==void 0&&re(B)},[B]);const ke=he,{exportOptions:Je,exportDialogVisible:_t,exporting:it,exportFetched:Et,exportTotal:It,exportTotalKnown:Ft,exportEtaSeconds:tr,exportPercent:xn,exportCancelledVisible:v,exportCancelledRows:b,openExportDialog:Q,closeExportDialog:ye,doExport:Ct,cancelExport:At,keepPartialExport:kn,discardPartialExport:wn}=ee.useExportExcel({props:{dataFun:t.dataFun,exportSelected:Ye,exportorFunc:t.exportorFunc},tableName:(y==null?void 0:y.displayName)??"数据",columns:de,currentRows:w,selectedRows:H,total:O,totalKnown:q,exportPageSize:l,hasMorePage:R}),{collectOptions:fi,collectDialogVisible:hi,collecting:mi,collectFetched:yi,collectTotal:gi,collectTotalKnown:_i,collectEtaSeconds:vi,collectPercent:pi,onCollectClick:xi,closeCollectDialog:ki,doCollect:wi,cancelCollect:Si}=ee.useCollectData({props:{dataFun:t.dataFun,collectorFunc:t.collectorFunc,maxCollectCount:u},selectable:Ye,currentRows:w,selectedRows:H,total:O,totalKnown:q,collectPageSize:c,hasMorePage:R}),bi=o.useCallback(_=>{var D,Y;$(_),(Y=(D=d.current).onUpdateViewMode)==null||Y.call(D,_)},[]),Mi=o.useCallback(_=>{var D,Y;fe(_),(Y=(D=d.current).onUpdateShowCheckbox)==null||Y.call(D,_),_||ne()},[ne]),Ci=o.useCallback(_=>{var D,Y;gt(_),(Y=(D=d.current).onUpdateColumnResizable)==null||Y.call(D,_)},[]),Di=o.useCallback(_=>{var D,Y;re(_),(Y=(D=d.current).onUpdateStickyHeader)==null||Y.call(D,_)},[]),ss=o.useRef(t.dataFun);ss.current=t.dataFun;const nr=o.useRef(r);nr.current=r;const as=o.useRef(T);as.current=T;const vt=o.useRef(A);vt.current=A;const Sn=o.useRef(t.onDataLoaded);Sn.current=t.onDataLoaded;const rr=o.useRef(0),Ie=o.useCallback(async _=>{var Se;const D=++rr.current,Y=(_==null?void 0:_.limit)??as.current??nr.current,we=(_==null?void 0:_.page)??vt.current;S(!0);try{const Xe=await ss.current({limit:Y,offset:(we-1)*Y},_==null?void 0:_.signal);if(D!==rr.current)return;ie(Xe),(Se=Sn.current)==null||Se.call(Sn,Xe)}finally{D===rr.current&&S(!1)}},[S,ie]),ji=o.useCallback(_=>{vt.current=_,I(_),Ie({page:_})},[Ie,I]),sr=o.useCallback(_=>{te(_),vt.current=1,I(1),Ie({limit:_,page:1})},[Ie,I,te]),is=o.useRef(!1);o.useEffect(()=>{is.current||(is.current=!0,Ie({page:1}))},[Ie]);const[ar,Oi]=o.useState(0),ls=o.useRef(0);o.useEffect(()=>{ar!==ls.current&&(ls.current=ar,Ie({page:1}))},[ar,Ie]);const os=o.useRef(void 0);o.useEffect(()=>{const _=os.current;os.current=T,!(_!==void 0||T===void 0)&&T!==nr.current&&(vt.current=1,I(1),Ie({page:1}))},[T,Ie,I]);const cs=o.useRef(r);o.useEffect(()=>{cs.current!==r&&(cs.current=r,sr(r))},[r,sr]);const us=o.useRef(t.dataFun);o.useEffect(()=>{us.current!==t.dataFun&&(us.current=t.dataFun,vt.current=1,I(1),Ie({page:1}))},[t.dataFun,Ie,I]);async function Ni(){await Promise.all([W(),G(),Z()]),vt.current=1,I(1),Oi(_=>_+1)}function Ri(){Ie()}const[bn,ds]=o.useState(null);function Pi(_,D,Y){_.preventDefault(),_.stopPropagation();const we=_.clientX,Se=rn=>Math.max(40,Math.round(Y+rn-we)),Xe=rn=>{ds({propertyPath:D,width:Se(rn.clientX)})},Ds=rn=>{window.removeEventListener("mousemove",Xe),window.removeEventListener("mouseup",Ds),document.body.style.userSelect="";const Vi=Se(rn.clientX);ds(null),F(D,Vi)};document.body.style.userSelect="none",window.addEventListener("mousemove",Xe),window.addEventListener("mouseup",Ds)}const[Lt,ir]=o.useState(null),Yi=Lt?ee.visibleActions(J,Lt.row):[];function fs(_,D){if(J.length===0)return;_.preventDefault();const Y=176,Se=ee.visibleActions(J,D).length*34+8;ir({x:Math.min(_.clientX,window.innerWidth-Y-8),y:Math.min(_.clientY,window.innerHeight-Se-8),row:D})}function hs(_,D){Oe(_,D)}function Ti(_){const D=Lt==null?void 0:Lt.row;ir(null),D&&_.execute(D,Cn)}const[ms,Mn]=o.useState([]),ys=o.useMemo(()=>((y==null?void 0:y.columns)??[]).map((_,D)=>({col:_,index:D})).filter(({col:_})=>_.showForDisplay??!0).sort((_,D)=>(_.col.displayOrder??_.index)-(D.col.displayOrder??D.index)).map(({col:_})=>_),[y]);function Ei(){const _=h.columns;return ys.map((D,Y)=>({col:D,config:_[D.propertyPath],index:Y})).sort((D,Y)=>{var we,Se;return(((we=D.config)==null?void 0:we.order)??D.index)-(((Se=Y.config)==null?void 0:Se.order)??Y.index)}).map(({col:D,config:Y})=>({propertyPath:D.propertyPath,displayName:D.displayName??D.propertyPath,visible:(Y==null?void 0:Y.visible)??!0,width:(Y==null?void 0:Y.width)??""}))}function Ii(){Mn(Ei()),Ce()}function Fi(){Mn(ys.map(_=>({propertyPath:_.propertyPath,displayName:_.displayName??_.propertyPath,visible:!0,width:""})))}function Ai(_,D){Mn(Y=>{const we=_+D;if(we<0||we>=Y.length)return Y;const Se=[...Y],[Xe]=Se.splice(_,1);return Xe?(Se.splice(we,0,Xe),Se):Y})}async function Li(){var Y,we;const _={};ms.forEach((Se,Xe)=>{_[Se.propertyPath]={propertyPath:Se.propertyPath,visible:Se.visible,order:Xe,width:Se.width}});const D={pageSize:T,columns:_};await((we=(Y=d.current).saveCustomConfigFun)==null?void 0:we.call(Y,D)),De(),d.current.loadCustomConfigFun&&await Z()}const lr=k||C||me||N,pt=[];t.empty!=null&&pt.push("empty"),t.footer!=null&&pt.push("footer"),t.loading!=null&&pt.push("loading"),t.card!=null&&pt.push("card"),t.list!=null&&pt.push("list"),t.selectionBar!=null&&pt.push("selectionBar");const gs=o.useRef(y);gs.current=y;const _s=o.useRef(p);_s.current=p;const vs=o.useRef(He);vs.current=He;const ps=o.useRef(Ye);ps.current=Ye;const xs=o.useRef(at);xs.current=at;const ks=o.useRef(ke);ks.current=ke;const ws=o.useRef(H);ws.current=H;const Ss=o.useRef(w);Ss.current=w;const bs=o.useRef(pt);bs.current=pt;const Cn={get meta(){return gs.current},get paged(){return _s.current},get currentPage(){return vt.current},get viewMode(){return vs.current},get selectable(){return ps.current},get columnResizable(){return xs.current},get stickyHeader(){return ks.current},get slotNames(){return bs.current},get selectedRows(){return ws.current},get rows(){return Ss.current},reload:Ni,refresh:Ri,setViewMode:bi,setSelectable:Mi,setColumnResizable:Ci,setStickyHeader:Di,clearSelection:ne,selectAllOnPage:ue,invertSelectionOnPage:ce,openConfigDialog:Ii,openExportDialog:Q,openCollectDialog:xi},or=o.useRef(Cn);or.current=Cn;const cr=o.useRef(null);cr.current===null&&(cr.current=new Proxy({},{get:(_,D)=>Reflect.get(or.current,D),has:(_,D)=>Reflect.has(or.current,D)})),o.useImperativeHandle(n,()=>cr.current,[]);const Ms=de.map(_=>{const D=(bn==null?void 0:bn.propertyPath)===_.propertyPath?bn.width:sl(_.width);return{key:_.propertyPath,dataIndex:_.propertyPath,title:_.displayName??_.propertyPath,width:D,ellipsis:!0,render:_.render?(Y,we)=>Os(_.render(we,Y)):Y=>Os(Y),onHeaderCell:()=>({className:`yk-table__col-header${at?" yk-table__col-header--resizable":""}`,...at?{onMouseDown:Y=>{const we=Y.currentTarget.getBoundingClientRect();Y.clientX<we.right-8||Pi(Y,_.propertyPath,D??we.width)}}:{}})}}),Cs=Ji({actions:J,table:Cn});Cs&&Ms.push(Cs);const Wi=Ye?{selectedRowKeys:Me,preserveSelectedRowKeys:!0,onChange:(_,D)=>ve(D)}:void 0,Bi={selectedRows:H,total:O,clearSelection:ne,selectAllOnPage:ue,invertSelectionOnPage:ce,pageSize:je};function Hi(_,D){if(D!==je){sr(D);return}ji(_)}return a.jsxs("div",{className:"yk-table",children:[t.selectionBar?a.jsx("div",{className:"yk-table__selection-bar-slot",children:t.selectionBar(Bi)}):null,a.jsxs("div",{className:"yk-table__view-area",children:[He==="table"?a.jsx("div",{className:`yk-table__table-wrap${ke?" yk-table__table-wrap--sticky-header":""}`,children:a.jsx(f.Table,{columns:Ms,dataSource:w,rowKey:i,bordered:!0,pagination:!1,rowSelection:Wi,locale:{emptyText:t.empty??a.jsx(f.Empty,{description:"暂无数据"})}})}):He==="card"?a.jsx($i,{rows:w,rowKey:i,showCheckbox:Ye,loading:lr,hasActions:J.length>0,isSelected:pe,onCheck:hs,onContextMenu:fs,card:t.card,empty:t.empty}):a.jsx(Zi,{rows:w,rowKey:i,showCheckbox:Ye,loading:lr,hasActions:J.length>0,isSelected:pe,onCheck:hs,onContextMenu:fs,list:t.list,empty:t.empty}),lr?a.jsx("div",{className:"yk-table__loading-mask",children:t.loading??a.jsx("span",{className:"yk-table__loading-spinner","aria-label":"加载中"})}):null]}),R||t.footer!=null?a.jsxs("div",{className:"yk-table__footer",children:[a.jsx("div",{className:"yk-table__footer-extra",children:t.footer}),R?a.jsx(f.Pagination,{className:"yk-table__pagination",size:"small",current:A,pageSize:je,total:O,pageSizeOptions:s,showSizeChanger:!0,showTotal:q?_=>`共 ${_} 条`:void 0,onChange:Hi}):null]}):null,a.jsx(zi,{menu:Lt,actions:Yi,isEnabled:ee.isEnabled,onClose:()=>ir(null),onSelect:Ti}),a.jsx(Ui,{open:U,drafts:ms,onCancel:De,onSave:Li,onReset:Fi,onMove:Ai,onDraftsChange:Mn}),a.jsx($s,{open:_t,options:Je,exporting:it,fetched:Et,total:It,totalKnown:Ft,percent:xn,etaSeconds:tr,cancelledVisible:v,cancelledRows:b,onExport:_=>void Ct(_),onCancelExport:At,onKeepPartial:()=>void kn(),onDiscardPartial:()=>void wn(),onClose:ye}),a.jsx(qi,{open:hi,title:t.collectorTitle,options:fi,collecting:mi,fetched:yi,total:gi,totalKnown:_i,percent:pi,etaSeconds:vi,maxCount:Math.max(1,Math.floor(u)),onCollect:_=>void wi(_),onCancelCollect:Si,onClose:ki})]})});var Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ve={},Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.AggInfoOf=Fe.AggInfo=Fe.AggItem=Fe.AggType=void 0;Fe.agg=al;var cn;(function(e){e.Sum="sum",e.Min="min",e.Max="max",e.Avg="avg",e.Count="count",e.DistinctCount="distinctcount"})(cn||(Fe.AggType=cn={}));class zs{constructor(t,n,r=null,s){this.path=t,this.type=n,this.name=r,this.filter=s}toString(){var t,n;const r=(n=(t=this.filter)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:"";return this.name?`${this.path}.${this.type}(${r}).as(${this.name})`:`${this.path}.${this.type}(${r})`}}Fe.AggItem=zs;class Gs{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}append(t,n=cn.Sum,r=null,s){return this.items.push(new zs(t,n,r,s)),this}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}}Fe.AggInfo=Gs;class Qs extends Gs{append(t,n=cn.Sum,r=null,s){return super.append(t,n,r,s),this}}Fe.AggInfoOf=Qs;function al(e,t=cn.Sum,n=null,r){return new Qs().append(e,t,n,r)}var Re={},Ne={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.Constant=void 0;bt.con=il;class qs{constructor(t){this.con=t}toString(){return JSON.stringify(this.con)}}bt.Constant=qs;function il(e){return new qs(e)}var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Expression=void 0;Yt.exp=ll;class Zs{constructor(t){this.exp=t}getExp(){return this.exp}toString(){return this.exp}}Yt.Expression=Zs;function ll(e){return new Zs(e)}var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.key=cl;Mt.toExp=ul;Mt.toValueExp=dl;const En=Yt,ol=bt;function cl(e){return e.toString()}function ul(e){return e instanceof En.Expression?e:new En.Expression(e)}function dl(e){return e==null?null:e instanceof En.Expression||e instanceof ol.Constant?e:new En.Expression(e)}Object.defineProperty(Ne,"__esModule",{value:!0});Ne.FilterInfoOf=Ne.empty=Ne.FilterInfo=Ne.CombinType=Ne.Operator=void 0;Ne.filter=hl;Ne.emptyFilter=ml;const un=bt,fl=Yt,Ns=Mt;var In;(function(e){e.Equals="==",e.NotEquals="!=",e.GreaterThan=">",e.LessThanOrEqual="<=",e.LessThan="<",e.GreaterThanOrEqual=">=",e.Between="between",e.NotBetween="not_between",e.In="in",e.NotIn="not_in",e.StartsWith="startswith",e.NotStartsWith="not_startswith",e.EndsWith="endswith",e.NotEndsWith="not_endswith",e.Contains="contains",e.NotContains="not_contains"})(In||(Ne.Operator=In={}));var be;(function(e){e[e.AndItems=1]="AndItems",e[e.OrItems=2]="OrItems",e[e.SingleItem=0]="SingleItem"})(be||(Ne.CombinType=be={}));class Pe{constructor(t,n,r,s=be.SingleItem,i=[]){this.items=[],this.left=t,this.right=r,this.op=n,this.combinType=s,this.items=i}toString(){switch(this.combinType){case be.AndItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Pe.Operator_And} `)}case be.OrItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Pe.Operator_Or} `)}default:return this.isEmpty()?"":`${this.left} ${this.op} ${this.right}`}}andAlso(t){return this.combinType==be.AndItems?(t.combinType==be.AndItems?this.items=this.items.concat(t.items):this.items.push(t),this):Pe.createAnd(this,t)}orElse(t){return this.combinType==be.OrItems?(t.combinType==be.OrItems?this.items=this.items.concat(t.items):this.items.push(t),this):Pe.createOr(this,t)}static createOr(...t){return new Pe(null,null,null,be.OrItems,t)}static createAnd(...t){return new Pe(null,null,null,be.AndItems,t)}isEmpty(){return this.combinType==be.SingleItem&&this.op==null}static fromSimpleObject(...t){return Pe.createAnd(...t.map(n=>{var r;return new Pe((0,fl.exp)(n.name),(r=n.op)!==null&&r!==void 0?r:In.Equals,(0,un.con)(n.value))}))}static fromSimpleDictionary(t){return Pe.fromSimpleObject(...Object.entries(t).map(([n,r])=>({name:n,value:r})))}}Ne.FilterInfo=Pe;Pe.Operator_And="and";Pe.Operator_Or="or";Ne.empty=new Pe((0,un.con)(1),In.Equals,(0,un.con)(1));class kt extends Pe{constructor(t,n,r,s=be.SingleItem,i=[]){super((0,Ns.toValueExp)(t),n,(0,Ns.toValueExp)(r),s,i)}and(t,n,r){const s=new kt(t,n,r);return this.combinType==be.AndItems?(s.combinType==be.AndItems?this.items=this.items.concat(s.items):this.items.push(s),this):new kt(null,null,null,be.AndItems,[this,s])}or(t,n,r){const s=new kt(t,n,r);return this.combinType==be.OrItems?(s.combinType==be.OrItems?this.items=this.items.concat(s.items):this.items.push(s),this):new kt(null,null,null,be.OrItems,[this,s])}andIf(t,n,r,s){return t?this.and(n,r,s):this}orIf(t,n,r,s){return t?this.or(n,r,s):this}}Ne.FilterInfoOf=kt;function hl(e,t,n){return new kt(e,t,n)}function ml(){return new kt((0,un.con)(null),null,(0,un.con)(null))}var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.queryConfig=void 0;Zt.queryConfig={defaultLimit:10,maxLimit:1e3};var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.DataOverflowError=void 0;class Rr extends Error{constructor(t){super(t),this.name="DataOverflowError",Object.setPrototypeOf(this,Rr.prototype)}}hn.DataOverflowError=Rr;var We=Vt&&Vt.__awaiter||function(e,t,n,r){function s(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function c(y){try{d(r.next(y))}catch(p){l(p)}}function u(y){try{d(r.throw(y))}catch(p){l(p)}}function d(y){y.done?i(y.value):s(y.value).then(c,u)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(Re,"__esModule",{value:!0});Re.findBy=Js;Re.findById=gl;Re.count=_l;Re.distinctCount=vl;Re.distinctList=pl;Re.asList=xl;Re.queryPage=kl;Re.loadAll=wl;Re.aggValue=Sl;Re.aggProp=mn;Re.sumProp=bl;Re.maxProp=Ml;Re.minProp=Cl;Re.avgProp=Dl;const Rs=Ne,yl=bt,Qt=Fe,Vn=Zt,Ks=hn;function Js(e,t,n,r){return We(this,void 0,void 0,function*(){const s=yield e({limit:1,offset:0,filter:(0,Rs.filter)(t,Rs.Operator.Equals,(0,yl.con)(n)).toString(),countAll:!1},r);return s.items.length>0?s.items[0]:null})}function gl(e,t,n){return We(this,void 0,void 0,function*(){return Js(e,"id",t,n)})}function _l(e,t,n){return We(this,void 0,void 0,function*(){var r;return(r=(yield e({limit:0,offset:0,filter:t==null?void 0:t.toString(),countAll:!0},n)).totalCount)!==null&&r!==void 0?r:0})}function vl(e,t,n,r){return We(this,void 0,void 0,function*(){var s;return(s=(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),select:t.toString(),distinct:!0,countAll:!0},r)).totalCount)!==null&&s!==void 0?s:0})}function pl(e,t,n){return We(this,void 0,void 0,function*(){var r,s,i,l,c;const u=yield e({limit:(r=t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,offset:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:t.select.toString(),orderBy:(i=t.orderBy)===null||i===void 0?void 0:i.toString(),distinct:!0,countAll:!1},n);if(u.hasNext&&(!((l=t.throwIfOverflow)!==null&&l!==void 0)||l))throw new Ks.DataOverflowError(`The result data of distinctList is lost. Total: ${(c=u.totalCount)!==null&&c!==void 0?c:0}, Max page size: ${u.limit}`);return u.items})}function xl(e,t,n){return We(this,void 0,void 0,function*(){var r,s,i,l,c,u;const d=yield e({limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,offset:0,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t==null?void 0:t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),countAll:!1},n);if(d.hasNext&&(!((c=t==null?void 0:t.throwIfOverflow)!==null&&c!==void 0)||c))throw new Ks.DataOverflowError(`The result data of asList is lost. Total: ${(u=d.totalCount)!==null&&u!==void 0?u:0}, Max page size: ${d.limit}`);return d.items})}function kl(e,t){var n,r,s,i,l,c;return e({limit:(n=t.limit)!==null&&n!==void 0?n:Vn.queryConfig.defaultLimit,offset:(r=t.offset)!==null&&r!==void 0?r:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t.orderBy)===null||l===void 0?void 0:l.toString(),agg:(c=t.agg)===null||c===void 0?void 0:c.toString(),distinct:t.distinct,countAll:t.countAll})}function wl(e,t,n){return We(this,void 0,void 0,function*(){var r,s,i,l,c;let u=[],d=0;const y={limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t==null?void 0:t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),distinct:(c=t==null?void 0:t.distinct)!==null&&c!==void 0?c:!1,countAll:!1};for(;!(n!=null&&n.aborted);){const p=yield e(Object.assign(Object.assign({},y),{offset:d}),n);if(u=u.concat(p.items),d+=y.limit,p.items.length==0||!p.hasNext||n!=null&&n.aborted)break}return u})}function Sl(e,t,n,r){return We(this,void 0,void 0,function*(){return(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),agg:t.toString(),countAll:!1},r)).aggs})}function mn(e,t){return We(this,arguments,void 0,function*(n,r,s=Qt.AggType.Sum,i,l){var c;const u="__tg0",d=yield n({limit:0,offset:0,filter:i==null?void 0:i.toString(),agg:(0,Qt.agg)(r,s,u,i).toString(),countAll:!1},l);return Number((c=d.aggs)===null||c===void 0?void 0:c[u])})}function bl(e,t,n,r){return We(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Sum,n,r)})}function Ml(e,t,n,r){return We(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Max,n,r)})}function Cl(e,t,n,r){return We(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Min,n,r)})}function Dl(e,t,n,r){return We(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Avg,n,r)})}var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.LimitInfo=void 0;class jl{}$n.LimitInfo=jl;var Ue={};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.OrderByInfoOf=Ue.OrderByInfo=Ue.OrderByItem=Ue.OrderByType=void 0;Ue.orderby=Ol;const vr=Mt;var qt;(function(e){e.Asc="asc()",e.Desc="desc()"})(qt||(Ue.OrderByType=qt={}));class Xs{constructor(t,n){this.path=t,this.type=n}toString(){return`${this.path}.${this.type.toString()}`}}Ue.OrderByItem=Xs;class ea{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}add(t,n=qt.Asc){return this.items.push(new Xs(t,n)),this}}Ue.OrderByInfo=ea;class ta extends ea{then(t){return this.add((0,vr.toExp)(t),qt.Asc),this}thenDesc(t){return this.add((0,vr.toExp)(t),qt.Desc),this}}Ue.OrderByInfoOf=ta;function Ol(e,t=qt.Asc){const n=new ta;return n.add((0,vr.toExp)(e),t),n}var na={};Object.defineProperty(na,"__esModule",{value:!0});var Rt={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.SelectInfoOf=tt.SelectInfo=tt.SelectItem=void 0;tt.select=Nl;class pr{constructor(t,n=!1){this.name=t,this.exclude=n}toString(){return this.exclude?`-${this.name}`:this.name}}tt.SelectItem=pr;class ra{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}appendItems(...t){return this.items?this.items=this.items.concat(t):this.items=t,this}}tt.SelectInfo=ra;class sa extends ra{include(...t){return this.appendItems(...t.map(n=>new pr(n.toString()))),this}exclude(...t){return this.appendItems(...t.map(n=>new pr(n.toString(),!0))),this}}tt.SelectInfoOf=sa;function Nl(...e){return new sa().include(...e)}Object.defineProperty(Rt,"__esModule",{value:!0});Rt.QueryBuilderOf=Rt.QueryBuilder=void 0;Rt.query=Pl;const ur=Fe,dr=Ne,xt=Ue,Wt=tt,Dt=Mt,Rl=Zt;class aa{constructor(){this._limit=Rl.queryConfig.defaultLimit,this._offset=0}build(){const t={limit:this._limit,offset:this._offset};return this._filterInfo&&(t.filter=this._filterInfo.toString()),this._orderByInfo&&(t.orderBy=this._orderByInfo.toString()),this._selectInfo&&(t.select=this._selectInfo.toString()),this._aggInfo&&(t.agg=this._aggInfo.toString()),t}withAgg(t){return this._aggInfo=t,this}withFilter(t){return this._filterInfo=t,this}withOrderBy(t){return this._orderByInfo=t,this}withSelect(t){return this._selectInfo=t,this}offset(t){return this._offset=t,this}limit(t){return this._limit=t,this}}Rt.QueryBuilder=aa;class ia extends aa{where(t,n=dr.Operator.Equals,r){return this._filterInfo?this._filterInfo=this._filterInfo.andAlso(new dr.FilterInfo((0,Dt.toValueExp)(t),n,(0,Dt.toValueExp)(r))):this._filterInfo=new dr.FilterInfo((0,Dt.toValueExp)(t),n,(0,Dt.toValueExp)(r)),this}orderby(t,n=xt.OrderByType.Asc){return this._orderByInfo=new xt.OrderByInfo(new xt.OrderByItem((0,Dt.toExp)(t),n)),this}orderbyDesc(t){return this.orderby(t,xt.OrderByType.Desc)}thenby(t,n=xt.OrderByType.Asc){return this._orderByInfo?this._orderByInfo.add((0,Dt.toExp)(t),n):this._orderByInfo=new xt.OrderByInfo(new xt.OrderByItem((0,Dt.toExp)(t),n)),this}thenbyDesc(t){return this.thenby(t,xt.OrderByType.Desc)}agg(t,n=ur.AggType.Sum,r=null){return this._aggInfo?this._aggInfo.append(t,n,r):this._aggInfo=new ur.AggInfo(new ur.AggItem(t,n,r)),this}include(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Wt.SelectItem(n.toString()))):this._selectInfo=new Wt.SelectInfo(...t.map(n=>new Wt.SelectItem(n.toString()))),this}exclude(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Wt.SelectItem(n.toString(),!0))):this._selectInfo=new Wt.SelectInfo(...t.map(n=>new Wt.SelectItem(n.toString(),!0))),this}}Rt.QueryBuilderOf=ia;function Pl(){return new ia}(function(e){var t=Vt&&Vt.__createBinding||(Object.create?function(r,s,i,l){l===void 0&&(l=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,l,c)}:function(r,s,i,l){l===void 0&&(l=i),r[l]=s[i]}),n=Vt&&Vt.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Fe,e),n(Re,e),n(bt,e),n(Zt,e),n(Yt,e),n(Ne,e),n($n,e),n(Ue,e),n(na,e),n(Rt,e),n(tt,e),n(Mt,e),n(hn,e)})(Ve);const la=o.createContext(null);//! moment.js
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("react/jsx-runtime"),o=require("react"),f=require("antd"),j=require("@ys-knife-crud/core"),ee=require("@ys-knife-crud/react"),Vs=require("react-dom");function $i(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:i,isSelected:l,onCheck:c,onContextMenu:u,card:d,empty:m}=e;return a.jsxs("div",{className:"yk-table__cards",children:[t.map((p,w)=>{const k=r&&l(p);return a.jsxs("div",{className:`yk-table__card${k?" is-selected":""}${i?" has-actions":""}`,title:i?"右键查看行操作":void 0,onContextMenu:C=>u(C,p),children:[r?a.jsx(f.Checkbox,{className:"yk-table__card-checkbox",checked:k,onChange:C=>c(p,C.target.checked)}):null,d?d(p,w):a.jsx("pre",{className:"yk-table__card-json",children:JSON.stringify(p,null,2)})]},String(p[n]))}),!s&&t.length===0?a.jsx(a.Fragment,{children:m??a.jsx(f.Empty,{className:"yk-table__cards-empty",description:"暂无数据"})}):null]})}function js(e,t,n){return e.map((r,s)=>s===t?{...r,...n}:r)}function Ui({open:e,drafts:t,onCancel:n,onSave:r,onReset:s,onMove:i,onDraftsChange:l}){return a.jsx(f.Modal,{open:e,title:"列设置",width:480,destroyOnClose:!0,onCancel:n,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{onClick:s,children:"重置"}),a.jsx(f.Button,{onClick:n,children:"取消"}),a.jsx(f.Button,{type:"primary",className:"yk-col-config-save",onClick:()=>void r(),children:"保存"})]}),children:a.jsx("div",{className:"yk-col-config",children:t.map((c,u)=>a.jsxs("div",{className:"yk-col-config-row",children:[a.jsx(f.Checkbox,{className:"yk-col-config-name",checked:c.visible,onChange:d=>l(js(t,u,{visible:d.target.checked})),children:c.displayName}),a.jsx(f.Input,{className:"yk-col-config-width",size:"small",value:c.width,placeholder:"宽度(如 120)",onChange:d=>l(js(t,u,{width:d.target.value}))}),a.jsx(f.Button,{type:"link",disabled:u===0,onClick:()=>i(u,-1),children:"上移"}),a.jsx(f.Button,{type:"link",disabled:u===t.length-1,onClick:()=>i(u,1),children:"下移"})]},c.propertyPath))})})}function Hn(e){return e==null||e===!1?null:o.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="function"?o.createElement(e):null}function zi({menu:e,actions:t,isEnabled:n,onClose:r,onSelect:s}){return o.useEffect(()=>{if(!e)return;const i=l=>{l.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,r]),!e||typeof document>"u"?null:Vs.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"yk-table__menu-mask",onClick:r,onContextMenu:i=>{i.preventDefault(),r()}}),a.jsx("ul",{className:"yk-table__context-menu",style:{left:e.x,top:e.y},children:t.map(i=>{const l=n(i,e.row);return a.jsxs("li",{className:`yk-table__context-menu-item${l?"":" is-disabled"}`,onClick:()=>{l&&s(i)},children:[i.icon?a.jsx("span",{className:"yk-table__context-menu-icon",children:Hn(i.icon)}):null,i.desc]},i.name)})})]}),document.body)}function Gi(e){if(e==null)return null;if(e<60)return`${e} 秒`;const t=Math.floor(e/60),n=e%60;return n>0?`${t} 分 ${n} 秒`:`${t} 分`}function $s({open:e,options:t,exporting:n,fetched:r,total:s,totalKnown:i,percent:l,etaSeconds:c,cancelledVisible:u,cancelledRows:d,onExport:m,onCancelExport:p,onKeepPartial:w,onDiscardPartial:k,onClose:C}){const A=Gi(c);return a.jsxs(a.Fragment,{children:[a.jsx(f.Modal,{open:e,title:"导出 Excel",width:420,destroyOnClose:!0,onCancel:C,footer:null,children:a.jsx("div",{className:"yk-export-options",children:t.map(N=>a.jsx(f.Button,{block:!0,className:"yk-export-option","data-scope":N.value,disabled:N.disabled,onClick:()=>m(N.value),children:N.label},N.value))})}),a.jsxs(f.Modal,{open:n,title:"正在导出",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:a.jsx(f.Button,{onClick:p,children:"取消"}),children:[a.jsx(f.Progress,{percent:l}),a.jsxs("p",{className:"yk-export-progress-text",children:["已加载 ",r,i?` / ${s}`:""," 条",A?`,预计剩余约 ${A}`:""]})]}),a.jsx(f.Modal,{open:u,title:"导出已取消",width:420,destroyOnClose:!0,onCancel:k,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{className:"yk-export-discard",onClick:k,children:"丢弃"}),a.jsx(f.Button,{className:"yk-export-keep",type:"primary",onClick:w,children:"保留部分文件"})]}),children:a.jsxs("p",{className:"yk-export-cancelled-text",children:["已写入 ",d," 条数据,是否保留已导出的部分文件?"]})})]})}function Qi(e){if(e==null)return null;if(e<60)return`${e} 秒`;const t=Math.floor(e/60),n=e%60;return n>0?`${t} 分 ${n} 秒`:`${t} 分`}function qi({open:e,title:t,options:n,collecting:r,fetched:s,total:i,totalKnown:l,percent:c,etaSeconds:u,maxCount:d,onCollect:m,onCancelCollect:p,onClose:w}){const k=Qi(u);return a.jsxs(a.Fragment,{children:[a.jsxs(f.Modal,{open:e,title:t??"收集数据",width:420,destroyOnClose:!0,onCancel:w,footer:null,children:[a.jsx("div",{className:"yk-collect-options",children:n.map(C=>a.jsx(f.Button,{block:!0,className:"yk-collect-option","data-scope":C.value,disabled:C.disabled,onClick:()=>m(C.value),children:C.label},C.value))}),a.jsxs("p",{className:"yk-collect-limit-hint",children:["单次最多 ",d," 条,超出将被截断。"]})]}),a.jsxs(f.Modal,{open:r,title:"正在处理数据",width:420,closable:!1,maskClosable:!1,keyboard:!1,destroyOnClose:!0,footer:a.jsx(f.Button,{onClick:p,children:"取消"}),children:[a.jsx(f.Progress,{percent:c}),a.jsxs("p",{className:"yk-collect-progress-text",children:["已处理 ",s,l?` / ${i}`:""," 条",k?`,预计剩余约 ${k}`:""]})]})]})}function Zi(e){const{rows:t,rowKey:n,showCheckbox:r,loading:s,hasActions:i,isSelected:l,onCheck:c,onContextMenu:u,list:d,empty:m}=e;return a.jsxs("div",{className:"yk-table__list",children:[t.map((p,w)=>{const k=r&&l(p);return a.jsxs("div",{className:`yk-table__list-item${k?" is-selected":""}${i?" has-actions":""}`,title:i?"右键查看行操作":void 0,onContextMenu:C=>u(C,p),children:[r?a.jsx(f.Checkbox,{className:"yk-table__list-item-checkbox",checked:k,onChange:C=>c(p,C.target.checked)}):null,a.jsx("div",{className:"yk-table__list-item-body",children:d?d(p,w):a.jsx("pre",{className:"yk-table__list-item-json",children:JSON.stringify(p,null,2)})})]},String(p[n]))}),!s&&t.length===0?a.jsx(a.Fragment,{children:m??a.jsx(f.Empty,{description:"暂无数据"})}):null]})}function Nr(e,t){return e==="danger"?{type:t?"default":"primary",danger:!0}:e==="primary"?{type:"primary"}:{type:"default"}}function Ki({actions:e,table:t,row:n}){return a.jsx("div",{className:"yk-row-actions",children:ee.visibleActions(e,n).map(r=>{const s=Nr(r.type,!0);return a.jsxs(f.Button,{type:"link",size:"small",danger:s.danger,disabled:!ee.isEnabled(r,n),className:"yk-row-action",onClick:()=>void r.execute(n,t),children:[r.icon?a.jsx("span",{className:"yk-row-action__icon",children:Hn(r.icon)}):null,r.desc]},r.name)})})}function Ji({actions:e,table:t}){return e.length===0?null:{key:"__actions",title:"操作",fixed:"right",width:e.length*34+(e.length-1)*12+30,render:(r,s)=>a.jsx(Ki,{actions:e,table:t,row:s})}}const Xi=20,el=[10,20,50,100],tl=1e3,nl=1e3,rl=1e4;function sl(e){if(!e)return;const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function Os(e){return e==null?null:o.isValidElement(e)||typeof e=="string"||typeof e=="number"?e:typeof e=="boolean"?e?"true":"false":String(e)}const Us=o.forwardRef(function(t,n){const r=t.pageSize??Xi,s=t.pageSizes??el,i=t.rowKey??"id",l=t.exportPageSize??tl,c=t.collectPageSize??nl,u=t.maxCollectCount??rl,d=o.useRef(t);d.current=t;const{meta:m,paged:p,rows:w,metaLoading:k,dataLoading:C,currentPage:A,total:N,totalKnown:q,loadMeta:W,setPaged:ie,setDataLoading:S,setCurrentPage:I}=ee.useDefault({metaFun:t.metaFun,dataFun:t.dataFun,pageSize:r,pageSizes:s}),{selectedRows:H,selectedRowKeys:Me,onSelectionChange:pe,isRowSelected:xe,toggleRowSelection:Oe,clearSelection:ne,selectAllOnPage:de,invertSelectionOnPage:ce}=ee.useSelection({rows:w,rowKey:i});o.useEffect(()=>{var g,D;(D=(g=d.current).onSelectionChange)==null||D.call(g,H)},[H]);const{actions:J,actionsLoading:ye,loadActions:G}=ee.useRowActions({rowActionsFunc:t.rowActionsFunc}),{customConfigs:h,customConfigLoading:R,defaultPageSize:T,configDialogVisible:U,columns:ue,loadCustomConfigs:Z,updateDefaultPageSize:te,updateColumnWidth:F,openConfigDialog:Ce,closeConfigDialog:De}=ee.useCustomConfig({loadCustomConfigFun:t.loadCustomConfigFun,saveCustomConfigFun:t.saveCustomConfigFun},m),je=T??r,P=N>Math.min(je,...s)||((p==null?void 0:p.hasNext)??!1),X=t.viewMode,[y,V]=o.useState(X??"table");o.useEffect(()=>{X!==void 0&&V(X)},[X]);const Ve=y,yt=t.showCheckbox,[tn,fe]=o.useState(yt??!1);o.useEffect(()=>{yt!==void 0&&fe(yt)},[yt]);const Ye=tn,st=t.columnResizable,[nn,gt]=o.useState(st??!0);o.useEffect(()=>{st!==void 0&&gt(st)},[st]);const at=nn,B=t.stickyHeader,[he,re]=o.useState(B??!1);o.useEffect(()=>{B!==void 0&&re(B)},[B]);const Se=he,{exportOptions:Xe,exportDialogVisible:_t,exporting:it,exportFetched:Et,exportTotal:It,exportTotalKnown:Ft,exportEtaSeconds:tr,exportPercent:xn,exportCancelledVisible:v,exportCancelledRows:b,openExportDialog:Q,closeExportDialog:ge,doExport:Ct,cancelExport:At,keepPartialExport:kn,discardPartialExport:wn}=ee.useExportExcel({props:{dataFun:t.dataFun,exportSelected:Ye,exportorFunc:t.exportorFunc},tableName:(m==null?void 0:m.displayName)??"数据",columns:ue,currentRows:w,selectedRows:H,total:N,totalKnown:q,exportPageSize:l,hasMorePage:P}),{collectOptions:fi,collectDialogVisible:hi,collecting:mi,collectFetched:yi,collectTotal:gi,collectTotalKnown:_i,collectEtaSeconds:vi,collectPercent:pi,onCollectClick:xi,closeCollectDialog:ki,doCollect:wi,cancelCollect:Si}=ee.useCollectData({props:{dataFun:t.dataFun,collectorFunc:t.collectorFunc,maxCollectCount:u},selectable:Ye,currentRows:w,selectedRows:H,total:N,totalKnown:q,collectPageSize:c,hasMorePage:P,columns:ue}),bi=o.useCallback(g=>{var D,Y;V(g),(Y=(D=d.current).onUpdateViewMode)==null||Y.call(D,g)},[]),Mi=o.useCallback(g=>{var D,Y;fe(g),(Y=(D=d.current).onUpdateShowCheckbox)==null||Y.call(D,g),g||ne()},[ne]),Ci=o.useCallback(g=>{var D,Y;gt(g),(Y=(D=d.current).onUpdateColumnResizable)==null||Y.call(D,g)},[]),Di=o.useCallback(g=>{var D,Y;re(g),(Y=(D=d.current).onUpdateStickyHeader)==null||Y.call(D,g)},[]),ss=o.useRef(t.dataFun);ss.current=t.dataFun;const nr=o.useRef(r);nr.current=r;const as=o.useRef(T);as.current=T;const vt=o.useRef(A);vt.current=A;const Sn=o.useRef(t.onDataLoaded);Sn.current=t.onDataLoaded;const rr=o.useRef(0),Ie=o.useCallback(async g=>{var me;const D=++rr.current,Y=(g==null?void 0:g.limit)??as.current??nr.current,ke=(g==null?void 0:g.page)??vt.current;S(!0);try{const Fe=await ss.current({limit:Y,offset:(ke-1)*Y},g==null?void 0:g.signal);if(D!==rr.current)return;ie(Fe),(me=Sn.current)==null||me.call(Sn,Fe)}finally{D===rr.current&&S(!1)}},[S,ie]),ji=o.useCallback(g=>{vt.current=g,I(g),Ie({page:g})},[Ie,I]),sr=o.useCallback(g=>{te(g),vt.current=1,I(1),Ie({limit:g,page:1})},[Ie,I,te]),is=o.useRef(!1);o.useEffect(()=>{is.current||(is.current=!0,Ie({page:1}))},[Ie]);const[ar,Oi]=o.useState(0),ls=o.useRef(0);o.useEffect(()=>{ar!==ls.current&&(ls.current=ar,Ie({page:1}))},[ar,Ie]);const os=o.useRef(void 0);o.useEffect(()=>{const g=os.current;os.current=T,!(g!==void 0||T===void 0)&&T!==nr.current&&(vt.current=1,I(1),Ie({page:1}))},[T,Ie,I]);const cs=o.useRef(r);o.useEffect(()=>{cs.current!==r&&(cs.current=r,sr(r))},[r,sr]);const us=o.useRef(t.dataFun);o.useEffect(()=>{us.current!==t.dataFun&&(us.current=t.dataFun,vt.current=1,I(1),Ie({page:1}))},[t.dataFun,Ie,I]);async function Ni(){await Promise.all([W(),G(),Z()]),vt.current=1,I(1),Oi(g=>g+1)}function Ri(){Ie()}const[bn,ds]=o.useState(null);function Pi(g,D,Y){g.preventDefault(),g.stopPropagation();const ke=g.clientX,me=rn=>Math.max(40,Math.round(Y+rn-ke)),Fe=rn=>{ds({propertyPath:D,width:me(rn.clientX)})},Ds=rn=>{window.removeEventListener("mousemove",Fe),window.removeEventListener("mouseup",Ds),document.body.style.userSelect="";const Vi=me(rn.clientX);ds(null),F(D,Vi)};document.body.style.userSelect="none",window.addEventListener("mousemove",Fe),window.addEventListener("mouseup",Ds)}const[Lt,ir]=o.useState(null),Yi=Lt?ee.visibleActions(J,Lt.row):[];function fs(g,D){if(J.length===0)return;g.preventDefault();const Y=176,me=ee.visibleActions(J,D).length*34+8;ir({x:Math.min(g.clientX,window.innerWidth-Y-8),y:Math.min(g.clientY,window.innerHeight-me-8),row:D})}function hs(g,D){Oe(g,D)}function Ti(g){const D=Lt==null?void 0:Lt.row;ir(null),D&&g.execute(D,Cn)}const[ms,Mn]=o.useState([]),ys=o.useMemo(()=>((m==null?void 0:m.columns)??[]).map((g,D)=>({col:g,index:D})).filter(({col:g})=>g.showForDisplay??!0).sort((g,D)=>(g.col.displayOrder??g.index)-(D.col.displayOrder??D.index)).map(({col:g})=>g),[m]);function Ei(){const g=h.columns;return ys.map((D,Y)=>({col:D,config:g[D.propertyPath],index:Y})).sort((D,Y)=>{var ke,me;return(((ke=D.config)==null?void 0:ke.order)??D.index)-(((me=Y.config)==null?void 0:me.order)??Y.index)}).map(({col:D,config:Y})=>({propertyPath:D.propertyPath,displayName:D.displayName??D.propertyPath,visible:(Y==null?void 0:Y.visible)??!0,width:(Y==null?void 0:Y.width)??""}))}function Ii(){Mn(Ei()),Ce()}function Fi(){Mn(ys.map(g=>({propertyPath:g.propertyPath,displayName:g.displayName??g.propertyPath,visible:!0,width:""})))}function Ai(g,D){Mn(Y=>{const ke=g+D;if(ke<0||ke>=Y.length)return Y;const me=[...Y],[Fe]=me.splice(g,1);return Fe?(me.splice(ke,0,Fe),me):Y})}async function Li(){var Y,ke;const g={};ms.forEach((me,Fe)=>{g[me.propertyPath]={propertyPath:me.propertyPath,visible:me.visible,order:Fe,width:me.width}});const D={pageSize:T,columns:g};await((ke=(Y=d.current).saveCustomConfigFun)==null?void 0:ke.call(Y,D)),De(),d.current.loadCustomConfigFun&&await Z()}const lr=k||C||ye||R,pt=[];t.empty!=null&&pt.push("empty"),t.footer!=null&&pt.push("footer"),t.loading!=null&&pt.push("loading"),t.card!=null&&pt.push("card"),t.list!=null&&pt.push("list"),t.selectionBar!=null&&pt.push("selectionBar");const gs=o.useRef(m);gs.current=m;const _s=o.useRef(p);_s.current=p;const vs=o.useRef(Ve);vs.current=Ve;const ps=o.useRef(Ye);ps.current=Ye;const xs=o.useRef(at);xs.current=at;const ks=o.useRef(Se);ks.current=Se;const ws=o.useRef(H);ws.current=H;const Ss=o.useRef(w);Ss.current=w;const bs=o.useRef(pt);bs.current=pt;const Cn={get meta(){return gs.current},get paged(){return _s.current},get currentPage(){return vt.current},get viewMode(){return vs.current},get selectable(){return ps.current},get columnResizable(){return xs.current},get stickyHeader(){return ks.current},get slotNames(){return bs.current},get selectedRows(){return ws.current},get rows(){return Ss.current},reload:Ni,refresh:Ri,setViewMode:bi,setSelectable:Mi,setColumnResizable:Ci,setStickyHeader:Di,clearSelection:ne,selectAllOnPage:de,invertSelectionOnPage:ce,openConfigDialog:Ii,openExportDialog:Q,openCollectDialog:xi},or=o.useRef(Cn);or.current=Cn;const cr=o.useRef(null);cr.current===null&&(cr.current=new Proxy({},{get:(g,D)=>Reflect.get(or.current,D),has:(g,D)=>Reflect.has(or.current,D)})),o.useImperativeHandle(n,()=>cr.current,[]);const Ms=ue.map(g=>{const D=(bn==null?void 0:bn.propertyPath)===g.propertyPath?bn.width:sl(g.width);return{key:g.propertyPath,dataIndex:g.propertyPath,title:g.displayName??g.propertyPath,width:D,ellipsis:!0,render:j.getCellRender(g)||g.formatter||j.getDefaultFormatter(g)?(Y,ke)=>{const me=j.formatCellValue(g,ke),Fe=j.getCellRender(g);return Os(Fe?Fe(ke,Y,me,g):me)}:Y=>Os(Y),onHeaderCell:()=>({className:`yk-table__col-header${at?" yk-table__col-header--resizable":""}`,...at?{onMouseDown:Y=>{const ke=Y.currentTarget.getBoundingClientRect();Y.clientX<ke.right-8||Pi(Y,g.propertyPath,D??ke.width)}}:{}})}}),Cs=Ji({actions:J,table:Cn});Cs&&Ms.push(Cs);const Wi=Ye?{selectedRowKeys:Me,preserveSelectedRowKeys:!0,onChange:(g,D)=>pe(D)}:void 0,Bi={selectedRows:H,total:N,clearSelection:ne,selectAllOnPage:de,invertSelectionOnPage:ce,pageSize:je};function Hi(g,D){if(D!==je){sr(D);return}ji(g)}return a.jsxs("div",{className:"yk-table",children:[t.selectionBar?a.jsx("div",{className:"yk-table__selection-bar-slot",children:t.selectionBar(Bi)}):null,a.jsxs("div",{className:"yk-table__view-area",children:[Ve==="table"?a.jsx("div",{className:`yk-table__table-wrap${Se?" yk-table__table-wrap--sticky-header":""}`,children:a.jsx(f.Table,{columns:Ms,dataSource:w,rowKey:i,bordered:!0,pagination:!1,rowSelection:Wi,locale:{emptyText:t.empty??a.jsx(f.Empty,{description:"暂无数据"})}})}):Ve==="card"?a.jsx($i,{rows:w,rowKey:i,showCheckbox:Ye,loading:lr,hasActions:J.length>0,isSelected:xe,onCheck:hs,onContextMenu:fs,card:t.card,empty:t.empty}):a.jsx(Zi,{rows:w,rowKey:i,showCheckbox:Ye,loading:lr,hasActions:J.length>0,isSelected:xe,onCheck:hs,onContextMenu:fs,list:t.list,empty:t.empty}),lr?a.jsx("div",{className:"yk-table__loading-mask",children:t.loading??a.jsx("span",{className:"yk-table__loading-spinner","aria-label":"加载中"})}):null]}),P||t.footer!=null?a.jsxs("div",{className:"yk-table__footer",children:[a.jsx("div",{className:"yk-table__footer-extra",children:t.footer}),P?a.jsx(f.Pagination,{className:"yk-table__pagination",size:"small",current:A,pageSize:je,total:N,pageSizeOptions:s,showSizeChanger:!0,showTotal:q?g=>`共 ${g} 条`:void 0,onChange:Hi}):null]}):null,a.jsx(zi,{menu:Lt,actions:Yi,isEnabled:ee.isEnabled,onClose:()=>ir(null),onSelect:Ti}),a.jsx(Ui,{open:U,drafts:ms,onCancel:De,onSave:Li,onReset:Fi,onMove:Ai,onDraftsChange:Mn}),a.jsx($s,{open:_t,options:Xe,exporting:it,fetched:Et,total:It,totalKnown:Ft,percent:xn,etaSeconds:tr,cancelledVisible:v,cancelledRows:b,onExport:g=>void Ct(g),onCancelExport:At,onKeepPartial:()=>void kn(),onDiscardPartial:()=>void wn(),onClose:ge}),a.jsx(qi,{open:hi,title:t.collectorTitle,options:fi,collecting:mi,fetched:yi,total:gi,totalKnown:_i,percent:pi,etaSeconds:vi,maxCount:Math.max(1,Math.floor(u)),onCollect:g=>void wi(g),onCancelCollect:Si,onClose:ki})]})});var Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},$e={},Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.AggInfoOf=Ae.AggInfo=Ae.AggItem=Ae.AggType=void 0;Ae.agg=al;var cn;(function(e){e.Sum="sum",e.Min="min",e.Max="max",e.Avg="avg",e.Count="count",e.DistinctCount="distinctcount"})(cn||(Ae.AggType=cn={}));class zs{constructor(t,n,r=null,s){this.path=t,this.type=n,this.name=r,this.filter=s}toString(){var t,n;const r=(n=(t=this.filter)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:"";return this.name?`${this.path}.${this.type}(${r}).as(${this.name})`:`${this.path}.${this.type}(${r})`}}Ae.AggItem=zs;class Gs{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}append(t,n=cn.Sum,r=null,s){return this.items.push(new zs(t,n,r,s)),this}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}}Ae.AggInfo=Gs;class Qs extends Gs{append(t,n=cn.Sum,r=null,s){return super.append(t,n,r,s),this}}Ae.AggInfoOf=Qs;function al(e,t=cn.Sum,n=null,r){return new Qs().append(e,t,n,r)}var Re={},Ne={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.Constant=void 0;bt.con=il;class qs{constructor(t){this.con=t}toString(){return JSON.stringify(this.con)}}bt.Constant=qs;function il(e){return new qs(e)}var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Expression=void 0;Yt.exp=ll;class Zs{constructor(t){this.exp=t}getExp(){return this.exp}toString(){return this.exp}}Yt.Expression=Zs;function ll(e){return new Zs(e)}var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.key=cl;Mt.toExp=ul;Mt.toValueExp=dl;const En=Yt,ol=bt;function cl(e){return e.toString()}function ul(e){return e instanceof En.Expression?e:new En.Expression(e)}function dl(e){return e==null?null:e instanceof En.Expression||e instanceof ol.Constant?e:new En.Expression(e)}Object.defineProperty(Ne,"__esModule",{value:!0});Ne.FilterInfoOf=Ne.empty=Ne.FilterInfo=Ne.CombinType=Ne.Operator=void 0;Ne.filter=hl;Ne.emptyFilter=ml;const un=bt,fl=Yt,Ns=Mt;var In;(function(e){e.Equals="==",e.NotEquals="!=",e.GreaterThan=">",e.LessThanOrEqual="<=",e.LessThan="<",e.GreaterThanOrEqual=">=",e.Between="between",e.NotBetween="not_between",e.In="in",e.NotIn="not_in",e.StartsWith="startswith",e.NotStartsWith="not_startswith",e.EndsWith="endswith",e.NotEndsWith="not_endswith",e.Contains="contains",e.NotContains="not_contains"})(In||(Ne.Operator=In={}));var be;(function(e){e[e.AndItems=1]="AndItems",e[e.OrItems=2]="OrItems",e[e.SingleItem=0]="SingleItem"})(be||(Ne.CombinType=be={}));class Pe{constructor(t,n,r,s=be.SingleItem,i=[]){this.items=[],this.left=t,this.right=r,this.op=n,this.combinType=s,this.items=i}toString(){switch(this.combinType){case be.AndItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Pe.Operator_And} `)}case be.OrItems:{const t=this.items.filter(n=>n&&!n.isEmpty());return t.length===1?`${t[0].toString()}`:t.map(n=>`(${n.toString()})`).join(` ${Pe.Operator_Or} `)}default:return this.isEmpty()?"":`${this.left} ${this.op} ${this.right}`}}andAlso(t){return this.combinType==be.AndItems?(t.combinType==be.AndItems?this.items=this.items.concat(t.items):this.items.push(t),this):Pe.createAnd(this,t)}orElse(t){return this.combinType==be.OrItems?(t.combinType==be.OrItems?this.items=this.items.concat(t.items):this.items.push(t),this):Pe.createOr(this,t)}static createOr(...t){return new Pe(null,null,null,be.OrItems,t)}static createAnd(...t){return new Pe(null,null,null,be.AndItems,t)}isEmpty(){return this.combinType==be.SingleItem&&this.op==null}static fromSimpleObject(...t){return Pe.createAnd(...t.map(n=>{var r;return new Pe((0,fl.exp)(n.name),(r=n.op)!==null&&r!==void 0?r:In.Equals,(0,un.con)(n.value))}))}static fromSimpleDictionary(t){return Pe.fromSimpleObject(...Object.entries(t).map(([n,r])=>({name:n,value:r})))}}Ne.FilterInfo=Pe;Pe.Operator_And="and";Pe.Operator_Or="or";Ne.empty=new Pe((0,un.con)(1),In.Equals,(0,un.con)(1));class kt extends Pe{constructor(t,n,r,s=be.SingleItem,i=[]){super((0,Ns.toValueExp)(t),n,(0,Ns.toValueExp)(r),s,i)}and(t,n,r){const s=new kt(t,n,r);return this.combinType==be.AndItems?(s.combinType==be.AndItems?this.items=this.items.concat(s.items):this.items.push(s),this):new kt(null,null,null,be.AndItems,[this,s])}or(t,n,r){const s=new kt(t,n,r);return this.combinType==be.OrItems?(s.combinType==be.OrItems?this.items=this.items.concat(s.items):this.items.push(s),this):new kt(null,null,null,be.OrItems,[this,s])}andIf(t,n,r,s){return t?this.and(n,r,s):this}orIf(t,n,r,s){return t?this.or(n,r,s):this}}Ne.FilterInfoOf=kt;function hl(e,t,n){return new kt(e,t,n)}function ml(){return new kt((0,un.con)(null),null,(0,un.con)(null))}var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.queryConfig=void 0;Zt.queryConfig={defaultLimit:10,maxLimit:1e3};var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.DataOverflowError=void 0;class Rr extends Error{constructor(t){super(t),this.name="DataOverflowError",Object.setPrototypeOf(this,Rr.prototype)}}hn.DataOverflowError=Rr;var Be=Vt&&Vt.__awaiter||function(e,t,n,r){function s(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function c(m){try{d(r.next(m))}catch(p){l(p)}}function u(m){try{d(r.throw(m))}catch(p){l(p)}}function d(m){m.done?i(m.value):s(m.value).then(c,u)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(Re,"__esModule",{value:!0});Re.findBy=Js;Re.findById=gl;Re.count=_l;Re.distinctCount=vl;Re.distinctList=pl;Re.asList=xl;Re.queryPage=kl;Re.loadAll=wl;Re.aggValue=Sl;Re.aggProp=mn;Re.sumProp=bl;Re.maxProp=Ml;Re.minProp=Cl;Re.avgProp=Dl;const Rs=Ne,yl=bt,Qt=Ae,Vn=Zt,Ks=hn;function Js(e,t,n,r){return Be(this,void 0,void 0,function*(){const s=yield e({limit:1,offset:0,filter:(0,Rs.filter)(t,Rs.Operator.Equals,(0,yl.con)(n)).toString(),countAll:!1},r);return s.items.length>0?s.items[0]:null})}function gl(e,t,n){return Be(this,void 0,void 0,function*(){return Js(e,"id",t,n)})}function _l(e,t,n){return Be(this,void 0,void 0,function*(){var r;return(r=(yield e({limit:0,offset:0,filter:t==null?void 0:t.toString(),countAll:!0},n)).totalCount)!==null&&r!==void 0?r:0})}function vl(e,t,n,r){return Be(this,void 0,void 0,function*(){var s;return(s=(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),select:t.toString(),distinct:!0,countAll:!0},r)).totalCount)!==null&&s!==void 0?s:0})}function pl(e,t,n){return Be(this,void 0,void 0,function*(){var r,s,i,l,c;const u=yield e({limit:(r=t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,offset:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:t.select.toString(),orderBy:(i=t.orderBy)===null||i===void 0?void 0:i.toString(),distinct:!0,countAll:!1},n);if(u.hasNext&&(!((l=t.throwIfOverflow)!==null&&l!==void 0)||l))throw new Ks.DataOverflowError(`The result data of distinctList is lost. Total: ${(c=u.totalCount)!==null&&c!==void 0?c:0}, Max page size: ${u.limit}`);return u.items})}function xl(e,t,n){return Be(this,void 0,void 0,function*(){var r,s,i,l,c,u;const d=yield e({limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,offset:0,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t==null?void 0:t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),countAll:!1},n);if(d.hasNext&&(!((c=t==null?void 0:t.throwIfOverflow)!==null&&c!==void 0)||c))throw new Ks.DataOverflowError(`The result data of asList is lost. Total: ${(u=d.totalCount)!==null&&u!==void 0?u:0}, Max page size: ${d.limit}`);return d.items})}function kl(e,t){var n,r,s,i,l,c;return e({limit:(n=t.limit)!==null&&n!==void 0?n:Vn.queryConfig.defaultLimit,offset:(r=t.offset)!==null&&r!==void 0?r:0,filter:(s=t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t.orderBy)===null||l===void 0?void 0:l.toString(),agg:(c=t.agg)===null||c===void 0?void 0:c.toString(),distinct:t.distinct,countAll:t.countAll})}function wl(e,t,n){return Be(this,void 0,void 0,function*(){var r,s,i,l,c;let u=[],d=0;const m={limit:(r=t==null?void 0:t.maxPageSize)!==null&&r!==void 0?r:Vn.queryConfig.maxLimit,filter:(s=t==null?void 0:t.filter)===null||s===void 0?void 0:s.toString(),select:(i=t==null?void 0:t.select)===null||i===void 0?void 0:i.toString(),orderBy:(l=t==null?void 0:t.orderBy)===null||l===void 0?void 0:l.toString(),distinct:(c=t==null?void 0:t.distinct)!==null&&c!==void 0?c:!1,countAll:!1};for(;!(n!=null&&n.aborted);){const p=yield e(Object.assign(Object.assign({},m),{offset:d}),n);if(u=u.concat(p.items),d+=m.limit,p.items.length==0||!p.hasNext||n!=null&&n.aborted)break}return u})}function Sl(e,t,n,r){return Be(this,void 0,void 0,function*(){return(yield e({limit:0,offset:0,filter:n==null?void 0:n.toString(),agg:t.toString(),countAll:!1},r)).aggs})}function mn(e,t){return Be(this,arguments,void 0,function*(n,r,s=Qt.AggType.Sum,i,l){var c;const u="__tg0",d=yield n({limit:0,offset:0,filter:i==null?void 0:i.toString(),agg:(0,Qt.agg)(r,s,u,i).toString(),countAll:!1},l);return Number((c=d.aggs)===null||c===void 0?void 0:c[u])})}function bl(e,t,n,r){return Be(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Sum,n,r)})}function Ml(e,t,n,r){return Be(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Max,n,r)})}function Cl(e,t,n,r){return Be(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Min,n,r)})}function Dl(e,t,n,r){return Be(this,void 0,void 0,function*(){return mn(e,t,Qt.AggType.Avg,n,r)})}var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.LimitInfo=void 0;class jl{}$n.LimitInfo=jl;var ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.OrderByInfoOf=ze.OrderByInfo=ze.OrderByItem=ze.OrderByType=void 0;ze.orderby=Ol;const vr=Mt;var qt;(function(e){e.Asc="asc()",e.Desc="desc()"})(qt||(ze.OrderByType=qt={}));class Xs{constructor(t,n){this.path=t,this.type=n}toString(){return`${this.path}.${this.type.toString()}`}}ze.OrderByItem=Xs;class ea{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}add(t,n=qt.Asc){return this.items.push(new Xs(t,n)),this}}ze.OrderByInfo=ea;class ta extends ea{then(t){return this.add((0,vr.toExp)(t),qt.Asc),this}thenDesc(t){return this.add((0,vr.toExp)(t),qt.Desc),this}}ze.OrderByInfoOf=ta;function Ol(e,t=qt.Asc){const n=new ta;return n.add((0,vr.toExp)(e),t),n}var na={};Object.defineProperty(na,"__esModule",{value:!0});var Rt={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.SelectInfoOf=tt.SelectInfo=tt.SelectItem=void 0;tt.select=Nl;class pr{constructor(t,n=!1){this.name=t,this.exclude=n}toString(){return this.exclude?`-${this.name}`:this.name}}tt.SelectItem=pr;class ra{constructor(...t){this.items=[],this.items.push(...t.filter(n=>n!==null))}toString(){return this.items.length===0?"":this.items.filter(t=>t!==null).map(t=>t.toString()).join(",")}appendItems(...t){return this.items?this.items=this.items.concat(t):this.items=t,this}}tt.SelectInfo=ra;class sa extends ra{include(...t){return this.appendItems(...t.map(n=>new pr(n.toString()))),this}exclude(...t){return this.appendItems(...t.map(n=>new pr(n.toString(),!0))),this}}tt.SelectInfoOf=sa;function Nl(...e){return new sa().include(...e)}Object.defineProperty(Rt,"__esModule",{value:!0});Rt.QueryBuilderOf=Rt.QueryBuilder=void 0;Rt.query=Pl;const ur=Ae,dr=Ne,xt=ze,Wt=tt,Dt=Mt,Rl=Zt;class aa{constructor(){this._limit=Rl.queryConfig.defaultLimit,this._offset=0}build(){const t={limit:this._limit,offset:this._offset};return this._filterInfo&&(t.filter=this._filterInfo.toString()),this._orderByInfo&&(t.orderBy=this._orderByInfo.toString()),this._selectInfo&&(t.select=this._selectInfo.toString()),this._aggInfo&&(t.agg=this._aggInfo.toString()),t}withAgg(t){return this._aggInfo=t,this}withFilter(t){return this._filterInfo=t,this}withOrderBy(t){return this._orderByInfo=t,this}withSelect(t){return this._selectInfo=t,this}offset(t){return this._offset=t,this}limit(t){return this._limit=t,this}}Rt.QueryBuilder=aa;class ia extends aa{where(t,n=dr.Operator.Equals,r){return this._filterInfo?this._filterInfo=this._filterInfo.andAlso(new dr.FilterInfo((0,Dt.toValueExp)(t),n,(0,Dt.toValueExp)(r))):this._filterInfo=new dr.FilterInfo((0,Dt.toValueExp)(t),n,(0,Dt.toValueExp)(r)),this}orderby(t,n=xt.OrderByType.Asc){return this._orderByInfo=new xt.OrderByInfo(new xt.OrderByItem((0,Dt.toExp)(t),n)),this}orderbyDesc(t){return this.orderby(t,xt.OrderByType.Desc)}thenby(t,n=xt.OrderByType.Asc){return this._orderByInfo?this._orderByInfo.add((0,Dt.toExp)(t),n):this._orderByInfo=new xt.OrderByInfo(new xt.OrderByItem((0,Dt.toExp)(t),n)),this}thenbyDesc(t){return this.thenby(t,xt.OrderByType.Desc)}agg(t,n=ur.AggType.Sum,r=null){return this._aggInfo?this._aggInfo.append(t,n,r):this._aggInfo=new ur.AggInfo(new ur.AggItem(t,n,r)),this}include(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Wt.SelectItem(n.toString()))):this._selectInfo=new Wt.SelectInfo(...t.map(n=>new Wt.SelectItem(n.toString()))),this}exclude(...t){return this._selectInfo?this._selectInfo.appendItems(...t.map(n=>new Wt.SelectItem(n.toString(),!0))):this._selectInfo=new Wt.SelectInfo(...t.map(n=>new Wt.SelectItem(n.toString(),!0))),this}}Rt.QueryBuilderOf=ia;function Pl(){return new ia}(function(e){var t=Vt&&Vt.__createBinding||(Object.create?function(r,s,i,l){l===void 0&&(l=i);var c=Object.getOwnPropertyDescriptor(s,i);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,l,c)}:function(r,s,i,l){l===void 0&&(l=i),r[l]=s[i]}),n=Vt&&Vt.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ae,e),n(Re,e),n(bt,e),n(Zt,e),n(Yt,e),n(Ne,e),n($n,e),n(ze,e),n(na,e),n(Rt,e),n(tt,e),n(Mt,e),n(hn,e)})($e);const la=o.createContext(null);//! moment.js
2
2
  //! version : 2.31.0
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
5
5
  //! momentjs.com
6
- var oa;function x(){return oa.apply(null,arguments)}function Yl(e){oa=e}function Ze(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Nt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function V(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pr(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(V(e,t))return!1;return!0}function Te(e){return e===void 0}function ft(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function yn(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ca(e,t){var n=[],r,s=e.length;for(r=0;r<s;++r)n.push(t(e[r],r));return n}function et(e,t){for(var n in t)V(t,n)&&(e[n]=t[n]);return V(t,"toString")&&(e.toString=t.toString),V(t,"valueOf")&&(e.valueOf=t.valueOf),e}function nt(e,t,n,r){return Ta(e,t,n,r,!0).utc()}function Tl(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidOffset:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function E(e){return e._pf==null&&(e._pf=Tl()),e._pf}var xr;Array.prototype.some?xr=Array.prototype.some:xr=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Yr(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=E(e),n=xr.call(t.parsedDateParts,function(s){return s!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidOffset&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function gn(e){var t=nt(NaN);return e!=null?et(E(t),e):E(t).userInvalidated=!0,t}var Ps=x.momentProperties=[],fr=!1;function Tr(e,t){var n,r,s,i=Ps.length;if(Te(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Te(t._i)||(e._i=t._i),Te(t._f)||(e._f=t._f),Te(t._l)||(e._l=t._l),Te(t._strict)||(e._strict=t._strict),Te(t._tzm)||(e._tzm=t._tzm),Te(t._isUTC)||(e._isUTC=t._isUTC),Te(t._offset)||(e._offset=t._offset),Te(t._pf)||(e._pf=E(t)),Te(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)r=Ps[n],s=t[r],Te(s)||(e[r]=s);return e}function _n(e){Tr(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),fr===!1&&(fr=!0,x.updateOffset(this),fr=!1)}function Le(e){return e instanceof _n||e!=null&&e._isAMomentObject!=null}function ua(e){x.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Qe(e,t){var n=!0;return et(function(){if(x.deprecationHandler!=null&&x.deprecationHandler(null,e),n){var r=[],s,i,l,c=arguments.length;for(i=0;i<c;i++){if(s="",typeof arguments[i]=="object"){s+=`
7
- [`+i+"] ";for(l in arguments[0])V(arguments[0],l)&&(s+=l+": "+arguments[0][l]+", ");s=s.slice(0,-2)}else s=arguments[i];r.push(s)}ua(e+`
6
+ var oa;function x(){return oa.apply(null,arguments)}function Yl(e){oa=e}function Ke(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Nt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function $(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Pr(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if($(e,t))return!1;return!0}function Te(e){return e===void 0}function ft(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function yn(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ca(e,t){var n=[],r,s=e.length;for(r=0;r<s;++r)n.push(t(e[r],r));return n}function et(e,t){for(var n in t)$(t,n)&&(e[n]=t[n]);return $(t,"toString")&&(e.toString=t.toString),$(t,"valueOf")&&(e.valueOf=t.valueOf),e}function nt(e,t,n,r){return Ta(e,t,n,r,!0).utc()}function Tl(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidOffset:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function E(e){return e._pf==null&&(e._pf=Tl()),e._pf}var xr;Array.prototype.some?xr=Array.prototype.some:xr=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Yr(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=E(e),n=xr.call(t.parsedDateParts,function(s){return s!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidOffset&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function gn(e){var t=nt(NaN);return e!=null?et(E(t),e):E(t).userInvalidated=!0,t}var Ps=x.momentProperties=[],fr=!1;function Tr(e,t){var n,r,s,i=Ps.length;if(Te(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Te(t._i)||(e._i=t._i),Te(t._f)||(e._f=t._f),Te(t._l)||(e._l=t._l),Te(t._strict)||(e._strict=t._strict),Te(t._tzm)||(e._tzm=t._tzm),Te(t._isUTC)||(e._isUTC=t._isUTC),Te(t._offset)||(e._offset=t._offset),Te(t._pf)||(e._pf=E(t)),Te(t._locale)||(e._locale=t._locale),i>0)for(n=0;n<i;n++)r=Ps[n],s=t[r],Te(s)||(e[r]=s);return e}function _n(e){Tr(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),fr===!1&&(fr=!0,x.updateOffset(this),fr=!1)}function We(e){return e instanceof _n||e!=null&&e._isAMomentObject!=null}function ua(e){x.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function qe(e,t){var n=!0;return et(function(){if(x.deprecationHandler!=null&&x.deprecationHandler(null,e),n){var r=[],s,i,l,c=arguments.length;for(i=0;i<c;i++){if(s="",typeof arguments[i]=="object"){s+=`
7
+ [`+i+"] ";for(l in arguments[0])$(arguments[0],l)&&(s+=l+": "+arguments[0][l]+", ");s=s.slice(0,-2)}else s=arguments[i];r.push(s)}ua(e+`
8
8
  Arguments: `+Array.prototype.slice.call(r).join("")+`
9
9
  `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ys={};function da(e,t){x.deprecationHandler!=null&&x.deprecationHandler(e,t),Ys[e]||(ua(t+`
10
- `+new Error().stack),Ys[e]=!0)}x.suppressDeprecationWarnings=!1;x.deprecationHandler=null;function rt(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}var Ts={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function qe(e){return typeof e=="string"?Ts[e]||Ts[e.toLowerCase()]:void 0}function Er(e){var t={},n,r;for(r in e)V(e,r)&&(n=qe(r),n&&(t[n]=e[r]));return t}var El={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Il(e){var t=[],n;for(n in e)V(e,n)&&t.push({unit:n,priority:El[n]});return t.sort(function(r,s){return r.priority-s.priority}),t}function Ge(e,t,n){var r=""+Math.abs(e),s=t-r.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+r}var Ir=/(\[[^\[]*\])|(\\e)|(\\)?(eHHmm|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Dn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,hr={},Ut={};function j(e,t,n,r){var s=r;typeof r=="string"&&(s=function(){return this[r]()}),e&&(Ut[e]=s),t&&(Ut[t[0]]=function(){return Ge(s.apply(this,arguments),t[1],t[2])}),n&&(Ut[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function Fl(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Al(e){var t=e.match(Ir),n,r;for(n=0,r=t.length;n<r;n++)Ut[t[n]]?t[n]=Ut[t[n]]:t[n]=Fl(t[n]);return function(s){var i="",l;for(l=0;l<r;l++)i+=rt(t[l])?t[l].call(s,e):t[l];return i}}function Pn(e,t){if(!e.isValid())return e.localeData().invalidDate();t=fa(t,e.localeData());var n="$"+t;return V(hr,n)||(hr[n]=Al(t)),hr[n](e)}function fa(e,t){var n=5;function r(s){return t.longDateFormat(s)||s}for(Dn.lastIndex=0;n>=0&&Dn.test(e);)e=e.replace(Dn,r),Dn.lastIndex=0,n-=1;return e}var ha=/\d/,Be=/\d\d/,ma=/\d{3}/,Fr=/\d{4}/,Un=/[+-]?\d{6}/,le=/\d\d?/,ya=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,zn=/\d{1,3}/,Lr=/\d{1,4}/,Gn=/[+-]?\d{1,6}/,Kt=/\d+/,Qn=/[+-]?\d+/,Ll=/Z|[+-]\d\d:?\d\d/gi,qn=/Z|[+-]\d\d(?::?\d\d)?/gi,Wl=/[+-]?\d+(\.\d{1,3})?/,vn=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Jt=/^[1-9]\d?/,Wr=/^([1-9]\d|\d)/,Fn;Fn={};function M(e,t,n){Fn[e]=rt(t)?t:function(r,s){return r&&n?n:t}}function Bl(e,t){return V(Fn,e)?Fn[e](t._strict,t._locale):new RegExp(Hl(e))}function Hl(e){return ut(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,s,i){return n||r||s||i}))}function ut(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $e(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function L(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=$e(t)),n}var kr={};function ae(e,t){var n,r=t,s;for(typeof e=="string"&&(e=[e]),ft(t)&&(r=function(i,l){l[t]=L(i)}),s=e.length,n=0;n<s;n++)kr[e[n]]=r}function Xt(e,t){ae(e,function(n,r,s,i){s._w=s._w||{},t(n,s._w,s,i)})}function Vl(e,t,n){t!=null&&V(kr,e)&&kr[e](t,n._a,n,e)}function Zn(e){return e%4===0&&e%100!==0||e%400===0}var _e=0,Ae=1,Ee=2,xe=3,ze=4,ct=5,Ot=6,$l=7,Ul=8;j("Y",0,0,function(){var e=this.year();return e<=9999?Ge(e,4):"+"+e});j(0,["YY",2],0,function(){return this.year()%100});j(0,["YYYY",4],0,"year");j(0,["YYYYY",5],0,"year");j(0,["YYYYYY",6,!0],0,"year");M("Y",Qn);M("YY",le,Be);M("YYYY",Lr,Fr);M("YYYYY",Gn,Un);M("YYYYYY",Gn,Un);ae(["YYYYY","YYYYYY"],_e);ae("YYYY",function(e,t){t[_e]=e.length===2?x.parseTwoDigitYear(e):L(e)});ae("YY",function(e,t){t[_e]=x.parseTwoDigitYear(e)});ae("Y",function(e,t){t[_e]=parseInt(e,10)});function on(e){return Zn(e)?366:365}x.parseTwoDigitYear=function(e){return L(e)+(L(e)>68?1900:2e3)};var ga=en("FullYear",!0);function zl(){return Zn(this.year())}function en(e,t){return function(n){return n!=null?(_a(this,e,n),x.updateOffset(this,t),this):dn(this,e)}}function dn(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function _a(e,t,n){var r,s,i,l,c;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(s?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(s?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(s?r.setUTCHours(n):r.setHours(n));case"Date":return void(s?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}i=n,l=e.month(),c=e.date(),c=c===29&&l===1&&!Zn(i)?28:c,s?r.setUTCFullYear(i,l,c):r.setFullYear(i,l,c)}}function Gl(e){return e=qe(e),rt(this[e])?this[e]():this}function Ql(e,t){if(typeof e=="object"){e=Er(e);var n=Il(e),r,s=n.length;for(r=0;r<s;r++)this[n[r].unit](e[n[r].unit])}else if(e=qe(e),rt(this[e]))return this[e](t);return this}function ql(e,t){return(e%t+t)%t}var ge;Array.prototype.indexOf?ge=Array.prototype.indexOf:ge=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Br(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ql(t,12);return e+=(t-n)/12,n===1?Zn(e)?29:28:31-n%7%2}j("M",["MM",2],"Mo",function(){return this.month()+1});j("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});j("MMMM",0,0,function(e){return this.localeData().months(this,e)});M("M",le,Jt);M("MM",le,Be);M("MMM",function(e,t){return t.monthsShortRegex(e)});M("MMMM",function(e,t){return t.monthsRegex(e)});ae(["M","MM"],function(e,t){t[Ae]=L(e)-1});ae(["MMM","MMMM"],function(e,t,n,r){var s=n._locale.monthsParse(e,r,n._strict);s!=null?t[Ae]=s:E(n).invalidMonth=e});var Zl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),va="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),pa=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Kl=vn,Jl=vn,Es=["monthsParse","longMonthsParse","shortMonthsParse","monthsRegex","monthsShortRegex","monthsStrictRegex","monthsShortStrictRegex"];function Xl(e,t){var n,r;for(n=0;n<Es.length;n++)r=Es[n],V(t,r)||delete e["_"+r]}function eo(e,t){return e?Ze(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||pa).test(t)?"format":"standalone"][e.month()]:Ze(this._months)?this._months:this._months.standalone}function to(e,t){return e?Ze(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[pa.test(t)?"format":"standalone"][e.month()]:Ze(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function no(e,t,n){var r,s,i,l=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=nt([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?t==="MMM"?(s=ge.call(this._shortMonthsParse,l),s!==-1?s:null):(s=ge.call(this._longMonthsParse,l),s!==-1?s:null):t==="MMM"?(s=ge.call(this._shortMonthsParse,l),s!==-1?s:(s=ge.call(this._longMonthsParse,l),s!==-1?s:null)):(s=ge.call(this._longMonthsParse,l),s!==-1?s:(s=ge.call(this._shortMonthsParse,l),s!==-1?s:null))}function ro(e,t,n){var r,s,i;if(this._monthsParseExact)return no.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(s=nt([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(i="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function xa(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=L(t);else if(t=e.localeData().monthsParse(t),!ft(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Br(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function ka(e){return e!=null?(xa(this,e),x.updateOffset(this,!0),this):dn(this,"Month")}function so(){return Br(this.year(),this.month())}function ao(e){return this._monthsParseExact?(V(this,"_monthsRegex")||wa.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(V(this,"_monthsShortRegex")||(this._monthsShortRegex=Kl),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function io(e){return this._monthsParseExact?(V(this,"_monthsRegex")||wa.call(this),e?this._monthsStrictRegex:this._monthsRegex):(V(this,"_monthsRegex")||(this._monthsRegex=Jl),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function wa(){function e(u,d){return d.length-u.length}var t=[],n=[],r=[],s,i,l,c;for(s=0;s<12;s++)i=nt([2e3,s]),l=ut(this.monthsShort(i,"")),c=ut(this.months(i,"")),t.push(l),n.push(c),r.push(c),r.push(l);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}j("d",0,"do","day");j("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});j("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});j("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});j("e",0,0,"weekday");j("E",0,0,"isoWeekday");j("eHHmm",0,0,function(){return""+this.weekday()+Ge(this.hours(),2)+Ge(this.minutes(),2)});M("d",le);M("e",le);M("E",le);M("eHHmm",Ar);M("dd",function(e,t){return t.weekdaysMinRegex(e)});M("ddd",function(e,t){return t.weekdaysShortRegex(e)});M("dddd",function(e,t){return t.weekdaysRegex(e)});Xt(["dd","ddd","dddd"],function(e,t,n,r){var s=n._locale.weekdaysParse(e,r,n._strict);s!=null?t.d=s:E(n).invalidWeekday=e});Xt(["d","e","E"],function(e,t,n,r){t[r]=L(e)});Xt("eHHmm",function(e,t,n){var r=e.length-4;t.e=L(e.substr(0,r)),n._a[xe]=L(e.substr(r,2)),n._a[ze]=L(e.substr(r+2))});function lo(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function oo(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Hr(e,t){return e.slice(t,7).concat(e.slice(0,t))}var co="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Sa="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),uo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),fo=vn,ho=vn,mo=vn,Is=["weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","minWeekdaysParse","weekdaysRegex","weekdaysShortRegex","weekdaysMinRegex","weekdaysStrictRegex","weekdaysShortStrictRegex","weekdaysMinStrictRegex"];function yo(e,t){var n,r;for(n=0;n<Is.length;n++)r=Is[n],V(t,r)||delete e["_"+r]}function go(e,t){var n=Ze(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Hr(n,this._week.dow):e?n[e.day()]:n}function _o(e){return e===!0?Hr(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function vo(e){return e===!0?Hr(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function po(e,t,n){var r,s,i,l=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=nt([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?t==="dddd"?(s=ge.call(this._weekdaysParse,l),s!==-1?s:null):t==="ddd"?(s=ge.call(this._shortWeekdaysParse,l),s!==-1?s:null):(s=ge.call(this._minWeekdaysParse,l),s!==-1?s:null):t==="dddd"?(s=ge.call(this._weekdaysParse,l),s!==-1||(s=ge.call(this._shortWeekdaysParse,l),s!==-1)?s:(s=ge.call(this._minWeekdaysParse,l),s!==-1?s:null)):t==="ddd"?(s=ge.call(this._shortWeekdaysParse,l),s!==-1||(s=ge.call(this._weekdaysParse,l),s!==-1)?s:(s=ge.call(this._minWeekdaysParse,l),s!==-1?s:null)):(s=ge.call(this._minWeekdaysParse,l),s!==-1||(s=ge.call(this._weekdaysParse,l),s!==-1)?s:(s=ge.call(this._shortWeekdaysParse,l),s!==-1?s:null))}function xo(e,t,n){var r,s,i;if(this._weekdaysParseExact)return po.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(s=nt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ko(e){if(!this.isValid())return e!=null?this:NaN;var t=dn(this,"Day");return e!=null?(e=lo(e,this.localeData()),this.add(e-t,"d")):t}function wo(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function So(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=oo(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function bo(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(V(this,"_weekdaysRegex")||(this._weekdaysRegex=fo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Mo(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(V(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ho),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Co(e){return this._weekdaysParseExact?(V(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(V(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vr(){function e(y,p){return p.length-y.length}var t=[],n=[],r=[],s=[],i,l,c,u,d;for(i=0;i<7;i++)l=nt([2e3,1]).day(i),c=ut(this.weekdaysMin(l,"")),u=ut(this.weekdaysShort(l,"")),d=ut(this.weekdays(l,"")),t.push(c),n.push(u),r.push(d),s.push(c),s.push(u),s.push(d);t.sort(e),n.sort(e),r.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Do(e){var t,n;Xl(this,e),yo(this,e);for(n in e)V(e,n)&&(t=e[n],rt(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function wr(e,t){var n=et({},e),r;for(r in t)V(t,r)&&(Nt(e[r])&&Nt(t[r])?(n[r]={},et(n[r],e[r]),et(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)V(e,r)&&!V(t,r)&&Nt(e[r])&&(n[r]=et({},n[r]));return n}function $r(e){e!=null&&this.set(e)}var Sr;Object.keys?Sr=Object.keys:Sr=function(e){var t,n=[];for(t in e)V(e,t)&&n.push(t);return n};var jo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Oo(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return rt(r)?r.call(t,n):r}var No={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Ro(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()],r=this._longDateFormatCache;return t||!n?t:r&&r[e]&&r[e].formatUpper===n?r[e].format:(t=n.match(Ir).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),r||(r=this._longDateFormatCache={}),r[e]={formatUpper:n,format:t},t)}var Po="Invalid date";function Yo(){return this._invalidDate}var To="%d",Eo=/\d{1,2}/;function Io(e){return this._ordinal.replace("%d",e)}var Fo={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ba(e,t,n,r){var s=this._relativeTime[n];return rt(s)?s(e,t,n,r):s.replace(/%d/i,e)}function Ao(e,t,n,r){return this.postformat(ba.call(this,e,t,n,r))}function Ma(e,t){var n=this._relativeTime[e>0?"future":"past"];return rt(n)?n(t):n.replace(/%s/i,t)}function Lo(e,t){return this.postformat(Ma.call(this,e,t))}function Wo(e,t,n,r,s,i,l){var c;return e<100&&e>=0?(c=new Date(e+400,t,n,r,s,i,l),isFinite(c.getFullYear())&&c.setFullYear(e)):c=new Date(e,t,n,r,s,i,l),c}function Pt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function An(e,t,n){var r=7+t-n,s=(7+Pt(e,0,r).getUTCDay()-t)%7;return-s+r-1}function Ca(e,t,n,r,s){var i=(7+n-r)%7,l=An(e,r,s),c=1+7*(t-1)+i+l,u,d;return c<=0?(u=e-1,d=on(u)+c):c>on(e)?(u=e+1,d=c-on(e)):(u=e,d=c),{year:u,dayOfYear:d}}function Da(e,t,n,r){var s=An(e,n,r),i=Math.floor((t-s-1)/7)+1,l,c;return i<1?(c=e-1,l=i+dt(c,n,r)):i>dt(e,n,r)?(l=i-dt(e,n,r),c=e+1):(c=e,l=i),{week:l,year:c}}function Ur(e,t,n){return Da(e.year(),e.dayOfYear(),t,n)}function Fs(e,t,n,r,s){var i=Math.round((Pt(e,t,n)-Pt(e,0,1))/864e5)+1;return Da(e,i,r,s)}function dt(e,t,n){var r=An(e,t,n),s=An(e+1,t,n);return(on(e)-r+s)/7}j("w",["ww",2],"wo","week");j("W",["WW",2],"Wo","isoWeek");M("w",le,Jt);M("ww",le,Be);M("W",le,Jt);M("WW",le,Be);Xt(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=L(e)});function Bo(e){return Ur(e,this._week.dow,this._week.doy).week}var Ho={dow:0,doy:6};function Vo(){return this._week.dow}function $o(){return this._week.doy}function Uo(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function zo(e){var t=Ur(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}function zr(){return this.hours()%12||12}function Go(){return this.hours()||24}j("H",["HH",2],0,"hour");j("h",["hh",2],0,zr);j("k",["kk",2],0,Go);j("hmm",0,0,function(){return""+zr.apply(this)+Ge(this.minutes(),2)});j("hmmss",0,0,function(){return""+zr.apply(this)+Ge(this.minutes(),2)+Ge(this.seconds(),2)});j("Hmm",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)});j("Hmmss",0,0,function(){return""+this.hours()+Ge(this.minutes(),2)+Ge(this.seconds(),2)});function ja(e,t){j(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}ja("a",!0);ja("A",!1);function Oa(e,t){return t._meridiemParse}M("a",Oa);M("A",Oa);M("H",le,Wr);M("h",le,Jt);M("k",le,Jt);M("HH",le,Be);M("hh",le,Be);M("kk",le,Be);M("hmm",ya);M("hmmss",Ar);M("Hmm",ya);M("Hmmss",Ar);ae(["H","HH"],xe);ae(["k","kk"],function(e,t,n){var r=L(e);t[xe]=r===24?0:r});ae(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});ae(["h","hh"],function(e,t,n){t[xe]=L(e),E(n).bigHour=!0});ae("hmm",function(e,t,n){var r=e.length-2;t[xe]=L(e.substr(0,r)),t[ze]=L(e.substr(r)),E(n).bigHour=!0});ae("hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[xe]=L(e.substr(0,r)),t[ze]=L(e.substr(r,2)),t[ct]=L(e.substr(s)),E(n).bigHour=!0});ae("Hmm",function(e,t,n){var r=e.length-2;t[xe]=L(e.substr(0,r)),t[ze]=L(e.substr(r))});ae("Hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[xe]=L(e.substr(0,r)),t[ze]=L(e.substr(r,2)),t[ct]=L(e.substr(s))});function Qo(e){return(e+"").toLowerCase().charAt(0)==="p"}var qo=/[ap]\.?m?\.?/i,Zo=en("Hours",!0);function Ko(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Na={calendar:jo,longDateFormat:No,invalidDate:Po,ordinal:To,dayOfMonthOrdinalParse:Eo,relativeTime:Fo,months:Zl,monthsShort:va,week:Ho,weekdays:co,weekdaysMin:uo,weekdaysShort:Sa,meridiemParse:qo},se={},sn={},fn;function Jo(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function br(e){return e&&e.toLowerCase().replace("_","-")}function Xo(e){for(var t=0,n,r,s,i;t<e.length;){for(i=br(e[t]).split("-"),n=i.length,r=br(e[t+1]),r=r?r.split("-"):null;n>0;){if(s=Kn(i.slice(0,n).join("-")),s)return s;if(r&&r.length>=n&&Jo(i,r)>=n-1)break;n--}t++}return fn}function ec(e){return typeof e=="string"&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)}function Kn(e){var t=null,n,r;if(V(se,e))return se[e];if(r=br(e),V(se,r))return se[r];if(typeof module<"u"&&module&&module.exports&&ec(r))try{t=fn._abbr,n=require,n("./locale/"+r),St(t)}catch{se[r]=null}if(V(se,r))return se[r]}function St(e,t){var n;return e&&(Te(t)?n=ht(e):n=Gr(e,t),n?fn=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),fn._abbr}function Gr(e,t){if(t!==null){var n,r=Na;if(t.abbr=e,se[e]!=null)da("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=se[e]._config;else if(t.parentLocale!=null)if(se[t.parentLocale]!=null)r=se[t.parentLocale]._config;else if(n=Kn(t.parentLocale),n!=null)r=n._config;else return sn[t.parentLocale]||(sn[t.parentLocale]=[]),sn[t.parentLocale].push({name:e,config:t}),null;return se[e]=new $r(wr(r,t)),sn[e]&&sn[e].forEach(function(s){Gr(s.name,s.config)}),St(e),se[e]}else return delete se[e],null}function tc(e,t){var n,r=Kn(e),s=Na;return r!=null&&(e=r._abbr),t!=null?(se[e]!=null&&se[e].parentLocale!=null?se[e].set(wr(se[e]._config,t)):(r!=null&&(s=r._config),t=wr(s,t),r==null&&(t.abbr=e),n=new $r(t),n.parentLocale=se[e],se[e]=n),St(e)):se[e]!=null&&(se[e].parentLocale!=null?(se[e]=se[e].parentLocale,e===St()&&St(e)):se[e]!=null&&delete se[e]),se[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return fn;if(!Ze(e)){if(t=Kn(e),t)return t;e=[e]}return Xo(e)}function nc(){return Sr(se)}function Qr(e){var t,n=e._a;return n&&E(e).overflow===-2&&(t=n[Ae]<0||n[Ae]>11?Ae:n[Ee]<1||n[Ee]>Br(n[_e],n[Ae])?Ee:n[xe]<0||n[xe]>24||n[xe]===24&&(n[ze]!==0||n[ct]!==0||n[Ot]!==0)?xe:n[ze]<0||n[ze]>59?ze:n[ct]<0||n[ct]>59?ct:n[Ot]<0||n[Ot]>999?Ot:-1,E(e)._overflowDayOfYear&&(t<_e||t>Ee)&&(t=Ee),E(e)._overflowWeeks&&t===-1&&(t=$l),E(e)._overflowWeekday&&t===-1&&(t=Ul),E(e).overflow=t),e}var rc=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,sc=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ac=/Z|[+-]\d\d(?::?\d\d)?/,jn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ic=/^\/?Date\((-?\d+)/i,lc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,oc={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ra(e){var t,n,r=e._i,s=rc.exec(r)||sc.exec(r),i,l,c,u,d=jn.length,y=mr.length;if(s){for(E(e).iso=!0,t=0,n=d;t<n;t++)if(jn[t][1].exec(s[1])){l=jn[t][0],i=jn[t][2]!==!1;break}if(l==null){e._isValid=!1;return}if(s[3]){for(t=0,n=y;t<n;t++)if(mr[t][1].exec(s[3])){c=(s[2]||" ")+mr[t][0];break}if(c==null){e._isValid=!1;return}}if(!i&&c!=null){e._isValid=!1;return}if(s[4])if(ac.exec(s[4]))u="Z";else{e._isValid=!1;return}e._f=l+(c||"")+(u||""),Zr(e)}else e._isValid=!1}function cc(e,t,n,r,s,i){var l=[uc(e),va.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(s,10)];return i&&l.push(parseInt(i,10)),l}function uc(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function dc(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function fc(e,t,n){if(e){var r=Sa.indexOf(e),s=new Date(t[0],t[1],t[2]).getDay();if(r!==s)return E(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function hc(e,t,n){if(e)return oc[e];if(t)return 0;var r=parseInt(n,10),s=r%100,i=(r-s)/100;return i*60+s}function Pa(e){var t=lc.exec(dc(e._i)),n;if(t){if(n=cc(t[4],t[3],t[2],t[5],t[6],t[7]),!fc(t[1],n,e))return;e._a=n,e._tzm=hc(t[8],t[9],t[10]),e._d=Pt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),E(e).rfc2822=!0}else e._isValid=!1}function mc(e){var t=ic.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Ra(e),e._isValid===!1)delete e._isValid;else return;if(Pa(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:x.createFromInputFallback(e)}x.createFromInputFallback=Qe("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function an(e,t,n){return e??t??n}function As(e,t,n){var r=Object.prototype.hasOwnProperty.call(e,"_isDefaultDatePartsForWeek"),s=e._isDefaultDatePartsForWeek;e._isDefaultDatePartsForWeek=!!n;try{return x._getDefaultDateParts(e,t,n)}finally{r?e._isDefaultDatePartsForWeek=s:delete e._isDefaultDatePartsForWeek}}function yc(e){var t=e._defaultDatePartsNow;return t?(t.hasValue||(t.value=x.now(),t.hasValue=!0),t.value):x.now()}function gc(e,t,n){var r=n||e._isDefaultDatePartsForWeek,s=r?oe(t):new Date(t);return r?[s.year(),s.month(),s.date()]:e._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}x._getDefaultDateParts=gc;function qr(e){var t,n,r=[],s,i,l,c,u;if(!e._d){for((e._a[_e]==null||e._a[Ae]==null||e._a[Ee]==null)&&(s=yc(e),i=As(e,s)),e._w&&e._a[Ee]==null&&e._a[Ae]==null&&_c(e,As(e,s,!0)),e._dayOfYear!=null&&(c=e._a[_e]!=null?e._a[_e]:i[_e],(e._dayOfYear>on(c)||e._dayOfYear===0)&&(E(e)._overflowDayOfYear=!0),n=Pt(c,0,e._dayOfYear),e._a[Ae]=n.getUTCMonth(),e._a[Ee]=n.getUTCDate()),u=e._a[_e]==null||e._a[Ae]==null||e._a[Ee]==null,t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[xe]===24&&e._a[ze]===0&&e._a[ct]===0&&e._a[Ot]===0&&(e._nextDay=!0,e._a[xe]=0),e._d=(e._useUTC?Pt:Wo).apply(null,r),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[xe]=24),e._w&&typeof e._w.d<"u"&&!u&&e._w.d!==l&&(E(e).weekdayMismatch=!0)}}function _c(e,t){var n,r,s,i,l,c,u,d,y;n=e._w,n.GG!=null||n.W!=null||n.E!=null?(l=1,c=4,r=an(n.GG,e._a[_e],Fs(t[_e],t[Ae],t[Ee],1,4).year),s=an(n.W,1),i=an(n.E,1),(i<1||i>7)&&(d=!0)):(l=e._locale._week.dow,c=e._locale._week.doy,y=Fs(t[_e],t[Ae],t[Ee],l,c),r=an(n.gg,e._a[_e],y.year),s=an(n.w,y.week),n.d!=null?(i=n.d,(i<0||i>6)&&(d=!0)):n.e!=null?(i=n.e+l,(n.e<0||n.e>6)&&(d=!0)):i=l),s<1||s>dt(r,l,c)?E(e)._overflowWeeks=!0:d!=null?E(e)._overflowWeekday=!0:(u=Ca(r,s,i,l,c),e._a[_e]=u.year,e._dayOfYear=u.dayOfYear)}x.ISO_8601=function(){};x.RFC_2822=function(){};function Zr(e){if(e._f===x.ISO_8601){Ra(e);return}if(e._f===x.RFC_2822){Pa(e);return}e._a=[],E(e).empty=!0;var t=""+e._i,n,r,s,i,l,c=t.length,u=0,d,y;for(s=fa(e._f,e._locale).match(Ir)||[],y=s.length,n=0;n<y;n++)i=s[n],r=(t.match(Bl(i,e))||[])[0],r&&(l=t.substr(0,t.indexOf(r)),l.length>0&&E(e).unusedInput.push(l),t=t.slice(t.indexOf(r)+r.length),u+=r.length),Ut[i]?(r?E(e).empty=!1:E(e).unusedTokens.push(i),Vl(i,r,e)):e._strict&&!r&&E(e).unusedTokens.push(i);E(e).charsLeftOver=c-u,t.length>0&&E(e).unusedInput.push(t),e._a[xe]<=12&&E(e).bigHour===!0&&e._a[xe]>0&&(E(e).bigHour=void 0),E(e).parsedDateParts=e._a.slice(0),E(e).meridiem=e._meridiem,e._a[xe]=vc(e._locale,e._a[xe],e._meridiem),d=E(e).era,d!==null&&(e._a[_e]=e._locale.erasConvertYear(d,e._a[_e])),qr(e),Qr(e)}function vc(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function pc(e){var t,n,r,s,i,l,c=!1,u={},d=e._f.length;if(d===0){E(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;s<d;s++)i=0,l=!1,t=Tr({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._defaultDatePartsNow=u,t._f=e._f[s],Zr(t),Yr(t)&&(l=!0),i+=E(t).charsLeftOver,i+=E(t).unusedTokens.length*10,E(t).score=i,c?i<r&&(r=i,n=t):(r==null||i<r||l)&&(r=i,n=t,l&&(c=!0));et(e,n||t)}function xc(e){if(!e._d){var t=Er(e._i),n=t.day===void 0?t.date:t.day;e._a=ca([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),qr(e)}}function kc(e){var t=new _n(Qr(Ya(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ya(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),t===null||n===void 0&&t===""?gn({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Le(t)?new _n(Qr(t)):(yn(t)?e._d=t:Ze(n)?pc(e):n?Zr(e):wc(e),Yr(e)||(e._d=null),e))}function wc(e){var t=e._i;Te(t)?e._d=new Date(x.now()):yn(t)?e._d=new Date(t.valueOf()):typeof t=="string"?mc(e):Ze(t)?(e._a=ca(t.slice(0),function(n){return parseInt(n,10)}),qr(e)):Nt(t)?xc(e):ft(t)?e._d=new Date(t):x.createFromInputFallback(e)}function Ta(e,t,n,r,s){var i={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Nt(e)&&Pr(e)||Ze(e)&&e.length===0)&&(e=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=s,i._l=n,i._i=e,i._f=t,i._strict=r,kc(i)}function oe(e,t,n,r){return Ta(e,t,n,r,!1)}var Sc=Qe("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=oe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:gn()}),bc=Qe("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=oe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:gn()});function Ea(e,t){var n,r;if(t.length===1&&Ze(t[0])&&(t=t[0]),!t.length)return oe();for(r=0;r<t.length;++r)if(Le(t[r])){n=t[r];break}if(!n)return gn();for(++r;r<t.length;++r)Le(t[r])&&(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Mc(){var e=[].slice.call(arguments,0);return Ea("isBefore",e)}function Cc(){var e=[].slice.call(arguments,0);return Ea("isAfter",e)}var Dc=function(){return Date.now?Date.now():+new Date},ln=["year","quarter","month","week","day","hour","minute","second","millisecond"];function jc(e){var t,n=!1,r,s=ln.length;for(t in e)if(V(e,t)&&!(ge.call(ln,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<s;++r)if(e[ln[r]]){if(n)return!1;parseFloat(e[ln[r]])!==L(e[ln[r]])&&(n=!0)}return!0}function Oc(){return this._isValid}function Nc(){return Ke(NaN)}function Jn(e){var t=Er(e),n=t.year||0,r=t.quarter||0,s=t.month||0,i=t.week||t.isoWeek||0,l=t.day||0,c=t.hour||0,u=t.minute||0,d=t.second||0,y=t.millisecond||0;this._isValid=jc(t),this._milliseconds=+y+d*1e3+u*6e4+c*1e3*60*60,this._days=+l+i*7,this._months=+s+r*3+n*12,this._data={},this._locale=ht(),this._bubble()}function Yn(e){return e instanceof Jn}function Mr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Rc(e,t,n){var r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),i=0,l;for(l=0;l<r;l++)L(e[l])!==L(t[l])&&i++;return i+s}function Ia(e,t){j(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Ge(~~(n/60),2)+t+Ge(~~n%60,2)})}Ia("Z",":");Ia("ZZ","");M("Z",qn);M("ZZ",qn);ae(["Z","ZZ"],function(e,t,n){var r=Kr(qn,e);n._useUTC=!0,n._tzm=r,r===null&&(E(n).invalidOffset=e)});var Pc=/([\+\-]|\d\d)/gi;function Kr(e,t){var n=(t||"").match(e),r,s,i;return n===null||(r=n[n.length-1]||[],s=(r+"").match(Pc)||["-",0,0],i=+(s[1]*60)+L(s[2]),L(s[2])>59||(s[0]==="+"?i>14*60:i>12*60))?null:i===0?0:s[0]==="+"?i:-i}function Jr(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Le(e)||yn(e)?e.valueOf():oe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),x.updateOffset(n,!1),n):oe(e).local()}function Cr(e){return-Math.round(e._d.getTimezoneOffset())}x.updateOffset=function(){};function Yc(e,t,n){var r=this._offset||0,s;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Kr(qn,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(s=Cr(this)),this._offset=e,this._isUTC=!0,s!=null&&this.add(s,"m"),r!==e&&(!t||this._changeInProgress?La(this,Ke(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,x.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Cr(this)}function Tc(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ec(e){return this.utcOffset(0,e)}function Ic(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Cr(this),"m")),this}function Fc(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Kr(Ll,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Ac(e){return this.isValid()?(e=e?oe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Lc(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Wc(){if(!Te(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Tr(e,this),e=Ya(e),e._a?(t=e._isUTC?nt(e._a):oe(e._a),this._isDSTShifted=this.isValid()&&Rc(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Bc(){return this.isValid()?!this._isUTC:!1}function Hc(){return this.isValid()?this._isUTC:!1}function Fa(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Vc=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,$c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ke(e,t){var n=e,r=null,s,i,l;return Yn(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ft(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=Vc.exec(e))?(s=r[1]==="-"?-1:1,n={y:0,d:L(r[Ee])*s,h:L(r[xe])*s,m:L(r[ze])*s,s:L(r[ct])*s,ms:L(Mr(r[Ot]*1e3))*s}):(r=$c.exec(e))?(s=r[1]==="-"?-1:1,n={y:jt(r[2],s),M:jt(r[3],s),w:jt(r[4],s),d:jt(r[5],s),h:jt(r[6],s),m:jt(r[7],s),s:jt(r[8],s)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(l=Uc(oe(n.from),oe(n.to)),n={},n.ms=l.milliseconds,n.M=l.months),i=new Jn(n),Yn(e)&&V(e,"_locale")&&(i._locale=e._locale),Yn(e)&&V(e,"_isValid")&&(i._isValid=e._isValid),i}Ke.fn=Jn.prototype;Ke.invalid=Nc;function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ls(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Uc(e,t){var n;return e.isValid()&&t.isValid()?(t=Jr(t,e),e.isBefore(t)?n=Ls(e,t):(n=Ls(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Aa(e,t){return function(n,r){var s,i;return r!==null&&!isNaN(+r)&&(da(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),s=Ke(n,r),La(this,s,e),this}}function La(e,t,n,r){var s=t._milliseconds,i=Mr(t._days),l=Mr(t._months);e.isValid()&&(r=r??!0,l&&xa(e,dn(e,"Month")+l*n),i&&_a(e,"Date",dn(e,"Date")+i*n),s&&e._d.setTime(e._d.valueOf()+s*n),r&&x.updateOffset(e,i||l))}var zc=Aa(1,"add"),Gc=Aa(-1,"subtract");function Wa(e){return typeof e=="string"||e instanceof String}function Qc(e){return Le(e)||yn(e)||Wa(e)||ft(e)||Zc(e)||qc(e)||e===null||e===void 0}function qc(e){var t=Nt(e)&&!Pr(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,i,l=r.length;for(s=0;s<l;s+=1)i=r[s],n=n||V(e,i);return t&&n}function Zc(e){var t=Ze(e),n=!1;return t&&(n=e.filter(function(r){return!ft(r)&&Wa(e)}).length===0),t&&n}function Kc(e){var t=Nt(e)&&!Pr(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,i;for(s=0;s<r.length;s+=1)i=r[s],n=n||V(e,i);return t&&n}function Jc(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Xc(e,t){arguments.length===1&&(arguments[0]?Qc(arguments[0])?(e=arguments[0],t=void 0):Kc(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||oe(),r=Jr(n,this).startOf("day"),s=x.calendarFormat(this,r)||"sameElse",i=t&&(rt(t[s])?t[s].call(this,n):t[s]);return this.format(i||this.localeData().calendar(s,this,oe(n)))}function eu(){return new _n(this)}function tu(e,t){var n=Le(e)?e:oe(e);return this.isValid()&&n.isValid()?(t=qe(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function nu(e,t){var n=Le(e)?e:oe(e);return this.isValid()&&n.isValid()?(t=qe(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function ru(e,t,n,r){var s=Le(e)?e:oe(e),i=Le(t)?t:oe(t);return this.isValid()&&s.isValid()&&i.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(s,n):!this.isBefore(s,n))&&(r[1]===")"?this.isBefore(i,n):!this.isAfter(i,n))):!1}function su(e,t){var n=Le(e)?e:oe(e),r;return this.isValid()&&n.isValid()?(t=qe(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function au(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function iu(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function lu(e,t,n){var r,s,i;if(!this.isValid())return NaN;if(r=Jr(e,this),!r.isValid())return NaN;switch(s=(r.utcOffset()-this.utcOffset())*6e4,t=qe(t),t){case"year":i=Tn(this,r)/12;break;case"month":i=Tn(this,r);break;case"quarter":i=Tn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-s)/864e5;break;case"week":i=(this-r-s)/6048e5;break;default:i=this-r}return n?i:$e(i)}function Tn(e,t){if(e.date()<t.date())return-Tn(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),s,i;return t-r<0?(s=e.clone().add(n-1,"months"),i=(t-r)/(r-s)):(s=e.clone().add(n+1,"months"),i=(t-r)/(s-r)),-(n+i)||0}x.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";x.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ou(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function cu(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Pn(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):rt(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Pn(n,"Z")):Pn(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function uu(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,s,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(n+r+s+i)}function du(e){e||(e=this.isUtc()?x.defaultFormatUtc:x.defaultFormat);var t=Pn(this,e);return this.localeData().postformat(t)}function fu(e,t){return this.isValid()&&(Le(e)&&e.isValid()||oe(e).isValid())?Ke({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function hu(e){return this.from(oe(),e)}function mu(e,t){return this.isValid()&&(Le(e)&&e.isValid()||oe(e).isValid())?Ke({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function yu(e){return this.to(oe(),e)}function Ba(e){var t;return e===void 0?this._locale._abbr:(t=ht(e),t!=null&&(this._locale=t),this)}var Ha=Qe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Va(){return this._locale}var Ln=1e3,zt=60*Ln,Wn=60*zt,$a=(365*400+97)*24*Wn;function Gt(e,t){return(e%t+t)%t}function Ua(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-$a:new Date(e,t,n).valueOf()}function za(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-$a:Date.UTC(e,t,n)}function gu(e){var t,n;if(e=qe(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?za:Ua,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Gt(t+(this._isUTC?0:this.utcOffset()*zt),Wn);break;case"minute":t=this._d.valueOf(),t-=Gt(t,zt);break;case"second":t=this._d.valueOf(),t-=Gt(t,Ln);break}return this._d.setTime(t),x.updateOffset(this,!0),this}function _u(e){var t,n;if(e=qe(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?za:Ua,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Wn-Gt(t+(this._isUTC?0:this.utcOffset()*zt),Wn)-1;break;case"minute":t=this._d.valueOf(),t+=zt-Gt(t,zt)-1;break;case"second":t=this._d.valueOf(),t+=Ln-Gt(t,Ln)-1;break}return this._d.setTime(t),x.updateOffset(this,!0),this}function vu(){return this._d.valueOf()-(this._offset||0)*6e4}function pu(){return Math.floor(this.valueOf()/1e3)}function xu(){return new Date(this.valueOf())}function ku(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wu(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Su(){return this.isValid()?this.toISOString():null}function bu(){return Yr(this)}function Mu(){return et({},E(this))}function Cu(){return E(this).overflow}function Du(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}j("N",0,0,"eraAbbr");j("NN",0,0,"eraAbbr");j("NNN",0,0,"eraAbbr");j("NNNN",0,0,"eraName");j("NNNNN",0,0,"eraNarrow");j("y",["y",1],"yo","eraYear");j("y",["yy",2],0,"eraYear");j("y",["yyy",3],0,"eraYear");j("y",["yyyy",4],0,"eraYear");M("N",Xr);M("NN",Xr);M("NNN",Xr);M("NNNN",Au);M("NNNNN",Lu);ae(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var s=n._locale.erasParse(e,r,n._strict);s?E(n).era=s:E(n).invalidEra=e});M("y",Kt);M("yy",Kt);M("yyy",Kt);M("yyyy",Kt);M("yo",Wu);ae(["y","yy","yyy","yyyy"],_e);ae(["yo"],function(e,t,n,r){var s;n._locale._eraYearOrdinalRegex&&(s=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[_e]=n._locale.eraYearOrdinalParse(e,s):t[_e]=parseInt(e,10)});function ju(e,t){var n,r,s,i=this._eras||ht("en")._eras;for(n=0,r=i.length;n<r;++n){switch(typeof i[n].since){case"string":s=x(i[n].since).startOf("day"),i[n].since=s.valueOf();break}switch(typeof i[n].until){case"undefined":i[n].until=1/0;break;case"string":s=x(i[n].until).startOf("day").valueOf(),i[n].until=s.valueOf();break}}return i}function Ou(e,t,n){var r,s,i=this.eras(),l,c,u;for(e=e.toUpperCase(),r=0,s=i.length;r<s;++r)if(l=i[r].name.toUpperCase(),c=i[r].abbr.toUpperCase(),u=i[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(c===e)return i[r];break;case"NNNN":if(l===e)return i[r];break;case"NNNNN":if(u===e)return i[r];break}else if([l,c,u].indexOf(e)>=0)return i[r]}function Nu(e,t){var n=e.since<=e.until?1:-1;return t===void 0?x(e.since).year():x(e.since).year()+(t-e.offset)*n}function Ru(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function Pu(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function Yu(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function Tu(){var e,t,n,r,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,r=this.clone().startOf("day").valueOf(),s[e].since<=r&&r<=s[e].until||s[e].until<=r&&r<=s[e].since)return(this.year()-x(s[e].since).year())*n+s[e].offset;return this.year()}function Eu(e){return V(this,"_erasNameRegex")||es.call(this),e?this._erasNameRegex:this._erasRegex}function Iu(e){return V(this,"_erasAbbrRegex")||es.call(this),e?this._erasAbbrRegex:this._erasRegex}function Fu(e){return V(this,"_erasNarrowRegex")||es.call(this),e?this._erasNarrowRegex:this._erasRegex}function Xr(e,t){return t.erasAbbrRegex(e)}function Au(e,t){return t.erasNameRegex(e)}function Lu(e,t){return t.erasNarrowRegex(e)}function Wu(e,t){return t._eraYearOrdinalRegex||Kt}function es(){var e=[],t=[],n=[],r=[],s,i,l,c,u,d=this.eras();for(s=0,i=d.length;s<i;++s)l=ut(d[s].name),c=ut(d[s].abbr),u=ut(d[s].narrow),t.push(l),e.push(c),n.push(u),r.push(l),r.push(c),r.push(u);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}j(0,["gg",2],0,function(){return this.weekYear()%100});j(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Xn(e,t){j(0,[e,e.length],0,t)}Xn("gggg","weekYear");Xn("ggggg","weekYear");Xn("GGGG","isoWeekYear");Xn("GGGGG","isoWeekYear");M("G",Qn);M("g",Qn);M("GG",le,Be);M("gg",le,Be);M("GGGG",Lr,Fr);M("gggg",Lr,Fr);M("GGGGG",Gn,Un);M("ggggg",Gn,Un);Xt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=L(e)});Xt(["gg","GG"],function(e,t,n,r){t[r]=x.parseTwoDigitYear(e)});function Bu(e){return Ga.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Hu(e){return Ga.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vu(){return dt(this.year(),1,4)}function $u(){return dt(this.isoWeekYear(),1,4)}function Uu(){var e=this.localeData()._week;return dt(this.year(),e.dow,e.doy)}function zu(){var e=this.localeData()._week;return dt(this.weekYear(),e.dow,e.doy)}function Ga(e,t,n,r,s){var i;return e==null?Ur(this,r,s).year:(i=dt(e,r,s),t>i&&(t=i),Gu.call(this,e,t,n,r,s))}function Gu(e,t,n,r,s){var i=Ca(e,t,n,r,s),l=Pt(i.year,0,i.dayOfYear);return this.year(l.getUTCFullYear()),this.month(l.getUTCMonth()),this.date(l.getUTCDate()),this}j("Q",0,"Qo","quarter");M("Q",ha);ae("Q",function(e,t){t[Ae]=(L(e)-1)*3});function Qu(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}j("D",["DD",2],"Do","date");M("D",le,Jt);M("DD",le,Be);M("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});ae(["D","DD"],Ee);ae("Do",function(e,t){t[Ee]=L(e.match(le)[0])});var Qa=en("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear");M("DDD",zn);M("DDDD",ma);ae(["DDD","DDDD"],function(e,t,n){n._dayOfYear=L(e)});function qu(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}j("m",["mm",2],0,"minute");M("m",le,Wr);M("mm",le,Be);ae(["m","mm"],ze);var Zu=en("Minutes",!1);j("s",["ss",2],0,"second");M("s",le,Wr);M("ss",le,Be);ae(["s","ss"],ct);var Ku=en("Seconds",!1);j("S",0,0,function(){return~~(this.millisecond()/100)});j(0,["SS",2],0,function(){return~~(this.millisecond()/10)});j(0,["SSS",3],0,"millisecond");j(0,["SSSS",4],0,function(){return this.millisecond()*10});j(0,["SSSSS",5],0,function(){return this.millisecond()*100});j(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});j(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});j(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});j(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});M("S",zn,ha);M("SS",zn,Be);M("SSS",zn,ma);var wt,qa;for(wt="SSSS";wt.length<=9;wt+="S")M(wt,Kt);function Ju(e,t){t[Ot]=L(("0."+e)*1e3)}for(wt="S";wt.length<=9;wt+="S")ae(wt,Ju);qa=en("Milliseconds",!1);j("z",0,0,"zoneAbbr");j("zz",0,0,"zoneName");function Xu(){return this._isUTC?"UTC":""}function ed(){return this._isUTC?"Coordinated Universal Time":""}var g=_n.prototype;g.add=zc;g.calendar=Xc;g.clone=eu;g.diff=lu;g.endOf=_u;g.format=du;g.from=fu;g.fromNow=hu;g.to=mu;g.toNow=yu;g.get=Gl;g.invalidAt=Cu;g.isAfter=tu;g.isBefore=nu;g.isBetween=ru;g.isSame=su;g.isSameOrAfter=au;g.isSameOrBefore=iu;g.isValid=bu;g.lang=Ha;g.locale=Ba;g.localeData=Va;g.max=bc;g.min=Sc;g.parsingFlags=Mu;g.set=Ql;g.startOf=gu;g.subtract=Gc;g.toArray=ku;g.toObject=wu;g.toDate=xu;g.toISOString=cu;g.inspect=uu;typeof Symbol<"u"&&Symbol.for!=null&&(g[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});g.toJSON=Su;g.toString=ou;g.unix=pu;g.valueOf=vu;g.creationData=Du;g.eraName=Ru;g.eraNarrow=Pu;g.eraAbbr=Yu;g.eraYear=Tu;g.year=ga;g.isLeapYear=zl;g.weekYear=Bu;g.isoWeekYear=Hu;g.quarter=g.quarters=Qu;g.month=ka;g.daysInMonth=so;g.week=g.weeks=Uo;g.isoWeek=g.isoWeeks=zo;g.weeksInYear=Uu;g.weeksInWeekYear=zu;g.isoWeeksInYear=Vu;g.isoWeeksInISOWeekYear=$u;g.date=Qa;g.day=g.days=ko;g.weekday=wo;g.isoWeekday=So;g.dayOfYear=qu;g.hour=g.hours=Zo;g.minute=g.minutes=Zu;g.second=g.seconds=Ku;g.millisecond=g.milliseconds=qa;g.utcOffset=Yc;g.utc=Ec;g.local=Ic;g.parseZone=Fc;g.hasAlignedHourOffset=Ac;g.isDST=Lc;g.isLocal=Bc;g.isUtcOffset=Hc;g.isUtc=Fa;g.isUTC=Fa;g.zoneAbbr=Xu;g.zoneName=ed;g.dates=Qe("dates accessor is deprecated. Use date instead.",Qa);g.months=Qe("months accessor is deprecated. Use month instead",ka);g.years=Qe("years accessor is deprecated. Use year instead",ga);g.zone=Qe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Tc);g.isDSTShifted=Qe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Wc);function td(e){return oe(e*1e3)}function nd(){return oe.apply(null,arguments).parseZone()}function Za(e){return e}var K=$r.prototype;K.calendar=Oo;K.longDateFormat=Ro;K.invalidDate=Yo;K.ordinal=Io;K.preparse=Za;K.postformat=Za;K.relativeTime=Ao;K.pastFuture=Lo;K.set=Do;K.eras=ju;K.erasParse=Ou;K.erasConvertYear=Nu;K.erasAbbrRegex=Iu;K.erasNameRegex=Eu;K.erasNarrowRegex=Fu;K.months=eo;K.monthsShort=to;K.monthsParse=ro;K.monthsRegex=io;K.monthsShortRegex=ao;K.week=Bo;K.firstDayOfYear=$o;K.firstDayOfWeek=Vo;K.weekdays=go;K.weekdaysMin=vo;K.weekdaysShort=_o;K.weekdaysParse=xo;K.weekdaysRegex=bo;K.weekdaysShortRegex=Mo;K.weekdaysMinRegex=Co;K.isPM=Qo;K.meridiem=Ko;function Bn(e,t,n,r){var s=ht(),i=nt().set(r,t);return s[n](i,e)}function Ka(e,t,n){if(ft(e)&&(t=e,e=void 0),e=e||"",t!=null)return Bn(e,t,n,"month");var r,s=[];for(r=0;r<12;r++)s[r]=Bn(e,r,n,"month");return s}function ts(e,t,n,r){typeof e=="boolean"?(ft(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ft(t)&&(n=t,t=void 0),t=t||"");var s=ht(),i=e?s._week.dow:0,l,c=[];if(n!=null)return Bn(t,(n+i)%7,r,"day");for(l=0;l<7;l++)c[l]=Bn(t,(l+i)%7,r,"day");return c}function rd(e,t){return Ka(e,t,"months")}function sd(e,t){return Ka(e,t,"monthsShort")}function ad(e,t,n){return ts(e,t,n,"weekdays")}function id(e,t,n){return ts(e,t,n,"weekdaysShort")}function ld(e,t,n){return ts(e,t,n,"weekdaysMin")}St("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=L(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});x.lang=Qe("moment.lang is deprecated. Use moment.locale instead.",St);x.langData=Qe("moment.langData is deprecated. Use moment.localeData instead.",ht);var lt=Math.abs;function od(){var e=this._data;return this._milliseconds=lt(this._milliseconds),this._days=lt(this._days),this._months=lt(this._months),e.milliseconds=lt(e.milliseconds),e.seconds=lt(e.seconds),e.minutes=lt(e.minutes),e.hours=lt(e.hours),e.months=lt(e.months),e.years=lt(e.years),this}function Ja(e,t,n,r){var s=Ke(t,n);return e._milliseconds+=r*s._milliseconds,e._days+=r*s._days,e._months+=r*s._months,e._bubble()}function cd(e,t){return Ja(this,e,t,1)}function ud(e,t){return Ja(this,e,t,-1)}function Ws(e){return e<0?Math.floor(e):Math.ceil(e)}function dd(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,s,i,l,c,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Ws(Dr(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,s=$e(e/1e3),r.seconds=s%60,i=$e(s/60),r.minutes=i%60,l=$e(i/60),r.hours=l%24,t+=$e(l/24),u=$e(Xa(t)),n+=u,t-=Ws(Dr(u)),c=$e(n/12),n%=12,r.days=t,r.months=n,r.years=c,this}function Xa(e){return e*4800/146097}function Dr(e){return e*146097/4800}function fd(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=qe(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+Xa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function mt(e){return function(){return this.as(e)}}var ei=mt("ms"),hd=mt("s"),md=mt("m"),yd=mt("h"),gd=mt("d"),_d=mt("w"),vd=mt("M"),pd=mt("Q"),xd=mt("y"),kd=ei;function wd(){return Ke(this)}function Sd(e){return e=qe(e),this.isValid()?this[e+"s"]():NaN}function Tt(e){return function(){return this.isValid()?this._data[e]:NaN}}var bd=Tt("milliseconds"),Md=Tt("seconds"),Cd=Tt("minutes"),Dd=Tt("hours"),jd=Tt("days"),Od=Tt("months"),Nd=Tt("years");function Rd(){return $e(this.days()/7)}var ot=Math.round,$t={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Pd(e,t,n,r,s){return ba.call(s,t||1,!!n,e,r)}function Yd(e,t,n,r){var s=Ke(e).abs(),i=ot(s.as("s")),l=ot(s.as("m")),c=ot(s.as("h")),u=ot(s.as("d")),d=ot(s.as("M")),y=ot(s.as("w")),p=ot(s.as("y")),w=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||l<=1&&["m"]||l<n.m&&["mm",l]||c<=1&&["h"]||c<n.h&&["hh",c]||u<=1&&["d"]||u<n.d&&["dd",u];return n.w!=null&&(w=w||y<=1&&["w"]||y<n.w&&["ww",y]),w=w||d<=1&&["M"]||d<n.M&&["MM",d]||p<=1&&["y"]||["yy",p],w[2]=t,w[3]=+e>0,w[4]=r,Pd.apply(null,w)}function Td(e){return e===void 0?ot:typeof e=="function"?(ot=e,!0):!1}function Ed(e,t){return $t[e]===void 0?!1:t===void 0?$t[e]:($t[e]=t,e==="s"&&($t.ss=t-1),!0)}function Id(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$t,s,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=et(et({},$t),t||{}),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),s=this.localeData(),i=Yd(this,!n,r,s),n&&(i=Ma.call(s,+this,i)),s.postformat(i)}var yr=Math.abs;function Bt(e){return(e>0)-(e<0)||+e}function er(){if(!this.isValid())return this.localeData().invalidDate();var e=yr(this._milliseconds)/1e3,t=yr(this._days),n=yr(this._months),r,s,i,l,c=this.asSeconds(),u,d,y,p;return c?(r=$e(e/60),s=$e(r/60),e%=60,r%=60,i=$e(n/12),n%=12,l=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=c<0?"-":"",d=Bt(this._months)!==Bt(c)?"-":"",y=Bt(this._days)!==Bt(c)?"-":"",p=Bt(this._milliseconds)!==Bt(c)?"-":"",u+"P"+(i?d+i+"Y":"")+(n?d+n+"M":"")+(t?y+t+"D":"")+(s||r||e?"T":"")+(s?p+s+"H":"")+(r?p+r+"M":"")+(e?p+l+"S":"")):"P0D"}var z=Jn.prototype;z.isValid=Oc;z.abs=od;z.add=cd;z.subtract=ud;z.as=fd;z.asMilliseconds=ei;z.asSeconds=hd;z.asMinutes=md;z.asHours=yd;z.asDays=gd;z.asWeeks=_d;z.asMonths=vd;z.asQuarters=pd;z.asYears=xd;z.valueOf=kd;z._bubble=dd;z.clone=wd;z.get=Sd;z.milliseconds=bd;z.seconds=Md;z.minutes=Cd;z.hours=Dd;z.days=jd;z.weeks=Rd;z.months=Od;z.years=Nd;z.humanize=Id;z.toISOString=er;z.toString=er;z.toJSON=er;z.locale=Ba;z.localeData=Va;z.toIsoString=Qe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",er);z.lang=Ha;j("X",0,0,"unix");j("x",0,0,"valueOf");M("x",Qn);M("X",Wl);ae("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});ae("x",function(e,t,n){n._d=new Date(L(e))});//! moment.js
11
- x.version="2.31.0";Yl(oe);x.fn=g;x.min=Mc;x.max=Cc;x.now=Dc;x.utc=nt;x.unix=td;x.months=rd;x.isDate=yn;x.locale=St;x.invalid=gn;x.duration=Ke;x.isMoment=Le;x.weekdays=ad;x.parseZone=nd;x.localeData=ht;x.isDuration=Yn;x.monthsShort=sd;x.weekdaysMin=ld;x.defineLocale=Gr;x.updateLocale=tc;x.locales=nc;x.weekdaysShort=id;x.normalizeUnits=qe;x.relativeTimeRounding=Td;x.relativeTimeThreshold=Ed;x.calendarFormat=Jc;x.prototype=g;x.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Fd=[{label:"是",value:!0},{label:"否",value:!1}];function On(e){const t=x();return[t.clone().subtract(e,"day"),t]}function ti(e){const[t,n]=o.useState(7),r=e.valueFormat??"YYYY-MM-DD",s=e.op===P.Operator.Between||e.op===P.Operator.NotBetween,i=e.op===P.Operator.In||e.op===P.Operator.NotIn,l=e.value,c=typeof l=="string"?l:"",u=typeof l=="number"?l:void 0,d=typeof l=="boolean"?l:void 0,y=typeof l=="string"||typeof l=="number"||typeof l=="boolean"?l:void 0,p=Array.isArray(l)?l:[],w=Array.isArray(l)&&l.length===2&&typeof l[0]=="string"&&typeof l[1]=="string"?[x(l[0]),x(l[1])]:null,k=Array.isArray(l)&&typeof l[0]=="number"?l[0]:void 0,C=Array.isArray(l)&&typeof l[1]=="number"?l[1]:void 0,A=(e.options??[]).map(S=>({label:S.label,value:S.value})),O=S=>{var I;return(I=e.onChange)==null?void 0:I.call(e,S)},q=()=>{const S=t;if(!S||S<1)return;const[I,H]=On(S);O([I.format(r),H.format(r)])};let W;e.fieldType==="string"&&i?W=a.jsx(f.Select,{mode:"tags",value:p,onChange:S=>O(S),tokenSeparators:[",",","],placeholder:"输入后回车添加",style:{width:"100%"}}):e.fieldType==="string"?W=a.jsx(f.Input,{value:c,onChange:S=>O(S.target.value),placeholder:"请输入",allowClear:!0}):e.fieldType==="number"&&s?W=a.jsxs(a.Fragment,{children:[a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:k,onChange:S=>O([S??null,C??null]),placeholder:"最小值",controls:!1}),a.jsx("span",{className:"yk-advanced-value-editor__sep",children:"~"}),a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:C,onChange:S=>O([k??null,S??null]),placeholder:"最大值",controls:!1})]}):e.fieldType==="number"?W=a.jsx(f.InputNumber,{value:u,onChange:S=>O(S??null),placeholder:"请输入数字",controls:!1,style:{width:"100%"}}):e.fieldType==="date"&&s?W=a.jsxs(a.Fragment,{children:[a.jsx(f.DatePicker.RangePicker,{className:"yk-advanced-value-editor__daterange-picker",value:w,format:r,placeholder:["开始日期","结束日期"],ranges:{"最近 7 天":On(7),"最近 30 天":On(30),"最近 90 天":On(90)},onChange:(S,I)=>{O(S?[I[0],I[1]]:null)}}),a.jsx(f.Popover,{trigger:"click",placement:"bottom",content:a.jsxs("div",{className:"yk-advanced-value-editor__recent-pop",children:[a.jsx("span",{children:"最近"}),a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__recent-input",value:t,onChange:S=>n(typeof S=="number"?S:1),min:1,controls:!1}),a.jsx("span",{children:"天"}),a.jsx(f.Button,{type:"primary",size:"small",onClick:q,children:"应用"})]}),children:a.jsx(f.Button,{className:"yk-advanced-value-editor__recent-trigger",style:{flex:"0 0 auto"},children:"最近 N 天"})})]}):e.fieldType==="date"?W=a.jsx(f.DatePicker,{value:typeof l=="string"?x(l):null,format:r,onChange:(S,I)=>O(I||null),placeholder:"选择日期",allowClear:!0}):e.fieldType==="boolean"?W=a.jsx(f.Select,{value:d,options:Fd.map(S=>({label:S.label,value:S.value})),onChange:S=>O(S),placeholder:"请选择",allowClear:!0}):e.fieldType==="enum"&&i?W=a.jsx(f.Select,{mode:"multiple",value:p,options:A,onChange:S=>O(S),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading}):W=a.jsx(f.Select,{value:y,options:A,onChange:S=>O(S??null),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading});const ie=["yk-advanced-value-editor",s?"yk-advanced-value-editor--range":"",e.fieldType==="date"&&s?"yk-advanced-value-editor--daterange":"",e.className??""].filter(Boolean).join(" ");return a.jsx("div",{className:ie,children:W})}function ns(e){const t=o.useContext(la);if(!t)return null;const{group:n,level:r=0}=e,s=c=>{(c==="and"||c==="or")&&t.api.setGroupCombinator(n.id,c)},i=c=>t.columns.find(u=>u.propertyPath===c),l=c=>{var u;return((u=i(c))==null?void 0:u.displayFormat)??"YYYY-MM-DD"};return a.jsxs("div",{className:`yk-adv-group level-${r}${r===0?" is-root":""}`,children:[a.jsxs("div",{className:"yk-adv-group__header",children:[a.jsx("span",{className:"yk-adv-group__comb-label",children:"满足"}),a.jsxs(f.Radio.Group,{size:"small",value:n.combinator,onChange:c=>s(c.target.value),children:[a.jsx(f.Radio.Button,{value:"and",children:"全部"}),a.jsx(f.Radio.Button,{value:"or",children:"任一"})]}),a.jsx("span",{className:"yk-adv-group__comb-label",children:"条件"}),a.jsxs("span",{className:"yk-adv-group__actions",children:[a.jsx(f.Button,{type:"link",onClick:()=>t.api.addLeaf(n.id),children:"+ 条件"}),a.jsx(f.Button,{type:"link",onClick:()=>t.api.addNestedGroup(n.id),children:"+ 嵌套组"}),r>0&&a.jsx(f.Button,{type:"link",danger:!0,onClick:()=>t.api.removeNode(n.id),children:"删除组"})]})]}),a.jsxs("div",{className:"yk-adv-group__children",children:[n.children.map(c=>{if(P.isConditionGroup(c))return a.jsx("div",{className:"yk-adv-group__nested",children:a.jsx(ns,{group:c,level:r+1})},c.id);const u=c;return a.jsxs("div",{className:"yk-adv-group__row",children:[a.jsx(f.Select,{className:"yk-adv-group__field",value:u.propertyPath||void 0,options:t.columns.map(d=>({label:d.displayName??d.propertyPath,value:d.propertyPath})),placeholder:"选择字段",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeField(u.id,d)}),a.jsx(f.Select,{className:"yk-adv-group__op",value:u.op,options:t.api.operatorsOf(u.propertyPath).map(d=>({label:P.OPERATOR_LABELS[d]??String(d),value:d})),placeholder:"操作符",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeOperator(u.id,d)}),!P.isNullOperator(u.op)&&a.jsx(ti,{className:["yk-adv-group__value",t.api.isConditionEmpty(u)?"is-invalid":""].filter(Boolean).join(" "),fieldType:t.api.fieldTypeOf(u.propertyPath),op:u.op,value:u.value,options:t.optionsMap[u.propertyPath]??[],optionsLoading:t.loadingMap[u.propertyPath]===!0,valueFormat:l(u.propertyPath),onChange:d=>t.updateValue(u.id,d)}),a.jsx(f.Button,{className:"yk-adv-group__remove",type:"link",danger:!0,onClick:()=>t.api.removeNode(u.id),children:"删除"})]},u.id)}),n.children.length===0&&a.jsx("div",{className:"yk-adv-group__empty",children:"暂无条件,点击「+ 条件」或「+ 嵌套组」"})]})]})}function ni(e,t,n){for(const r of e.children)if(P.isConditionGroup(r)){if(ni(r,t,n))return!0}else if(r.id===t)return r.value=n,!0;return!1}const ri=o.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,i=t.searchButtonText??"查询",l=t.resetButtonText??"重置",c=t.showSaveQuery??!0,u=ee.useAdvancedFilter({columns:t.columns,optionSources:t.optionSources}),{rootGroup:d,fieldTypeOf:y,filter:p,reset:w}=u,[k,C]=o.useState({}),[A,O]=o.useState({}),q=o.useRef({}),W=o.useRef({}),ie=R=>{var m;const X=(m=t.optionSources)==null?void 0:m[R];X&&(q.current[R]||W.current[R]||(W.current={...W.current,[R]:!0},O(W.current),X().then($=>{q.current={...q.current,[R]:$},C(q.current)}).finally(()=>{W.current={...W.current,[R]:!1},O(W.current)})))},S=R=>{const X=new Set,m=$=>{P.isConditionGroup($)?$.children.forEach(m):y($.propertyPath)==="enum"&&X.add($.propertyPath)};return R.children.forEach(m),[...X]};o.useEffect(()=>{for(const R of S(d))ie(R)},[d,y,t.optionSources]);const I=(R,X)=>{ni(d,R,X),u.setGroupCombinator(d.id,d.combinator)},[H,Me]=o.useState([]),ve=t.savedQueries??H,pe=R=>{var X;Me(R),(X=t.onUpdateSavedQueries)==null||X.call(t,R)},[Oe,ne]=o.useState(!1),[ue,ce]=o.useState(""),[J,me]=o.useState(""),G=o.useRef(0),h=()=>{const R=X=>X.children.some(m=>P.isConditionGroup(m)?R(m):u.isConditionEmpty(m));return R(d)},N=()=>{ce(""),me(""),ne(!0)},T=()=>{const R=ue.trim();if(!R)return;h()&&f.message.warning("当前存在未填值的条件行(标红),保存的预设可能不完整");const X=JSON.parse(JSON.stringify(d)),m={id:`sq-${++G.current}`,name:R,description:J.trim(),group:X,filterInfo:p};pe([...ve,m]),ne(!1)},U=o.useRef(!1),[de,Z]=o.useState(0),te=R=>{const X=JSON.parse(JSON.stringify(R.group));Object.assign(d,X),u.setGroupCombinator(d.id,d.combinator),U.current=!0,Z(m=>m+1)};o.useEffect(()=>{var R;U.current&&(U.current=!1,(R=t.onSearch)==null||R.call(t,p))},[de,p]);const F=R=>{pe(ve.filter(X=>X.id!==R))},Ce=()=>{var R;return(R=t.onSearch)==null?void 0:R.call(t,p)},De=()=>{var R;w(),(R=t.onReset)==null||R.call(t)};o.useImperativeHandle(n,()=>({get filter(){return p},reset:De,openSaveDialog:N,applySavedQuery:te,removeSavedQuery:F,get savedQueries(){return ve}}),[p,ve,d]);const je={columns:t.columns,optionsMap:k,loadingMap:A,api:u,updateValue:I};return a.jsx(la.Provider,{value:je,children:a.jsxs("div",{className:"yk-advanced-filter",onKeyDown:R=>{R.key==="Enter"&&Ce()},children:[a.jsx(ns,{group:d,level:0}),(r||s||c)&&a.jsxs("div",{className:"yk-advanced-filter__actions",children:[r&&a.jsx(f.Button,{type:"primary",onClick:Ce,children:i}),s&&a.jsx(f.Button,{onClick:De,children:l}),c&&a.jsx(f.Button,{onClick:N,children:"保存"})]}),a.jsxs(f.Modal,{open:Oe,title:"保存查询",width:440,onCancel:()=>ne(!1),onOk:T,okText:"确定",cancelText:"取消",okButtonProps:{disabled:!ue.trim()},children:[a.jsxs("div",{className:"yk-advanced-filter__form-item",children:[a.jsx("label",{className:"yk-advanced-filter__form-label",children:"名称"}),a.jsx(f.Input,{value:ue,onChange:R=>ce(R.target.value),placeholder:"请输入查询名称",maxLength:50,showCount:!0,onPressEnter:T})]}),a.jsxs("div",{className:"yk-advanced-filter__form-item",children:[a.jsx("label",{className:"yk-advanced-filter__form-label",children:"描述"}),a.jsx(f.Input.TextArea,{value:J,onChange:R=>me(R.target.value),rows:2,placeholder:"可选,描述此查询的用途(hover 标签时显示)",maxLength:200,showCount:!0})]})]})]})})}),si=o.forwardRef(function(t,n){const r=ee.useFilterPanel(),s=o.useRef(r);s.current=r;const i=o.useMemo(()=>({get filter(){return s.current.filter},reset:()=>s.current.reset(),register:r.register,notify:r.notify}),[r.register,r.notify]),l=o.useMemo(()=>{const c=[];t.extraFilter&&c.push(t.extraFilter);const u=r.filter;return u&&!u.isEmpty()&&c.push(u),c.length===0?P.emptyFilter():c.length===1?c[0]:P.FilterInfo.createAnd(...c)},[t.extraFilter,r.filter]);return o.useImperativeHandle(n,()=>({filter:l,reset:()=>r.reset()}),[l,r]),a.jsx(ee.FilterPanelContext.Provider,{value:i,children:t.children})});function Ad(e,t){const n=new Map;for(const r of e)n.set(r.propertyPath,P.inferColumnFieldType(r,(t==null?void 0:t[r.propertyPath])!==void 0));return r=>n.get(r)??"string"}function Ld(e,t){if(P.isNullOperator(e.op))return!1;const n=t(e.propertyPath),r=e.value;return P.isRangeOperator(e.op)?!Array.isArray(r)||r.length!==2?!0:r[0]===null||r[0]===void 0||r[0]===""||r[1]===null||r[1]===void 0||r[1]==="":P.isMultiValueOperator(e.op)?!Array.isArray(r)||r.length===0:n==="boolean"||n==="number"||n==="date"?r==null||r==="":r==null||typeof r=="string"&&r.trim()===""}function Wd(e,t){if(Ld(e,t))return null;if(e.op==="is_null"){const n=t(e.propertyPath);return n==="string"?P.FilterInfo.createOr(P.filter(e.propertyPath,P.Operator.Equals,Ve.con(null)),P.filter(e.propertyPath,P.Operator.Equals,Ve.con(""))):n==="array"?P.FilterInfo.createOr(P.filter(e.propertyPath,P.Operator.Equals,Ve.con(null)),P.filter(`${e.propertyPath}.count`,P.Operator.Equals,Ve.con(0))):P.filter(e.propertyPath,P.Operator.Equals,Ve.con(null))}if(e.op==="is_not_null"){const n=t(e.propertyPath);return n==="string"?P.FilterInfo.createAnd(P.filter(e.propertyPath,P.Operator.NotEquals,Ve.con(null)),P.filter(e.propertyPath,P.Operator.NotEquals,Ve.con(""))):n==="array"?P.FilterInfo.createAnd(P.filter(e.propertyPath,P.Operator.NotEquals,Ve.con(null)),P.filter(`${e.propertyPath}.count`,P.Operator.GreaterThan,Ve.con(0))):P.filter(e.propertyPath,P.Operator.NotEquals,Ve.con(null))}return P.filter(e.propertyPath,e.op,Ve.con(e.value))}function ai(e,t){if(P.isConditionGroup(e)){const n=e.children.map(r=>ai(r,t)).filter(r=>r!==null);return n.length===0?null:n.length===1?n[0]:e.combinator==="or"?P.FilterInfo.createOr(...n):P.FilterInfo.createAnd(...n)}return Wd(e,t)}function Bd(e,t,n){const r=Ad(t,n);return ai(e,r)??P.emptyFilter()}const ii=o.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,i=t.searchButtonText??"查询",l=t.resetButtonText??"重置",c=t.enableAdvancedFilter??!1,u=t.advancedColumns??[],d=t.showQuickQuery??!1,y=t.singleLine??!1,p=o.useRef(null),w=o.useRef(null),[k,C]=o.useState("simple"),[A,O]=o.useState(!0),[q,W]=o.useState(0),ie=o.useRef(null),[S,I]=o.useState([]),H=t.quickQueries??S,Me=()=>{var h,N;return k==="advanced"?((h=w.current)==null?void 0:h.filter)??P.emptyFilter():((N=p.current)==null?void 0:N.filter)??P.emptyFilter()},ve=()=>{var h;return(h=t.onSearch)==null?void 0:h.call(t,Me())},pe=()=>{var h,N,T;k==="advanced"?(h=w.current)==null||h.reset():(N=p.current)==null||N.reset(),(T=t.onReset)==null||T.call(t)};o.useImperativeHandle(n,()=>({get filter(){return Me()},get mode(){return k},reset:pe}),[k]);const Oe=h=>{var N;I(h),(N=t.onUpdateQuickQueries)==null||N.call(t,h)},ne=async h=>{const N=new Set(H.map(U=>U.id)),T=h.filter(U=>!N.has(U.id));if(t.saveQuickQueryFun&&T.length>0){const U=[];for(const Z of T)try{const te=await t.saveQuickQueryFun(Z);U.push(te??Z)}catch{f.message.error(`保存快速查询「${Z.name}」失败`),U.push(Z)}let de=h;if(U.some((Z,te)=>Z!==T[te])){const Z=new Map(T.map((te,F)=>[te.id,U[F]??te]));de=h.map(te=>Z.get(te.id)??te)}Oe(de)}else Oe(h)};o.useEffect(()=>{if(!t.loadQuickQueryFun)return;let h=!1;return t.loadQuickQueryFun().then(N=>{var U;if(h)return;const T=N.map(de=>({...de,filterInfo:de.filterInfo??Bd(de.group,u,t.advancedOptionSources)}));I(T),(U=t.onUpdateQuickQueries)==null||U.call(t,T)}).catch(()=>{h||f.message.error("加载快速查询失败")}),()=>{h=!0}},[]);const ue=h=>{var N,T;k==="advanced"?(N=w.current)==null||N.applySavedQuery(h):(T=t.onSearch)==null||T.call(t,h.filterInfo)},ce=h=>{const N=H.find(U=>U.id===h),T=(N==null?void 0:N.name)??"该查询";f.Modal.confirm({title:"删除确认",content:`确定要删除快速查询「${T}」吗?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{ne(H.filter(U=>U.id!==h))}})},J=()=>{const h=ie.current;if(!h)return;for(const F of Array.from(h.children))F.style.display="";if(!y||!A){W(0),h.style.maxWidth="";return}const N=h.nextElementSibling,T=N?N.offsetWidth:0,U=16;h.style.maxWidth=`calc(100% - ${T+U}px)`;const de=h.clientWidth;let Z=0,te=0;for(const F of Array.from(h.children)){const Ce=F,De=Ce.offsetWidth;Z>0&&Z+De+U>de?(Ce.style.display="none",te++):Z+=De+U}W(te)};o.useEffect(()=>{J();const h=ie.current;if(!h)return;const N=new ResizeObserver(()=>J());return N.observe(h),()=>N.disconnect()},[y,A,k]);const me=()=>O(h=>!h),G=A?a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"6 9 12 15 18 9"}),a.jsx("polyline",{points:"6 14 12 20 18 14"})]}):a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"18 15 12 9 6 15"}),a.jsx("polyline",{points:"18 10 12 4 6 10"})]});return a.jsx("div",{className:["yk-filter-panel",y?"is-single-line":"",y&&A?"is-collapsed":""].filter(Boolean).join(" "),onKeyDown:h=>{h.key==="Enter"&&k==="simple"&&ve()},children:k==="simple"?a.jsxs(a.Fragment,{children:[y&&a.jsx(f.Button,{type:"text",className:"yk-filter-panel__toggle","aria-label":A?"展开更多条件":"折叠",title:A?q?`展开(${q} 个条件被隐藏)`:"展开":"折叠",onClick:me,children:G}),a.jsx("div",{className:"yk-filter-panel__items",ref:ie,children:a.jsx(si,{ref:p,children:t.children})}),(r||s||c)&&a.jsxs("div",{className:"yk-filter-panel__actions",children:[r&&a.jsx(f.Button,{type:"primary",onClick:ve,children:i}),s&&a.jsx(f.Button,{onClick:pe,children:l}),c&&!(y&&A)&&a.jsx(f.Button,{type:"link",onClick:()=>C("advanced"),children:"高级查询"})]}),d&&H.length>0&&a.jsxs("div",{className:"yk-filter-panel__saved",children:[a.jsx("span",{className:"yk-filter-panel__saved-label",children:"快速查询:"}),H.map(h=>a.jsx(f.Tooltip,{title:h.description||void 0,children:a.jsx(f.Button,{size:"small",onClick:()=>ue(h),children:h.name})},h.id))]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"yk-filter-panel__mode-bar",children:a.jsx(f.Button,{type:"link",onClick:()=>C("simple"),children:"← 简单查询"})}),a.jsx(ri,{ref:w,columns:u,optionSources:t.advancedOptionSources,savedQueries:H,onSearch:h=>{var N;return(N=t.onSearch)==null?void 0:N.call(t,h)},onReset:()=>{var h;return(h=t.onReset)==null?void 0:h.call(t)},onUpdateSavedQueries:ne}),H.length>0&&a.jsxs("div",{className:"yk-filter-panel__saved",children:[a.jsx("span",{className:"yk-filter-panel__saved-label",children:"已存查询:"}),H.map(h=>a.jsx(f.Tooltip,{title:h.description||void 0,children:a.jsx(f.Tag,{className:"yk-filter-panel__saved-tag",closable:!0,onClick:()=>ue(h),onClose:()=>ce(h.id),children:h.name})},h.id))]})]})})});function Hd({count:e,onSelectAll:t,onInvert:n,onClear:r}){return e<=0?null:a.jsxs("div",{className:"yk-table__selection-bar",children:[a.jsxs("span",{className:"yk-table__selection-bar__count",children:["已选 ",e," 项"]}),a.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:t,children:"全选"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:n,children:"反选"}),a.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:r,children:"清空"})]})}function li({actions:e,table:t=null,children:n}){const[r,s]=o.useState(null),i=o.useMemo(()=>e.filter(d=>d.align!=="right"),[e]),l=o.useMemo(()=>e.filter(d=>d.align==="right"),[e]);async function c(d){if(!(!t||r!==null)){s(d.name);try{await d.execute(t)}finally{s(null)}}}function u(d){return a.jsx(f.Button,{...Nr(d.type,d.plain),icon:Hn(d.icon),loading:r===d.name,disabled:r!==null&&r!==d.name,onClick:()=>void c(d),children:d.desc},d.name)}return a.jsxs("div",{className:"yk-command-bar",children:[a.jsxs("div",{className:"yk-command-bar__actions",children:[i.map(u),t&&a.jsx(Hd,{count:t.selectedRows.length,onSelectAll:()=>t.selectAllOnPage(),onInvert:()=>t.invertSelectionOnPage(),onClear:()=>t.clearSelection()}),n]}),l.length>0&&a.jsx("div",{className:"yk-command-bar__right",children:l.map(u)})]})}function Vd(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("circle",{cx:"9",cy:"6",r:"2.4",fill:"#fff"}),a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("circle",{cx:"15",cy:"12",r:"2.4",fill:"#fff"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"}),a.jsx("circle",{cx:"9",cy:"18",r:"2.4",fill:"#fff"})]})}function $d(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("polyline",{points:"23 4 23 10 17 10"}),a.jsx("polyline",{points:"1 20 1 14 7 14"}),a.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Ud(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),a.jsx("polyline",{points:"7 10 12 15 17 10"}),a.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function zd(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Ht({checked:e}){return a.jsx("span",{className:"yk-table-action-menu-button__check",children:e?"✓":""})}const rs=o.forwardRef(function({table:t,trigger:n,className:r},s){const[,i]=o.useReducer(u=>u+1,0);function l(u){switch(u){case"refresh":t.refresh();break;case"config":t.openConfigDialog();break;case"export":t.openExportDialog();break;case"view-table":t.setViewMode("table");break;case"view-card":t.setViewMode("card");break;case"view-list":t.setViewMode("list");break;case"toggle-checkbox":t.setSelectable(!t.selectable);break;case"toggle-column-resize":t.setColumnResizable(!t.columnResizable);break;case"toggle-sticky-header":t.setStickyHeader(!t.stickyHeader);break}}const c=[{key:"refresh",label:a.jsxs(a.Fragment,{children:[a.jsx($d,{}),"刷新"]})},{key:"export",label:a.jsxs(a.Fragment,{children:[a.jsx(Ud,{}),"导出 Excel"]})},{key:"config",label:a.jsxs(a.Fragment,{children:[a.jsx(zd,{}),"列设置"]})},{type:"divider"},{key:"view-table",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="table"}),"表格视图"]})},...t.slotNames.includes("card")?[{key:"view-card",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="card"}),"卡片视图"]})}]:[],...t.slotNames.includes("list")?[{key:"view-list",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="list"}),"列表视图"]})}]:[],{type:"divider"},{key:"toggle-checkbox",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.selectable}),"选择行"]})},{key:"toggle-column-resize",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.columnResizable}),"列宽拖动"]})},{key:"toggle-sticky-header",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.stickyHeader}),"锁定表头"]})}];return a.jsx(f.Dropdown,{trigger:["click"],placement:"bottomRight",onOpenChange:u=>{u&&i()},overlay:a.jsx(f.Menu,{items:c,onClick:({key:u})=>l(u)}),children:n?a.jsx("span",{className:"yk-table-action-menu-button__trigger",children:n}):a.jsx(f.Button,{ref:s,className:`yk-table-action-menu-button__btn${r?` ${r}`:""}`,title:"表格操作","aria-label":"表格操作",children:a.jsx(Vd,{})})})});rs.displayName="YsTableActionMenuButton";const Gd=[10,20,50,100],Qd=[],qd=[],Zd=[],Kd=[],Jd=[];function Bs(e){if(e!=null)return typeof e=="function"?e:()=>e}function gr(e){return typeof e=="function"?e():e}const oi=o.forwardRef(function(t,n){const{metaFun:r,dataFun:s,rowActionsFunc:i,pageSize:l=20,pageSizes:c=Gd,showCheckbox:u=!1,columnResizable:d=!0,stickyHeader:y=!1,loadCustomConfigFun:p,saveCustomConfigFun:w,exportPageSize:k=1e3,exportorFunc:C,collectPageSize:A=1e3,maxCollectCount:O=1e4,collectorFunc:q,collectorTitle:W,rowKey:ie="id",viewMode:S="table",actions:I=qd,showSearch:H=!0,showReset:Me=!0,searchButtonText:ve="查询",resetButtonText:pe="重置",enableAdvancedFilter:Oe=!1,advancedColumns:ne=Qd,advancedOptionSources:ue,showQuickQuery:ce=!1,quickQueries:J,loadQuickQueryFun:me,saveQuickQueryFun:G,singleLine:h=!1}=t,N=o.useRef(P.emptyFilter()),T=o.useRef(null),[U,de]=o.useState(null),Z=o.useRef(null),te=o.useCallback(m=>{T.current=m,de(m)},[]),F=o.useCallback(()=>T.current,[]),[,Ce]=o.useState(0),De=o.useCallback(()=>{Ce(m=>m+1)},[]),je=o.useCallback((m,$)=>s(m,N.current,$),[s]),R=o.useCallback(m=>{var $,He;N.current=m,($=t.onSearch)==null||$.call(t,m),(He=T.current)==null||He.reload()},[t.onSearch]),X=o.useCallback(()=>{var m,$;N.current=P.emptyFilter(),(m=t.onReset)==null||m.call(t),($=T.current)==null||$.reload()},[t.onReset]);return o.useImperativeHandle(n,()=>({get table(){return F()},get filterPanel(){return Z.current},get meta(){var m;return((m=F())==null?void 0:m.meta)??null},get paged(){var m;return((m=F())==null?void 0:m.paged)??null},get currentPage(){var m;return((m=F())==null?void 0:m.currentPage)??1},get viewMode(){var m;return((m=F())==null?void 0:m.viewMode)??"table"},get selectable(){var m;return((m=F())==null?void 0:m.selectable)??!1},get columnResizable(){var m;return((m=F())==null?void 0:m.columnResizable)??!0},get stickyHeader(){var m;return((m=F())==null?void 0:m.stickyHeader)??!1},get slotNames(){var m;return((m=F())==null?void 0:m.slotNames)??Jd},get selectedRows(){var m;return((m=F())==null?void 0:m.selectedRows)??Zd},get rows(){var m;return((m=F())==null?void 0:m.rows)??Kd},reload:()=>{var m;(m=F())==null||m.reload()},refresh:()=>{var m;(m=F())==null||m.refresh()},setViewMode:m=>{var $;($=F())==null||$.setViewMode(m)},setSelectable:m=>{var $;($=F())==null||$.setSelectable(m)},setColumnResizable:m=>{var $;($=F())==null||$.setColumnResizable(m)},setStickyHeader:m=>{var $;($=F())==null||$.setStickyHeader(m)},clearSelection:()=>{var m;(m=F())==null||m.clearSelection()},selectAllOnPage:()=>{var m;(m=F())==null||m.selectAllOnPage()},invertSelectionOnPage:()=>{var m;(m=F())==null||m.invertSelectionOnPage()},openConfigDialog:()=>{var m;(m=F())==null||m.openConfigDialog()},openExportDialog:()=>{var m;(m=F())==null||m.openExportDialog()},openCollectDialog:()=>{var m;(m=F())==null||m.openCollectDialog()}}),[F]),a.jsxs("div",{className:"yk-table-page",children:[a.jsxs("div",{className:"yk-table-page__filter-row",children:[a.jsx("div",{className:"yk-table-page__filter",children:a.jsx(ii,{ref:Z,showSearch:H,showReset:Me,searchButtonText:ve,resetButtonText:pe,enableAdvancedFilter:Oe,advancedColumns:ne,advancedOptionSources:ue,showQuickQuery:ce,quickQueries:J,loadQuickQueryFun:me,saveQuickQueryFun:G,singleLine:h,onSearch:R,onReset:X,onUpdateQuickQueries:t.onUpdateQuickQueries,children:t.children})}),a.jsx("div",{className:"yk-table-page__filter-extra",children:t.filterExtra===void 0?U?a.jsx(rs,{table:U}):null:t.filterExtra})]}),a.jsx("div",{className:"yk-table-page__command",children:a.jsx(li,{actions:I,table:U,children:t.commandBar})}),a.jsx("div",{className:"yk-table-page__table",children:a.jsx(Us,{ref:te,metaFun:r,dataFun:je,rowActionsFunc:i,pageSize:l,pageSizes:c,showCheckbox:u,columnResizable:d,stickyHeader:y,loadCustomConfigFun:p,saveCustomConfigFun:w,exportPageSize:k,exportorFunc:C,collectPageSize:A,maxCollectCount:O,collectorFunc:q,collectorTitle:W,rowKey:ie,viewMode:S,onDataLoaded:t.onDataLoaded,onUpdateViewMode:t.onUpdateViewMode,onUpdateShowCheckbox:t.onUpdateShowCheckbox,onUpdateColumnResizable:t.onUpdateColumnResizable,onUpdateStickyHeader:t.onUpdateStickyHeader,onSelectionChange:De,card:Bs(t.card),list:Bs(t.list),empty:gr(t.empty),loading:gr(t.loading),footer:gr(t.footer)})})]})});oi.displayName="YsTablePage";const ci=o.forwardRef(function(t,n){const{dataFun:r,pageSize:s=20,threshold:i=100,rowKey:l="id",height:c="100%",immediate:u=!0,showCheckbox:d=!1,metaFun:y,exportorFunc:p,exportPageSize:w=1e3}=t,[k,C]=o.useState([]),[A,O]=o.useState(!1),[q,W]=o.useState(!1),[ie,S]=o.useState(!0),[I,H]=o.useState(null),[Me,ve]=o.useState(0),[pe,Oe]=o.useState(!1),[ne,ue]=o.useState(null),ce=o.useRef([]),J=o.useRef(!1),me=o.useRef(!1),G=o.useRef(!0),h=o.useRef(null),N=o.useRef(t.dataFun),T=o.useRef(t.metaFun),U=o.useRef(s),de=o.useRef({onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange});N.current=t.dataFun,T.current=t.metaFun,U.current=s,h.current=ne,de.current={onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange};const Z=ee.useSelection({rows:k,rowKey:l}),te=o.useRef(Z);te.current=Z;const F=o.useRef(!1);o.useEffect(()=>{var B,he;if(!F.current){F.current=!0;return}(he=(B=de.current).onSelectionChange)==null||he.call(B,[...Z.selectedRows])},[Z.selectedRows]);const Ce=o.useCallback(async B=>{var he,re,ke,Je;if(B){if(me.current||J.current||!G.current)return;me.current=!0,W(!0)}else{if(J.current)return;J.current=!0,O(!0),H(null)}try{const _t=B?ce.current.length:0,it=await N.current({limit:U.current,offset:_t}),Et=it.items,It=B?[...ce.current,...Et]:Et;ce.current=It,C(It);const Ft=it.hasNext??!1;G.current=Ft,S(Ft),it.totalCount!=null&&(ve(it.totalCount),Oe(!0)),(re=(he=de.current).onDataLoaded)==null||re.call(he,it,B)}catch(_t){H(_t),(Je=(ke=de.current).onError)==null||Je.call(ke,_t)}finally{B?(me.current=!1,W(!1)):(J.current=!1,O(!1))}},[]),De=o.useCallback(()=>{Ce(!0)},[Ce]),je=o.useCallback(()=>{G.current=!0,S(!0),Ce(!1)},[Ce]),R=o.useCallback(async()=>{const B=T.current;if(!B){ue(null);return}try{ue(await B())}catch{ue(null)}},[]),X=o.useRef(null),m=o.useRef(null);o.useEffect(()=>{const B=X.current,he=m.current;if(!B||!he||typeof IntersectionObserver>"u")return;const re=new IntersectionObserver(ke=>{ke.some(Je=>Je.isIntersecting)&&G.current&&!J.current&&!me.current&&De()},{root:B,rootMargin:`0px 0px ${i}px 0px`,threshold:0});return re.observe(he),()=>re.disconnect()},[i,De]),o.useEffect(()=>{R(),u&&Ce(!1)},[]);const $=o.useRef(t.dataFun);o.useEffect(()=>{$.current!==t.dataFun&&($.current=t.dataFun,je())},[t.dataFun,je]);const He=o.useRef(t.metaFun);o.useEffect(()=>{He.current!==t.metaFun&&(He.current=t.metaFun,R())},[t.metaFun,R]);const yt=o.useMemo(()=>{if(ne)return ne.columns.map((re,ke)=>({column:re,index:ke})).filter(({column:re})=>re.showForDisplay!==!1).sort((re,ke)=>(re.column.displayOrder??re.index)-(ke.column.displayOrder??ke.index)).map(({column:re})=>re);const B=new Set,he=[];for(const re of k)for(const ke of Object.keys(re))B.has(ke)||(B.add(ke),he.push({propertyPath:ke}));return he},[ne,k]),tn=(ne==null?void 0:ne.displayName)??"数据",fe=ee.useExportExcel({props:{dataFun:r,exportSelected:d,exportorFunc:p},tableName:tn,columns:yt,currentRows:k,selectedRows:Z.selectedRows,total:Me,totalKnown:pe,exportPageSize:w,hasMorePage:ie,pageScopeLabel:"导出当前已加载"}),Ye=o.useRef(fe);Ye.current=fe;const st=o.useCallback(()=>{Ye.current.onExportClick()},[]);o.useImperativeHandle(n,()=>({get items(){return ce.current},get loading(){return J.current},get loadingMore(){return me.current},get hasMore(){return G.current},get meta(){return h.current},get selectedRows(){return te.current.selectedRows},get rows(){return ce.current},reload:je,refresh:je,loadNextPage:De,isRowSelected:B=>te.current.isRowSelected(B),toggleRowSelection:(B,he)=>te.current.toggleRowSelection(B,he),clearSelection:()=>te.current.clearSelection(),selectAllOnPage:()=>te.current.selectAllOnPage(),invertSelectionOnPage:()=>te.current.invertSelectionOnPage(),openExportDialog:st}),[De,st,je]);function nn(B,he){const re=t.children;return typeof re=="function"?re(B,he):re??a.jsx("pre",{className:"yk-infinite-list__item-json",children:JSON.stringify(B,null,2)})}const gt=t.error,at=typeof gt=="function"?gt({error:I}):gt;return a.jsxs("div",{ref:X,className:"yk-infinite-list",style:{height:c},children:[k.map((B,he)=>a.jsxs("div",{className:`yk-infinite-list__item${d&&Z.isRowSelected(B)?" is-selected":""}`,children:[d?a.jsx(f.Checkbox,{className:"yk-infinite-list__item-checkbox",checked:Z.isRowSelected(B),onChange:re=>Z.toggleRowSelection(B,re.target.checked)}):null,a.jsx("div",{className:"yk-infinite-list__item-body",children:nn(B,he)})]},String(B[l]))),I?a.jsx("div",{className:"yk-infinite-list__status",children:at??a.jsx(f.Empty,{description:`加载失败:${String(I)}`,children:a.jsx(f.Button,{type:"primary",onClick:je,children:"重试"})})}):!A&&k.length===0?a.jsx("div",{className:"yk-infinite-list__status",children:t.empty??a.jsx(f.Empty,{description:"暂无数据"})}):null,a.jsx("div",{ref:m,className:"yk-infinite-list__sentinel"}),q?a.jsx("div",{className:"yk-infinite-list__loading-more",children:t.loading??a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"yk-infinite-list__spinner"}),a.jsx("span",{children:"加载中..."})]})}):null,!ie&&k.length>0&&!A?a.jsx("div",{className:"yk-infinite-list__no-more",children:t.noMore??a.jsx("span",{children:"— 没有更多了 —"})}):null,a.jsx($s,{open:fe.exportDialogVisible,options:fe.exportOptions,exporting:fe.exporting,fetched:fe.exportFetched,total:fe.exportTotal,totalKnown:fe.exportTotalKnown,percent:fe.exportPercent,etaSeconds:fe.exportEtaSeconds,cancelledVisible:fe.exportCancelledVisible,cancelledRows:fe.exportCancelledRows,onExport:B=>void fe.doExport(B),onCancelExport:fe.cancelExport,onKeepPartial:()=>void fe.keepPartialExport(),onDiscardPartial:()=>void fe.discardPartialExport(),onClose:fe.closeExportDialog})]})});ci.displayName="YsInfiniteList";function Xd(e){return e.icon?a.jsx("i",{className:"yk-main-panel__menu-icon",children:e.icon}):void 0}function jr(e){const t=[];for(const n of e){const r=Xd(n),s=a.jsx("span",{className:"yk-main-panel__menu-text",children:n.label});n.children&&n.children.length>0?t.push({key:n.key,icon:r,label:s,children:jr(n.children)}):t.push({key:n.key,icon:r,label:s})}return t}function ef(){return a.jsx("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true",className:"yk-main-panel__search-icon",children:a.jsx("path",{fill:"currentColor",d:"M909.098 839.904l-181.22-181.248a341.5 341.5 0 1 0-47.734 48.58l180.56 180.588a33.92 33.92 0 0 0 48.394-47.92zM454.4 745.6a291.2 291.2 0 1 1 291.2-291.2 291.2 291.2 0 0 1-291.2 291.2z"})})}function tf({nodesFunc:e,componentMap:t,defaultActive:n="",showMenuSearch:r=!0,menuKeyword:s="",onUpdateMenuKeyword:i,onTabChange:l}){const[c,u]=o.useState(!1),[d,y]=o.useState(s);o.useEffect(()=>{y(s)},[s]);const p=h=>{y(h),i==null||i(h)},w=d.trim().length>0,{nodes:k,menuLoading:C}=ee.useMainPanelNodes({nodesFunc:e}),{openTabs:A,activeKey:O,setActiveKey:q,openTab:W,removeTab:ie,getComponent:S}=ee.useMainPanelTabs({componentMap:t}),I=o.useMemo(()=>ee.filterNodesByKeyword(k,d),[k,d]),H=o.useMemo(()=>ee.collectGroupKeys(I),[I]),Me=o.useMemo(()=>jr(k),[k]),ve=o.useMemo(()=>jr(I),[I]),pe=({key:h})=>{const N=ee.findNode(k,h);N&&!ee.isGroupNode(N)&&W(N)},Oe=o.useRef(k),ne=o.useRef(!1),ue=o.useRef(!1);o.useEffect(()=>{if(!ne.current)if(k!==Oe.current)ne.current=!0;else return;if(ue.current||(ue.current=!0,!n))return;const h=ee.findNode(k,n);h&&!ee.isGroupNode(h)&&W(h)},[k,n,W]);const ce=o.useRef(O),J=o.useRef(l);J.current=l,o.useEffect(()=>{var h;ce.current!==O&&(ce.current=O,(h=J.current)==null||h.call(J,O))},[O]);const me=A.map(h=>{const N=h.componentPath?S(h.componentPath):null;return{key:h.key,label:h.label,closable:!0,forceRender:!0,children:N?a.jsx(o.Suspense,{fallback:a.jsx("div",{className:"yk-main-panel__loading",children:a.jsx(f.Spin,{size:"small"})}),children:a.jsx(N,{...h.props??{}})}):null}}),G="yk-main-panel__menu";return a.jsxs("div",{className:"yk-main-panel",children:[a.jsxs("aside",{className:`yk-main-panel__aside${c?" is-collapsed":""}`,children:[a.jsxs("div",{className:"yk-main-panel__aside-header",children:[a.jsx(f.Button,{type:"text",size:"small",className:"yk-main-panel__collapse-btn",title:c?"展开菜单":"折叠菜单",onClick:()=>u(h=>!h),children:"☰"}),r&&!c&&a.jsx(f.Input,{className:"yk-main-panel__aside-search",size:"small",allowClear:!0,placeholder:"搜索功能","aria-label":"搜索功能",value:d,prefix:a.jsx(ef,{}),onChange:h=>p(h.target.value)})]}),a.jsx("div",{className:"yk-main-panel__menu-wrap",children:a.jsx(f.Spin,{spinning:C,size:"small",children:w?a.jsxs(a.Fragment,{children:[a.jsx(f.Menu,{mode:"inline",className:G,inlineCollapsed:c,items:ve,selectedKeys:O?[O]:[],defaultOpenKeys:H,onClick:pe},`search-${d}`),I.length===0&&!C&&a.jsx("div",{className:"yk-main-panel__menu-empty",children:"未找到匹配的功能"})]}):a.jsx(f.Menu,{mode:"inline",className:G,inlineCollapsed:c,items:Me,selectedKeys:O?[O]:[],onClick:pe},"full")})})]}),a.jsx("main",{className:"yk-main-panel__main",children:A.length>0?a.jsx(f.Tabs,{className:"yk-main-panel__tabs",type:"editable-card",hideAdd:!0,activeKey:O,items:me,onChange:h=>q(h),onEdit:(h,N)=>{N==="remove"&&typeof h!="object"&&ie(h)}}):a.jsx("div",{className:"yk-main-panel__empty",children:a.jsx(f.Empty,{description:"暂无打开的功能,从左侧菜单选择"})})})]})}function pn(e){ee.useFilterItem(e.api);const t=e.minWidth??200;return a.jsxs("div",{className:"yk-filter-item",style:{minWidth:`${t}px`},children:[a.jsx("label",{className:"yk-filter-item__label",children:e.label}),a.jsx("div",{className:"yk-filter-item__control",children:e.children})]})}const nf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useTextFilterItem(t),c=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);return o.useImperativeHandle(n,()=>c,[c]),a.jsx(pn,{label:t.label,api:c,children:a.jsx(f.Input,{value:r,onChange:u=>s(u.target.value),placeholder:t.placeholder,allowClear:!0})})}),rf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useDateFilterItem(t),c=t.valueFormat??"YYYY-MM-DD",u=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);return o.useImperativeHandle(n,()=>u,[u]),a.jsx(pn,{label:t.label,api:u,children:a.jsx(f.DatePicker,{value:r?x(r):null,format:c,onChange:(d,y)=>s(typeof y=="string"?y:""),placeholder:t.placeholder,allowClear:!0})})}),sf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useDateRangeFilterItem({propertyPath:t.propertyPath,defaultValue:t.defaultValue}),c=t.valueFormat??"YYYY-MM-DD",u=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);o.useImperativeHandle(n,()=>u,[u]);const d=r&&r.length===2?[x(r[0]),x(r[1])]:null;return a.jsx(pn,{label:t.label,api:u,minWidth:240,children:a.jsx(f.DatePicker.RangePicker,{value:d,format:c,onChange:(y,p)=>{s(y?[p[0],p[1]]:null)},placeholder:[t.startPlaceholder??"开始日期",t.endPlaceholder??"结束日期"],disabledDate:t.disabledDate?y=>{var p;return((p=t.disabledDate)==null?void 0:p.call(t,y.toDate()))??!1}:void 0,allowClear:!0})})}),af=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useEnumFilterItem({op:t.op,propertyPath:t.propertyPath,defaultValue:t.defaultValue,multiple:t.multiple}),[c,u]=o.useState([]),[d,y]=o.useState(!1),p=o.useRef(t.optionsSource);p.current=t.optionsSource,o.useEffect(()=>{let C=!0;return y(!0),p.current().then(A=>{C&&u(A)}).finally(()=>{C&&y(!1)}),()=>{C=!1}},[]);const w=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);o.useImperativeHandle(n,()=>w,[w]);const k=c.map(C=>({label:C.label,value:C.value}));return a.jsx(pn,{label:t.label,api:w,children:t.multiple?a.jsx(f.Select,{mode:"multiple",value:Array.isArray(r)?r:[],options:k,onChange:C=>s(C),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d}):a.jsx(f.Select,{value:r??void 0,options:k,onChange:C=>s(C??null),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d})})});function ui(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function lf({open:e,row:t,columns:n,saver:r,onClose:s,onSaved:i}){const[l,c]=o.useState({}),[u,d]=o.useState([]);o.useEffect(()=>{if(!e||!t)return;const w={};for(const k of n)w[k.name]=ui(t.data[k.name]);c(w),d([])},[e,t,n]);function y(){s==null||s()}function p(){if(!t)return;const w={};for(const A of n)w[A.name]=l[A.name]??"";const{row:k,errors:C}=r(t,w);d(C),!(C.length>0)&&(i==null||i(k),y())}return a.jsxs(f.Modal,{open:e,title:t?`编辑第 ${t.rowNumber} 行`:"编辑数据行",width:480,maskClosable:!1,destroyOnClose:!0,onCancel:y,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{onClick:y,children:"取消"}),a.jsx(f.Button,{type:"primary",onClick:p,children:"保存并重新校验"})]}),children:[u.length>0?a.jsx(f.Alert,{className:"yk-import-row-edit-dialog__alert",type:"error",showIcon:!0,message:a.jsx(a.Fragment,{children:u.map((w,k)=>a.jsx("div",{children:w},k))})}):null,a.jsx(f.Form,{labelCol:{flex:"0 0 92px"},wrapperCol:{flex:"auto"},children:n.map(w=>a.jsx(f.Form.Item,{label:w.name,required:!w.optional,children:a.jsx(f.Input,{value:l[w.name]??"",placeholder:w.optional?"可留空":`请输入${w.name}`,onChange:k=>c(C=>({...C,[w.name]:k.target.value})),onPressEnter:p})},w.name))})]})}const _r={valid:{label:"待处理"},invalid:{label:"校验失败",color:"red"},processing:{label:"处理中",color:"orange"},success:{label:"成功",color:"green"},failed:{label:"失败",color:"red"}};function of(e){const t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t} 秒`;const n=Math.floor(t/60),r=t%60;return r>0?`${n} 分 ${r} 秒`:`${n} 分`}function Nn(e){var t;return Array.from(((t=e.dataTransfer)==null?void 0:t.types)??[]).includes("Files")}function cf(){return a.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 20h9"}),a.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function uf(){return a.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const df=o.forwardRef(function(t,n){var xn;const{columns:r,processor:s,parser:i,accept:l=".xlsx",autoScroll:c=!0,title:u,maxHeight:d}=t,{rows:y,fileName:p,sheetName:w,loading:k,processing:C,stopping:A,processingTotal:O,progressDone:q,progressSuccess:W,progressFailed:ie,hasData:S,invalidCount:I,selectedCount:H,pendingCount:Me,loadFile:ve,syncSelection:pe,saveRowEdit:Oe,removeRow:ne,startProcessing:ue,stopProcessing:ce,clear:J}=ee.useImportExcel({columns:r,processor:s,parser:i}),me=o.useRef(null),G=o.useRef(null),h=o.useRef(w);h.current=w;const[N,T]=o.useState(0),U=N>0;function de(v){const b=l.split(",").map(ye=>ye.trim().toLowerCase()).filter(Boolean);if(b.length===0)return!0;const Q=v.name.toLowerCase();return b.some(ye=>Q.endsWith(ye))}async function Z(v){var b;if(!k){if(!de(v)){f.message.error(`仅支持 ${l} 格式的文件`);return}try{const Q=await ve(v);(b=t.onLoaded)==null||b.call(t,Q),setTimeout(()=>{const ye=h.current;f.message.success(`已加载 ${Q.length} 行${ye?`(工作表「${ye}」)`:""}`)},0)}catch(Q){f.message.error(Q instanceof Error?Q.message:String(Q))}}}async function te(v){var ye;const b=v.target,Q=(ye=b.files)==null?void 0:ye[0];b.value="",Q&&await Z(Q)}function F(){var v;(v=me.current)==null||v.click()}function Ce(v){Nn(v)&&T(b=>b+1)}function De(v){Nn(v)&&(v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="copy"))}function je(v){Nn(v)&&T(b=>Math.max(0,b-1))}function R(v){var Q,ye;if(!Nn(v))return;v.preventDefault(),T(0);const b=(ye=(Q=v.dataTransfer)==null?void 0:Q.files)==null?void 0:ye[0];b&&Z(b)}const X=o.useRef(0),[m,$]=o.useState(0);o.useEffect(()=>{if(!C)return;X.current=Date.now(),$(Date.now());const v=setInterval(()=>$(Date.now()),500);return()=>clearInterval(v)},[C]);const He=O<=0?0:Math.min(100,q/O*100),yt=!C||q===0?"预计剩余 计算中…":`预计剩余 ${of((m-X.current)/q*(O-q))}`,[tn,fe]=o.useState(360);o.useEffect(()=>{const v=G.current;if(!v)return;const b=()=>{var At;const ye=((At=v.querySelector(".ant-table-thead"))==null?void 0:At.getBoundingClientRect().height)??39;let Ct=Math.max(120,Math.floor(v.clientHeight-ye-1));typeof d=="number"&&(Ct=Math.min(Ct,d)),fe(Ct)};b();const Q=new ResizeObserver(b);return Q.observe(v),()=>Q.disconnect()},[d,S]);const Ye=((xn=y.find(v=>v.status==="processing"))==null?void 0:xn.rowNumber)??null;o.useEffect(()=>{var kn,wn;if(Ye===null||!c)return;const v=(kn=G.current)==null?void 0:kn.querySelector(".ant-table-body"),b=(wn=G.current)==null?void 0:wn.querySelector(`.ant-table-tbody tr[data-row-key="${Ye}"]`);if(!v||!b)return;const Q=v.getBoundingClientRect(),ye=b.getBoundingClientRect(),Ct=Math.max(0,v.scrollHeight-v.clientHeight),At=v.scrollTop+(ye.top-Q.top)-(v.clientHeight-ye.height)/2;v.scrollTop=Math.min(Ct,Math.max(0,Math.round(At)))},[Ye,c]);const st=y.filter(v=>v.selected).map(v=>v.rowNumber);function nn(v){return v.status!=="invalid"}function gt(v){var Q;const b=y.filter(ye=>v.includes(ye.rowNumber));pe(b),(Q=t.onSelectionChange)==null||Q.call(t,b)}async function at(){var v;try{const b=await ue();if(!b)return;if((v=t.onProcessed)==null||v.call(t,b),b.stopped){const Q=b.total-b.success-b.failed;f.message.warning(`已停止:成功 ${b.success} 行,失败 ${b.failed} 行,剩余 ${Q} 行未处理(可再次「开始处理」续跑)`)}else b.failed===0?f.message.success(`全部处理完成,共 ${b.success} 行`):f.message.warning(`处理完成:成功 ${b.success} 行,失败 ${b.failed} 行`)}catch(b){f.message.error(b instanceof Error?b.message:String(b))}}const[B,he]=o.useState(!1),[re,ke]=o.useState(null);function Je(v){return!C&&(v.status==="invalid"||v.status==="failed")}function _t(v){Je(v)&&(ke(v),he(!0))}function it(v){var b;(b=t.onRowUpdate)==null||b.call(t,v),f.message.success(`第 ${v.rowNumber} 行已修正,可重新处理`)}function Et(v){Je(v)&&f.Modal.confirm({title:"删除数据行",content:`确定删除第 ${v.rowNumber} 行吗?删除后不可恢复。`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{var b;ne(v),(b=t.onRowRemove)==null||b.call(t,v),f.message.success(`已删除第 ${v.rowNumber} 行`)}})}o.useImperativeHandle(n,()=>({openFilePicker:F,startProcessing:at,stopProcessing:ce,clear:J}));const It=Object.keys(_r).map(v=>({text:`${_r[v].label}(${y.filter(b=>b.status===v).length})`,value:v})),Ft=[{title:"行号",key:"rowNumber",width:70,align:"center",fixed:"left",render:(v,b,Q)=>a.jsx("span",{title:`Excel 第 ${b.rowNumber} 行`,children:Q+1})},...r.map(v=>({title:v.name,key:v.name,width:120,ellipsis:{showTitle:!0},render:(b,Q)=>ui(Q.data[v.name])})),{title:"状态",key:"status",dataIndex:"status",width:200,fixed:"right",className:"yk-import-excel__status-cell",filters:It,filterMultiple:!1,onFilter:(v,b)=>b.status===v,render:(v,b)=>{const Q=_r[b.status];return a.jsxs(a.Fragment,{children:[a.jsxs(f.Tag,{color:Q.color,children:[b.status==="processing"?a.jsx("span",{className:"yk-import-excel__spin"}):null,Q.label]}),b.status==="invalid"?a.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.errors.join(";")}):b.message?a.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.message}):null]})}},{title:"操作",key:"action",width:110,align:"center",fixed:"right",render:(v,b)=>Je(b)?a.jsxs("div",{className:"yk-import-excel__actions",children:[a.jsx(f.Button,{type:"link",size:"small",icon:a.jsx(cf,{}),onClick:()=>_t(b),children:"编辑"}),a.jsx(f.Button,{type:"link",size:"small",danger:!0,icon:a.jsx(uf,{}),onClick:()=>Et(b),children:"删除"})]}):a.jsx("span",{className:"yk-import-excel__action-placeholder",children:"—"})}],tr={selectedRowKeys:st,columnWidth:44,getCheckboxProps:v=>({disabled:!nn(v)}),onChange:gt};return a.jsxs("div",{className:"yk-import-excel",onDragEnter:Ce,onDragOver:De,onDragLeave:je,onDrop:R,children:[a.jsx("input",{ref:me,className:"yk-import-excel__file",type:"file",accept:l,onChange:te}),u?a.jsx("div",{className:"yk-import-excel__title",children:u}):null,a.jsxs("div",{className:"yk-import-excel__toolbar",children:[a.jsx(f.Button,{type:"primary",loading:k,onClick:F,children:"选择 Excel 文件"}),a.jsxs(f.Button,{type:"primary",loading:C,disabled:Me===0,onClick:at,children:["开始处理",Me>0?`(${Me} 行)`:""]}),C?a.jsx(f.Button,{danger:!0,disabled:A,onClick:ce,children:A?"正在停止…":"停止"}):null,a.jsx(f.Button,{disabled:!S||C,onClick:J,children:"清空"}),p?a.jsxs("span",{className:"yk-import-excel__file-name",title:p,children:[p,w?`(工作表:${w})`:""]}):null,S?a.jsxs("div",{className:"yk-import-excel__stats",children:[a.jsxs("span",{className:"yk-import-excel__stat",children:["共 ",y.length," 行"]}),a.jsxs("span",{className:"yk-import-excel__stat",children:["已选 ",H]}),a.jsxs("span",{className:"yk-import-excel__stat yk-import-excel__stat--danger",children:["校验失败 ",I]})]}):null]}),C?a.jsxs("div",{className:"yk-import-excel__progress",children:[a.jsx(f.Progress,{className:"yk-import-excel__progress-bar",percent:He,status:"active",format:()=>`${q}/${O}`}),a.jsxs("span",{className:"yk-import-excel__progress-meta",children:["成功 ",W,a.jsxs("span",{className:"yk-import-excel__danger-text",children:[" ","/ 失败 ",ie]})]}),a.jsx("span",{className:"yk-import-excel__progress-eta",children:yt})]}):null,a.jsx("div",{ref:G,className:"yk-import-excel__body",children:a.jsx(f.Spin,{spinning:k,wrapperClassName:"yk-import-excel__loading",children:S?a.jsx(f.Table,{className:"yk-import-excel__table",rowKey:"rowNumber",columns:Ft,dataSource:y,bordered:!0,size:"small",pagination:!1,rowSelection:tr,scroll:{x:"max-content",y:tn},rowClassName:(v,b)=>b%2===1?"yk-import-excel__row-alt":""}):a.jsxs("div",{className:"yk-import-excel__empty",onClick:F,children:[a.jsxs("svg",{className:"yk-import-excel__empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("path",{d:"M12 18v-6"}),a.jsx("polyline",{points:"9.5 14.5 12 12l2.5 2.5"})]}),a.jsx("p",{className:"yk-import-excel__empty-title",children:"点击选择 Excel 文件,或将文件拖拽到此处"}),a.jsxs("p",{className:"yk-import-excel__empty-hint",children:["支持 ",l," 格式,首行需为表头"]})]})})}),U?a.jsx("div",{className:"yk-import-excel__drop-mask",children:a.jsxs("div",{className:"yk-import-excel__drop-tip",children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 15V3"}),a.jsx("polyline",{points:"7 8 12 3 17 8"}),a.jsx("path",{d:"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4"})]}),a.jsx("span",{children:"松开鼠标,加载 Excel 文件"})]})}):null,a.jsx(lf,{open:B,row:re,columns:r,saver:Oe,onClose:()=>he(!1),onSaved:it})]})});var Or,Rn=Vs;if(process.env.NODE_ENV==="production")Or=Rn.createRoot,Rn.hydrateRoot;else{var Hs=Rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Or=function(e,t){Hs.usingClientEntryPoint=!0;try{return Rn.createRoot(e,t)}finally{Hs.usingClientEntryPoint=!1}}}function ff(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function hf(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),a.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10"})]})}const mf=o.forwardRef(function(t,n){const{title:r,width:s,heightValue:i,component:l,componentProps:c,actions:u,onCancel:d,onClosed:y,closeOnClickModal:p,closeOnPressEscape:w,maximizable:k,defaultMaximized:C,contentRef:A,modalHandle:O,destroy:q}=t,[W,ie]=o.useState(!0),[S,I]=o.useState(-1),[H,Me]=o.useState(k&&C),ve=()=>{k&&Me(G=>!G)},pe=()=>{ie(!1)},Oe=()=>{S>=0||(d==null||d(),ie(!1))},ne=async(G,h)=>{if(!(S>=0)){I(h);try{await G.execute(O)}finally{I(-1)}}};o.useImperativeHandle(n,()=>({close:pe,toggleMaximize:ve,isMaximized:()=>H}),[k,H]);const ue=k?a.jsxs("div",{className:"yk-modal__title-row",children:[a.jsx("span",{className:"yk-modal__title-text",children:r}),a.jsx(f.Button,{type:"text",size:"small",className:"yk-modal__maximize",title:H?"还原":"最大化","aria-label":H?"还原":"最大化",onClick:ve,children:H?a.jsx(hf,{}):a.jsx(ff,{})})]}):r,ce=u&&u.length>0?a.jsx("div",{className:"yk-modal__footer",children:u.map((G,h)=>{const{type:N,danger:T}=Nr(G.type);return a.jsx(f.Button,{type:N,danger:T,title:G.desc,disabled:S>=0&&S!==h,loading:S===h,onClick:()=>void ne(G,h),icon:G.icon?a.jsx("span",{className:"yk-modal__action-icon",children:Hn(G.icon)}):void 0,children:G.desc},G.name)})}):null,J={...H?{top:0}:{},...i&&!H?{"--yk-modal-height":i}:{}},me=["yk-modal",H?"yk-modal--maximized":i?"yk-modal--fixed-height":""].filter(Boolean).join(" ");return a.jsx(f.Modal,{open:W,title:ue,width:s,style:J,wrapClassName:me,closable:S<0,maskClosable:p,keyboard:w,destroyOnClose:!0,onCancel:Oe,afterClose:()=>{y==null||y(),q()},footer:ce,children:o.createElement(l,{...c??{},onClose:pe,ref:A})})});function yf(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function di(e){const{title:t="",width:n="500px",height:r,component:s,props:i,actions:l,onCancel:c,onClosed:u,closeOnClickModal:d=!1,closeOnPressEscape:y=!1,maximizable:p=!1,defaultMaximized:w=!1}=e,k=document.createElement("div");document.body.appendChild(k);const C=Or(k);let A=!1;const O=()=>{A||(A=!0,C.unmount(),k.remove())},q={current:null},W={current:null},ie={close:()=>{var S;return(S=q.current)==null?void 0:S.close()},toggleMaximize:()=>{var S;return(S=q.current)==null?void 0:S.toggleMaximize()},isMaximized:()=>{var S;return((S=q.current)==null?void 0:S.isMaximized())??!1},getContentInstance:()=>W.current??null};return C.render(a.jsx(mf,{ref:q,title:t,width:n,heightValue:yf(r),component:s,componentProps:i,actions:l,onCancel:c,onClosed:u,closeOnClickModal:d,closeOnPressEscape:y,maximizable:p,defaultMaximized:w,contentRef:W,modalHandle:ie,destroy:O})),ie}function gf(e){const{confirmText:t="确定",cancelText:n="取消",confirmType:r="primary",onConfirm:s,...i}=e;return di({...i,actions:[{name:"cancel",desc:n,execute:c=>c.close()},{name:"confirm",desc:t,type:r,execute:async c=>{if(!s){c.close();return}await s(c)!==!1&&c.close()}}]})}Object.defineProperty(exports,"fromArray",{enumerable:!0,get:()=>P.fromArray});Object.defineProperty(exports,"fromBool",{enumerable:!0,get:()=>P.fromBool});Object.defineProperty(exports,"fromObjectItems",{enumerable:!0,get:()=>P.fromObjectItems});Object.defineProperty(exports,"fromOptions",{enumerable:!0,get:()=>P.fromOptions});exports.YsAdvancedConditionGroup=ns;exports.YsAdvancedFilterPanel=ri;exports.YsAdvancedValueEditor=ti;exports.YsCommandBar=li;exports.YsDateFilterItem=rf;exports.YsDateRangeFilterItem=sf;exports.YsEnumFilterItem=af;exports.YsFilterItemLayout=pn;exports.YsFilterPanel=ii;exports.YsImportExcel=df;exports.YsInfiniteList=ci;exports.YsMainPanel=tf;exports.YsRootFilterPanel=si;exports.YsTable=Us;exports.YsTableActionMenuButton=rs;exports.YsTablePage=oi;exports.YsTextFilterItem=nf;exports.openDialog=gf;exports.openModal=di;
10
+ `+new Error().stack),Ys[e]=!0)}x.suppressDeprecationWarnings=!1;x.deprecationHandler=null;function rt(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}var Ts={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ze(e){return typeof e=="string"?Ts[e]||Ts[e.toLowerCase()]:void 0}function Er(e){var t={},n,r;for(r in e)$(e,r)&&(n=Ze(r),n&&(t[n]=e[r]));return t}var El={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Il(e){var t=[],n;for(n in e)$(e,n)&&t.push({unit:n,priority:El[n]});return t.sort(function(r,s){return r.priority-s.priority}),t}function Qe(e,t,n){var r=""+Math.abs(e),s=t-r.length,i=e>=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+r}var Ir=/(\[[^\[]*\])|(\\e)|(\\)?(eHHmm|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Dn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,hr={},Ut={};function O(e,t,n,r){var s=r;typeof r=="string"&&(s=function(){return this[r]()}),e&&(Ut[e]=s),t&&(Ut[t[0]]=function(){return Qe(s.apply(this,arguments),t[1],t[2])}),n&&(Ut[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function Fl(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Al(e){var t=e.match(Ir),n,r;for(n=0,r=t.length;n<r;n++)Ut[t[n]]?t[n]=Ut[t[n]]:t[n]=Fl(t[n]);return function(s){var i="",l;for(l=0;l<r;l++)i+=rt(t[l])?t[l].call(s,e):t[l];return i}}function Pn(e,t){if(!e.isValid())return e.localeData().invalidDate();t=fa(t,e.localeData());var n="$"+t;return $(hr,n)||(hr[n]=Al(t)),hr[n](e)}function fa(e,t){var n=5;function r(s){return t.longDateFormat(s)||s}for(Dn.lastIndex=0;n>=0&&Dn.test(e);)e=e.replace(Dn,r),Dn.lastIndex=0,n-=1;return e}var ha=/\d/,He=/\d\d/,ma=/\d{3}/,Fr=/\d{4}/,Un=/[+-]?\d{6}/,le=/\d\d?/,ya=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,zn=/\d{1,3}/,Lr=/\d{1,4}/,Gn=/[+-]?\d{1,6}/,Kt=/\d+/,Qn=/[+-]?\d+/,Ll=/Z|[+-]\d\d:?\d\d/gi,qn=/Z|[+-]\d\d(?::?\d\d)?/gi,Wl=/[+-]?\d+(\.\d{1,3})?/,vn=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Jt=/^[1-9]\d?/,Wr=/^([1-9]\d|\d)/,Fn;Fn={};function M(e,t,n){Fn[e]=rt(t)?t:function(r,s){return r&&n?n:t}}function Bl(e,t){return $(Fn,e)?Fn[e](t._strict,t._locale):new RegExp(Hl(e))}function Hl(e){return ut(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,s,i){return n||r||s||i}))}function ut(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ue(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function L(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Ue(t)),n}var kr={};function ae(e,t){var n,r=t,s;for(typeof e=="string"&&(e=[e]),ft(t)&&(r=function(i,l){l[t]=L(i)}),s=e.length,n=0;n<s;n++)kr[e[n]]=r}function Xt(e,t){ae(e,function(n,r,s,i){s._w=s._w||{},t(n,s._w,s,i)})}function Vl(e,t,n){t!=null&&$(kr,e)&&kr[e](t,n._a,n,e)}function Zn(e){return e%4===0&&e%100!==0||e%400===0}var ve=0,Le=1,Ee=2,we=3,Ge=4,ct=5,Ot=6,$l=7,Ul=8;O("Y",0,0,function(){var e=this.year();return e<=9999?Qe(e,4):"+"+e});O(0,["YY",2],0,function(){return this.year()%100});O(0,["YYYY",4],0,"year");O(0,["YYYYY",5],0,"year");O(0,["YYYYYY",6,!0],0,"year");M("Y",Qn);M("YY",le,He);M("YYYY",Lr,Fr);M("YYYYY",Gn,Un);M("YYYYYY",Gn,Un);ae(["YYYYY","YYYYYY"],ve);ae("YYYY",function(e,t){t[ve]=e.length===2?x.parseTwoDigitYear(e):L(e)});ae("YY",function(e,t){t[ve]=x.parseTwoDigitYear(e)});ae("Y",function(e,t){t[ve]=parseInt(e,10)});function on(e){return Zn(e)?366:365}x.parseTwoDigitYear=function(e){return L(e)+(L(e)>68?1900:2e3)};var ga=en("FullYear",!0);function zl(){return Zn(this.year())}function en(e,t){return function(n){return n!=null?(_a(this,e,n),x.updateOffset(this,t),this):dn(this,e)}}function dn(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function _a(e,t,n){var r,s,i,l,c;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(s?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(s?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(s?r.setUTCHours(n):r.setHours(n));case"Date":return void(s?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}i=n,l=e.month(),c=e.date(),c=c===29&&l===1&&!Zn(i)?28:c,s?r.setUTCFullYear(i,l,c):r.setFullYear(i,l,c)}}function Gl(e){return e=Ze(e),rt(this[e])?this[e]():this}function Ql(e,t){if(typeof e=="object"){e=Er(e);var n=Il(e),r,s=n.length;for(r=0;r<s;r++)this[n[r].unit](e[n[r].unit])}else if(e=Ze(e),rt(this[e]))return this[e](t);return this}function ql(e,t){return(e%t+t)%t}var _e;Array.prototype.indexOf?_e=Array.prototype.indexOf:_e=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Br(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ql(t,12);return e+=(t-n)/12,n===1?Zn(e)?29:28:31-n%7%2}O("M",["MM",2],"Mo",function(){return this.month()+1});O("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});O("MMMM",0,0,function(e){return this.localeData().months(this,e)});M("M",le,Jt);M("MM",le,He);M("MMM",function(e,t){return t.monthsShortRegex(e)});M("MMMM",function(e,t){return t.monthsRegex(e)});ae(["M","MM"],function(e,t){t[Le]=L(e)-1});ae(["MMM","MMMM"],function(e,t,n,r){var s=n._locale.monthsParse(e,r,n._strict);s!=null?t[Le]=s:E(n).invalidMonth=e});var Zl="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),va="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),pa=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Kl=vn,Jl=vn,Es=["monthsParse","longMonthsParse","shortMonthsParse","monthsRegex","monthsShortRegex","monthsStrictRegex","monthsShortStrictRegex"];function Xl(e,t){var n,r;for(n=0;n<Es.length;n++)r=Es[n],$(t,r)||delete e["_"+r]}function eo(e,t){return e?Ke(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||pa).test(t)?"format":"standalone"][e.month()]:Ke(this._months)?this._months:this._months.standalone}function to(e,t){return e?Ke(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[pa.test(t)?"format":"standalone"][e.month()]:Ke(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function no(e,t,n){var r,s,i,l=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=nt([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?t==="MMM"?(s=_e.call(this._shortMonthsParse,l),s!==-1?s:null):(s=_e.call(this._longMonthsParse,l),s!==-1?s:null):t==="MMM"?(s=_e.call(this._shortMonthsParse,l),s!==-1?s:(s=_e.call(this._longMonthsParse,l),s!==-1?s:null)):(s=_e.call(this._longMonthsParse,l),s!==-1?s:(s=_e.call(this._shortMonthsParse,l),s!==-1?s:null))}function ro(e,t,n){var r,s,i;if(this._monthsParseExact)return no.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(s=nt([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(i="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function xa(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=L(t);else if(t=e.localeData().monthsParse(t),!ft(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Br(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function ka(e){return e!=null?(xa(this,e),x.updateOffset(this,!0),this):dn(this,"Month")}function so(){return Br(this.year(),this.month())}function ao(e){return this._monthsParseExact?($(this,"_monthsRegex")||wa.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):($(this,"_monthsShortRegex")||(this._monthsShortRegex=Kl),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function io(e){return this._monthsParseExact?($(this,"_monthsRegex")||wa.call(this),e?this._monthsStrictRegex:this._monthsRegex):($(this,"_monthsRegex")||(this._monthsRegex=Jl),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function wa(){function e(u,d){return d.length-u.length}var t=[],n=[],r=[],s,i,l,c;for(s=0;s<12;s++)i=nt([2e3,s]),l=ut(this.monthsShort(i,"")),c=ut(this.months(i,"")),t.push(l),n.push(c),r.push(c),r.push(l);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}O("d",0,"do","day");O("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});O("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});O("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});O("e",0,0,"weekday");O("E",0,0,"isoWeekday");O("eHHmm",0,0,function(){return""+this.weekday()+Qe(this.hours(),2)+Qe(this.minutes(),2)});M("d",le);M("e",le);M("E",le);M("eHHmm",Ar);M("dd",function(e,t){return t.weekdaysMinRegex(e)});M("ddd",function(e,t){return t.weekdaysShortRegex(e)});M("dddd",function(e,t){return t.weekdaysRegex(e)});Xt(["dd","ddd","dddd"],function(e,t,n,r){var s=n._locale.weekdaysParse(e,r,n._strict);s!=null?t.d=s:E(n).invalidWeekday=e});Xt(["d","e","E"],function(e,t,n,r){t[r]=L(e)});Xt("eHHmm",function(e,t,n){var r=e.length-4;t.e=L(e.substr(0,r)),n._a[we]=L(e.substr(r,2)),n._a[Ge]=L(e.substr(r+2))});function lo(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function oo(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Hr(e,t){return e.slice(t,7).concat(e.slice(0,t))}var co="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Sa="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),uo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),fo=vn,ho=vn,mo=vn,Is=["weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","minWeekdaysParse","weekdaysRegex","weekdaysShortRegex","weekdaysMinRegex","weekdaysStrictRegex","weekdaysShortStrictRegex","weekdaysMinStrictRegex"];function yo(e,t){var n,r;for(n=0;n<Is.length;n++)r=Is[n],$(t,r)||delete e["_"+r]}function go(e,t){var n=Ke(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Hr(n,this._week.dow):e?n[e.day()]:n}function _o(e){return e===!0?Hr(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function vo(e){return e===!0?Hr(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function po(e,t,n){var r,s,i,l=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=nt([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?t==="dddd"?(s=_e.call(this._weekdaysParse,l),s!==-1?s:null):t==="ddd"?(s=_e.call(this._shortWeekdaysParse,l),s!==-1?s:null):(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null):t==="dddd"?(s=_e.call(this._weekdaysParse,l),s!==-1||(s=_e.call(this._shortWeekdaysParse,l),s!==-1)?s:(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null)):t==="ddd"?(s=_e.call(this._shortWeekdaysParse,l),s!==-1||(s=_e.call(this._weekdaysParse,l),s!==-1)?s:(s=_e.call(this._minWeekdaysParse,l),s!==-1?s:null)):(s=_e.call(this._minWeekdaysParse,l),s!==-1||(s=_e.call(this._weekdaysParse,l),s!==-1)?s:(s=_e.call(this._shortWeekdaysParse,l),s!==-1?s:null))}function xo(e,t,n){var r,s,i;if(this._weekdaysParseExact)return po.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(s=nt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ko(e){if(!this.isValid())return e!=null?this:NaN;var t=dn(this,"Day");return e!=null?(e=lo(e,this.localeData()),this.add(e-t,"d")):t}function wo(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function So(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=oo(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function bo(e){return this._weekdaysParseExact?($(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):($(this,"_weekdaysRegex")||(this._weekdaysRegex=fo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Mo(e){return this._weekdaysParseExact?($(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):($(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ho),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Co(e){return this._weekdaysParseExact?($(this,"_weekdaysRegex")||Vr.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):($(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vr(){function e(m,p){return p.length-m.length}var t=[],n=[],r=[],s=[],i,l,c,u,d;for(i=0;i<7;i++)l=nt([2e3,1]).day(i),c=ut(this.weekdaysMin(l,"")),u=ut(this.weekdaysShort(l,"")),d=ut(this.weekdays(l,"")),t.push(c),n.push(u),r.push(d),s.push(c),s.push(u),s.push(d);t.sort(e),n.sort(e),r.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Do(e){var t,n;Xl(this,e),yo(this,e);for(n in e)$(e,n)&&(t=e[n],rt(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function wr(e,t){var n=et({},e),r;for(r in t)$(t,r)&&(Nt(e[r])&&Nt(t[r])?(n[r]={},et(n[r],e[r]),et(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)$(e,r)&&!$(t,r)&&Nt(e[r])&&(n[r]=et({},n[r]));return n}function $r(e){e!=null&&this.set(e)}var Sr;Object.keys?Sr=Object.keys:Sr=function(e){var t,n=[];for(t in e)$(e,t)&&n.push(t);return n};var jo={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Oo(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return rt(r)?r.call(t,n):r}var No={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Ro(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()],r=this._longDateFormatCache;return t||!n?t:r&&r[e]&&r[e].formatUpper===n?r[e].format:(t=n.match(Ir).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),r||(r=this._longDateFormatCache={}),r[e]={formatUpper:n,format:t},t)}var Po="Invalid date";function Yo(){return this._invalidDate}var To="%d",Eo=/\d{1,2}/;function Io(e){return this._ordinal.replace("%d",e)}var Fo={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ba(e,t,n,r){var s=this._relativeTime[n];return rt(s)?s(e,t,n,r):s.replace(/%d/i,e)}function Ao(e,t,n,r){return this.postformat(ba.call(this,e,t,n,r))}function Ma(e,t){var n=this._relativeTime[e>0?"future":"past"];return rt(n)?n(t):n.replace(/%s/i,t)}function Lo(e,t){return this.postformat(Ma.call(this,e,t))}function Wo(e,t,n,r,s,i,l){var c;return e<100&&e>=0?(c=new Date(e+400,t,n,r,s,i,l),isFinite(c.getFullYear())&&c.setFullYear(e)):c=new Date(e,t,n,r,s,i,l),c}function Pt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function An(e,t,n){var r=7+t-n,s=(7+Pt(e,0,r).getUTCDay()-t)%7;return-s+r-1}function Ca(e,t,n,r,s){var i=(7+n-r)%7,l=An(e,r,s),c=1+7*(t-1)+i+l,u,d;return c<=0?(u=e-1,d=on(u)+c):c>on(e)?(u=e+1,d=c-on(e)):(u=e,d=c),{year:u,dayOfYear:d}}function Da(e,t,n,r){var s=An(e,n,r),i=Math.floor((t-s-1)/7)+1,l,c;return i<1?(c=e-1,l=i+dt(c,n,r)):i>dt(e,n,r)?(l=i-dt(e,n,r),c=e+1):(c=e,l=i),{week:l,year:c}}function Ur(e,t,n){return Da(e.year(),e.dayOfYear(),t,n)}function Fs(e,t,n,r,s){var i=Math.round((Pt(e,t,n)-Pt(e,0,1))/864e5)+1;return Da(e,i,r,s)}function dt(e,t,n){var r=An(e,t,n),s=An(e+1,t,n);return(on(e)-r+s)/7}O("w",["ww",2],"wo","week");O("W",["WW",2],"Wo","isoWeek");M("w",le,Jt);M("ww",le,He);M("W",le,Jt);M("WW",le,He);Xt(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=L(e)});function Bo(e){return Ur(e,this._week.dow,this._week.doy).week}var Ho={dow:0,doy:6};function Vo(){return this._week.dow}function $o(){return this._week.doy}function Uo(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function zo(e){var t=Ur(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}function zr(){return this.hours()%12||12}function Go(){return this.hours()||24}O("H",["HH",2],0,"hour");O("h",["hh",2],0,zr);O("k",["kk",2],0,Go);O("hmm",0,0,function(){return""+zr.apply(this)+Qe(this.minutes(),2)});O("hmmss",0,0,function(){return""+zr.apply(this)+Qe(this.minutes(),2)+Qe(this.seconds(),2)});O("Hmm",0,0,function(){return""+this.hours()+Qe(this.minutes(),2)});O("Hmmss",0,0,function(){return""+this.hours()+Qe(this.minutes(),2)+Qe(this.seconds(),2)});function ja(e,t){O(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}ja("a",!0);ja("A",!1);function Oa(e,t){return t._meridiemParse}M("a",Oa);M("A",Oa);M("H",le,Wr);M("h",le,Jt);M("k",le,Jt);M("HH",le,He);M("hh",le,He);M("kk",le,He);M("hmm",ya);M("hmmss",Ar);M("Hmm",ya);M("Hmmss",Ar);ae(["H","HH"],we);ae(["k","kk"],function(e,t,n){var r=L(e);t[we]=r===24?0:r});ae(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});ae(["h","hh"],function(e,t,n){t[we]=L(e),E(n).bigHour=!0});ae("hmm",function(e,t,n){var r=e.length-2;t[we]=L(e.substr(0,r)),t[Ge]=L(e.substr(r)),E(n).bigHour=!0});ae("hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[we]=L(e.substr(0,r)),t[Ge]=L(e.substr(r,2)),t[ct]=L(e.substr(s)),E(n).bigHour=!0});ae("Hmm",function(e,t,n){var r=e.length-2;t[we]=L(e.substr(0,r)),t[Ge]=L(e.substr(r))});ae("Hmmss",function(e,t,n){var r=e.length-4,s=e.length-2;t[we]=L(e.substr(0,r)),t[Ge]=L(e.substr(r,2)),t[ct]=L(e.substr(s))});function Qo(e){return(e+"").toLowerCase().charAt(0)==="p"}var qo=/[ap]\.?m?\.?/i,Zo=en("Hours",!0);function Ko(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Na={calendar:jo,longDateFormat:No,invalidDate:Po,ordinal:To,dayOfMonthOrdinalParse:Eo,relativeTime:Fo,months:Zl,monthsShort:va,week:Ho,weekdays:co,weekdaysMin:uo,weekdaysShort:Sa,meridiemParse:qo},se={},sn={},fn;function Jo(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function br(e){return e&&e.toLowerCase().replace("_","-")}function Xo(e){for(var t=0,n,r,s,i;t<e.length;){for(i=br(e[t]).split("-"),n=i.length,r=br(e[t+1]),r=r?r.split("-"):null;n>0;){if(s=Kn(i.slice(0,n).join("-")),s)return s;if(r&&r.length>=n&&Jo(i,r)>=n-1)break;n--}t++}return fn}function ec(e){return typeof e=="string"&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)}function Kn(e){var t=null,n,r;if($(se,e))return se[e];if(r=br(e),$(se,r))return se[r];if(typeof module<"u"&&module&&module.exports&&ec(r))try{t=fn._abbr,n=require,n("./locale/"+r),St(t)}catch{se[r]=null}if($(se,r))return se[r]}function St(e,t){var n;return e&&(Te(t)?n=ht(e):n=Gr(e,t),n?fn=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),fn._abbr}function Gr(e,t){if(t!==null){var n,r=Na;if(t.abbr=e,se[e]!=null)da("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=se[e]._config;else if(t.parentLocale!=null)if(se[t.parentLocale]!=null)r=se[t.parentLocale]._config;else if(n=Kn(t.parentLocale),n!=null)r=n._config;else return sn[t.parentLocale]||(sn[t.parentLocale]=[]),sn[t.parentLocale].push({name:e,config:t}),null;return se[e]=new $r(wr(r,t)),sn[e]&&sn[e].forEach(function(s){Gr(s.name,s.config)}),St(e),se[e]}else return delete se[e],null}function tc(e,t){var n,r=Kn(e),s=Na;return r!=null&&(e=r._abbr),t!=null?(se[e]!=null&&se[e].parentLocale!=null?se[e].set(wr(se[e]._config,t)):(r!=null&&(s=r._config),t=wr(s,t),r==null&&(t.abbr=e),n=new $r(t),n.parentLocale=se[e],se[e]=n),St(e)):se[e]!=null&&(se[e].parentLocale!=null?(se[e]=se[e].parentLocale,e===St()&&St(e)):se[e]!=null&&delete se[e]),se[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return fn;if(!Ke(e)){if(t=Kn(e),t)return t;e=[e]}return Xo(e)}function nc(){return Sr(se)}function Qr(e){var t,n=e._a;return n&&E(e).overflow===-2&&(t=n[Le]<0||n[Le]>11?Le:n[Ee]<1||n[Ee]>Br(n[ve],n[Le])?Ee:n[we]<0||n[we]>24||n[we]===24&&(n[Ge]!==0||n[ct]!==0||n[Ot]!==0)?we:n[Ge]<0||n[Ge]>59?Ge:n[ct]<0||n[ct]>59?ct:n[Ot]<0||n[Ot]>999?Ot:-1,E(e)._overflowDayOfYear&&(t<ve||t>Ee)&&(t=Ee),E(e)._overflowWeeks&&t===-1&&(t=$l),E(e)._overflowWeekday&&t===-1&&(t=Ul),E(e).overflow=t),e}var rc=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,sc=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ac=/Z|[+-]\d\d(?::?\d\d)?/,jn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ic=/^\/?Date\((-?\d+)/i,lc=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,oc={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ra(e){var t,n,r=e._i,s=rc.exec(r)||sc.exec(r),i,l,c,u,d=jn.length,m=mr.length;if(s){for(E(e).iso=!0,t=0,n=d;t<n;t++)if(jn[t][1].exec(s[1])){l=jn[t][0],i=jn[t][2]!==!1;break}if(l==null){e._isValid=!1;return}if(s[3]){for(t=0,n=m;t<n;t++)if(mr[t][1].exec(s[3])){c=(s[2]||" ")+mr[t][0];break}if(c==null){e._isValid=!1;return}}if(!i&&c!=null){e._isValid=!1;return}if(s[4])if(ac.exec(s[4]))u="Z";else{e._isValid=!1;return}e._f=l+(c||"")+(u||""),Zr(e)}else e._isValid=!1}function cc(e,t,n,r,s,i){var l=[uc(e),va.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(s,10)];return i&&l.push(parseInt(i,10)),l}function uc(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function dc(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function fc(e,t,n){if(e){var r=Sa.indexOf(e),s=new Date(t[0],t[1],t[2]).getDay();if(r!==s)return E(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function hc(e,t,n){if(e)return oc[e];if(t)return 0;var r=parseInt(n,10),s=r%100,i=(r-s)/100;return i*60+s}function Pa(e){var t=lc.exec(dc(e._i)),n;if(t){if(n=cc(t[4],t[3],t[2],t[5],t[6],t[7]),!fc(t[1],n,e))return;e._a=n,e._tzm=hc(t[8],t[9],t[10]),e._d=Pt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),E(e).rfc2822=!0}else e._isValid=!1}function mc(e){var t=ic.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Ra(e),e._isValid===!1)delete e._isValid;else return;if(Pa(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:x.createFromInputFallback(e)}x.createFromInputFallback=qe("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function an(e,t,n){return e??t??n}function As(e,t,n){var r=Object.prototype.hasOwnProperty.call(e,"_isDefaultDatePartsForWeek"),s=e._isDefaultDatePartsForWeek;e._isDefaultDatePartsForWeek=!!n;try{return x._getDefaultDateParts(e,t,n)}finally{r?e._isDefaultDatePartsForWeek=s:delete e._isDefaultDatePartsForWeek}}function yc(e){var t=e._defaultDatePartsNow;return t?(t.hasValue||(t.value=x.now(),t.hasValue=!0),t.value):x.now()}function gc(e,t,n){var r=n||e._isDefaultDatePartsForWeek,s=r?oe(t):new Date(t);return r?[s.year(),s.month(),s.date()]:e._useUTC?[s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()]:[s.getFullYear(),s.getMonth(),s.getDate()]}x._getDefaultDateParts=gc;function qr(e){var t,n,r=[],s,i,l,c,u;if(!e._d){for((e._a[ve]==null||e._a[Le]==null||e._a[Ee]==null)&&(s=yc(e),i=As(e,s)),e._w&&e._a[Ee]==null&&e._a[Le]==null&&_c(e,As(e,s,!0)),e._dayOfYear!=null&&(c=e._a[ve]!=null?e._a[ve]:i[ve],(e._dayOfYear>on(c)||e._dayOfYear===0)&&(E(e)._overflowDayOfYear=!0),n=Pt(c,0,e._dayOfYear),e._a[Le]=n.getUTCMonth(),e._a[Ee]=n.getUTCDate()),u=e._a[ve]==null||e._a[Le]==null||e._a[Ee]==null,t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[we]===24&&e._a[Ge]===0&&e._a[ct]===0&&e._a[Ot]===0&&(e._nextDay=!0,e._a[we]=0),e._d=(e._useUTC?Pt:Wo).apply(null,r),l=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[we]=24),e._w&&typeof e._w.d<"u"&&!u&&e._w.d!==l&&(E(e).weekdayMismatch=!0)}}function _c(e,t){var n,r,s,i,l,c,u,d,m;n=e._w,n.GG!=null||n.W!=null||n.E!=null?(l=1,c=4,r=an(n.GG,e._a[ve],Fs(t[ve],t[Le],t[Ee],1,4).year),s=an(n.W,1),i=an(n.E,1),(i<1||i>7)&&(d=!0)):(l=e._locale._week.dow,c=e._locale._week.doy,m=Fs(t[ve],t[Le],t[Ee],l,c),r=an(n.gg,e._a[ve],m.year),s=an(n.w,m.week),n.d!=null?(i=n.d,(i<0||i>6)&&(d=!0)):n.e!=null?(i=n.e+l,(n.e<0||n.e>6)&&(d=!0)):i=l),s<1||s>dt(r,l,c)?E(e)._overflowWeeks=!0:d!=null?E(e)._overflowWeekday=!0:(u=Ca(r,s,i,l,c),e._a[ve]=u.year,e._dayOfYear=u.dayOfYear)}x.ISO_8601=function(){};x.RFC_2822=function(){};function Zr(e){if(e._f===x.ISO_8601){Ra(e);return}if(e._f===x.RFC_2822){Pa(e);return}e._a=[],E(e).empty=!0;var t=""+e._i,n,r,s,i,l,c=t.length,u=0,d,m;for(s=fa(e._f,e._locale).match(Ir)||[],m=s.length,n=0;n<m;n++)i=s[n],r=(t.match(Bl(i,e))||[])[0],r&&(l=t.substr(0,t.indexOf(r)),l.length>0&&E(e).unusedInput.push(l),t=t.slice(t.indexOf(r)+r.length),u+=r.length),Ut[i]?(r?E(e).empty=!1:E(e).unusedTokens.push(i),Vl(i,r,e)):e._strict&&!r&&E(e).unusedTokens.push(i);E(e).charsLeftOver=c-u,t.length>0&&E(e).unusedInput.push(t),e._a[we]<=12&&E(e).bigHour===!0&&e._a[we]>0&&(E(e).bigHour=void 0),E(e).parsedDateParts=e._a.slice(0),E(e).meridiem=e._meridiem,e._a[we]=vc(e._locale,e._a[we],e._meridiem),d=E(e).era,d!==null&&(e._a[ve]=e._locale.erasConvertYear(d,e._a[ve])),qr(e),Qr(e)}function vc(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function pc(e){var t,n,r,s,i,l,c=!1,u={},d=e._f.length;if(d===0){E(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;s<d;s++)i=0,l=!1,t=Tr({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._defaultDatePartsNow=u,t._f=e._f[s],Zr(t),Yr(t)&&(l=!0),i+=E(t).charsLeftOver,i+=E(t).unusedTokens.length*10,E(t).score=i,c?i<r&&(r=i,n=t):(r==null||i<r||l)&&(r=i,n=t,l&&(c=!0));et(e,n||t)}function xc(e){if(!e._d){var t=Er(e._i),n=t.day===void 0?t.date:t.day;e._a=ca([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),qr(e)}}function kc(e){var t=new _n(Qr(Ya(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ya(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),t===null||n===void 0&&t===""?gn({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),We(t)?new _n(Qr(t)):(yn(t)?e._d=t:Ke(n)?pc(e):n?Zr(e):wc(e),Yr(e)||(e._d=null),e))}function wc(e){var t=e._i;Te(t)?e._d=new Date(x.now()):yn(t)?e._d=new Date(t.valueOf()):typeof t=="string"?mc(e):Ke(t)?(e._a=ca(t.slice(0),function(n){return parseInt(n,10)}),qr(e)):Nt(t)?xc(e):ft(t)?e._d=new Date(t):x.createFromInputFallback(e)}function Ta(e,t,n,r,s){var i={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Nt(e)&&Pr(e)||Ke(e)&&e.length===0)&&(e=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=s,i._l=n,i._i=e,i._f=t,i._strict=r,kc(i)}function oe(e,t,n,r){return Ta(e,t,n,r,!1)}var Sc=qe("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=oe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:gn()}),bc=qe("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=oe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:gn()});function Ea(e,t){var n,r;if(t.length===1&&Ke(t[0])&&(t=t[0]),!t.length)return oe();for(r=0;r<t.length;++r)if(We(t[r])){n=t[r];break}if(!n)return gn();for(++r;r<t.length;++r)We(t[r])&&(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Mc(){var e=[].slice.call(arguments,0);return Ea("isBefore",e)}function Cc(){var e=[].slice.call(arguments,0);return Ea("isAfter",e)}var Dc=function(){return Date.now?Date.now():+new Date},ln=["year","quarter","month","week","day","hour","minute","second","millisecond"];function jc(e){var t,n=!1,r,s=ln.length;for(t in e)if($(e,t)&&!(_e.call(ln,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<s;++r)if(e[ln[r]]){if(n)return!1;parseFloat(e[ln[r]])!==L(e[ln[r]])&&(n=!0)}return!0}function Oc(){return this._isValid}function Nc(){return Je(NaN)}function Jn(e){var t=Er(e),n=t.year||0,r=t.quarter||0,s=t.month||0,i=t.week||t.isoWeek||0,l=t.day||0,c=t.hour||0,u=t.minute||0,d=t.second||0,m=t.millisecond||0;this._isValid=jc(t),this._milliseconds=+m+d*1e3+u*6e4+c*1e3*60*60,this._days=+l+i*7,this._months=+s+r*3+n*12,this._data={},this._locale=ht(),this._bubble()}function Yn(e){return e instanceof Jn}function Mr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Rc(e,t,n){var r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),i=0,l;for(l=0;l<r;l++)L(e[l])!==L(t[l])&&i++;return i+s}function Ia(e,t){O(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Qe(~~(n/60),2)+t+Qe(~~n%60,2)})}Ia("Z",":");Ia("ZZ","");M("Z",qn);M("ZZ",qn);ae(["Z","ZZ"],function(e,t,n){var r=Kr(qn,e);n._useUTC=!0,n._tzm=r,r===null&&(E(n).invalidOffset=e)});var Pc=/([\+\-]|\d\d)/gi;function Kr(e,t){var n=(t||"").match(e),r,s,i;return n===null||(r=n[n.length-1]||[],s=(r+"").match(Pc)||["-",0,0],i=+(s[1]*60)+L(s[2]),L(s[2])>59||(s[0]==="+"?i>14*60:i>12*60))?null:i===0?0:s[0]==="+"?i:-i}function Jr(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(We(e)||yn(e)?e.valueOf():oe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),x.updateOffset(n,!1),n):oe(e).local()}function Cr(e){return-Math.round(e._d.getTimezoneOffset())}x.updateOffset=function(){};function Yc(e,t,n){var r=this._offset||0,s;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Kr(qn,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(s=Cr(this)),this._offset=e,this._isUTC=!0,s!=null&&this.add(s,"m"),r!==e&&(!t||this._changeInProgress?La(this,Je(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,x.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Cr(this)}function Tc(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ec(e){return this.utcOffset(0,e)}function Ic(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Cr(this),"m")),this}function Fc(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Kr(Ll,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Ac(e){return this.isValid()?(e=e?oe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Lc(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Wc(){if(!Te(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Tr(e,this),e=Ya(e),e._a?(t=e._isUTC?nt(e._a):oe(e._a),this._isDSTShifted=this.isValid()&&Rc(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Bc(){return this.isValid()?!this._isUTC:!1}function Hc(){return this.isValid()?this._isUTC:!1}function Fa(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Vc=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,$c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Je(e,t){var n=e,r=null,s,i,l;return Yn(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:ft(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=Vc.exec(e))?(s=r[1]==="-"?-1:1,n={y:0,d:L(r[Ee])*s,h:L(r[we])*s,m:L(r[Ge])*s,s:L(r[ct])*s,ms:L(Mr(r[Ot]*1e3))*s}):(r=$c.exec(e))?(s=r[1]==="-"?-1:1,n={y:jt(r[2],s),M:jt(r[3],s),w:jt(r[4],s),d:jt(r[5],s),h:jt(r[6],s),m:jt(r[7],s),s:jt(r[8],s)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(l=Uc(oe(n.from),oe(n.to)),n={},n.ms=l.milliseconds,n.M=l.months),i=new Jn(n),Yn(e)&&$(e,"_locale")&&(i._locale=e._locale),Yn(e)&&$(e,"_isValid")&&(i._isValid=e._isValid),i}Je.fn=Jn.prototype;Je.invalid=Nc;function jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Ls(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Uc(e,t){var n;return e.isValid()&&t.isValid()?(t=Jr(t,e),e.isBefore(t)?n=Ls(e,t):(n=Ls(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Aa(e,t){return function(n,r){var s,i;return r!==null&&!isNaN(+r)&&(da(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),s=Je(n,r),La(this,s,e),this}}function La(e,t,n,r){var s=t._milliseconds,i=Mr(t._days),l=Mr(t._months);e.isValid()&&(r=r??!0,l&&xa(e,dn(e,"Month")+l*n),i&&_a(e,"Date",dn(e,"Date")+i*n),s&&e._d.setTime(e._d.valueOf()+s*n),r&&x.updateOffset(e,i||l))}var zc=Aa(1,"add"),Gc=Aa(-1,"subtract");function Wa(e){return typeof e=="string"||e instanceof String}function Qc(e){return We(e)||yn(e)||Wa(e)||ft(e)||Zc(e)||qc(e)||e===null||e===void 0}function qc(e){var t=Nt(e)&&!Pr(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,i,l=r.length;for(s=0;s<l;s+=1)i=r[s],n=n||$(e,i);return t&&n}function Zc(e){var t=Ke(e),n=!1;return t&&(n=e.filter(function(r){return!ft(r)&&Wa(e)}).length===0),t&&n}function Kc(e){var t=Nt(e)&&!Pr(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,i;for(s=0;s<r.length;s+=1)i=r[s],n=n||$(e,i);return t&&n}function Jc(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function Xc(e,t){arguments.length===1&&(arguments[0]?Qc(arguments[0])?(e=arguments[0],t=void 0):Kc(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||oe(),r=Jr(n,this).startOf("day"),s=x.calendarFormat(this,r)||"sameElse",i=t&&(rt(t[s])?t[s].call(this,n):t[s]);return this.format(i||this.localeData().calendar(s,this,oe(n)))}function eu(){return new _n(this)}function tu(e,t){var n=We(e)?e:oe(e);return this.isValid()&&n.isValid()?(t=Ze(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function nu(e,t){var n=We(e)?e:oe(e);return this.isValid()&&n.isValid()?(t=Ze(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function ru(e,t,n,r){var s=We(e)?e:oe(e),i=We(t)?t:oe(t);return this.isValid()&&s.isValid()&&i.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(s,n):!this.isBefore(s,n))&&(r[1]===")"?this.isBefore(i,n):!this.isAfter(i,n))):!1}function su(e,t){var n=We(e)?e:oe(e),r;return this.isValid()&&n.isValid()?(t=Ze(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function au(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function iu(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function lu(e,t,n){var r,s,i;if(!this.isValid())return NaN;if(r=Jr(e,this),!r.isValid())return NaN;switch(s=(r.utcOffset()-this.utcOffset())*6e4,t=Ze(t),t){case"year":i=Tn(this,r)/12;break;case"month":i=Tn(this,r);break;case"quarter":i=Tn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-s)/864e5;break;case"week":i=(this-r-s)/6048e5;break;default:i=this-r}return n?i:Ue(i)}function Tn(e,t){if(e.date()<t.date())return-Tn(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),s,i;return t-r<0?(s=e.clone().add(n-1,"months"),i=(t-r)/(r-s)):(s=e.clone().add(n+1,"months"),i=(t-r)/(s-r)),-(n+i)||0}x.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";x.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ou(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function cu(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Pn(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):rt(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Pn(n,"Z")):Pn(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function uu(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,s,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(n+r+s+i)}function du(e){e||(e=this.isUtc()?x.defaultFormatUtc:x.defaultFormat);var t=Pn(this,e);return this.localeData().postformat(t)}function fu(e,t){return this.isValid()&&(We(e)&&e.isValid()||oe(e).isValid())?Je({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function hu(e){return this.from(oe(),e)}function mu(e,t){return this.isValid()&&(We(e)&&e.isValid()||oe(e).isValid())?Je({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function yu(e){return this.to(oe(),e)}function Ba(e){var t;return e===void 0?this._locale._abbr:(t=ht(e),t!=null&&(this._locale=t),this)}var Ha=qe("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function Va(){return this._locale}var Ln=1e3,zt=60*Ln,Wn=60*zt,$a=(365*400+97)*24*Wn;function Gt(e,t){return(e%t+t)%t}function Ua(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-$a:new Date(e,t,n).valueOf()}function za(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-$a:Date.UTC(e,t,n)}function gu(e){var t,n;if(e=Ze(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?za:Ua,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Gt(t+(this._isUTC?0:this.utcOffset()*zt),Wn);break;case"minute":t=this._d.valueOf(),t-=Gt(t,zt);break;case"second":t=this._d.valueOf(),t-=Gt(t,Ln);break}return this._d.setTime(t),x.updateOffset(this,!0),this}function _u(e){var t,n;if(e=Ze(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?za:Ua,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Wn-Gt(t+(this._isUTC?0:this.utcOffset()*zt),Wn)-1;break;case"minute":t=this._d.valueOf(),t+=zt-Gt(t,zt)-1;break;case"second":t=this._d.valueOf(),t+=Ln-Gt(t,Ln)-1;break}return this._d.setTime(t),x.updateOffset(this,!0),this}function vu(){return this._d.valueOf()-(this._offset||0)*6e4}function pu(){return Math.floor(this.valueOf()/1e3)}function xu(){return new Date(this.valueOf())}function ku(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function wu(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Su(){return this.isValid()?this.toISOString():null}function bu(){return Yr(this)}function Mu(){return et({},E(this))}function Cu(){return E(this).overflow}function Du(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}O("N",0,0,"eraAbbr");O("NN",0,0,"eraAbbr");O("NNN",0,0,"eraAbbr");O("NNNN",0,0,"eraName");O("NNNNN",0,0,"eraNarrow");O("y",["y",1],"yo","eraYear");O("y",["yy",2],0,"eraYear");O("y",["yyy",3],0,"eraYear");O("y",["yyyy",4],0,"eraYear");M("N",Xr);M("NN",Xr);M("NNN",Xr);M("NNNN",Au);M("NNNNN",Lu);ae(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var s=n._locale.erasParse(e,r,n._strict);s?E(n).era=s:E(n).invalidEra=e});M("y",Kt);M("yy",Kt);M("yyy",Kt);M("yyyy",Kt);M("yo",Wu);ae(["y","yy","yyy","yyyy"],ve);ae(["yo"],function(e,t,n,r){var s;n._locale._eraYearOrdinalRegex&&(s=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ve]=n._locale.eraYearOrdinalParse(e,s):t[ve]=parseInt(e,10)});function ju(e,t){var n,r,s,i=this._eras||ht("en")._eras;for(n=0,r=i.length;n<r;++n){switch(typeof i[n].since){case"string":s=x(i[n].since).startOf("day"),i[n].since=s.valueOf();break}switch(typeof i[n].until){case"undefined":i[n].until=1/0;break;case"string":s=x(i[n].until).startOf("day").valueOf(),i[n].until=s.valueOf();break}}return i}function Ou(e,t,n){var r,s,i=this.eras(),l,c,u;for(e=e.toUpperCase(),r=0,s=i.length;r<s;++r)if(l=i[r].name.toUpperCase(),c=i[r].abbr.toUpperCase(),u=i[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(c===e)return i[r];break;case"NNNN":if(l===e)return i[r];break;case"NNNNN":if(u===e)return i[r];break}else if([l,c,u].indexOf(e)>=0)return i[r]}function Nu(e,t){var n=e.since<=e.until?1:-1;return t===void 0?x(e.since).year():x(e.since).year()+(t-e.offset)*n}function Ru(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function Pu(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function Yu(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function Tu(){var e,t,n,r,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,r=this.clone().startOf("day").valueOf(),s[e].since<=r&&r<=s[e].until||s[e].until<=r&&r<=s[e].since)return(this.year()-x(s[e].since).year())*n+s[e].offset;return this.year()}function Eu(e){return $(this,"_erasNameRegex")||es.call(this),e?this._erasNameRegex:this._erasRegex}function Iu(e){return $(this,"_erasAbbrRegex")||es.call(this),e?this._erasAbbrRegex:this._erasRegex}function Fu(e){return $(this,"_erasNarrowRegex")||es.call(this),e?this._erasNarrowRegex:this._erasRegex}function Xr(e,t){return t.erasAbbrRegex(e)}function Au(e,t){return t.erasNameRegex(e)}function Lu(e,t){return t.erasNarrowRegex(e)}function Wu(e,t){return t._eraYearOrdinalRegex||Kt}function es(){var e=[],t=[],n=[],r=[],s,i,l,c,u,d=this.eras();for(s=0,i=d.length;s<i;++s)l=ut(d[s].name),c=ut(d[s].abbr),u=ut(d[s].narrow),t.push(l),e.push(c),n.push(u),r.push(l),r.push(c),r.push(u);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}O(0,["gg",2],0,function(){return this.weekYear()%100});O(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Xn(e,t){O(0,[e,e.length],0,t)}Xn("gggg","weekYear");Xn("ggggg","weekYear");Xn("GGGG","isoWeekYear");Xn("GGGGG","isoWeekYear");M("G",Qn);M("g",Qn);M("GG",le,He);M("gg",le,He);M("GGGG",Lr,Fr);M("gggg",Lr,Fr);M("GGGGG",Gn,Un);M("ggggg",Gn,Un);Xt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=L(e)});Xt(["gg","GG"],function(e,t,n,r){t[r]=x.parseTwoDigitYear(e)});function Bu(e){return Ga.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Hu(e){return Ga.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Vu(){return dt(this.year(),1,4)}function $u(){return dt(this.isoWeekYear(),1,4)}function Uu(){var e=this.localeData()._week;return dt(this.year(),e.dow,e.doy)}function zu(){var e=this.localeData()._week;return dt(this.weekYear(),e.dow,e.doy)}function Ga(e,t,n,r,s){var i;return e==null?Ur(this,r,s).year:(i=dt(e,r,s),t>i&&(t=i),Gu.call(this,e,t,n,r,s))}function Gu(e,t,n,r,s){var i=Ca(e,t,n,r,s),l=Pt(i.year,0,i.dayOfYear);return this.year(l.getUTCFullYear()),this.month(l.getUTCMonth()),this.date(l.getUTCDate()),this}O("Q",0,"Qo","quarter");M("Q",ha);ae("Q",function(e,t){t[Le]=(L(e)-1)*3});function Qu(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}O("D",["DD",2],"Do","date");M("D",le,Jt);M("DD",le,He);M("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});ae(["D","DD"],Ee);ae("Do",function(e,t){t[Ee]=L(e.match(le)[0])});var Qa=en("Date",!0);O("DDD",["DDDD",3],"DDDo","dayOfYear");M("DDD",zn);M("DDDD",ma);ae(["DDD","DDDD"],function(e,t,n){n._dayOfYear=L(e)});function qu(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}O("m",["mm",2],0,"minute");M("m",le,Wr);M("mm",le,He);ae(["m","mm"],Ge);var Zu=en("Minutes",!1);O("s",["ss",2],0,"second");M("s",le,Wr);M("ss",le,He);ae(["s","ss"],ct);var Ku=en("Seconds",!1);O("S",0,0,function(){return~~(this.millisecond()/100)});O(0,["SS",2],0,function(){return~~(this.millisecond()/10)});O(0,["SSS",3],0,"millisecond");O(0,["SSSS",4],0,function(){return this.millisecond()*10});O(0,["SSSSS",5],0,function(){return this.millisecond()*100});O(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});O(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});O(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});O(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});M("S",zn,ha);M("SS",zn,He);M("SSS",zn,ma);var wt,qa;for(wt="SSSS";wt.length<=9;wt+="S")M(wt,Kt);function Ju(e,t){t[Ot]=L(("0."+e)*1e3)}for(wt="S";wt.length<=9;wt+="S")ae(wt,Ju);qa=en("Milliseconds",!1);O("z",0,0,"zoneAbbr");O("zz",0,0,"zoneName");function Xu(){return this._isUTC?"UTC":""}function ed(){return this._isUTC?"Coordinated Universal Time":""}var _=_n.prototype;_.add=zc;_.calendar=Xc;_.clone=eu;_.diff=lu;_.endOf=_u;_.format=du;_.from=fu;_.fromNow=hu;_.to=mu;_.toNow=yu;_.get=Gl;_.invalidAt=Cu;_.isAfter=tu;_.isBefore=nu;_.isBetween=ru;_.isSame=su;_.isSameOrAfter=au;_.isSameOrBefore=iu;_.isValid=bu;_.lang=Ha;_.locale=Ba;_.localeData=Va;_.max=bc;_.min=Sc;_.parsingFlags=Mu;_.set=Ql;_.startOf=gu;_.subtract=Gc;_.toArray=ku;_.toObject=wu;_.toDate=xu;_.toISOString=cu;_.inspect=uu;typeof Symbol<"u"&&Symbol.for!=null&&(_[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});_.toJSON=Su;_.toString=ou;_.unix=pu;_.valueOf=vu;_.creationData=Du;_.eraName=Ru;_.eraNarrow=Pu;_.eraAbbr=Yu;_.eraYear=Tu;_.year=ga;_.isLeapYear=zl;_.weekYear=Bu;_.isoWeekYear=Hu;_.quarter=_.quarters=Qu;_.month=ka;_.daysInMonth=so;_.week=_.weeks=Uo;_.isoWeek=_.isoWeeks=zo;_.weeksInYear=Uu;_.weeksInWeekYear=zu;_.isoWeeksInYear=Vu;_.isoWeeksInISOWeekYear=$u;_.date=Qa;_.day=_.days=ko;_.weekday=wo;_.isoWeekday=So;_.dayOfYear=qu;_.hour=_.hours=Zo;_.minute=_.minutes=Zu;_.second=_.seconds=Ku;_.millisecond=_.milliseconds=qa;_.utcOffset=Yc;_.utc=Ec;_.local=Ic;_.parseZone=Fc;_.hasAlignedHourOffset=Ac;_.isDST=Lc;_.isLocal=Bc;_.isUtcOffset=Hc;_.isUtc=Fa;_.isUTC=Fa;_.zoneAbbr=Xu;_.zoneName=ed;_.dates=qe("dates accessor is deprecated. Use date instead.",Qa);_.months=qe("months accessor is deprecated. Use month instead",ka);_.years=qe("years accessor is deprecated. Use year instead",ga);_.zone=qe("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Tc);_.isDSTShifted=qe("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Wc);function td(e){return oe(e*1e3)}function nd(){return oe.apply(null,arguments).parseZone()}function Za(e){return e}var K=$r.prototype;K.calendar=Oo;K.longDateFormat=Ro;K.invalidDate=Yo;K.ordinal=Io;K.preparse=Za;K.postformat=Za;K.relativeTime=Ao;K.pastFuture=Lo;K.set=Do;K.eras=ju;K.erasParse=Ou;K.erasConvertYear=Nu;K.erasAbbrRegex=Iu;K.erasNameRegex=Eu;K.erasNarrowRegex=Fu;K.months=eo;K.monthsShort=to;K.monthsParse=ro;K.monthsRegex=io;K.monthsShortRegex=ao;K.week=Bo;K.firstDayOfYear=$o;K.firstDayOfWeek=Vo;K.weekdays=go;K.weekdaysMin=vo;K.weekdaysShort=_o;K.weekdaysParse=xo;K.weekdaysRegex=bo;K.weekdaysShortRegex=Mo;K.weekdaysMinRegex=Co;K.isPM=Qo;K.meridiem=Ko;function Bn(e,t,n,r){var s=ht(),i=nt().set(r,t);return s[n](i,e)}function Ka(e,t,n){if(ft(e)&&(t=e,e=void 0),e=e||"",t!=null)return Bn(e,t,n,"month");var r,s=[];for(r=0;r<12;r++)s[r]=Bn(e,r,n,"month");return s}function ts(e,t,n,r){typeof e=="boolean"?(ft(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,ft(t)&&(n=t,t=void 0),t=t||"");var s=ht(),i=e?s._week.dow:0,l,c=[];if(n!=null)return Bn(t,(n+i)%7,r,"day");for(l=0;l<7;l++)c[l]=Bn(t,(l+i)%7,r,"day");return c}function rd(e,t){return Ka(e,t,"months")}function sd(e,t){return Ka(e,t,"monthsShort")}function ad(e,t,n){return ts(e,t,n,"weekdays")}function id(e,t,n){return ts(e,t,n,"weekdaysShort")}function ld(e,t,n){return ts(e,t,n,"weekdaysMin")}St("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=L(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});x.lang=qe("moment.lang is deprecated. Use moment.locale instead.",St);x.langData=qe("moment.langData is deprecated. Use moment.localeData instead.",ht);var lt=Math.abs;function od(){var e=this._data;return this._milliseconds=lt(this._milliseconds),this._days=lt(this._days),this._months=lt(this._months),e.milliseconds=lt(e.milliseconds),e.seconds=lt(e.seconds),e.minutes=lt(e.minutes),e.hours=lt(e.hours),e.months=lt(e.months),e.years=lt(e.years),this}function Ja(e,t,n,r){var s=Je(t,n);return e._milliseconds+=r*s._milliseconds,e._days+=r*s._days,e._months+=r*s._months,e._bubble()}function cd(e,t){return Ja(this,e,t,1)}function ud(e,t){return Ja(this,e,t,-1)}function Ws(e){return e<0?Math.floor(e):Math.ceil(e)}function dd(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,s,i,l,c,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Ws(Dr(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,s=Ue(e/1e3),r.seconds=s%60,i=Ue(s/60),r.minutes=i%60,l=Ue(i/60),r.hours=l%24,t+=Ue(l/24),u=Ue(Xa(t)),n+=u,t-=Ws(Dr(u)),c=Ue(n/12),n%=12,r.days=t,r.months=n,r.years=c,this}function Xa(e){return e*4800/146097}function Dr(e){return e*146097/4800}function fd(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Ze(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+Xa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dr(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function mt(e){return function(){return this.as(e)}}var ei=mt("ms"),hd=mt("s"),md=mt("m"),yd=mt("h"),gd=mt("d"),_d=mt("w"),vd=mt("M"),pd=mt("Q"),xd=mt("y"),kd=ei;function wd(){return Je(this)}function Sd(e){return e=Ze(e),this.isValid()?this[e+"s"]():NaN}function Tt(e){return function(){return this.isValid()?this._data[e]:NaN}}var bd=Tt("milliseconds"),Md=Tt("seconds"),Cd=Tt("minutes"),Dd=Tt("hours"),jd=Tt("days"),Od=Tt("months"),Nd=Tt("years");function Rd(){return Ue(this.days()/7)}var ot=Math.round,$t={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Pd(e,t,n,r,s){return ba.call(s,t||1,!!n,e,r)}function Yd(e,t,n,r){var s=Je(e).abs(),i=ot(s.as("s")),l=ot(s.as("m")),c=ot(s.as("h")),u=ot(s.as("d")),d=ot(s.as("M")),m=ot(s.as("w")),p=ot(s.as("y")),w=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||l<=1&&["m"]||l<n.m&&["mm",l]||c<=1&&["h"]||c<n.h&&["hh",c]||u<=1&&["d"]||u<n.d&&["dd",u];return n.w!=null&&(w=w||m<=1&&["w"]||m<n.w&&["ww",m]),w=w||d<=1&&["M"]||d<n.M&&["MM",d]||p<=1&&["y"]||["yy",p],w[2]=t,w[3]=+e>0,w[4]=r,Pd.apply(null,w)}function Td(e){return e===void 0?ot:typeof e=="function"?(ot=e,!0):!1}function Ed(e,t){return $t[e]===void 0?!1:t===void 0?$t[e]:($t[e]=t,e==="s"&&($t.ss=t-1),!0)}function Id(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$t,s,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=et(et({},$t),t||{}),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),s=this.localeData(),i=Yd(this,!n,r,s),n&&(i=Ma.call(s,+this,i)),s.postformat(i)}var yr=Math.abs;function Bt(e){return(e>0)-(e<0)||+e}function er(){if(!this.isValid())return this.localeData().invalidDate();var e=yr(this._milliseconds)/1e3,t=yr(this._days),n=yr(this._months),r,s,i,l,c=this.asSeconds(),u,d,m,p;return c?(r=Ue(e/60),s=Ue(r/60),e%=60,r%=60,i=Ue(n/12),n%=12,l=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=c<0?"-":"",d=Bt(this._months)!==Bt(c)?"-":"",m=Bt(this._days)!==Bt(c)?"-":"",p=Bt(this._milliseconds)!==Bt(c)?"-":"",u+"P"+(i?d+i+"Y":"")+(n?d+n+"M":"")+(t?m+t+"D":"")+(s||r||e?"T":"")+(s?p+s+"H":"")+(r?p+r+"M":"")+(e?p+l+"S":"")):"P0D"}var z=Jn.prototype;z.isValid=Oc;z.abs=od;z.add=cd;z.subtract=ud;z.as=fd;z.asMilliseconds=ei;z.asSeconds=hd;z.asMinutes=md;z.asHours=yd;z.asDays=gd;z.asWeeks=_d;z.asMonths=vd;z.asQuarters=pd;z.asYears=xd;z.valueOf=kd;z._bubble=dd;z.clone=wd;z.get=Sd;z.milliseconds=bd;z.seconds=Md;z.minutes=Cd;z.hours=Dd;z.days=jd;z.weeks=Rd;z.months=Od;z.years=Nd;z.humanize=Id;z.toISOString=er;z.toString=er;z.toJSON=er;z.locale=Ba;z.localeData=Va;z.toIsoString=qe("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",er);z.lang=Ha;O("X",0,0,"unix");O("x",0,0,"valueOf");M("x",Qn);M("X",Wl);ae("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});ae("x",function(e,t,n){n._d=new Date(L(e))});//! moment.js
11
+ x.version="2.31.0";Yl(oe);x.fn=_;x.min=Mc;x.max=Cc;x.now=Dc;x.utc=nt;x.unix=td;x.months=rd;x.isDate=yn;x.locale=St;x.invalid=gn;x.duration=Je;x.isMoment=We;x.weekdays=ad;x.parseZone=nd;x.localeData=ht;x.isDuration=Yn;x.monthsShort=sd;x.weekdaysMin=ld;x.defineLocale=Gr;x.updateLocale=tc;x.locales=nc;x.weekdaysShort=id;x.normalizeUnits=Ze;x.relativeTimeRounding=Td;x.relativeTimeThreshold=Ed;x.calendarFormat=Jc;x.prototype=_;x.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Fd=[{label:"是",value:!0},{label:"否",value:!1}];function On(e){const t=x();return[t.clone().subtract(e,"day"),t]}function ti(e){const[t,n]=o.useState(7),r=e.valueFormat??"YYYY-MM-DD",s=e.op===j.Operator.Between||e.op===j.Operator.NotBetween,i=e.op===j.Operator.In||e.op===j.Operator.NotIn,l=e.value,c=typeof l=="string"?l:"",u=typeof l=="number"?l:void 0,d=typeof l=="boolean"?l:void 0,m=typeof l=="string"||typeof l=="number"||typeof l=="boolean"?l:void 0,p=Array.isArray(l)?l:[],w=Array.isArray(l)&&l.length===2&&typeof l[0]=="string"&&typeof l[1]=="string"?[x(l[0]),x(l[1])]:null,k=Array.isArray(l)&&typeof l[0]=="number"?l[0]:void 0,C=Array.isArray(l)&&typeof l[1]=="number"?l[1]:void 0,A=(e.options??[]).map(S=>({label:S.label,value:S.value})),N=S=>{var I;return(I=e.onChange)==null?void 0:I.call(e,S)},q=()=>{const S=t;if(!S||S<1)return;const[I,H]=On(S);N([I.format(r),H.format(r)])};let W;e.fieldType==="string"&&i?W=a.jsx(f.Select,{mode:"tags",value:p,onChange:S=>N(S),tokenSeparators:[",",","],placeholder:"输入后回车添加",style:{width:"100%"}}):e.fieldType==="string"?W=a.jsx(f.Input,{value:c,onChange:S=>N(S.target.value),placeholder:"请输入",allowClear:!0}):e.fieldType==="number"&&s?W=a.jsxs(a.Fragment,{children:[a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:k,onChange:S=>N([S??null,C??null]),placeholder:"最小值",controls:!1}),a.jsx("span",{className:"yk-advanced-value-editor__sep",children:"~"}),a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__num",value:C,onChange:S=>N([k??null,S??null]),placeholder:"最大值",controls:!1})]}):e.fieldType==="number"?W=a.jsx(f.InputNumber,{value:u,onChange:S=>N(S??null),placeholder:"请输入数字",controls:!1,style:{width:"100%"}}):e.fieldType==="date"&&s?W=a.jsxs(a.Fragment,{children:[a.jsx(f.DatePicker.RangePicker,{className:"yk-advanced-value-editor__daterange-picker",value:w,format:r,placeholder:["开始日期","结束日期"],ranges:{"最近 7 天":On(7),"最近 30 天":On(30),"最近 90 天":On(90)},onChange:(S,I)=>{N(S?[I[0],I[1]]:null)}}),a.jsx(f.Popover,{trigger:"click",placement:"bottom",content:a.jsxs("div",{className:"yk-advanced-value-editor__recent-pop",children:[a.jsx("span",{children:"最近"}),a.jsx(f.InputNumber,{className:"yk-advanced-value-editor__recent-input",value:t,onChange:S=>n(typeof S=="number"?S:1),min:1,controls:!1}),a.jsx("span",{children:"天"}),a.jsx(f.Button,{type:"primary",size:"small",onClick:q,children:"应用"})]}),children:a.jsx(f.Button,{className:"yk-advanced-value-editor__recent-trigger",style:{flex:"0 0 auto"},children:"最近 N 天"})})]}):e.fieldType==="date"?W=a.jsx(f.DatePicker,{value:typeof l=="string"?x(l):null,format:r,onChange:(S,I)=>N(I||null),placeholder:"选择日期",allowClear:!0}):e.fieldType==="boolean"?W=a.jsx(f.Select,{value:d,options:Fd.map(S=>({label:S.label,value:S.value})),onChange:S=>N(S),placeholder:"请选择",allowClear:!0}):e.fieldType==="enum"&&i?W=a.jsx(f.Select,{mode:"multiple",value:p,options:A,onChange:S=>N(S),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading}):W=a.jsx(f.Select,{value:m,options:A,onChange:S=>N(S??null),placeholder:"请选择",allowClear:!0,loading:e.optionsLoading});const ie=["yk-advanced-value-editor",s?"yk-advanced-value-editor--range":"",e.fieldType==="date"&&s?"yk-advanced-value-editor--daterange":"",e.className??""].filter(Boolean).join(" ");return a.jsx("div",{className:ie,children:W})}function ns(e){const t=o.useContext(la);if(!t)return null;const{group:n,level:r=0}=e,s=c=>{(c==="and"||c==="or")&&t.api.setGroupCombinator(n.id,c)},i=c=>t.columns.find(u=>u.propertyPath===c),l=c=>{var u;return((u=i(c))==null?void 0:u.displayFormat)??"YYYY-MM-DD"};return a.jsxs("div",{className:`yk-adv-group level-${r}${r===0?" is-root":""}`,children:[a.jsxs("div",{className:"yk-adv-group__header",children:[a.jsx("span",{className:"yk-adv-group__comb-label",children:"满足"}),a.jsxs(f.Radio.Group,{size:"small",value:n.combinator,onChange:c=>s(c.target.value),children:[a.jsx(f.Radio.Button,{value:"and",children:"全部"}),a.jsx(f.Radio.Button,{value:"or",children:"任一"})]}),a.jsx("span",{className:"yk-adv-group__comb-label",children:"条件"}),a.jsxs("span",{className:"yk-adv-group__actions",children:[a.jsx(f.Button,{type:"link",onClick:()=>t.api.addLeaf(n.id),children:"+ 条件"}),a.jsx(f.Button,{type:"link",onClick:()=>t.api.addNestedGroup(n.id),children:"+ 嵌套组"}),r>0&&a.jsx(f.Button,{type:"link",danger:!0,onClick:()=>t.api.removeNode(n.id),children:"删除组"})]})]}),a.jsxs("div",{className:"yk-adv-group__children",children:[n.children.map(c=>{if(j.isConditionGroup(c))return a.jsx("div",{className:"yk-adv-group__nested",children:a.jsx(ns,{group:c,level:r+1})},c.id);const u=c;return a.jsxs("div",{className:"yk-adv-group__row",children:[a.jsx(f.Select,{className:"yk-adv-group__field",value:u.propertyPath||void 0,options:t.columns.map(d=>({label:d.displayName??d.propertyPath,value:d.propertyPath})),placeholder:"选择字段",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeField(u.id,d)}),a.jsx(f.Select,{className:"yk-adv-group__op",value:u.op,options:t.api.operatorsOf(u.propertyPath).map(d=>({label:j.OPERATOR_LABELS[d]??String(d),value:d})),placeholder:"操作符",showSearch:!0,optionFilterProp:"label",onChange:d=>t.api.changeOperator(u.id,d)}),!j.isNullOperator(u.op)&&a.jsx(ti,{className:["yk-adv-group__value",t.api.isConditionEmpty(u)?"is-invalid":""].filter(Boolean).join(" "),fieldType:t.api.fieldTypeOf(u.propertyPath),op:u.op,value:u.value,options:t.optionsMap[u.propertyPath]??[],optionsLoading:t.loadingMap[u.propertyPath]===!0,valueFormat:l(u.propertyPath),onChange:d=>t.updateValue(u.id,d)}),a.jsx(f.Button,{className:"yk-adv-group__remove",type:"link",danger:!0,onClick:()=>t.api.removeNode(u.id),children:"删除"})]},u.id)}),n.children.length===0&&a.jsx("div",{className:"yk-adv-group__empty",children:"暂无条件,点击「+ 条件」或「+ 嵌套组」"})]})]})}function ni(e,t,n){for(const r of e.children)if(j.isConditionGroup(r)){if(ni(r,t,n))return!0}else if(r.id===t)return r.value=n,!0;return!1}const ri=o.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,i=t.searchButtonText??"查询",l=t.resetButtonText??"重置",c=t.showSaveQuery??!0,u=ee.useAdvancedFilter({columns:t.columns,optionSources:t.optionSources}),{rootGroup:d,fieldTypeOf:m,filter:p,reset:w}=u,[k,C]=o.useState({}),[A,N]=o.useState({}),q=o.useRef({}),W=o.useRef({}),ie=P=>{var y;const X=(y=t.optionSources)==null?void 0:y[P];X&&(q.current[P]||W.current[P]||(W.current={...W.current,[P]:!0},N(W.current),X().then(V=>{q.current={...q.current,[P]:V},C(q.current)}).finally(()=>{W.current={...W.current,[P]:!1},N(W.current)})))},S=P=>{const X=new Set,y=V=>{j.isConditionGroup(V)?V.children.forEach(y):m(V.propertyPath)==="enum"&&X.add(V.propertyPath)};return P.children.forEach(y),[...X]};o.useEffect(()=>{for(const P of S(d))ie(P)},[d,m,t.optionSources]);const I=(P,X)=>{ni(d,P,X),u.setGroupCombinator(d.id,d.combinator)},[H,Me]=o.useState([]),pe=t.savedQueries??H,xe=P=>{var X;Me(P),(X=t.onUpdateSavedQueries)==null||X.call(t,P)},[Oe,ne]=o.useState(!1),[de,ce]=o.useState(""),[J,ye]=o.useState(""),G=o.useRef(0),h=()=>{const P=X=>X.children.some(y=>j.isConditionGroup(y)?P(y):u.isConditionEmpty(y));return P(d)},R=()=>{ce(""),ye(""),ne(!0)},T=()=>{const P=de.trim();if(!P)return;h()&&f.message.warning("当前存在未填值的条件行(标红),保存的预设可能不完整");const X=JSON.parse(JSON.stringify(d)),y={id:`sq-${++G.current}`,name:P,description:J.trim(),group:X,filterInfo:p};xe([...pe,y]),ne(!1)},U=o.useRef(!1),[ue,Z]=o.useState(0),te=P=>{const X=JSON.parse(JSON.stringify(P.group));Object.assign(d,X),u.setGroupCombinator(d.id,d.combinator),U.current=!0,Z(y=>y+1)};o.useEffect(()=>{var P;U.current&&(U.current=!1,(P=t.onSearch)==null||P.call(t,p))},[ue,p]);const F=P=>{xe(pe.filter(X=>X.id!==P))},Ce=()=>{var P;return(P=t.onSearch)==null?void 0:P.call(t,p)},De=()=>{var P;w(),(P=t.onReset)==null||P.call(t)};o.useImperativeHandle(n,()=>({get filter(){return p},reset:De,openSaveDialog:R,applySavedQuery:te,removeSavedQuery:F,get savedQueries(){return pe}}),[p,pe,d]);const je={columns:t.columns,optionsMap:k,loadingMap:A,api:u,updateValue:I};return a.jsx(la.Provider,{value:je,children:a.jsxs("div",{className:"yk-advanced-filter",onKeyDown:P=>{P.key==="Enter"&&Ce()},children:[a.jsx(ns,{group:d,level:0}),(r||s||c)&&a.jsxs("div",{className:"yk-advanced-filter__actions",children:[r&&a.jsx(f.Button,{type:"primary",onClick:Ce,children:i}),s&&a.jsx(f.Button,{onClick:De,children:l}),c&&a.jsx(f.Button,{onClick:R,children:"保存"})]}),a.jsxs(f.Modal,{open:Oe,title:"保存查询",width:440,onCancel:()=>ne(!1),onOk:T,okText:"确定",cancelText:"取消",okButtonProps:{disabled:!de.trim()},children:[a.jsxs("div",{className:"yk-advanced-filter__form-item",children:[a.jsx("label",{className:"yk-advanced-filter__form-label",children:"名称"}),a.jsx(f.Input,{value:de,onChange:P=>ce(P.target.value),placeholder:"请输入查询名称",maxLength:50,showCount:!0,onPressEnter:T})]}),a.jsxs("div",{className:"yk-advanced-filter__form-item",children:[a.jsx("label",{className:"yk-advanced-filter__form-label",children:"描述"}),a.jsx(f.Input.TextArea,{value:J,onChange:P=>ye(P.target.value),rows:2,placeholder:"可选,描述此查询的用途(hover 标签时显示)",maxLength:200,showCount:!0})]})]})]})})}),si=o.forwardRef(function(t,n){const r=ee.useFilterPanel(),s=o.useRef(r);s.current=r;const i=o.useMemo(()=>({get filter(){return s.current.filter},reset:()=>s.current.reset(),register:r.register,notify:r.notify}),[r.register,r.notify]),l=o.useMemo(()=>{const c=[];t.extraFilter&&c.push(t.extraFilter);const u=r.filter;return u&&!u.isEmpty()&&c.push(u),c.length===0?j.emptyFilter():c.length===1?c[0]:j.FilterInfo.createAnd(...c)},[t.extraFilter,r.filter]);return o.useImperativeHandle(n,()=>({filter:l,reset:()=>r.reset()}),[l,r]),a.jsx(ee.FilterPanelContext.Provider,{value:i,children:t.children})});function Ad(e,t){const n=new Map;for(const r of e)n.set(r.propertyPath,j.inferColumnFieldType(r,(t==null?void 0:t[r.propertyPath])!==void 0));return r=>n.get(r)??"string"}function Ld(e,t){if(j.isNullOperator(e.op))return!1;const n=t(e.propertyPath),r=e.value;return j.isRangeOperator(e.op)?!Array.isArray(r)||r.length!==2?!0:r[0]===null||r[0]===void 0||r[0]===""||r[1]===null||r[1]===void 0||r[1]==="":j.isMultiValueOperator(e.op)?!Array.isArray(r)||r.length===0:n==="boolean"||n==="number"||n==="date"?r==null||r==="":r==null||typeof r=="string"&&r.trim()===""}function Wd(e,t){if(Ld(e,t))return null;if(e.op==="is_null"){const n=t(e.propertyPath);return n==="string"?j.FilterInfo.createOr(j.filter(e.propertyPath,j.Operator.Equals,$e.con(null)),j.filter(e.propertyPath,j.Operator.Equals,$e.con(""))):n==="array"?j.FilterInfo.createOr(j.filter(e.propertyPath,j.Operator.Equals,$e.con(null)),j.filter(`${e.propertyPath}.count`,j.Operator.Equals,$e.con(0))):j.filter(e.propertyPath,j.Operator.Equals,$e.con(null))}if(e.op==="is_not_null"){const n=t(e.propertyPath);return n==="string"?j.FilterInfo.createAnd(j.filter(e.propertyPath,j.Operator.NotEquals,$e.con(null)),j.filter(e.propertyPath,j.Operator.NotEquals,$e.con(""))):n==="array"?j.FilterInfo.createAnd(j.filter(e.propertyPath,j.Operator.NotEquals,$e.con(null)),j.filter(`${e.propertyPath}.count`,j.Operator.GreaterThan,$e.con(0))):j.filter(e.propertyPath,j.Operator.NotEquals,$e.con(null))}return j.filter(e.propertyPath,e.op,$e.con(e.value))}function ai(e,t){if(j.isConditionGroup(e)){const n=e.children.map(r=>ai(r,t)).filter(r=>r!==null);return n.length===0?null:n.length===1?n[0]:e.combinator==="or"?j.FilterInfo.createOr(...n):j.FilterInfo.createAnd(...n)}return Wd(e,t)}function Bd(e,t,n){const r=Ad(t,n);return ai(e,r)??j.emptyFilter()}const ii=o.forwardRef(function(t,n){const r=t.showSearch??!0,s=t.showReset??!0,i=t.searchButtonText??"查询",l=t.resetButtonText??"重置",c=t.enableAdvancedFilter??!1,u=t.advancedColumns??[],d=t.showQuickQuery??!1,m=t.singleLine??!1,p=o.useRef(null),w=o.useRef(null),[k,C]=o.useState("simple"),[A,N]=o.useState(!0),[q,W]=o.useState(0),ie=o.useRef(null),[S,I]=o.useState([]),H=t.quickQueries??S,Me=()=>{var h,R;return k==="advanced"?((h=w.current)==null?void 0:h.filter)??j.emptyFilter():((R=p.current)==null?void 0:R.filter)??j.emptyFilter()},pe=()=>{var h;return(h=t.onSearch)==null?void 0:h.call(t,Me())},xe=()=>{var h,R,T;k==="advanced"?(h=w.current)==null||h.reset():(R=p.current)==null||R.reset(),(T=t.onReset)==null||T.call(t)};o.useImperativeHandle(n,()=>({get filter(){return Me()},get mode(){return k},reset:xe}),[k]);const Oe=h=>{var R;I(h),(R=t.onUpdateQuickQueries)==null||R.call(t,h)},ne=async h=>{const R=new Set(H.map(U=>U.id)),T=h.filter(U=>!R.has(U.id));if(t.saveQuickQueryFun&&T.length>0){const U=[];for(const Z of T)try{const te=await t.saveQuickQueryFun(Z);U.push(te??Z)}catch{f.message.error(`保存快速查询「${Z.name}」失败`),U.push(Z)}let ue=h;if(U.some((Z,te)=>Z!==T[te])){const Z=new Map(T.map((te,F)=>[te.id,U[F]??te]));ue=h.map(te=>Z.get(te.id)??te)}Oe(ue)}else Oe(h)};o.useEffect(()=>{if(!t.loadQuickQueryFun)return;let h=!1;return t.loadQuickQueryFun().then(R=>{var U;if(h)return;const T=R.map(ue=>({...ue,filterInfo:ue.filterInfo??Bd(ue.group,u,t.advancedOptionSources)}));I(T),(U=t.onUpdateQuickQueries)==null||U.call(t,T)}).catch(()=>{h||f.message.error("加载快速查询失败")}),()=>{h=!0}},[]);const de=h=>{var R,T;k==="advanced"?(R=w.current)==null||R.applySavedQuery(h):(T=t.onSearch)==null||T.call(t,h.filterInfo)},ce=h=>{const R=H.find(U=>U.id===h),T=(R==null?void 0:R.name)??"该查询";f.Modal.confirm({title:"删除确认",content:`确定要删除快速查询「${T}」吗?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{ne(H.filter(U=>U.id!==h))}})},J=()=>{const h=ie.current;if(!h)return;for(const F of Array.from(h.children))F.style.display="";if(!m||!A){W(0),h.style.maxWidth="";return}const R=h.nextElementSibling,T=R?R.offsetWidth:0,U=16;h.style.maxWidth=`calc(100% - ${T+U}px)`;const ue=h.clientWidth;let Z=0,te=0;for(const F of Array.from(h.children)){const Ce=F,De=Ce.offsetWidth;Z>0&&Z+De+U>ue?(Ce.style.display="none",te++):Z+=De+U}W(te)};o.useEffect(()=>{J();const h=ie.current;if(!h)return;const R=new ResizeObserver(()=>J());return R.observe(h),()=>R.disconnect()},[m,A,k]);const ye=()=>N(h=>!h),G=A?a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"6 9 12 15 18 9"}),a.jsx("polyline",{points:"6 14 12 20 18 14"})]}):a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"18 15 12 9 6 15"}),a.jsx("polyline",{points:"18 10 12 4 6 10"})]});return a.jsx("div",{className:["yk-filter-panel",m?"is-single-line":"",m&&A?"is-collapsed":""].filter(Boolean).join(" "),onKeyDown:h=>{h.key==="Enter"&&k==="simple"&&pe()},children:k==="simple"?a.jsxs(a.Fragment,{children:[m&&a.jsx(f.Button,{type:"text",className:"yk-filter-panel__toggle","aria-label":A?"展开更多条件":"折叠",title:A?q?`展开(${q} 个条件被隐藏)`:"展开":"折叠",onClick:ye,children:G}),a.jsx("div",{className:"yk-filter-panel__items",ref:ie,children:a.jsx(si,{ref:p,children:t.children})}),(r||s||c)&&a.jsxs("div",{className:"yk-filter-panel__actions",children:[r&&a.jsx(f.Button,{type:"primary",onClick:pe,children:i}),s&&a.jsx(f.Button,{onClick:xe,children:l}),c&&!(m&&A)&&a.jsx(f.Button,{type:"link",onClick:()=>C("advanced"),children:"高级查询"})]}),d&&H.length>0&&a.jsxs("div",{className:"yk-filter-panel__saved",children:[a.jsx("span",{className:"yk-filter-panel__saved-label",children:"快速查询:"}),H.map(h=>a.jsx(f.Tooltip,{title:h.description||void 0,children:a.jsx(f.Button,{size:"small",onClick:()=>de(h),children:h.name})},h.id))]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"yk-filter-panel__mode-bar",children:a.jsx(f.Button,{type:"link",onClick:()=>C("simple"),children:"← 简单查询"})}),a.jsx(ri,{ref:w,columns:u,optionSources:t.advancedOptionSources,savedQueries:H,onSearch:h=>{var R;return(R=t.onSearch)==null?void 0:R.call(t,h)},onReset:()=>{var h;return(h=t.onReset)==null?void 0:h.call(t)},onUpdateSavedQueries:ne}),H.length>0&&a.jsxs("div",{className:"yk-filter-panel__saved",children:[a.jsx("span",{className:"yk-filter-panel__saved-label",children:"已存查询:"}),H.map(h=>a.jsx(f.Tooltip,{title:h.description||void 0,children:a.jsx(f.Tag,{className:"yk-filter-panel__saved-tag",closable:!0,onClick:()=>de(h),onClose:()=>ce(h.id),children:h.name})},h.id))]})]})})});function Hd({count:e,onSelectAll:t,onInvert:n,onClear:r}){return e<=0?null:a.jsxs("div",{className:"yk-table__selection-bar",children:[a.jsxs("span",{className:"yk-table__selection-bar__count",children:["已选 ",e," 项"]}),a.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:t,children:"全选"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:n,children:"反选"}),a.jsx("span",{className:"yk-table__selection-bar__sep",children:"|"}),a.jsx(f.Button,{type:"link",className:"yk-table__selection-bar__btn",onClick:r,children:"清空"})]})}function li({actions:e,table:t=null,children:n}){const[r,s]=o.useState(null),i=o.useMemo(()=>e.filter(d=>d.align!=="right"),[e]),l=o.useMemo(()=>e.filter(d=>d.align==="right"),[e]);async function c(d){if(!(!t||r!==null)){s(d.name);try{await d.execute(t)}finally{s(null)}}}function u(d){return a.jsx(f.Button,{...Nr(d.type,d.plain),icon:Hn(d.icon),loading:r===d.name,disabled:r!==null&&r!==d.name,onClick:()=>void c(d),children:d.desc},d.name)}return a.jsxs("div",{className:"yk-command-bar",children:[a.jsxs("div",{className:"yk-command-bar__actions",children:[i.map(u),t&&a.jsx(Hd,{count:t.selectedRows.length,onSelectAll:()=>t.selectAllOnPage(),onInvert:()=>t.invertSelectionOnPage(),onClear:()=>t.clearSelection()}),n]}),l.length>0&&a.jsx("div",{className:"yk-command-bar__right",children:l.map(u)})]})}function Vd(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("circle",{cx:"9",cy:"6",r:"2.4",fill:"#fff"}),a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("circle",{cx:"15",cy:"12",r:"2.4",fill:"#fff"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"}),a.jsx("circle",{cx:"9",cy:"18",r:"2.4",fill:"#fff"})]})}function $d(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("polyline",{points:"23 4 23 10 17 10"}),a.jsx("polyline",{points:"1 20 1 14 7 14"}),a.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Ud(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),a.jsx("polyline",{points:"7 10 12 15 17 10"}),a.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function zd(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"yk-table-action-menu-button__icon","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function Ht({checked:e}){return a.jsx("span",{className:"yk-table-action-menu-button__check",children:e?"✓":""})}const rs=o.forwardRef(function({table:t,trigger:n,className:r},s){const[,i]=o.useReducer(u=>u+1,0);function l(u){switch(u){case"refresh":t.refresh();break;case"config":t.openConfigDialog();break;case"export":t.openExportDialog();break;case"view-table":t.setViewMode("table");break;case"view-card":t.setViewMode("card");break;case"view-list":t.setViewMode("list");break;case"toggle-checkbox":t.setSelectable(!t.selectable);break;case"toggle-column-resize":t.setColumnResizable(!t.columnResizable);break;case"toggle-sticky-header":t.setStickyHeader(!t.stickyHeader);break}}const c=[{key:"refresh",label:a.jsxs(a.Fragment,{children:[a.jsx($d,{}),"刷新"]})},{key:"export",label:a.jsxs(a.Fragment,{children:[a.jsx(Ud,{}),"导出 Excel"]})},{key:"config",label:a.jsxs(a.Fragment,{children:[a.jsx(zd,{}),"列设置"]})},{type:"divider"},{key:"view-table",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="table"}),"表格视图"]})},...t.slotNames.includes("card")?[{key:"view-card",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="card"}),"卡片视图"]})}]:[],...t.slotNames.includes("list")?[{key:"view-list",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.viewMode==="list"}),"列表视图"]})}]:[],{type:"divider"},{key:"toggle-checkbox",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.selectable}),"选择行"]})},{key:"toggle-column-resize",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.columnResizable}),"列宽拖动"]})},{key:"toggle-sticky-header",label:a.jsxs(a.Fragment,{children:[a.jsx(Ht,{checked:t.stickyHeader}),"锁定表头"]})}];return a.jsx(f.Dropdown,{trigger:["click"],placement:"bottomRight",onOpenChange:u=>{u&&i()},overlay:a.jsx(f.Menu,{items:c,onClick:({key:u})=>l(u)}),children:n?a.jsx("span",{className:"yk-table-action-menu-button__trigger",children:n}):a.jsx(f.Button,{ref:s,className:`yk-table-action-menu-button__btn${r?` ${r}`:""}`,title:"表格操作","aria-label":"表格操作",children:a.jsx(Vd,{})})})});rs.displayName="YsTableActionMenuButton";const Gd=[10,20,50,100],Qd=[],qd=[],Zd=[],Kd=[],Jd=[];function Bs(e){if(e!=null)return typeof e=="function"?e:()=>e}function gr(e){return typeof e=="function"?e():e}const oi=o.forwardRef(function(t,n){const{metaFun:r,dataFun:s,rowActionsFunc:i,pageSize:l=20,pageSizes:c=Gd,showCheckbox:u=!1,columnResizable:d=!0,stickyHeader:m=!1,loadCustomConfigFun:p,saveCustomConfigFun:w,exportPageSize:k=1e3,exportorFunc:C,collectPageSize:A=1e3,maxCollectCount:N=1e4,collectorFunc:q,collectorTitle:W,rowKey:ie="id",viewMode:S="table",actions:I=qd,showSearch:H=!0,showReset:Me=!0,searchButtonText:pe="查询",resetButtonText:xe="重置",enableAdvancedFilter:Oe=!1,advancedColumns:ne=Qd,advancedOptionSources:de,showQuickQuery:ce=!1,quickQueries:J,loadQuickQueryFun:ye,saveQuickQueryFun:G,singleLine:h=!1}=t,R=o.useRef(j.emptyFilter()),T=o.useRef(null),[U,ue]=o.useState(null),Z=o.useRef(null),te=o.useCallback(y=>{T.current=y,ue(y)},[]),F=o.useCallback(()=>T.current,[]),[,Ce]=o.useState(0),De=o.useCallback(()=>{Ce(y=>y+1)},[]),je=o.useCallback((y,V)=>s(y,R.current,V),[s]),P=o.useCallback(y=>{var V,Ve;R.current=y,(V=t.onSearch)==null||V.call(t,y),(Ve=T.current)==null||Ve.reload()},[t.onSearch]),X=o.useCallback(()=>{var y,V;R.current=j.emptyFilter(),(y=t.onReset)==null||y.call(t),(V=T.current)==null||V.reload()},[t.onReset]);return o.useImperativeHandle(n,()=>({get table(){return F()},get filterPanel(){return Z.current},get meta(){var y;return((y=F())==null?void 0:y.meta)??null},get paged(){var y;return((y=F())==null?void 0:y.paged)??null},get currentPage(){var y;return((y=F())==null?void 0:y.currentPage)??1},get viewMode(){var y;return((y=F())==null?void 0:y.viewMode)??"table"},get selectable(){var y;return((y=F())==null?void 0:y.selectable)??!1},get columnResizable(){var y;return((y=F())==null?void 0:y.columnResizable)??!0},get stickyHeader(){var y;return((y=F())==null?void 0:y.stickyHeader)??!1},get slotNames(){var y;return((y=F())==null?void 0:y.slotNames)??Jd},get selectedRows(){var y;return((y=F())==null?void 0:y.selectedRows)??Zd},get rows(){var y;return((y=F())==null?void 0:y.rows)??Kd},reload:()=>{var y;(y=F())==null||y.reload()},refresh:()=>{var y;(y=F())==null||y.refresh()},setViewMode:y=>{var V;(V=F())==null||V.setViewMode(y)},setSelectable:y=>{var V;(V=F())==null||V.setSelectable(y)},setColumnResizable:y=>{var V;(V=F())==null||V.setColumnResizable(y)},setStickyHeader:y=>{var V;(V=F())==null||V.setStickyHeader(y)},clearSelection:()=>{var y;(y=F())==null||y.clearSelection()},selectAllOnPage:()=>{var y;(y=F())==null||y.selectAllOnPage()},invertSelectionOnPage:()=>{var y;(y=F())==null||y.invertSelectionOnPage()},openConfigDialog:()=>{var y;(y=F())==null||y.openConfigDialog()},openExportDialog:()=>{var y;(y=F())==null||y.openExportDialog()},openCollectDialog:y=>{var V;(V=F())==null||V.openCollectDialog(y)}}),[F]),a.jsxs("div",{className:"yk-table-page",children:[a.jsxs("div",{className:"yk-table-page__filter-row",children:[a.jsx("div",{className:"yk-table-page__filter",children:a.jsx(ii,{ref:Z,showSearch:H,showReset:Me,searchButtonText:pe,resetButtonText:xe,enableAdvancedFilter:Oe,advancedColumns:ne,advancedOptionSources:de,showQuickQuery:ce,quickQueries:J,loadQuickQueryFun:ye,saveQuickQueryFun:G,singleLine:h,onSearch:P,onReset:X,onUpdateQuickQueries:t.onUpdateQuickQueries,children:t.children})}),a.jsx("div",{className:"yk-table-page__filter-extra",children:t.filterExtra===void 0?U?a.jsx(rs,{table:U}):null:t.filterExtra})]}),a.jsx("div",{className:"yk-table-page__command",children:a.jsx(li,{actions:I,table:U,children:t.commandBar})}),a.jsx("div",{className:"yk-table-page__table",children:a.jsx(Us,{ref:te,metaFun:r,dataFun:je,rowActionsFunc:i,pageSize:l,pageSizes:c,showCheckbox:u,columnResizable:d,stickyHeader:m,loadCustomConfigFun:p,saveCustomConfigFun:w,exportPageSize:k,exportorFunc:C,collectPageSize:A,maxCollectCount:N,collectorFunc:q,collectorTitle:W,rowKey:ie,viewMode:S,onDataLoaded:t.onDataLoaded,onUpdateViewMode:t.onUpdateViewMode,onUpdateShowCheckbox:t.onUpdateShowCheckbox,onUpdateColumnResizable:t.onUpdateColumnResizable,onUpdateStickyHeader:t.onUpdateStickyHeader,onSelectionChange:De,card:Bs(t.card),list:Bs(t.list),empty:gr(t.empty),loading:gr(t.loading),footer:gr(t.footer)})})]})});oi.displayName="YsTablePage";const ci=o.forwardRef(function(t,n){const{dataFun:r,pageSize:s=20,threshold:i=100,rowKey:l="id",height:c="100%",immediate:u=!0,showCheckbox:d=!1,metaFun:m,exportorFunc:p,exportPageSize:w=1e3}=t,[k,C]=o.useState([]),[A,N]=o.useState(!1),[q,W]=o.useState(!1),[ie,S]=o.useState(!0),[I,H]=o.useState(null),[Me,pe]=o.useState(0),[xe,Oe]=o.useState(!1),[ne,de]=o.useState(null),ce=o.useRef([]),J=o.useRef(!1),ye=o.useRef(!1),G=o.useRef(!0),h=o.useRef(null),R=o.useRef(t.dataFun),T=o.useRef(t.metaFun),U=o.useRef(s),ue=o.useRef({onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange});R.current=t.dataFun,T.current=t.metaFun,U.current=s,h.current=ne,ue.current={onDataLoaded:t.onDataLoaded,onError:t.onError,onSelectionChange:t.onSelectionChange};const Z=ee.useSelection({rows:k,rowKey:l}),te=o.useRef(Z);te.current=Z;const F=o.useRef(!1);o.useEffect(()=>{var B,he;if(!F.current){F.current=!0;return}(he=(B=ue.current).onSelectionChange)==null||he.call(B,[...Z.selectedRows])},[Z.selectedRows]);const Ce=o.useCallback(async B=>{var he,re,Se,Xe;if(B){if(ye.current||J.current||!G.current)return;ye.current=!0,W(!0)}else{if(J.current)return;J.current=!0,N(!0),H(null)}try{const _t=B?ce.current.length:0,it=await R.current({limit:U.current,offset:_t}),Et=it.items,It=B?[...ce.current,...Et]:Et;ce.current=It,C(It);const Ft=it.hasNext??!1;G.current=Ft,S(Ft),it.totalCount!=null&&(pe(it.totalCount),Oe(!0)),(re=(he=ue.current).onDataLoaded)==null||re.call(he,it,B)}catch(_t){H(_t),(Xe=(Se=ue.current).onError)==null||Xe.call(Se,_t)}finally{B?(ye.current=!1,W(!1)):(J.current=!1,N(!1))}},[]),De=o.useCallback(()=>{Ce(!0)},[Ce]),je=o.useCallback(()=>{G.current=!0,S(!0),Ce(!1)},[Ce]),P=o.useCallback(async()=>{const B=T.current;if(!B){de(null);return}try{de(await B())}catch{de(null)}},[]),X=o.useRef(null),y=o.useRef(null);o.useEffect(()=>{const B=X.current,he=y.current;if(!B||!he||typeof IntersectionObserver>"u")return;const re=new IntersectionObserver(Se=>{Se.some(Xe=>Xe.isIntersecting)&&G.current&&!J.current&&!ye.current&&De()},{root:B,rootMargin:`0px 0px ${i}px 0px`,threshold:0});return re.observe(he),()=>re.disconnect()},[i,De]),o.useEffect(()=>{P(),u&&Ce(!1)},[]);const V=o.useRef(t.dataFun);o.useEffect(()=>{V.current!==t.dataFun&&(V.current=t.dataFun,je())},[t.dataFun,je]);const Ve=o.useRef(t.metaFun);o.useEffect(()=>{Ve.current!==t.metaFun&&(Ve.current=t.metaFun,P())},[t.metaFun,P]);const yt=o.useMemo(()=>{if(ne)return ne.columns.map((re,Se)=>({column:re,index:Se})).filter(({column:re})=>re.showForDisplay!==!1).sort((re,Se)=>(re.column.displayOrder??re.index)-(Se.column.displayOrder??Se.index)).map(({column:re})=>re);const B=new Set,he=[];for(const re of k)for(const Se of Object.keys(re))B.has(Se)||(B.add(Se),he.push({propertyPath:Se}));return he},[ne,k]),tn=(ne==null?void 0:ne.displayName)??"数据",fe=ee.useExportExcel({props:{dataFun:r,exportSelected:d,exportorFunc:p},tableName:tn,columns:yt,currentRows:k,selectedRows:Z.selectedRows,total:Me,totalKnown:xe,exportPageSize:w,hasMorePage:ie,pageScopeLabel:"导出当前已加载"}),Ye=o.useRef(fe);Ye.current=fe;const st=o.useCallback(()=>{Ye.current.onExportClick()},[]);o.useImperativeHandle(n,()=>({get items(){return ce.current},get loading(){return J.current},get loadingMore(){return ye.current},get hasMore(){return G.current},get meta(){return h.current},get selectedRows(){return te.current.selectedRows},get rows(){return ce.current},reload:je,refresh:je,loadNextPage:De,isRowSelected:B=>te.current.isRowSelected(B),toggleRowSelection:(B,he)=>te.current.toggleRowSelection(B,he),clearSelection:()=>te.current.clearSelection(),selectAllOnPage:()=>te.current.selectAllOnPage(),invertSelectionOnPage:()=>te.current.invertSelectionOnPage(),openExportDialog:st}),[De,st,je]);function nn(B,he){const re=t.children;return typeof re=="function"?re(B,he):re??a.jsx("pre",{className:"yk-infinite-list__item-json",children:JSON.stringify(B,null,2)})}const gt=t.error,at=typeof gt=="function"?gt({error:I}):gt;return a.jsxs("div",{ref:X,className:"yk-infinite-list",style:{height:c},children:[k.map((B,he)=>a.jsxs("div",{className:`yk-infinite-list__item${d&&Z.isRowSelected(B)?" is-selected":""}`,children:[d?a.jsx(f.Checkbox,{className:"yk-infinite-list__item-checkbox",checked:Z.isRowSelected(B),onChange:re=>Z.toggleRowSelection(B,re.target.checked)}):null,a.jsx("div",{className:"yk-infinite-list__item-body",children:nn(B,he)})]},String(B[l]))),I?a.jsx("div",{className:"yk-infinite-list__status",children:at??a.jsx(f.Empty,{description:`加载失败:${String(I)}`,children:a.jsx(f.Button,{type:"primary",onClick:je,children:"重试"})})}):!A&&k.length===0?a.jsx("div",{className:"yk-infinite-list__status",children:t.empty??a.jsx(f.Empty,{description:"暂无数据"})}):null,a.jsx("div",{ref:y,className:"yk-infinite-list__sentinel"}),q?a.jsx("div",{className:"yk-infinite-list__loading-more",children:t.loading??a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"yk-infinite-list__spinner"}),a.jsx("span",{children:"加载中..."})]})}):null,!ie&&k.length>0&&!A?a.jsx("div",{className:"yk-infinite-list__no-more",children:t.noMore??a.jsx("span",{children:"— 没有更多了 —"})}):null,a.jsx($s,{open:fe.exportDialogVisible,options:fe.exportOptions,exporting:fe.exporting,fetched:fe.exportFetched,total:fe.exportTotal,totalKnown:fe.exportTotalKnown,percent:fe.exportPercent,etaSeconds:fe.exportEtaSeconds,cancelledVisible:fe.exportCancelledVisible,cancelledRows:fe.exportCancelledRows,onExport:B=>void fe.doExport(B),onCancelExport:fe.cancelExport,onKeepPartial:()=>void fe.keepPartialExport(),onDiscardPartial:()=>void fe.discardPartialExport(),onClose:fe.closeExportDialog})]})});ci.displayName="YsInfiniteList";function Xd(e){return e.icon?a.jsx("i",{className:"yk-main-panel__menu-icon",children:e.icon}):void 0}function jr(e){const t=[];for(const n of e){const r=Xd(n),s=a.jsx("span",{className:"yk-main-panel__menu-text",children:n.label});n.children&&n.children.length>0?t.push({key:n.key,icon:r,label:s,children:jr(n.children)}):t.push({key:n.key,icon:r,label:s})}return t}function ef(){return a.jsx("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14","aria-hidden":"true",className:"yk-main-panel__search-icon",children:a.jsx("path",{fill:"currentColor",d:"M909.098 839.904l-181.22-181.248a341.5 341.5 0 1 0-47.734 48.58l180.56 180.588a33.92 33.92 0 0 0 48.394-47.92zM454.4 745.6a291.2 291.2 0 1 1 291.2-291.2 291.2 291.2 0 0 1-291.2 291.2z"})})}function tf({nodesFunc:e,componentMap:t,defaultActive:n="",showMenuSearch:r=!0,menuKeyword:s="",onUpdateMenuKeyword:i,onTabChange:l}){const[c,u]=o.useState(!1),[d,m]=o.useState(s);o.useEffect(()=>{m(s)},[s]);const p=h=>{m(h),i==null||i(h)},w=d.trim().length>0,{nodes:k,menuLoading:C}=ee.useMainPanelNodes({nodesFunc:e}),{openTabs:A,activeKey:N,setActiveKey:q,openTab:W,removeTab:ie,getComponent:S}=ee.useMainPanelTabs({componentMap:t}),I=o.useMemo(()=>ee.filterNodesByKeyword(k,d),[k,d]),H=o.useMemo(()=>ee.collectGroupKeys(I),[I]),Me=o.useMemo(()=>jr(k),[k]),pe=o.useMemo(()=>jr(I),[I]),xe=({key:h})=>{const R=ee.findNode(k,h);R&&!ee.isGroupNode(R)&&W(R)},Oe=o.useRef(k),ne=o.useRef(!1),de=o.useRef(!1);o.useEffect(()=>{if(!ne.current)if(k!==Oe.current)ne.current=!0;else return;if(de.current||(de.current=!0,!n))return;const h=ee.findNode(k,n);h&&!ee.isGroupNode(h)&&W(h)},[k,n,W]);const ce=o.useRef(N),J=o.useRef(l);J.current=l,o.useEffect(()=>{var h;ce.current!==N&&(ce.current=N,(h=J.current)==null||h.call(J,N))},[N]);const ye=A.map(h=>{const R=h.componentPath?S(h.componentPath):null;return{key:h.key,label:h.label,closable:!0,forceRender:!0,children:R?a.jsx(o.Suspense,{fallback:a.jsx("div",{className:"yk-main-panel__loading",children:a.jsx(f.Spin,{size:"small"})}),children:a.jsx(R,{...h.props??{}})}):null}}),G="yk-main-panel__menu";return a.jsxs("div",{className:"yk-main-panel",children:[a.jsxs("aside",{className:`yk-main-panel__aside${c?" is-collapsed":""}`,children:[a.jsxs("div",{className:"yk-main-panel__aside-header",children:[a.jsx(f.Button,{type:"text",size:"small",className:"yk-main-panel__collapse-btn",title:c?"展开菜单":"折叠菜单",onClick:()=>u(h=>!h),children:"☰"}),r&&!c&&a.jsx(f.Input,{className:"yk-main-panel__aside-search",size:"small",allowClear:!0,placeholder:"搜索功能","aria-label":"搜索功能",value:d,prefix:a.jsx(ef,{}),onChange:h=>p(h.target.value)})]}),a.jsx("div",{className:"yk-main-panel__menu-wrap",children:a.jsx(f.Spin,{spinning:C,size:"small",children:w?a.jsxs(a.Fragment,{children:[a.jsx(f.Menu,{mode:"inline",className:G,inlineCollapsed:c,items:pe,selectedKeys:N?[N]:[],defaultOpenKeys:H,onClick:xe},`search-${d}`),I.length===0&&!C&&a.jsx("div",{className:"yk-main-panel__menu-empty",children:"未找到匹配的功能"})]}):a.jsx(f.Menu,{mode:"inline",className:G,inlineCollapsed:c,items:Me,selectedKeys:N?[N]:[],onClick:xe},"full")})})]}),a.jsx("main",{className:"yk-main-panel__main",children:A.length>0?a.jsx(f.Tabs,{className:"yk-main-panel__tabs",type:"editable-card",hideAdd:!0,activeKey:N,items:ye,onChange:h=>q(h),onEdit:(h,R)=>{R==="remove"&&typeof h!="object"&&ie(h)}}):a.jsx("div",{className:"yk-main-panel__empty",children:a.jsx(f.Empty,{description:"暂无打开的功能,从左侧菜单选择"})})})]})}function pn(e){ee.useFilterItem(e.api);const t=e.minWidth??200;return a.jsxs("div",{className:"yk-filter-item",style:{minWidth:`${t}px`},children:[a.jsx("label",{className:"yk-filter-item__label",children:e.label}),a.jsx("div",{className:"yk-filter-item__control",children:e.children})]})}const nf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useTextFilterItem(t),c=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);return o.useImperativeHandle(n,()=>c,[c]),a.jsx(pn,{label:t.label,api:c,children:a.jsx(f.Input,{value:r,onChange:u=>s(u.target.value),placeholder:t.placeholder,allowClear:!0})})}),rf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useDateFilterItem(t),c=t.valueFormat??"YYYY-MM-DD",u=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);return o.useImperativeHandle(n,()=>u,[u]),a.jsx(pn,{label:t.label,api:u,children:a.jsx(f.DatePicker,{value:r?x(r):null,format:c,onChange:(d,m)=>s(typeof m=="string"?m:""),placeholder:t.placeholder,allowClear:!0})})}),sf=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useDateRangeFilterItem({propertyPath:t.propertyPath,defaultValue:t.defaultValue}),c=t.valueFormat??"YYYY-MM-DD",u=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);o.useImperativeHandle(n,()=>u,[u]);const d=r&&r.length===2?[x(r[0]),x(r[1])]:null;return a.jsx(pn,{label:t.label,api:u,minWidth:240,children:a.jsx(f.DatePicker.RangePicker,{value:d,format:c,onChange:(m,p)=>{s(m?[p[0],p[1]]:null)},placeholder:[t.startPlaceholder??"开始日期",t.endPlaceholder??"结束日期"],disabledDate:t.disabledDate?m=>{var p;return((p=t.disabledDate)==null?void 0:p.call(t,m.toDate()))??!1}:void 0,allowClear:!0})})}),af=o.forwardRef(function(t,n){const{value:r,setValue:s,filter:i,reset:l}=ee.useEnumFilterItem({op:t.op,propertyPath:t.propertyPath,defaultValue:t.defaultValue,multiple:t.multiple}),[c,u]=o.useState([]),[d,m]=o.useState(!1),p=o.useRef(t.optionsSource);p.current=t.optionsSource,o.useEffect(()=>{let C=!0;return m(!0),p.current().then(A=>{C&&u(A)}).finally(()=>{C&&m(!1)}),()=>{C=!1}},[]);const w=o.useMemo(()=>({get filter(){return i},reset:l}),[i,l]);o.useImperativeHandle(n,()=>w,[w]);const k=c.map(C=>({label:C.label,value:C.value}));return a.jsx(pn,{label:t.label,api:w,children:t.multiple?a.jsx(f.Select,{mode:"multiple",value:Array.isArray(r)?r:[],options:k,onChange:C=>s(C),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d}):a.jsx(f.Select,{value:r??void 0,options:k,onChange:C=>s(C??null),placeholder:t.placeholder,allowClear:t.clearable??!0,loading:d})})});function ui(e){if(e==null)return"";if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function lf({open:e,row:t,columns:n,saver:r,onClose:s,onSaved:i}){const[l,c]=o.useState({}),[u,d]=o.useState([]);o.useEffect(()=>{if(!e||!t)return;const w={};for(const k of n)w[k.name]=ui(t.data[k.name]);c(w),d([])},[e,t,n]);function m(){s==null||s()}function p(){if(!t)return;const w={};for(const A of n)w[A.name]=l[A.name]??"";const{row:k,errors:C}=r(t,w);d(C),!(C.length>0)&&(i==null||i(k),m())}return a.jsxs(f.Modal,{open:e,title:t?`编辑第 ${t.rowNumber} 行`:"编辑数据行",width:480,maskClosable:!1,destroyOnClose:!0,onCancel:m,footer:a.jsxs(a.Fragment,{children:[a.jsx(f.Button,{onClick:m,children:"取消"}),a.jsx(f.Button,{type:"primary",onClick:p,children:"保存并重新校验"})]}),children:[u.length>0?a.jsx(f.Alert,{className:"yk-import-row-edit-dialog__alert",type:"error",showIcon:!0,message:a.jsx(a.Fragment,{children:u.map((w,k)=>a.jsx("div",{children:w},k))})}):null,a.jsx(f.Form,{labelCol:{flex:"0 0 92px"},wrapperCol:{flex:"auto"},children:n.map(w=>a.jsx(f.Form.Item,{label:w.name,required:!w.optional,children:a.jsx(f.Input,{value:l[w.name]??"",placeholder:w.optional?"可留空":`请输入${w.name}`,onChange:k=>c(C=>({...C,[w.name]:k.target.value})),onPressEnter:p})},w.name))})]})}const _r={valid:{label:"待处理"},invalid:{label:"校验失败",color:"red"},processing:{label:"处理中",color:"orange"},success:{label:"成功",color:"green"},failed:{label:"失败",color:"red"}};function of(e){const t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t} 秒`;const n=Math.floor(t/60),r=t%60;return r>0?`${n} 分 ${r} 秒`:`${n} 分`}function Nn(e){var t;return Array.from(((t=e.dataTransfer)==null?void 0:t.types)??[]).includes("Files")}function cf(){return a.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 20h9"}),a.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function uf(){return a.jsxs("svg",{className:"yk-import-excel__action-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const df=o.forwardRef(function(t,n){var xn;const{columns:r,processor:s,parser:i,accept:l=".xlsx",autoScroll:c=!0,title:u,maxHeight:d}=t,{rows:m,fileName:p,sheetName:w,loading:k,processing:C,stopping:A,processingTotal:N,progressDone:q,progressSuccess:W,progressFailed:ie,hasData:S,invalidCount:I,selectedCount:H,pendingCount:Me,loadFile:pe,syncSelection:xe,saveRowEdit:Oe,removeRow:ne,startProcessing:de,stopProcessing:ce,clear:J}=ee.useImportExcel({columns:r,processor:s,parser:i}),ye=o.useRef(null),G=o.useRef(null),h=o.useRef(w);h.current=w;const[R,T]=o.useState(0),U=R>0;function ue(v){const b=l.split(",").map(ge=>ge.trim().toLowerCase()).filter(Boolean);if(b.length===0)return!0;const Q=v.name.toLowerCase();return b.some(ge=>Q.endsWith(ge))}async function Z(v){var b;if(!k){if(!ue(v)){f.message.error(`仅支持 ${l} 格式的文件`);return}try{const Q=await pe(v);(b=t.onLoaded)==null||b.call(t,Q),setTimeout(()=>{const ge=h.current;f.message.success(`已加载 ${Q.length} 行${ge?`(工作表「${ge}」)`:""}`)},0)}catch(Q){f.message.error(Q instanceof Error?Q.message:String(Q))}}}async function te(v){var ge;const b=v.target,Q=(ge=b.files)==null?void 0:ge[0];b.value="",Q&&await Z(Q)}function F(){var v;(v=ye.current)==null||v.click()}function Ce(v){Nn(v)&&T(b=>b+1)}function De(v){Nn(v)&&(v.preventDefault(),v.dataTransfer&&(v.dataTransfer.dropEffect="copy"))}function je(v){Nn(v)&&T(b=>Math.max(0,b-1))}function P(v){var Q,ge;if(!Nn(v))return;v.preventDefault(),T(0);const b=(ge=(Q=v.dataTransfer)==null?void 0:Q.files)==null?void 0:ge[0];b&&Z(b)}const X=o.useRef(0),[y,V]=o.useState(0);o.useEffect(()=>{if(!C)return;X.current=Date.now(),V(Date.now());const v=setInterval(()=>V(Date.now()),500);return()=>clearInterval(v)},[C]);const Ve=N<=0?0:Math.min(100,q/N*100),yt=!C||q===0?"预计剩余 计算中…":`预计剩余 ${of((y-X.current)/q*(N-q))}`,[tn,fe]=o.useState(360);o.useEffect(()=>{const v=G.current;if(!v)return;const b=()=>{var At;const ge=((At=v.querySelector(".ant-table-thead"))==null?void 0:At.getBoundingClientRect().height)??39;let Ct=Math.max(120,Math.floor(v.clientHeight-ge-1));typeof d=="number"&&(Ct=Math.min(Ct,d)),fe(Ct)};b();const Q=new ResizeObserver(b);return Q.observe(v),()=>Q.disconnect()},[d,S]);const Ye=((xn=m.find(v=>v.status==="processing"))==null?void 0:xn.rowNumber)??null;o.useEffect(()=>{var kn,wn;if(Ye===null||!c)return;const v=(kn=G.current)==null?void 0:kn.querySelector(".ant-table-body"),b=(wn=G.current)==null?void 0:wn.querySelector(`.ant-table-tbody tr[data-row-key="${Ye}"]`);if(!v||!b)return;const Q=v.getBoundingClientRect(),ge=b.getBoundingClientRect(),Ct=Math.max(0,v.scrollHeight-v.clientHeight),At=v.scrollTop+(ge.top-Q.top)-(v.clientHeight-ge.height)/2;v.scrollTop=Math.min(Ct,Math.max(0,Math.round(At)))},[Ye,c]);const st=m.filter(v=>v.selected).map(v=>v.rowNumber);function nn(v){return v.status!=="invalid"}function gt(v){var Q;const b=m.filter(ge=>v.includes(ge.rowNumber));xe(b),(Q=t.onSelectionChange)==null||Q.call(t,b)}async function at(){var v;try{const b=await de();if(!b)return;if((v=t.onProcessed)==null||v.call(t,b),b.stopped){const Q=b.total-b.success-b.failed;f.message.warning(`已停止:成功 ${b.success} 行,失败 ${b.failed} 行,剩余 ${Q} 行未处理(可再次「开始处理」续跑)`)}else b.failed===0?f.message.success(`全部处理完成,共 ${b.success} 行`):f.message.warning(`处理完成:成功 ${b.success} 行,失败 ${b.failed} 行`)}catch(b){f.message.error(b instanceof Error?b.message:String(b))}}const[B,he]=o.useState(!1),[re,Se]=o.useState(null);function Xe(v){return!C&&(v.status==="invalid"||v.status==="failed")}function _t(v){Xe(v)&&(Se(v),he(!0))}function it(v){var b;(b=t.onRowUpdate)==null||b.call(t,v),f.message.success(`第 ${v.rowNumber} 行已修正,可重新处理`)}function Et(v){Xe(v)&&f.Modal.confirm({title:"删除数据行",content:`确定删除第 ${v.rowNumber} 行吗?删除后不可恢复。`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onOk:()=>{var b;ne(v),(b=t.onRowRemove)==null||b.call(t,v),f.message.success(`已删除第 ${v.rowNumber} 行`)}})}o.useImperativeHandle(n,()=>({openFilePicker:F,startProcessing:at,stopProcessing:ce,clear:J}));const It=Object.keys(_r).map(v=>({text:`${_r[v].label}(${m.filter(b=>b.status===v).length})`,value:v})),Ft=[{title:"行号",key:"rowNumber",width:70,align:"center",fixed:"left",render:(v,b,Q)=>a.jsx("span",{title:`Excel 第 ${b.rowNumber} 行`,children:Q+1})},...r.map(v=>({title:v.name,key:v.name,width:120,ellipsis:{showTitle:!0},render:(b,Q)=>ui(Q.data[v.name])})),{title:"状态",key:"status",dataIndex:"status",width:200,fixed:"right",className:"yk-import-excel__status-cell",filters:It,filterMultiple:!1,onFilter:(v,b)=>b.status===v,render:(v,b)=>{const Q=_r[b.status];return a.jsxs(a.Fragment,{children:[a.jsxs(f.Tag,{color:Q.color,children:[b.status==="processing"?a.jsx("span",{className:"yk-import-excel__spin"}):null,Q.label]}),b.status==="invalid"?a.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.errors.join(";")}):b.message?a.jsx("div",{className:"yk-import-excel__msg yk-import-excel__msg--danger",children:b.message}):null]})}},{title:"操作",key:"action",width:110,align:"center",fixed:"right",render:(v,b)=>Xe(b)?a.jsxs("div",{className:"yk-import-excel__actions",children:[a.jsx(f.Button,{type:"link",size:"small",icon:a.jsx(cf,{}),onClick:()=>_t(b),children:"编辑"}),a.jsx(f.Button,{type:"link",size:"small",danger:!0,icon:a.jsx(uf,{}),onClick:()=>Et(b),children:"删除"})]}):a.jsx("span",{className:"yk-import-excel__action-placeholder",children:"—"})}],tr={selectedRowKeys:st,columnWidth:44,getCheckboxProps:v=>({disabled:!nn(v)}),onChange:gt};return a.jsxs("div",{className:"yk-import-excel",onDragEnter:Ce,onDragOver:De,onDragLeave:je,onDrop:P,children:[a.jsx("input",{ref:ye,className:"yk-import-excel__file",type:"file",accept:l,onChange:te}),u?a.jsx("div",{className:"yk-import-excel__title",children:u}):null,a.jsxs("div",{className:"yk-import-excel__toolbar",children:[a.jsx(f.Button,{type:"primary",loading:k,onClick:F,children:"选择 Excel 文件"}),a.jsxs(f.Button,{type:"primary",loading:C,disabled:Me===0,onClick:at,children:["开始处理",Me>0?`(${Me} 行)`:""]}),C?a.jsx(f.Button,{danger:!0,disabled:A,onClick:ce,children:A?"正在停止…":"停止"}):null,a.jsx(f.Button,{disabled:!S||C,onClick:J,children:"清空"}),p?a.jsxs("span",{className:"yk-import-excel__file-name",title:p,children:[p,w?`(工作表:${w})`:""]}):null,S?a.jsxs("div",{className:"yk-import-excel__stats",children:[a.jsxs("span",{className:"yk-import-excel__stat",children:["共 ",m.length," 行"]}),a.jsxs("span",{className:"yk-import-excel__stat",children:["已选 ",H]}),a.jsxs("span",{className:"yk-import-excel__stat yk-import-excel__stat--danger",children:["校验失败 ",I]})]}):null]}),C?a.jsxs("div",{className:"yk-import-excel__progress",children:[a.jsx(f.Progress,{className:"yk-import-excel__progress-bar",percent:Ve,status:"active",format:()=>`${q}/${N}`}),a.jsxs("span",{className:"yk-import-excel__progress-meta",children:["成功 ",W,a.jsxs("span",{className:"yk-import-excel__danger-text",children:[" ","/ 失败 ",ie]})]}),a.jsx("span",{className:"yk-import-excel__progress-eta",children:yt})]}):null,a.jsx("div",{ref:G,className:"yk-import-excel__body",children:a.jsx(f.Spin,{spinning:k,wrapperClassName:"yk-import-excel__loading",children:S?a.jsx(f.Table,{className:"yk-import-excel__table",rowKey:"rowNumber",columns:Ft,dataSource:m,bordered:!0,size:"small",pagination:!1,rowSelection:tr,scroll:{x:"max-content",y:tn},rowClassName:(v,b)=>b%2===1?"yk-import-excel__row-alt":""}):a.jsxs("div",{className:"yk-import-excel__empty",onClick:F,children:[a.jsxs("svg",{className:"yk-import-excel__empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("path",{d:"M12 18v-6"}),a.jsx("polyline",{points:"9.5 14.5 12 12l2.5 2.5"})]}),a.jsx("p",{className:"yk-import-excel__empty-title",children:"点击选择 Excel 文件,或将文件拖拽到此处"}),a.jsxs("p",{className:"yk-import-excel__empty-hint",children:["支持 ",l," 格式,首行需为表头"]})]})})}),U?a.jsx("div",{className:"yk-import-excel__drop-mask",children:a.jsxs("div",{className:"yk-import-excel__drop-tip",children:[a.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 15V3"}),a.jsx("polyline",{points:"7 8 12 3 17 8"}),a.jsx("path",{d:"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4"})]}),a.jsx("span",{children:"松开鼠标,加载 Excel 文件"})]})}):null,a.jsx(lf,{open:B,row:re,columns:r,saver:Oe,onClose:()=>he(!1),onSaved:it})]})});var Or,Rn=Vs;if(process.env.NODE_ENV==="production")Or=Rn.createRoot,Rn.hydrateRoot;else{var Hs=Rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Or=function(e,t){Hs.usingClientEntryPoint=!0;try{return Rn.createRoot(e,t)}finally{Hs.usingClientEntryPoint=!1}}}function ff(){return a.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"})})}function hf(){return a.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"8",y:"8",width:"12",height:"12",rx:"2"}),a.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10"})]})}const mf=o.forwardRef(function(t,n){const{title:r,width:s,heightValue:i,component:l,componentProps:c,actions:u,onCancel:d,onClosed:m,closeOnClickModal:p,closeOnPressEscape:w,maximizable:k,defaultMaximized:C,contentRef:A,modalHandle:N,destroy:q}=t,[W,ie]=o.useState(!0),[S,I]=o.useState(-1),[H,Me]=o.useState(k&&C),pe=()=>{k&&Me(G=>!G)},xe=()=>{ie(!1)},Oe=()=>{S>=0||(d==null||d(),ie(!1))},ne=async(G,h)=>{if(!(S>=0)){I(h);try{await G.execute(N)}finally{I(-1)}}};o.useImperativeHandle(n,()=>({close:xe,toggleMaximize:pe,isMaximized:()=>H}),[k,H]);const de=k?a.jsxs("div",{className:"yk-modal__title-row",children:[a.jsx("span",{className:"yk-modal__title-text",children:r}),a.jsx(f.Button,{type:"text",size:"small",className:"yk-modal__maximize",title:H?"还原":"最大化","aria-label":H?"还原":"最大化",onClick:pe,children:H?a.jsx(hf,{}):a.jsx(ff,{})})]}):r,ce=u&&u.length>0?a.jsx("div",{className:"yk-modal__footer",children:u.map((G,h)=>{const{type:R,danger:T}=Nr(G.type);return a.jsx(f.Button,{type:R,danger:T,title:G.desc,disabled:S>=0&&S!==h,loading:S===h,onClick:()=>void ne(G,h),icon:G.icon?a.jsx("span",{className:"yk-modal__action-icon",children:Hn(G.icon)}):void 0,children:G.desc},G.name)})}):null,J={...H?{top:0}:{},...i&&!H?{"--yk-modal-height":i}:{}},ye=["yk-modal",H?"yk-modal--maximized":i?"yk-modal--fixed-height":""].filter(Boolean).join(" ");return a.jsx(f.Modal,{open:W,title:de,width:s,style:J,wrapClassName:ye,closable:S<0,maskClosable:p,keyboard:w,destroyOnClose:!0,onCancel:Oe,afterClose:()=>{m==null||m(),q()},footer:ce,children:o.createElement(l,{...c??{},onClose:xe,ref:A})})});function yf(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function di(e){const{title:t="",width:n="500px",height:r,component:s,props:i,actions:l,onCancel:c,onClosed:u,closeOnClickModal:d=!1,closeOnPressEscape:m=!1,maximizable:p=!1,defaultMaximized:w=!1}=e,k=document.createElement("div");document.body.appendChild(k);const C=Or(k);let A=!1;const N=()=>{A||(A=!0,C.unmount(),k.remove())},q={current:null},W={current:null},ie={close:()=>{var S;return(S=q.current)==null?void 0:S.close()},toggleMaximize:()=>{var S;return(S=q.current)==null?void 0:S.toggleMaximize()},isMaximized:()=>{var S;return((S=q.current)==null?void 0:S.isMaximized())??!1},getContentInstance:()=>W.current??null};return C.render(a.jsx(mf,{ref:q,title:t,width:n,heightValue:yf(r),component:s,componentProps:i,actions:l,onCancel:c,onClosed:u,closeOnClickModal:d,closeOnPressEscape:m,maximizable:p,defaultMaximized:w,contentRef:W,modalHandle:ie,destroy:N})),ie}function gf(e){const{confirmText:t="确定",cancelText:n="取消",confirmType:r="primary",onConfirm:s,...i}=e;return di({...i,actions:[{name:"cancel",desc:n,execute:c=>c.close()},{name:"confirm",desc:t,type:r,execute:async c=>{if(!s){c.close();return}await s(c)!==!1&&c.close()}}]})}Object.defineProperty(exports,"fromArray",{enumerable:!0,get:()=>j.fromArray});Object.defineProperty(exports,"fromBool",{enumerable:!0,get:()=>j.fromBool});Object.defineProperty(exports,"fromObjectItems",{enumerable:!0,get:()=>j.fromObjectItems});Object.defineProperty(exports,"fromOptions",{enumerable:!0,get:()=>j.fromOptions});exports.YsAdvancedConditionGroup=ns;exports.YsAdvancedFilterPanel=ri;exports.YsAdvancedValueEditor=ti;exports.YsCommandBar=li;exports.YsDateFilterItem=rf;exports.YsDateRangeFilterItem=sf;exports.YsEnumFilterItem=af;exports.YsFilterItemLayout=pn;exports.YsFilterPanel=ii;exports.YsImportExcel=df;exports.YsInfiniteList=ci;exports.YsMainPanel=tf;exports.YsRootFilterPanel=si;exports.YsTable=Us;exports.YsTableActionMenuButton=rs;exports.YsTablePage=oi;exports.YsTextFilterItem=nf;exports.openDialog=gf;exports.openModal=di;
12
12
  //# sourceMappingURL=index.cjs.map