Files
GenericAgent/frontends/desktop/dist/assets/index-BkPDmlaQ.js
T
YI QI LIMandabraxas914 efb3bc6ad1 feat(desktop): compiled React Desktop 2.0 v0.2.1 renderer update (#787)
* fix(desktop): expose explicit backup capabilities

* fix(desktop): align titlebar controls with native metrics

* release(desktop): prepare portable v0.2.1

* build(desktop): rebuild compiled dist from source 4a67226

Rebuild the compiled-only React Desktop 2.0 renderer from abraxas914/GenericAgent
main @4a67226, carrying the v0.2.1 iterations that PR #784 was closed to await:
live turn-timer persistence across session switch, Mixin image-to-path fallback,
folder drag-drop, per-turn duration, and image-thumbnail repair.

- dist/**: regenerated 98 manifest assets + entry HTML
- build-provenance.json: sourceCommit -> 4a67226, manifest sha256 recomputed
- verify-compiled-dist.mjs: expectedSourceCommit -> 4a67226
- dist/README.md: provenance source commit updated
- desktop_bridge.py, test_bridge_origin_security.py: synced to 4a67226
- core (agentmain.py, llmcore*, src/**, public/**) remains zero-diff vs upstream

---------

Co-authored-by: abraxas914 <abraxas345589144233@outlook.com>
2026-08-30 14:21:51 +08:00

5 lines
267 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{g as te,C as _t,c as Oe,b as L,R as b,P as a,B as X,f as ge,i as Ce,l as M,au as qt,aR as va,ad as Ca,aS as Gt,aT as Qo,aU as Jo,K as ei,L as _a,D as Oa,aV as ti,aW as Ra,aX as Ea,aY as ni,v as xa,y as Ta,N as x,aZ as Ps,n as ft,w as $e,a_ as Yt,h as H,k as he,o as jt,aL as re,a$ as Ia,b0 as As,a as Pa,u as si,b1 as Aa,b2 as Da,b3 as ri,G as oi,b4 as Na,b5 as Ds,t as ii,b6 as Ns,b7 as ai,b8 as ka,b9 as li,M as La,_ as ue,az as Pt,s as ks,a0 as Ma,V as ye,J as je,p as Et,E as ja,ae as Xt,aQ as yt,X as Ee,aa as za,ba as Fa,bb as Ka,bc as $a,bd as Ba,m as hr,O as Ls,aH as ci,ag as Ms,be as Ha,bf as Wa,bg as le,bh as Ua,x as di,A as Va,bi as Zt,ax as Ne,bj as qa,bk as we,ab as ui,Y as hi,j as Ae,bl as Ga,bm as Ya,d as Xa,e as Za,aJ as Qa,bn as Ja,H as el,bo as St,bp as pr,bq as zt,br as tl}from"./tauri-compat-D_GD_wMe.js";import{_ as gt,r as nl,o as pi,p as sl,q as rl,v as ol,w as il,x as fi,y as al,T as mt,z as gi,F as fr,I as ll,A as cl,D as gr,G as Fe,R as dl,a as Re,j as ul}from"./main-j7e_THPB.js";import{S as mi}from"./index-D9Nakaf3.js";import{B as Ft,I as hl}from"./index-9FI8Jlf5.js";const pl=["default","error","warning","success"];var fl=_t();const gl=te(fl);function mr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _s(i,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},_s(i,e)}function ml(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m17.55 15.66-4.8 5.48a1 1 0 0 1-1.5 0l-4.8-5.48A1 1 0 0 1 7.2 14h9.6a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const bl=Oe(ml,"caretdown");function yl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m6.45 8.34 4.8-5.48a1 1 0 0 1 1.5 0l4.8 5.48A1 1 0 0 1 16.8 10H7.2a1 1 0 0 1-.75-1.66Z",fill:"currentColor"}))}const Sl=Oe(yl,"caretup");function wl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"M5 12.5c0-.83.67-1.5 1.5-1.5h11a1.5 1.5 0 0 1 0 3h-11A1.5 1.5 0 0 1 5 12.5Z",fill:"currentColor"}))}const vl=Oe(wl,"checkbox_indeterminate");function Cl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.41 7.3c.66.51.78 1.45.28 2.11l-6.5 8.5a1.5 1.5 0 0 1-2.37.01l-3.5-4.5a1.5 1.5 0 1 1 2.36-1.84L10 14.54l5.32-6.95a1.5 1.5 0 0 1 2.1-.28Z",fill:"currentColor"}))}const _l=Oe(Cl,"checkbox_tick");function Ol(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.28 4.24a1.5 1.5 0 0 1 0 2.12l-5.66 5.66 5.66 5.65a1.5 1.5 0 1 1-2.12 2.13l-6.72-6.72a1.5 1.5 0 0 1 0-2.12l6.72-6.72a1.5 1.5 0 0 1 2.12 0Z",fill:"currentColor"}))}const bi=Oe(Ol,"chevron_left");function Rl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.44 19.8a1.5 1.5 0 0 1 0-2.13l5.66-5.65-5.66-5.66a1.5 1.5 0 1 1 2.12-2.12l6.72 6.72a1.5 1.5 0 0 1 0 2.12L9.56 19.8a1.5 1.5 0 0 1-2.12 0Z",fill:"currentColor"}))}const js=Oe(Rl,"chevron_right");function El(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.1 2.58A1 1 0 0 1 2 2h20a1 1 0 0 1 .76 1.65l-8.2 9.18V21a1 1 0 0 1-1.44.9l-3.07-2a1 1 0 0 1-.55-.9v-6.17L1.24 3.65a1 1 0 0 1-.15-1.07Z",fill:"currentColor"}))}const xl=Oe(El,"filter");function Tl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))}const Il=Oe(Tl,"search");function Pl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m20.56 9.66-7.8 8.97a1 1 0 0 1-1.51 0L3.44 9.66A1 1 0 0 1 4.19 8h15.62a1 1 0 0 1 .75 1.66Z",fill:"currentColor"}))}const Al=Oe(Pl,"tree_triangle_down");function Dl(i){return L.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},i),L.createElement("path",{d:"m9.66 3.44 8.97 7.8a1 1 0 0 1 0 1.51l-8.97 7.81A1 1 0 0 1 8 19.81V4.19a1 1 0 0 1 1.66-.75Z",fill:"currentColor"}))}const Nl=Oe(Dl,"tree_triangle_right");var kl=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class yi extends b.PureComponent{render(){const e=this.props,{triggerRender:t,componentName:n}=e,s=kl(e,["triggerRender","componentName"]);return t(Object.assign({},s))}}yi.propTypes={triggerRender:a.func.isRequired,componentName:a.string,componentProps:a.object,value:a.any,inputValue:a.string,placeholder:a.oneOfType([a.string,a.array]),className:a.string,style:a.object};const Ll={PREFIX:`${X}-highlight`},Ml=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");class jl extends ge{constructor(e){super(Object.assign({},e)),this.findAll=t=>{let{autoEscape:n=!0,caseSensitive:s=!1,searchWords:r,sourceString:o}=t;Ce(r)&&(r=[r]);const l=this.findChunks({autoEscape:n,caseSensitive:s,searchWords:r,sourceString:o}),c=this.combineChunks({chunks:l});return this.fillInChunks({chunksToHighlight:c,totalLength:o?o.length:0})},this.findChunks=t=>{let{autoEscape:n,caseSensitive:s,searchWords:r,sourceString:o}=t;return r.map(l=>typeof l=="string"?{text:l}:l).filter(l=>l.text).reduce((l,c)=>{let d=c.text;n&&(d=Ml(d));const u=new RegExp(d,s?"g":"gi");let h;for(;h=u.exec(o);){const g=h.index,m=u.lastIndex;m>g&&l.push({highlight:!0,start:g,end:m,className:c.className,style:c.style}),h.index===u.lastIndex&&u.lastIndex++}return l},[])},this.combineChunks=t=>{let{chunks:n}=t;return n.sort((s,r)=>s.start-r.start).reduce((s,r)=>{if(s.length===0)return[r];{const o=s.pop();if(r.start<=o.end){const l=Math.max(o.end,r.end);s.push({highlight:!0,start:o.start,end:l,className:o.className||r.className,style:Object.assign(Object.assign({},o.style),r.style)})}else s.push(o,r);return s}},[])},this.fillInChunks=t=>{let{chunksToHighlight:n,totalLength:s}=t;const r=[],o=(l,c,d,u,h)=>{c-l>0&&r.push({start:l,end:c,highlight:d,className:u,style:h})};if(n.length===0)o(0,s,!1);else{let l=0;n.forEach(c=>{o(l,c.start,!1),o(c.start,c.end,!0,c.className,c.style),l=c.end}),o(l,s,!1)}return r}}}const zl=Ll.PREFIX;class zs extends L.PureComponent{constructor(){super(...arguments),this.getHighLightTextHTML=e=>{let{sourceString:t="",searchWords:n=[],option:s={autoEscape:!0,caseSensitive:!1}}=e;const r=new jl().findAll(Object.assign({sourceString:t,searchWords:n},s)),o=s.highlightTag||"mark",l=s.highlightClassName||"",c=s.highlightStyle||{};return r.map((d,u)=>{const{end:h,start:g,highlight:m,style:y,className:p}=d,f=t.substr(g,h-g);return m?b.createElement(o,{style:Object.assign(Object.assign({},c),y),className:`${l} ${p||""}`.trim(),key:f+u},f):f})}}render(){const{searchWords:e,sourceString:t,component:n,highlightClassName:s,highlightStyle:r,caseSensitive:o,autoEscape:l}=this.props,c=M({[`${zl}-tag`]:!0},s),d={highlightTag:n,highlightClassName:c,highlightStyle:r,caseSensitive:o,autoEscape:l};return this.getHighLightTextHTML({sourceString:t,searchWords:e,option:d})}}zs.propTypes={style:a.object,className:a.string,autoEscape:a.bool,caseSensitive:a.bool,sourceString:a.string,searchWords:a.arrayOf(a.string),highlightStyle:a.object,highlightClassName:a.string,component:a.string};zs.defaultProps={component:"mark",autoEscape:!0,caseSensitive:!1,sourceString:""};const Fl={PREFIX:`${X}-space`},ze={ALIGN_SET:["start","end","center","baseline"],SPACING_LOOSE:"loose",SPACING_MEDIUM:"medium",SPACING_TIGHT:"tight"},Kl="Symbol(react.fragment)",Os=i=>{let e=[];return b.Children.forEach(i,t=>{t!=null&&(Array.isArray(t)?e=e.concat(Os(t)):L.isValidElement(t)&&t.type&&t.type.toString()===Kl&&t.props?e=e.concat(Os(t.props.children)):e.push(t))}),e},be=Fl.PREFIX;class Qt extends L.PureComponent{render(){const{children:e=null,style:t,className:n,spacing:s,wrap:r,align:o,vertical:l}=this.props,c=r&&l?!1:r,d=Object.assign({},t);let u="",h="";Ce(s)?(u=s,h=s):gt(s)?(d.rowGap=s,d.columnGap=s):gl(s)&&(Ce(s[0])?u=s[0]:gt(s[0])&&(d.columnGap=`${s[0]}px`),Ce(s[1])?h=s[1]:gt(s[1])&&(d.rowGap=`${s[1]}px`));const g=M(be,n,{[`${be}-align-${o}`]:o,[`${be}-vertical`]:l,[`${be}-horizontal`]:!l,[`${be}-wrap`]:c,[`${be}-tight-horizontal`]:u===ze.SPACING_TIGHT,[`${be}-tight-vertical`]:h===ze.SPACING_TIGHT,[`${be}-medium-horizontal`]:u===ze.SPACING_MEDIUM,[`${be}-medium-vertical`]:h===ze.SPACING_MEDIUM,[`${be}-loose-horizontal`]:u===ze.SPACING_LOOSE,[`${be}-loose-vertical`]:h===ze.SPACING_LOOSE}),m=Os(e),y=qt(this.props);return b.createElement("div",Object.assign({},y,{className:g,style:d,"x-semi-prop":"children"}),m)}}Qt.propTypes={wrap:a.bool,align:a.oneOf(ze.ALIGN_SET),vertical:a.bool,spacing:a.oneOfType([a.string,a.number,a.array]),children:a.node,style:a.object,className:a.string};Qt.defaultProps={vertical:!1,wrap:!1,spacing:"tight",align:"center"};var $l=va();const Pe=te($l);var yn,br;function Bl(){if(br)return yn;br=1;var i=Ca(),e=1/0,t=17976931348623157e292;function n(s){if(!s)return s===0?s:0;if(s=i(s),s===e||s===-e){var r=s<0?-1:1;return r*t}return s===s?s:0}return yn=n,yn}var Sn,yr;function Jt(){if(yr)return Sn;yr=1;var i=Bl();function e(t){var n=i(t),s=n%1;return n===n?s?n-s:n:0}return Sn=e,Sn}var wn,Sr;function Hl(){if(Sr)return wn;Sr=1;var i=pi(),e=Gt(),t=Qo(),n=Jt(),s=nl(),r=Math.max;function o(l,c,d,u){l=e(l)?l:s(l),d=d&&!u?n(d):0;var h=l.length;return d<0&&(d=r(h+d,0)),t(l)?d<=h&&l.indexOf(c,d)>-1:!!h&&i(l,c,d)>-1}return wn=o,wn}var Wl=Hl();const Kt=te(Wl);var vn,wr;function Ul(){if(wr)return vn;wr=1;var i=sl(),e=Jo(),t=ei(),n=_a(),s=t(function(r,o){return n(r)?i(r,e(o,1,n,!0)):[]});return vn=s,vn}var Vl=Ul();const vr=te(Vl);var Cn,Cr;function ql(){if(Cr)return Cn;Cr=1;var i=Oa();function e(t,n,s){for(var r=-1,o=t.length;++r<o;){var l=t[r],c=n(l);if(c!=null&&(d===void 0?c===c&&!i(c):s(c,d)))var d=c,u=l}return u}return Cn=e,Cn}var _n,_r;function Gl(){if(_r)return _n;_r=1;function i(e,t){return e>t}return _n=i,_n}var On,Or;function Yl(){if(Or)return On;Or=1;var i=ql(),e=Gl(),t=ti();function n(s){return s&&s.length?i(s,t,e):void 0}return On=n,On}Yl();var Rn,Rr;function Xl(){if(Rr)return Rn;Rr=1;var i=Ra(),e=Ea(),t=ni(),n=1/0,s=i&&1/t(new i([,-0]))[1]==n?function(r){return new i(r)}:e;return Rn=s,Rn}var En,Er;function Zl(){if(Er)return En;Er=1;var i=xa(),e=rl(),t=ol(),n=Ta(),s=Xl(),r=ni(),o=200;function l(c,d,u){var h=-1,g=e,m=c.length,y=!0,p=[],f=p;if(u)y=!1,g=t;else if(m>=o){var S=d?null:s(c);if(S)return r(S);y=!1,g=n,f=new i}else f=d?[]:p;e:for(;++h<m;){var v=c[h],w=d?d(v):v;if(v=u||v!==0?v:0,y&&w===w){for(var _=f.length;_--;)if(f[_]===w)continue e;d&&f.push(w),p.push(v)}else g(f,w,u)||(f!==p&&f.push(w),p.push(v))}return p}return En=l,En}var xn,xr;function Ql(){if(xr)return xn;xr=1;var i=Zl();function e(t){return t&&t.length?i(t):[]}return xn=e,xn}var Jl=Ql();const ec=te(Jl);function tc(i,e){return`${i}-${e}`}function nc(i){return!Ps(i)&&!ft(i)}function sc(i,e,t){const n=x(t,"key","key"),s=x(t,"children","children"),r=(o,l,c)=>{const d=o?o[s]:i,u=o?tc(c.pos,l):"0";if(o){const h=x(o,n,null),g={data:Object.assign({},o),ind:l,pos:u,key:h!==null?h:u,parentPos:c.node?c.pos:null,level:Number(c.level)+1};e(g)}d&&d.forEach((h,g)=>{r(h,g,{node:o,pos:u,level:c?Number(c.level)+1:-1})})};r(null)}function rc(i,e){const t={},n={},s={},r={posEntities:t,keyEntities:n,valueEntities:s},o=x(e,"value","value");return sc(i,l=>{const{pos:c,key:d,parentPos:u}=l,h=Object.assign({},l),g=x(h,`data.${o}`,null);g!==null&&(s[g]=d),t[c]=h,n[d]=h,h.parent=t[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h))},e),r}function Si(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=[],s=r=>{if(!r)return;const{children:o}=r;nc(o)&&o.forEach(c=>{n.push(c.key),s(e[c.key])})};return i.forEach(r=>{t&&n.push(r),s(e[r])}),n}function oc(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const n=[];return i&&i.forEach(s=>{const r=e[s];r&&r.children&&r.children.forEach(o=>{(!t.length||!t.includes(o.key))&&n.push(o.key)})}),n}function wi(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=[];return i.forEach(r=>{e[r]&&e[r].parent&&n.push(e[r].parent.key)}),oc(ec(n),e,t?[]:i)}function vi(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=[],s=r=>{r.parent&&(n.push(r.parent.key),s(r.parent))};return i.forEach(r=>{e[r]&&s(e[r]),t&&n.push(r)}),n}function Tr(i,e,t,n){const s=Si([i],e,!0),r=e[i];t=new Set([...t,i]);const o=l=>{if(!l.parent)return;const{key:c}=l;if(wi([c],e).every(h=>t.has(h))){const h=l.parent;t.add(h.key),o(h)}else{const h=vi([c],e,!1);n=new Set([...n,...h])}};return o(r),{checkedKeys:new Set([...t,...s]),halfCheckedKeys:n}}function Ir(i,e,t,n){const s=Si([i],e,!0),r=e[i];s.forEach(l=>{t.has(l)&&t.delete(l),n.has(l)&&n.delete(l)});const o=l=>{const c=l.parent;if(!c||!t.has(c.key)&&!n.has(c.key))return;const{key:d}=l,h=wi([d],e).some(m=>t.has(m)||n.has(m)),g=vi([d],e,!1);h?g.forEach(m=>{t.has(m)&&(t.delete(m),n.add(m))}):(t.has(c.key)&&t.delete(c.key),n.has(c.key)&&n.delete(c.key),o(c))};return r&&o(r),{checkedKeys:t,halfCheckedKeys:n}}const At={PREFIX:`${X}-checkbox`,INPUT:`${X}-checkbox-input`,WRAPPER:""},ic={PREFIX:`${X}-checkboxGroup`},ve={DIRECTION_SET:["horizontal","vertical"],TYPE_DEFAULT:"default",TYPE_CARD:"card",TYPE_PURECARD:"pureCard",DEFAULT_DIRECTION:"vertical"};class ac extends ge{constructor(e){super(Object.assign({},e)),this.clickState=!1,this.handleFocusVisible=t=>{const{target:n}=t;try{if(this.clickState){this.clickState=!1;return}n.matches(":focus-visible")&&this._adapter.setFocusVisible(!0)}catch{$e(!0,"Warning: [Semi Checkbox] The current browser does not support the focus-visible")}},this.handleBlur=()=>{this.clickState=!1,this._adapter.setFocusVisible(!1)}}init(){const{children:e,extra:t,extraId:n,addonId:s}=this.getProps();e&&!s&&this._adapter.setAddonId(),t&&!n&&this._adapter.setExtraId()}notifyChange(e,t){const n=this._adapter.generateEvent(e,t);this._adapter.notifyChange(n)}handleChange(e){if(this.getProp("disabled"))return;if((e==null?void 0:e.type)==="click"&&(this.clickState=!0),this._adapter.focusCheckboxEntity(),this._adapter.getIsInGroup()){this._adapter.getGroupDisabled()||this.handleChangeInGroup(e);return}const r=!this.getState("checked");this._isControlledComponent("checked")?this.notifyChange(r,e):(this.setChecked(r),this.notifyChange(r,e))}handleChangeInGroup(e){const{value:t}=this.getProps(),r=!this._adapter.getGroupValue().includes(t),o=this._adapter.generateEvent(r,e);this._adapter.notifyChange(o),this._adapter.notifyGroupChange(o)}handleEnterPress(e){Yt(e)&&this.handleChange(e)}setChecked(e){this._adapter.setNativeControlChecked(e)}destroy(){}}const Fs=b.createContext({});class en extends L.PureComponent{blur(){this.inputEntity.blur()}focus(){const{preventScroll:e}=this.props;this.inputEntity.focus({preventScroll:e})}render(){const{indeterminate:e,checked:t,disabled:n,prefixCls:s,name:r,isPureCardType:o,addonId:l,extraId:c,focusInner:d,onInputFocus:u,onInputBlur:h}=this.props,g=s||At.PREFIX,m=M({[`${g}-inner`]:!0,[`${g}-inner-checked`]:!!t,[`${g}-inner-pureCardType`]:o},At.WRAPPER),y=M({[`${g}-inner-display`]:!0,[`${g}-focus`]:d,[`${g}-focus-border`]:d&&!t}),p=t?b.createElement(_l,null):e?b.createElement(vl,null):null,f={type:"checkbox","aria-label":this.props["aria-label"],"aria-disabled":n,"aria-checked":t,"aria-labelledby":l,"aria-describedby":c||this.props["aria-describedby"],"aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-required":this.props["aria-required"],className:At.INPUT,onChange:H,checked:t,disabled:n,onFocus:u,onBlur:h};return r&&(f.name=r),b.createElement("span",{className:m},b.createElement("input",Object.assign({},f,{ref:S=>{this.inputEntity=S}})),b.createElement("span",{className:y},p))}}en.contextType=Fs;en.propTypes={"aria-describedby":a.string,"aria-errormessage":a.string,"aria-invalid":a.bool,"aria-labelledby":a.string,"aria-required":a.bool,checked:a.bool,disabled:a.bool,onChange:a.func,children:a.node,grouped:a.bool,value:a.any,isPureCardType:a.bool,addonId:a.string,extraId:a.string,focusInner:a.bool,onInputFocus:a.func,onInputBlur:a.func,preventScroll:a.bool};en.defaultProps={onChange:H};class xe extends he{get adapter(){return Object.assign(Object.assign({},super.adapter),{setNativeControlChecked:e=>{this.setState({checked:e})},notifyChange:e=>{const{onChange:t}=this.props;t&&t(e)},generateEvent:(e,t)=>{const{props:n}=this;return{target:Object.assign(Object.assign({},n),{checked:e}),stopPropagation:()=>{t.stopPropagation()},preventDefault:()=>{t.preventDefault()},nativeEvent:{stopImmediatePropagation:()=>{t.nativeEvent&&typeof t.nativeEvent.stopImmediatePropagation=="function"&&t.nativeEvent.stopImmediatePropagation()}}}},getIsInGroup:()=>this.isInGroup(),getGroupValue:()=>this.context&&this.context.checkboxGroup.value||[],notifyGroupChange:e=>{this.context.checkboxGroup.onChange(e)},getGroupDisabled:()=>this.context&&this.context.checkboxGroup.disabled,setAddonId:()=>{this.setState({addonId:jt({prefix:"addon"})})},setExtraId:()=>{this.setState({extraId:jt({prefix:"extra"})})},setFocusVisible:e=>{this.setState({focusVisible:e})},focusCheckboxEntity:()=>{this.focus()}})}constructor(e){super(e),this.handleChange=n=>this.foundation.handleChange(n),this.handleEnterPress=n=>this.foundation.handleEnterPress(n),this.handleFocusVisible=n=>{this.foundation.handleFocusVisible(n)},this.handleBlur=n=>{this.foundation.handleBlur()};const t=!1;this.state={checked:e.checked||e.defaultChecked||t,addonId:e.addonId,extraId:e.extraId,focusVisible:!1},this.checkboxEntity=null,this.foundation=new ac(this.adapter)}componentDidUpdate(e){this.props.checked!==e.checked&&(ft(this.props.checked)?this.foundation.setChecked(!1):il(this.props.checked)&&this.foundation.setChecked(this.props.checked))}isInGroup(){return!!(this.context&&this.context.checkboxGroup&&"value"in this.props)}focus(){this.checkboxEntity&&this.checkboxEntity.focus()}blur(){this.checkboxEntity&&this.checkboxEntity.blur()}render(){const{disabled:e,style:t,prefixCls:n,className:s,indeterminate:r,children:o,onMouseEnter:l,onMouseLeave:c,extra:d,value:u,role:h,tabIndex:g,id:m,type:y}=this.props,{checked:p,addonId:f,extraId:S,focusVisible:v}=this.state,w={checked:p,disabled:e},_=this.isInGroup();if(_){if(this.context.checkboxGroup.value){const K=(this.context.checkboxGroup.value||[]).includes(u);w.checked=K}this.context.checkboxGroup.disabled&&(w.disabled=this.context.checkboxGroup.disabled||this.props.disabled);const{isCardType:A,isPureCardType:F}=this.context.checkboxGroup;w.isCardType=A,w.isPureCardType=F,w.name=this.context.checkboxGroup.name}else w.isPureCardType=y===ve.TYPE_PURECARD,w.isCardType=y===ve.TYPE_CARD||w.isPureCardType;const O=n||At.PREFIX,I=w.isCardType||w.isPureCardType,E=M(O,{[`${O}-disabled`]:w.disabled,[`${O}-indeterminate`]:r,[`${O}-checked`]:w.checked,[`${O}-unChecked`]:!w.checked,[`${O}-cardType`]:w.isCardType,[`${O}-cardType_disabled`]:w.disabled&&w.isCardType,[`${O}-cardType_enable`]:!(w.disabled&&w.isCardType),[`${O}-cardType_checked`]:w.isCardType&&w.checked&&!w.disabled,[`${O}-cardType_checked_disabled`]:w.isCardType&&w.checked&&w.disabled,[s]:!!s,[`${O}-focus`]:v&&I}),k=M(`${O}-extra`,{[`${O}-cardType_extra_noChildren`]:w.isCardType&&!o});_&&this.context.checkboxGroup.name;const N=this.props["x-semi-children-alias"]||"children",P=()=>!o&&!d?null:b.createElement("div",{className:`${O}-content`},o?b.createElement("span",{id:f,className:`${O}-addon`,"x-semi-prop":N},o):null,d?b.createElement("div",{id:S,className:k,"x-semi-prop":"extra"},d):null);return b.createElement("span",Object.assign({role:h,tabIndex:g,style:t,className:E,id:m,onMouseEnter:l,onMouseLeave:c,onClick:this.handleChange,onKeyPress:this.handleEnterPress,"aria-labelledby":this.props["aria-labelledby"]},this.getDataAttr(this.props)),b.createElement(en,Object.assign({},this.props,w,{addonId:o&&f,extraId:d&&S,isPureCardType:w.isPureCardType,ref:A=>{this.checkboxEntity=A},focusInner:v&&!I,onInputFocus:this.handleFocusVisible,onInputBlur:this.handleBlur})),P())}}xe.contextType=Fs;xe.propTypes={"aria-describedby":a.string,"aria-errormessage":a.string,"aria-invalid":a.bool,"aria-labelledby":a.string,"aria-required":a.bool,checked:a.bool,defaultChecked:a.bool,disabled:a.bool,indeterminate:a.bool,onChange:a.func,value:a.any,style:a.object,className:a.string,prefixCls:a.string,onMouseEnter:a.func,onMouseLeave:a.func,extra:a.node,index:a.number,"aria-label":a.string,tabIndex:a.number,preventScroll:a.bool,type:a.string};xe.defaultProps={defaultChecked:!1,indeterminate:!1,onChange:H,onMouseEnter:H,onMouseLeave:H,type:"default"};xe.elementType="Checkbox";class Ks extends ge{static get checkboxGroupDefaultAdapter(){return{}}constructor(e){super(Object.assign(Object.assign({},Ks.checkboxGroupDefaultAdapter),e))}init(){const{defaultValue:e,value:t}=this.getProps();typeof e<"u"&&!Array.isArray(e)&&$e(!0,"Warning: [Semi CheckboxGroup] defaultValue should be an Array"),typeof t<"u"&&!Array.isArray(t)&&$e(!0,"Warning: [Semi CheckboxGroup] value should be an Array")}notifyChange(e){this._adapter.notifyChange(e)}handleChange(e){const t=this.getState("value");let n=[];Array.isArray(t)||(n=[t]),e.target.checked?n=[...t,e.target.value]:n=t.filter((r,o)=>r!==e.target.value),"value"in this.getProps()?this.notifyChange(n):(this._adapter.updateGroupValue(n),this.notifyChange(n))}getFormatName(){return this.getProp("name")||"default"}handlePropValueChange(e){Array.isArray(e)?this._adapter.updateGroupValue(e):(typeof e>"u"&&this._adapter.updateGroupValue([]),$e(!0,"Warning: [Semi CheckboxGroup] value should be an Array"))}destroy(){}}class $s extends he{get adapter(){return Object.assign(Object.assign({},super.adapter),{updateGroupValue:e=>{this.setState({value:e})},notifyChange:e=>{this.props.onChange&&this.props.onChange(e)}})}constructor(e){super(e),this.state={value:e.value||e.defaultValue},this.foundation=new Ks(this.adapter),this.onChange=this.onChange.bind(this)}componentDidMount(){this.foundation.init()}componentDidUpdate(e){re(e.value,this.props.value)||this.foundation.handlePropValueChange(this.props.value)}componentWillUnmount(){this.foundation.destroy()}onChange(e){this.foundation.handleChange(e)}render(){const{children:e,options:t,prefixCls:n,direction:s,className:r,id:o,style:l,type:c,disabled:d}=this.props,u=c===ve.TYPE_PURECARD,h=c===ve.TYPE_CARD||u,g=n||ic.PREFIX,m=M({[g]:!0,[`${g}-wrapper`]:!0,[`${g}-${s}`]:s,[`${g}-${s}-cardType`]:s&&h,[`${g}-${s}-pureCardType`]:s&&u},r),y=this.state.value.slice();let p;return t?p=(t||[]).map((f,S)=>typeof f=="string"?b.createElement(xe,{role:"listitem",key:S,disabled:this.props.disabled,value:f,prefixCls:n},f):b.createElement(xe,{role:"listitem",key:S,disabled:f.disabled||this.props.disabled,value:f.value,prefixCls:n,extra:f.extra,className:f.className,style:f.style,onChange:f.onChange},f.label)):e&&(p=b.Children.toArray(e).map((f,S)=>b.cloneElement(f,{key:S,role:"listitem"}))),b.createElement("div",Object.assign({id:o,role:"list","aria-label":this.props["aria-label"],className:m,style:l,"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"]},this.getDataAttr(this.props)),b.createElement(Fs.Provider,{value:{checkboxGroup:{onChange:this.onChange,value:y,disabled:this.props.disabled,name:this.foundation.getFormatName(),isCardType:h,isPureCardType:u}}},p))}}$s.propTypes={"aria-describedby":a.string,"aria-errormessage":a.string,"aria-invalid":a.bool,"aria-labelledby":a.string,"aria-required":a.bool,defaultValue:a.array,disabled:a.bool,name:a.string,options:a.array,value:a.array,onChange:a.func,children:a.node,prefixCls:a.string,direction:a.oneOf(ve.DIRECTION_SET),className:a.string,type:a.oneOf([ve.TYPE_DEFAULT,ve.TYPE_CARD,ve.TYPE_PURECARD]),style:a.object};$s.defaultProps={disabled:!1,onChange:()=>{},type:ve.TYPE_DEFAULT,defaultValue:[],direction:ve.DEFAULT_DIRECTION};class lc extends xe{}lc.Group=$s;function Rs(){return Rs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Rs.apply(null,arguments)}function cc(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,_s(i,e)}var Pr=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function dc(i,e){return!!(i===e||Pr(i)&&Pr(e))}function uc(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!dc(i[t],e[t]))return!1;return!0}function Ke(i,e){e===void 0&&(e=uc);var t,n=[],s,r=!1;function o(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return r&&t===this&&e(l,n)||(s=i.apply(this,l),r=!0,t=this,n=l),s}return o}var hc=typeof performance=="object"&&typeof performance.now=="function",Ar=hc?function(){return performance.now()}:function(){return Date.now()};function Dr(i){cancelAnimationFrame(i.id)}function pc(i,e){var t=Ar();function n(){Ar()-t>=e?i.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Tn=-1;function Nr(i){if(i===void 0&&(i=!1),Tn===-1||i){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(e),Tn=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Tn}var Ve=null;function kr(i){if(i===void 0&&(i=!1),Ve===null||i){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?Ve="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Ve="negative":Ve="positive-ascending"),document.body.removeChild(e),Ve}return Ve}var fc=150,gc=function(e,t){return e};function Ci(i){var e,t=i.getItemOffset,n=i.getEstimatedTotalSize,s=i.getItemSize,r=i.getOffsetForIndexAndAlignment,o=i.getStartIndexForOffset,l=i.getStopIndexForStartIndex,c=i.initInstanceProps,d=i.shouldResetStyleCacheOnItemSizeChange,u=i.validateProps;return e=(function(h){cc(g,h);function g(y){var p;return p=h.call(this,y)||this,p._instanceProps=c(p.props,mr(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:mr(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=Ke(function(f,S,v,w){return p.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:S,visibleStartIndex:v,visibleStopIndex:w})}),p._callOnScroll=void 0,p._callOnScroll=Ke(function(f,S,v){return p.props.onScroll({scrollDirection:f,scrollOffset:S,scrollUpdateWasRequested:v})}),p._getItemStyle=void 0,p._getItemStyle=function(f){var S=p.props,v=S.direction,w=S.itemSize,_=S.layout,O=p._getItemStyleCache(d&&w,d&&_,d&&v),I;if(O.hasOwnProperty(f))I=O[f];else{var E=t(p.props,f,p._instanceProps),k=s(p.props,f,p._instanceProps),N=v==="horizontal"||_==="horizontal",P=v==="rtl",A=N?E:0;O[f]=I={position:"absolute",left:P?void 0:A,right:P?A:void 0,top:N?0:E,height:N?"100%":k,width:N?k:"100%"}}return I},p._getItemStyleCache=void 0,p._getItemStyleCache=Ke(function(f,S,v){return{}}),p._onScrollHorizontal=function(f){var S=f.currentTarget,v=S.clientWidth,w=S.scrollLeft,_=S.scrollWidth;p.setState(function(O){if(O.scrollOffset===w)return null;var I=p.props.direction,E=w;if(I==="rtl")switch(kr()){case"negative":E=-w;break;case"positive-descending":E=_-v-w;break}return E=Math.max(0,Math.min(E,_-v)),{isScrolling:!0,scrollDirection:O.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(f){var S=f.currentTarget,v=S.clientHeight,w=S.scrollHeight,_=S.scrollTop;p.setState(function(O){if(O.scrollOffset===_)return null;var I=Math.max(0,Math.min(_,w-v));return{isScrolling:!0,scrollDirection:O.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(f){var S=p.props.outerRef;p._outerRef=f,typeof S=="function"?S(f):S!=null&&typeof S=="object"&&S.hasOwnProperty("current")&&(S.current=f)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&Dr(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=pc(p._resetIsScrolling,fc)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}g.getDerivedStateFromProps=function(p,f){return mc(p,f),u(p),null};var m=g.prototype;return m.scrollTo=function(p){p=Math.max(0,p),this.setState(function(f){return f.scrollOffset===p?null:{scrollDirection:f.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(p,f){f===void 0&&(f="auto");var S=this.props,v=S.itemCount,w=S.layout,_=this.state.scrollOffset;p=Math.max(0,Math.min(p,v-1));var O=0;if(this._outerRef){var I=this._outerRef;w==="vertical"?O=I.scrollWidth>I.clientWidth?Nr():0:O=I.scrollHeight>I.clientHeight?Nr():0}this.scrollTo(r(this.props,p,f,_,this._instanceProps,O))},m.componentDidMount=function(){var p=this.props,f=p.direction,S=p.initialScrollOffset,v=p.layout;if(typeof S=="number"&&this._outerRef!=null){var w=this._outerRef;f==="horizontal"||v==="horizontal"?w.scrollLeft=S:w.scrollTop=S}this._callPropsCallbacks()},m.componentDidUpdate=function(){var p=this.props,f=p.direction,S=p.layout,v=this.state,w=v.scrollOffset,_=v.scrollUpdateWasRequested;if(_&&this._outerRef!=null){var O=this._outerRef;if(f==="horizontal"||S==="horizontal")if(f==="rtl")switch(kr()){case"negative":O.scrollLeft=-w;break;case"positive-ascending":O.scrollLeft=w;break;default:var I=O.clientWidth,E=O.scrollWidth;O.scrollLeft=E-I-w;break}else O.scrollLeft=w;else O.scrollTop=w}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Dr(this._resetIsScrollingTimeoutId)},m.render=function(){var p=this.props,f=p.children,S=p.className,v=p.direction,w=p.height,_=p.innerRef,O=p.innerElementType,I=p.innerTagName,E=p.itemCount,k=p.itemData,N=p.itemKey,P=N===void 0?gc:N,A=p.layout,F=p.outerElementType,K=p.outerTagName,z=p.style,q=p.useIsScrolling,V=p.width,W=this.state.isScrolling,G=v==="horizontal"||A==="horizontal",se=G?this._onScrollHorizontal:this._onScrollVertical,Q=this._getRangeToRender(),pe=Q[0],oe=Q[1],de=[];if(E>0)for(var ie=pe;ie<=oe;ie++)de.push(L.createElement(f,{data:k,key:P(ie,k),index:ie,isScrolling:q?W:void 0,style:this._getItemStyle(ie)}));var Ot=n(this.props,this._instanceProps);return L.createElement(F||K||"div",{className:S,onScroll:se,ref:this._outerRefSetter,style:Rs({position:"relative",height:w,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:v},z)},L.createElement(O||I||"div",{children:de,ref:_,style:{height:G?"100%":Ot,pointerEvents:W?"none":void 0,width:G?Ot:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var f=this._getRangeToRender(),S=f[0],v=f[1],w=f[2],_=f[3];this._callOnItemsRendered(S,v,w,_)}}if(typeof this.props.onScroll=="function"){var O=this.state,I=O.scrollDirection,E=O.scrollOffset,k=O.scrollUpdateWasRequested;this._callOnScroll(I,E,k)}},m._getRangeToRender=function(){var p=this.props,f=p.itemCount,S=p.overscanCount,v=this.state,w=v.isScrolling,_=v.scrollDirection,O=v.scrollOffset;if(f===0)return[0,0,0,0];var I=o(this.props,O,this._instanceProps),E=l(this.props,I,O,this._instanceProps),k=!w||_==="backward"?Math.max(1,S):1,N=!w||_==="forward"?Math.max(1,S):1;return[Math.max(0,I-k),Math.max(0,Math.min(f-1,E+N)),I,E]},g})(L.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var mc=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},bc=50,Ge=function(e,t,n){var s=e,r=s.itemSize,o=n.itemMetadataMap,l=n.lastMeasuredIndex;if(t>l){var c=0;if(l>=0){var d=o[l];c=d.offset+d.size}for(var u=l+1;u<=t;u++){var h=r(u);o[u]={offset:c,size:h},c+=h}n.lastMeasuredIndex=t}return o[t]},yc=function(e,t,n){var s=t.itemMetadataMap,r=t.lastMeasuredIndex,o=r>0?s[r].offset:0;return o>=n?_i(e,t,r,0,n):Sc(e,t,Math.max(0,r),n)},_i=function(e,t,n,s,r){for(;s<=n;){var o=s+Math.floor((n-s)/2),l=Ge(e,o,t).offset;if(l===r)return o;l<r?s=o+1:l>r&&(n=o-1)}return s>0?s-1:0},Sc=function(e,t,n,s){for(var r=e.itemCount,o=1;n<r&&Ge(e,n,t).offset<s;)n+=o,o*=2;return _i(e,t,Math.min(n,r-1),Math.floor(n/2),s)},Lr=function(e,t){var n=e.itemCount,s=t.itemMetadataMap,r=t.estimatedItemSize,o=t.lastMeasuredIndex,l=0;if(o>=n&&(o=n-1),o>=0){var c=s[o];l=c.offset+c.size}var d=n-o-1,u=d*r;return l+u},wc=Ci({getItemOffset:function(e,t,n){return Ge(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:Lr,getOffsetForIndexAndAlignment:function(e,t,n,s,r,o){var l=e.direction,c=e.height,d=e.layout,u=e.width,h=l==="horizontal"||d==="horizontal",g=h?u:c,m=Ge(e,t,r),y=Lr(e,r),p=Math.max(0,Math.min(y-g,m.offset)),f=Math.max(0,m.offset-g+m.size+o);switch(n==="smart"&&(s>=f-g&&s<=p+g?n="auto":n="center"),n){case"start":return p;case"end":return f;case"center":return Math.round(f+(p-f)/2);case"auto":default:return s>=f&&s<=p?s:s<f?f:p}},getStartIndexForOffset:function(e,t,n){return yc(e,n,t)},getStopIndexForStartIndex:function(e,t,n,s){for(var r=e.direction,o=e.height,l=e.itemCount,c=e.layout,d=e.width,u=r==="horizontal"||c==="horizontal",h=u?d:o,g=Ge(e,t,s),m=n+h,y=g.offset+g.size,p=t;p<l-1&&y<m;)p++,y+=Ge(e,p,s).size;return p},initInstanceProps:function(e,t){var n=e,s=n.estimatedItemSize,r={itemMetadataMap:{},estimatedItemSize:s||bc,lastMeasuredIndex:-1};return t.resetAfterIndex=function(o,l){l===void 0&&(l=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,o-1),t._getItemStyleCache(-1),l&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),Oi=Ci({getItemOffset:function(e,t){var n=e.itemSize;return t*n},getItemSize:function(e,t){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var t=e.itemCount,n=e.itemSize;return n*t},getOffsetForIndexAndAlignment:function(e,t,n,s,r,o){var l=e.direction,c=e.height,d=e.itemCount,u=e.itemSize,h=e.layout,g=e.width,m=l==="horizontal"||h==="horizontal",y=m?g:c,p=Math.max(0,d*u-y),f=Math.min(p,t*u),S=Math.max(0,t*u-y+u+o);switch(n==="smart"&&(s>=S-y&&s<=f+y?n="auto":n="center"),n){case"start":return f;case"end":return S;case"center":{var v=Math.round(S+(f-S)/2);return v<Math.ceil(y/2)?0:v>p+Math.floor(y/2)?p:v}case"auto":default:return s>=S&&s<=f?s:s<S?S:f}},getStartIndexForOffset:function(e,t){var n=e.itemCount,s=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/s)))},getStopIndexForStartIndex:function(e,t,n){var s=e.direction,r=e.height,o=e.itemCount,l=e.itemSize,c=e.layout,d=e.width,u=s==="horizontal"||c==="horizontal",h=t*l,g=u?d:r,m=Math.ceil((g+n-h)/l);return Math.max(0,Math.min(o-1,t+m-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}}),vc=Function.prototype.toString,In=Object.create,Cc=Object.prototype.toString,_c=(function(){function i(){this._keys=[],this._values=[]}return i.prototype.has=function(e){return!!~this._keys.indexOf(e)},i.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},i.prototype.set=function(e,t){this._keys.push(e),this._values.push(t)},i})();function Oc(){return new _c}function Rc(){return new WeakMap}var Ec=typeof WeakMap<"u"?Rc:Oc;function Bs(i){if(!i)return In(null);var e=i.constructor;if(e===Object)return i===Object.prototype?{}:In(i);if(e&&~vc.call(e).indexOf("[native code]"))try{return new e}catch{}return In(i)}function xc(i){var e="";return i.global&&(e+="g"),i.ignoreCase&&(e+="i"),i.multiline&&(e+="m"),i.unicode&&(e+="u"),i.sticky&&(e+="y"),e}function Tc(i){return i.flags}var Ic=/test/g.flags==="g"?Tc:xc;function Ri(i){var e=Cc.call(i);return e.substring(8,e.length-1)}function Pc(i){return i[Symbol.toStringTag]||Ri(i)}var Ac=typeof Symbol<"u"?Pc:Ri,Dc=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,Ei=Object.getOwnPropertyNames,Hs=Object.getOwnPropertySymbols,xi=Object.prototype,Ti=xi.hasOwnProperty,kc=xi.propertyIsEnumerable,Ii=typeof Hs=="function";function Lc(i){return Ei(i).concat(Hs(i))}var Mc=Ii?Lc:Ei;function tn(i,e,t){for(var n=Mc(i),s=0,r=n.length,o=void 0,l=void 0;s<r;++s)if(o=n[s],!(o==="callee"||o==="caller")){if(l=Nc(i,o),!l){e[o]=t.copier(i[o],t);continue}!l.get&&!l.set&&(l.value=t.copier(l.value,t));try{Dc(e,o,l)}catch{e[o]=l.value}}return e}function jc(i,e){var t=new e.Constructor;e.cache.set(i,t);for(var n=0,s=i.length;n<s;++n)t[n]=e.copier(i[n],e);return t}function zc(i,e){var t=new e.Constructor;return e.cache.set(i,t),tn(i,t,e)}function Pi(i,e){return i.slice(0)}function Fc(i,e){return i.slice(0,i.size,i.type)}function Kc(i,e){return new e.Constructor(Pi(i.buffer))}function $c(i,e){return new e.Constructor(i.getTime())}function Ai(i,e){var t=new e.Constructor;return e.cache.set(i,t),i.forEach(function(n,s){t.set(s,e.copier(n,e))}),t}function Bc(i,e){return tn(i,Ai(i,e),e)}function Hc(i,e){var t=Bs(e.prototype);e.cache.set(i,t);for(var n in i)Ti.call(i,n)&&(t[n]=e.copier(i[n],e));return t}function Wc(i,e){var t=Bs(e.prototype);e.cache.set(i,t);for(var n in i)Ti.call(i,n)&&(t[n]=e.copier(i[n],e));for(var s=Hs(i),r=0,o=s.length,l=void 0;r<o;++r)l=s[r],kc.call(i,l)&&(t[l]=e.copier(i[l],e));return t}var Uc=Ii?Wc:Hc;function Vc(i,e){var t=Bs(e.prototype);return e.cache.set(i,t),tn(i,t,e)}function Pn(i,e){return new e.Constructor(i.valueOf())}function qc(i,e){var t=new e.Constructor(i.source,Ic(i));return t.lastIndex=i.lastIndex,t}function Dt(i,e){return i}function Di(i,e){var t=new e.Constructor;return e.cache.set(i,t),i.forEach(function(n){t.add(e.copier(n,e))}),t}function Gc(i,e){return tn(i,Di(i,e),e)}var Yc=Array.isArray,Ws=Object.assign,Xc=Object.getPrototypeOf||(function(i){return i.__proto__}),Ni={array:jc,arrayBuffer:Pi,blob:Fc,dataView:Kc,date:$c,error:Dt,map:Ai,object:Uc,regExp:qc,set:Di},Zc=Ws({},Ni,{array:zc,map:Bc,object:Vc,set:Gc});function Qc(i){return{Arguments:i.object,Array:i.array,ArrayBuffer:i.arrayBuffer,Blob:i.blob,Boolean:Pn,DataView:i.dataView,Date:i.date,Error:i.error,Float32Array:i.arrayBuffer,Float64Array:i.arrayBuffer,Int8Array:i.arrayBuffer,Int16Array:i.arrayBuffer,Int32Array:i.arrayBuffer,Map:i.map,Number:Pn,Object:i.object,Promise:Dt,RegExp:i.regExp,Set:i.set,String:Pn,WeakMap:Dt,WeakSet:Dt,Uint8Array:i.arrayBuffer,Uint8ClampedArray:i.arrayBuffer,Uint16Array:i.arrayBuffer,Uint32Array:i.arrayBuffer,Uint64Array:i.arrayBuffer}}function ki(i){var e=Ws({},Ni,i),t=Qc(e),n=t.Array,s=t.Object;function r(o,l){if(l.prototype=l.Constructor=void 0,!o||typeof o!="object")return o;if(l.cache.has(o))return l.cache.get(o);if(l.prototype=Xc(o),l.Constructor=l.prototype&&l.prototype.constructor,!l.Constructor||l.Constructor===Object)return s(o,l);if(Yc(o))return n(o,l);var c=t[Ac(o)];return c?c(o,l):typeof o.then=="function"?o:s(o,l)}return function(l){return r(l,{Constructor:void 0,cache:Ec(),copier:r,prototype:void 0})}}function Jc(i){return ki(Ws({},Zc,i))}Jc({});var $t=ki({}),An,Mr;function ed(){if(Mr)return An;Mr=1;var i=Ia(),e=As(),t=1,n=2;function s(r,o,l,c){var d=l.length,u=d,h=!c;if(r==null)return!u;for(r=Object(r);d--;){var g=l[d];if(h&&g[2]?g[1]!==r[g[0]]:!(g[0]in r))return!1}for(;++d<u;){g=l[d];var m=g[0],y=r[m],p=g[1];if(h&&g[2]){if(y===void 0&&!(m in r))return!1}else{var f=new i;if(c)var S=c(y,p,m,r,o,f);if(!(S===void 0?e(p,y,t|n,c,f):S))return!1}}return!0}return An=s,An}var Dn,jr;function Li(){if(jr)return Dn;jr=1;var i=Pa();function e(t){return t===t&&!i(t)}return Dn=e,Dn}var Nn,zr;function td(){if(zr)return Nn;zr=1;var i=Li(),e=si();function t(n){for(var s=e(n),r=s.length;r--;){var o=s[r],l=n[o];s[r]=[o,l,i(l)]}return s}return Nn=t,Nn}var kn,Fr;function Mi(){if(Fr)return kn;Fr=1;function i(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return kn=i,kn}var Ln,Kr;function nd(){if(Kr)return Ln;Kr=1;var i=ed(),e=td(),t=Mi();function n(s){var r=e(s);return r.length==1&&r[0][2]?t(r[0][0],r[0][1]):function(o){return o===s||i(o,s,r)}}return Ln=n,Ln}var Mn,$r;function sd(){if($r)return Mn;$r=1;var i=As(),e=Aa(),t=Da(),n=ri(),s=Li(),r=Mi(),o=oi(),l=1,c=2;function d(u,h){return n(u)&&s(h)?r(o(u),h):function(g){var m=e(g,u);return m===void 0&&m===h?t(g,u):i(h,m,l|c)}}return Mn=d,Mn}var jn,Br;function ji(){if(Br)return jn;Br=1;function i(e){return function(t){return t==null?void 0:t[e]}}return jn=i,jn}var zn,Hr;function rd(){if(Hr)return zn;Hr=1;var i=Na();function e(t){return function(n){return i(n,t)}}return zn=e,zn}var Fn,Wr;function od(){if(Wr)return Fn;Wr=1;var i=ji(),e=rd(),t=ri(),n=oi();function s(r){return t(r)?i(n(r)):e(r)}return Fn=s,Fn}var Kn,Ur;function nt(){if(Ur)return Kn;Ur=1;var i=nd(),e=sd(),t=ti(),n=_t(),s=od();function r(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):i(o):s(o)}return Kn=r,Kn}var $n,Vr;function zi(){if(Vr)return $n;Vr=1;var i=fi(),e=nt(),t=Jt(),n=Math.max;function s(r,o,l){var c=r==null?0:r.length;if(!c)return-1;var d=l==null?0:t(l);return d<0&&(d=n(c+d,0)),i(r,e(o,3),d)}return $n=s,$n}var id=zi();const Ze=te(id);var Bn,qr;function ad(){if(qr)return Bn;qr=1;var i=Ds(),e=Gt();function t(n,s){var r=-1,o=e(n)?Array(n.length):[];return i(n,function(l,c,d){o[++r]=s(l,c,d)}),o}return Bn=t,Bn}var Hn,Gr;function ld(){if(Gr)return Hn;Gr=1;var i=ii(),e=nt(),t=ad(),n=_t();function s(r,o){var l=n(r)?i:t;return l(r,e(o,3))}return Hn=s,Hn}var cd=ld();const Bt=te(cd);var Wn,Yr;function dd(){if(Yr)return Wn;Yr=1;var i=nt(),e=Gt(),t=si();function n(s){return function(r,o,l){var c=Object(r);if(!e(r)){var d=i(o,3);r=t(r),o=function(h){return d(c[h],h,c)}}var u=s(r,o,l);return u>-1?c[d?r[u]:u]:void 0}}return Wn=n,Wn}var Un,Xr;function ud(){if(Xr)return Un;Xr=1;var i=dd(),e=zi(),t=i(e);return Un=t,Un}var hd=ud();const We=te(hd);var Vn,Zr;function pd(){if(Zr)return Vn;Zr=1;var i=ai(),e=Ns(),t=Jt();function n(s,r,o){var l=s==null?0:s.length;return l?(o&&typeof o!="number"&&e(s,r,o)?(r=0,o=l):(r=r==null?0:t(r),o=o===void 0?l:t(o)),i(s,r,o)):[]}return Vn=n,Vn}var fd=pd();const gd=te(fd);var md=ka();const bd=te(md),yd={PREFIX:X+"-overflow-list"},Qr={COLLAPSE:"collapse",SCROLL:"scroll"},Jr={START:"start",END:"end"},Sd={GROW:1},Be={BOUNDARY_SET:Object.values(Jr),POSITION_SET:["vertical","horizontal"],MODE_SET:Object.values(Qr),MODE_MAP:Qr,BOUNDARY_MAP:Jr,OVERFLOW_DIR:Sd},eo={MINIMUM_HTML_ELEMENT_WIDTH:4};class Us extends b.PureComponent{componentDidMount(){const{items:e}=this.props;this.cachedKeys=Object.keys(e);const{root:t,threshold:n,rootMargin:s,option:r,onIntersect:o}=this.props;this.observer=new IntersectionObserver(o,Object.assign({root:t,threshold:n,rootMargin:s},r)),this.observeElement()}componentDidUpdate(){const{items:e}=this.props,t=Object.keys(e);re(this.cachedKeys,t)||(this.observeElement(!0),this.cachedKeys=t)}componentWillUnmount(){this.observer&&(this.observer.disconnect(),this.observer=null)}observeElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{items:t}=this.props;if(li(t)){this.observer.disconnect();return}e&&this.observer.disconnect(),Object.keys(t).forEach(n=>{const s=t[n];s&&La(s)&&this.observer.observe(s)})}render(){const{children:e}=this.props;return e}}Us.propTypes={onIntersect:a.func,option:a.object,root:a.any,threshold:a.number,rootMargin:a.string,items:a.object};Us.defaultProps={onIntersect:()=>{},threshold:.75,rootMargin:"0px",option:{},items:{}};const wd=Be.BOUNDARY_MAP;class vd extends ge{constructor(e){super(Object.assign({},e)),this.previousY=void 0,this.isScrollMode=()=>{const{renderMode:t}=this.getProps();return t==="scroll"},this.getReversedItems=()=>{const{items:t}=this.getProps();return $t(t).reverse()}}getOverflowItem(){const{items:e}=this.getProps(),{visibleState:t,overflow:n,scrollOverflow:s}=this.getStates();if(!this.isScrollMode())return n;if(!t||t.size===0)return Array.isArray(s)&&s.length===2?s:[[],[]];const r=e.map(d=>{let{key:u}=d;return!!t.get(u)}),o=r.indexOf(!0),l=r.lastIndexOf(!0);if(o<0||l<0)return Array.isArray(s)&&s.length===2?s:[[],[]];const c=[];return c[0]=o>=0?e.slice(0,o):[],c[1]=l>=0?e.slice(l+1,e.length):e.slice(),c}_syncScrollOverflowCache(e){if(!this.isScrollMode())return;const{items:t}=this.getProps(),n=t.map(l=>{let{key:c}=l;return!!e.get(c)}),s=n.indexOf(!0),r=n.lastIndexOf(!0);if(s<0||r<0){this._adapter.updateStates({isScrollOverflowCalculating:!0});return}const o=[];o[0]=s>=0?t.slice(0,s):[],o[1]=r>=0?t.slice(r+1,t.length):t.slice(),this._adapter.updateStates({scrollOverflow:o,isScrollOverflowCalculating:!1})}handleIntersect(e){const t=$t(this.getState("visibleState")),n={};e.forEach(c=>{const d=x(c,"target.dataset.scrollkey"),u=c.isIntersecting;n[d]=c,t.set(d,u)});let s=!1;for(const c of t.values())if(c){s=!0;break}const r=s,[o]=e,l=o.boundingClientRect.y;if(!r&&this.previousY!==void 0&&l!==this.previousY){this.previousY=l;return}this.previousY=l,this._adapter.updateVisibleState(t),this._syncScrollOverflowCache(t),this._adapter.notifyIntersect(n)}handleCollapseOverflow(){const{minVisibleItems:e,collapseFrom:t}=this.getProps(),{overflowWidth:n,containerWidth:s,pivot:r,overflowStatus:o}=this.getStates(),{items:l,onOverflow:c}=this.getProps();let d=n,u=0,h=!1;for(const g of this._adapter.getItemSizeMap().values()){if(d+=g,d>s){h=!0;break}if(u===l.length-1){this._adapter.updateStates({overflowStatus:"normal",pivot:l.length-1,visible:l,overflow:[]});break}u++}if(h){const g=Math.max(e,u),m=t===wd.START,y=m?this.getReversedItems().slice(0,g).reverse():l.slice(0,g),p=m?this.getReversedItems().slice(g).reverse():l.slice(g);this._adapter.updateStates({overflowStatus:"overflowed",pivot:g,visible:y,overflow:p}),r!==g&&c(p);return}}}const at=yd.PREFIX,qn=Be.BOUNDARY_MAP,to=Be.OVERFLOW_DIR,qe=Be.MODE_MAP;class Qe extends he{constructor(e){var t;super(e),t=this,this.scroller=null,this.spacer=null,this.isScrollMode=()=>{const{renderMode:n}=this.props;return n===qe.SCROLL},this.resize=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var s;const r=(s=n[0])===null||s===void 0?void 0:s.target.clientWidth;t.setState({containerWidth:r,overflowStatus:"calculating"})},this.reintersect=n=>{this.foundation.handleIntersect(n)},this.mergeRef=(n,s,r)=>{this.itemRefs[r]=s,typeof n=="function"?n(s):typeof n=="object"&&n&&"current"in n&&(n.current=s)},this.renderOverflow=()=>{const n=this.foundation.getOverflowItem();return this.props.overflowRenderer(n)},this.getItemKey=(n,s)=>{const{itemKey:r}=this.props;return ue(r)?r(n):x(n,r||"key",s)},this.renderItemList=()=>{const{className:n,wrapperClassName:s,wrapperStyle:r,style:o,visibleItemRenderer:l,renderMode:c,collapseFrom:d}=this.props,{visible:u,overflowStatus:h}=this.state;let g=this.renderOverflow();if(!this.isScrollMode()&&(Array.isArray(g)&&(g=b.createElement(b.Fragment,null,g)),b.isValidElement(g))){const p=b.cloneElement(g);g=b.createElement(Pt,{onResize:f=>{let[S]=f;this.setState({overflowWidth:S.target.clientWidth,overflowStatus:"calculating"})}},b.createElement("div",{className:`${at}-overflow`},p))}const m=c===qe.SCROLL?(()=>{const p=[b.createElement("div",{className:M(s,`${at}-scroll-wrapper`),ref:f=>{this.scroller=f},style:Object.assign({},r),key:`${at}-scroll-wrapper`},u.map(l).map(f=>{const{forwardRef:S,key:v}=f;return b.cloneElement(f,{ref:w=>this.mergeRef(S,w,v),"data-scrollkey":`${v}`,key:v})}))];return this.props.overflowRenderDirection==="both"?(p.unshift(g[0]),p.push(g[1])):this.props.overflowRenderDirection==="start"?(p.unshift(g[1]),p.unshift(g[0])):(p.push(g[0]),p.push(g[1])),p})():[d===qn.START?g:null,u.map((p,f)=>{const S=this.getItemKey(p,f),v=l(p,f),w=b.cloneElement(v);return b.createElement(Pt,{key:S??f,onResize:_=>{let[O]=_;return this.onItemResize(O,p,f)}},b.createElement("div",{key:S??f,className:`${at}-item`},w))}),d===qn.END?g:null];return b.createElement("div",{className:M(`${at}`,n),style:Object.assign(Object.assign({},o),c===qe.COLLAPSE?{maxWidth:"100%",visibility:h==="calculating"&&this.state.pivot<0?"hidden":"visible"}:null)},...m)},this.onItemResize=(n,s,r)=>{const o=this.getItemKey(s,r),l=this.itemSizeMap.get(o);l?l!==n.target.clientWidth&&(this.itemSizeMap.set(o,n.target.clientWidth),this.setState({overflowStatus:"calculating"})):this.itemSizeMap.set(o,n.target.clientWidth);const{maxCount:c}=this.state;this.itemSizeMap.size===c&&this.setState({overflowStatus:"calculating"})},this.state={direction:to.GROW,lastOverflowCount:0,overflow:[],visible:[],containerWidth:0,visibleState:new Map,itemSizeMap:new Map,overflowStatus:"calculating",pivot:-1,overflowWidth:0,maxCount:0,scrollOverflow:[[],[]],isScrollOverflowCalculating:!0},this.foundation=new vd(this.adapter),this.previousWidths=new Map,this.itemRefs={},this.itemSizeMap=new Map}static getDerivedStateFromProps(e,t){const{prevProps:n}=t,s={};s.prevProps=e;const r=l=>!n&&l in e||n&&!re(n[l],e[l]),o=r("items");if(o||r("style")){if(s.direction=to.GROW,s.lastOverflowCount=0,s.maxCount=0,s.isScrollOverflowCalculating=!0,o&&e.renderMode===qe.SCROLL&&Array.isArray(t.scrollOverflow)){const l=(m,y)=>{const{itemKey:p}=e;return ue(p)?p(m):x(m,p||"key",y)},c=e.items||[],d=new Map;c.forEach((m,y)=>{d.set(l(m,y),m)});const u=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map((y,p)=>d.get(l(y,p))).filter(Boolean)},[h,g]=t.scrollOverflow;s.scrollOverflow=[u(h),u(g)]}if(e.renderMode===qe.SCROLL)s.visible=e.items,s.overflow=[];else{let l=e.items.length;Math.floor(t.containerWidth/eo.MINIMUM_HTML_ELEMENT_WIDTH)!==0&&(l=Math.min(l,Math.floor(t.containerWidth/eo.MINIMUM_HTML_ELEMENT_WIDTH)));const c=e.collapseFrom===qn.START,d=c?$t(e.items).reverse().slice(0,l):e.items.slice(0,l),u=c?$t(e.items).reverse().slice(l):e.items.slice(l);s.visible=d,s.overflow=u,s.maxCount=l}s.overflowStatus="calculating"}return s}get adapter(){return Object.assign(Object.assign({},super.adapter),{updateVisibleState:e=>{this.setState({visibleState:e},()=>{var t,n;(n=(t=this.props).onVisibleStateChange)===null||n===void 0||n.call(t,e)})},updateStates:e=>{this.setState(Object.assign({},e))},notifyIntersect:e=>{this.props.onIntersect&&this.props.onIntersect(e)},getItemSizeMap:()=>this.itemSizeMap})}componentDidUpdate(e,t){const n=e.items.map((d,u)=>this.getItemKey(d,u)),s=this.props.items.map((d,u)=>this.getItemKey(d,u));re(n,s)||(this.itemRefs={},this.itemSizeMap=new Map,this.setState({visibleState:new Map,isScrollOverflowCalculating:!0}));const{overflow:r,containerWidth:o,visible:l,overflowStatus:c}=this.state;this.isScrollMode()||c!=="calculating"||this.foundation.handleCollapseOverflow()}render(){const e=this.renderItemList(),{renderMode:t}=this.props;return t===qe.SCROLL?b.createElement(Us,{onIntersect:this.reintersect,root:this.scroller,threshold:this.props.threshold,items:this.itemRefs},e):b.createElement(Pt,{onResize:this.resize},e)}}Qe.__SemiComponentName__="OverflowList";Qe.defaultProps=ks(Qe.__SemiComponentName__,{collapseFrom:"end",minVisibleItems:0,overflowRenderer:()=>null,renderMode:"collapse",threshold:.75,visibleItemRenderer:()=>null,onOverflow:()=>null,overflowRenderDirection:"both"});Qe.propTypes={className:a.string,collapseFrom:a.oneOf(Be.BOUNDARY_SET),direction:a.oneOf(Be.POSITION_SET),items:a.array,minVisibleItems:a.number,onIntersect:a.func,onOverflow:a.func,overflowRenderer:a.func,renderMode:a.oneOf(Be.MODE_SET),style:a.object,threshold:a.number,visibleItemRenderer:a.func,wrapperClassName:a.string,wrapperStyle:a.object,collapseMask:a.object,overflowRenderDirection:a.string};const Cd={PREFIX:`${X}-page`},Vs={PAGE_SHOW_MAX:7,DEFAULT_PAGE_SIZE:10,PAGE_SIZE_OPTION:[10,20,40,100],REST_PAGE_MAX_SIZE:1e6};class _d extends ge{constructor(e){super(Object.assign({},e))}init(){const{currentPage:e,total:t,pageSize:n}=this.getStates();this._updateDisabled({currentPage:e,total:t,pageSize:n}),this._updatePageList({currentPage:e,total:t,pageSize:n}),this._registerEventHandler()}destroy(){this._unregisterEventHandler()}_registerEventHandler(){this._adapter.registerKeyDownHandler(this.handleKeyDown)}_unregisterEventHandler(){this._adapter.unregisterKeyDownHandler(this.handleKeyDown)}_updateDisabled(e){const{currentPage:t,total:n,pageSize:s}=e,r=this._getTotalPageNumber(n,s);let o=!1,l=!1;t===1?(o=!0,l=r<2):t===r&&(o=!1,l=!0);const{prevDisabled:c,nextDisabled:d}=this.getStates();(o!==c||l!==d)&&this._adapter.setDisabled(o,l)}goPage(e){if(e==="...")return;const{pageSize:t,currentPage:n}=this.getStates(),s=this._isInProps("currentPage");e!==n&&(s?(this._adapter.notifyPageChange(e),this._adapter.notifyChange(e,t)):(this.updatePage(e),this._adapter.notifyPageChange(e),this._adapter.notifyChange(e,t)))}updatePage(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;(t===null||typeof t>"u")&&(t=this.getState("total")),(n===null||typeof n>"u")&&(n=this.getState("pageSize")),this._updateDisabled({currentPage:e,total:t,pageSize:n}),this._updatePageList({currentPage:e,total:t,pageSize:n}),t!==this.getState("total")&&this._adapter.updateTotal(t),e!==this.getState("currentPage")&&this._adapter.setCurrentPage(e),n!==this.getState("pageSize")&&this._adapter.updatePageSize(n)}updateAllPageNumbers(e,t){const{size:n,hoverShowPageSelect:s,disabled:r}=this.getProps();if(!(n!=="small"||!s||r)){const o=Array.from({length:Math.ceil(e/t)},(l,c)=>c+1);this._adapter.updateAllPageNumbers(o)}}goPrev(){const{currentPage:e}=this.getStates();e>1&&this.goPage(e-1)}goNext(){const{currentPage:e,total:t,pageSize:n}=this.getStates(),s=this._getTotalPageNumber(t,n);e<=s-1&&this.goPage(e+1)}_updatePageList(e){const{currentPage:t,total:n,pageSize:s}=e;let r=[],o=[],l=[];const c=this._getTotalPageNumber(n,s),{PAGE_SHOW_MAX:d,REST_PAGE_MAX_SIZE:u}=Vs;if(c<=d)r=Array.from({length:c},(h,g)=>g+1),o=[],l=[];else switch(!0){case t<4:r=[1,2,3,4,"...",c-1,c],l=Array.from({length:Math.min(c-6,u)},(m,y)=>y+5),o=[];break;case t===4:r=[1,2,3,4,5,"...",c],l=Array.from({length:Math.min(c-6,u)},(m,y)=>y+6),o=[];break;case(4<t&&t<c-3):const h=Array.from({length:3},(m,y)=>t+(y-1));r=[1].concat("...",h,"...",c),l=Array.from({length:Math.min(c-t-2,u)},(m,y)=>t+y+2),o=Array.from({length:Math.min(t-3,u)},(m,y)=>y+2);break;case(t-3<=t&&t<=c):const g=Array.from({length:5},(m,y)=>c-(4-y));r=[1,"..."].concat(g),l=[],o=Array.from({length:Math.min(g[0]-2,u)},(m,y)=>y+2);break}this._adapter.setPageList({pageList:r,restLeftPageList:o,restRightPageList:l})}changePageSize(e){const{pageSize:t}=this.getStates();this._adapter.updatePageSize(e),this._adapter.notifyPageSizeChange(e);const{total:n,currentPage:s}=this.getStates(),{preventPageChangeOnPageSizeChange:r}=this.getProps();let o=s;if(!r){const l=(s-1)*t+1;o=Math.ceil(l/e)}this.updatePage(o,n,e),s!==o&&this._adapter.notifyPageChange(o),this._adapter.notifyChange(o,e)}handleKeyDown(){}pageSizeInOpts(){const{pageSizeOpts:e}=this.getProps(),{pageSize:t}=this.getStates(),n=[...e];if(n.indexOf(t)===-1){const s=n.findIndex(r=>r>t);n.splice(s,0,t)}return n}handleQuickJumpNumberChange(e){this._adapter.updateQuickJumpPage(e)}_handleQuickJump(e){let t=Number(e);const{pageSize:n,total:s}=this.getStates(),r=this._getTotalPageNumber(s,n);Number.isNaN(t)||(t>r&&(t=r),t<=0&&(t=1),this._adapter.updateQuickJumpPage(""),this.goPage(t))}handleQuickJumpBlur(){const{quickJumpPage:e}=this.getStates();(typeof e=="string"&&e||typeof e=="number")&&this._handleQuickJump(e)}handleQuickJumpEnterPress(e){this._handleQuickJump(e)}_getTotalPageNumber(e,t){return Math.ceil(e/t)}}const qs={PREFIX:`${X}-select`,PREFIX_OPTION:`${X}-select-option`,PREFIX_GROUP:`${X}-select-group`},_e={SIZE_SET:["small","large","default"],POSITION_SET:Ma.POSITION_SET,STATUS:pl,SEARCH_POSITION_TRIGGER:"trigger",SEARCH_POSITION_DROPDOWN:"dropdown"},Fi={LIST_HEIGHT:270};var no=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class Od extends ge{constructor(e){super(Object.assign({},e)),this._keydownHandler=null}init(){this._setDropdownWidth();const e=this.getProp("defaultOpen"),t=this.getProp("open"),n=this._collectOptions();this._setDefaultSelection(n),(e||t)&&this.open(void 0,n),this.getProp("autoFocus")&&this.focus(n)}focus(e,t){const n=this._isFilterable(),s=this._isMultiple(),{isOpen:r}=this.getStates(),{searchPosition:o}=this.getProps(),l=t!==!1;if(this._adapter.updateFocusState(!0),this._adapter.setIsFocusInContainer(!1),n){if(!l){o===_e.SEARCH_POSITION_TRIGGER?s?this.focusInput():this.toggle2SearchInput(!0):this._focusTrigger();return}s?(this.focusInput(),r||this.open(void 0,e)):(this.toggle2SearchInput(!0),r||this.open(void 0,e))}else this._focusTrigger()}_focusTrigger(){this._adapter.focusTrigger()}destroy(){this._adapter.unregisterClickOutsideHandler()}_setDropdownWidth(){const{style:e,dropdownMatchSelectWidth:t}=this.getProps();let n;t&&(e&&gt(e.width)||e&&Ce(e.width)&&!e.width.includes("%")?n=e.width:n=this._adapter.getTriggerWidth(),this._adapter.setOptionWrapperWidth(n))}_collectOptions(){const e=this._adapter.getOptionsFromChildren();return this._adapter.updateOptions(e),this._adapter.rePositionDropdown(),e}_setDefaultSelection(e){let{value:t}=this.getProps();const{defaultValue:n}=this.getProps();this._isControlledComponent()||(t=n),this._update(t,e)}handleOptionListChange(){const e=this._collectOptions(),{selections:t}=this.getStates();this.updateOptionsActiveStatus(t,e);const{defaultActiveFirstOption:n}=this.getProps();n&&this._adapter.updateFocusIndex(0)}handleOptionListChangeHadDefaultValue(){const e=this.getState("selections");let t;const{onChangeWithObject:n}=this.getProps(),s=this._isMultiple();switch(!0){case(s&&!!e.size):try{t=[...e].map(o=>n?o[1]:o[1].value)}catch{t=[]}break;case(s&&!e.size):t=[];break;case(!s&&!!e.size):try{t=n?[...e][0][1]:[...e][0][1].value}catch{}break;case(!s&&!e.size):break}const r=this._adapter.getOptionsFromChildren();this._update(t,r)}handleValueChange(e){const{allowCreate:t,autoClearSearchValue:n,remote:s}=this.getProps(),{inputValue:r}=this.getStates();let o;t&&this._isControlledComponent()?(o=this.getState("options"),o.forEach(l=>l._show=!0)):o=this._adapter.getOptionsFromChildren(),this._adapter.rePositionDropdown(),this._isFilterable()&&!n&&r&&!s&&(o=this._filterOption(o,r)),this._update(e,o)}_update(e,t){let n;this._isMultiple()?(n=this._updateMultiple(e,t),this.updateOverflowItemCount(n.size)):n=this._updateSingle(e,t),this._adapter.updateSelection(n),this.updateOptionsActiveStatus(n,t)}_updateSingle(e,t){const n=new Map,{onChangeWithObject:s}=this.getProps(),r=s&&typeof e<"u"?e.value:e,o=t.filter(c=>c.value===r),l=!o.length&&typeof r<"u"&&r!==null;if(o.length){const c=o[0],d=Object.assign({},c);n.set(d.label,d)}else if(l){let c={value:e,label:e,_notExist:!0,_scrollIndex:-1};s&&(c=Object.assign(Object.assign({},e),{_notExist:!0,_scrollIndex:-1})),n.set(c.label,c)}return n}_updateMultiple(e,t){const n=this.getState("selections");let s=[];const r=Array.isArray(e);this.checkMultipleProps(),n.size&&(s=[...n].map(d=>d[1]));const o=new Map;let l=e;const{onChangeWithObject:c}=this.getProps();return c&&r&&(l=e.map(d=>d.value)),r&&l.length&&l.forEach((d,u)=>{const h=t.findIndex(g=>g.value===d);if(h!==-1)o.set(t[h].label,t[h]);else{const g=s.findIndex(m=>m.value===d);if(g!==-1){const m=s[g];if(c){const y=Object.assign({},e[u]);re(y,m)?o.set(m.label,m):o.set(y.label,y)}else o.set(m.label,m)}else{let m={value:d,label:d,_notExist:!0};c&&(m=Object.assign(Object.assign({},e[u]),{_notExist:!0})),o.set(m.label,Object.assign(Object.assign({},m),{_scrollIndex:-1}))}}}),o}_isMultiple(){return this.getProp("multiple")}_isDisabled(){return this.getProp("disabled")}_isFilterable(){return!!this.getProp("filter")}handleClick(e){const{clickToHide:t}=this.getProps(),{isOpen:n}=this.getStates();this._isDisabled()||(n?n&&t?this.close({event:e}):n&&!t&&this.focusInput():(this.open(),this._notifyFocus(e)))}open(e,t){const n=this._isFilterable(),s=t||this.getState("options");if(n){const o=this._filterOption(s,"").filter(l=>!l._inputCreateOnly);this._adapter.updateOptions(o),this.toggle2SearchInput(!0)}else this._adapter.updateFocusState(!0);this._adapter.openMenu(()=>{const{searchPosition:r,autoFocus:o}=this.getProps();o&&r===_e.SEARCH_POSITION_DROPDOWN&&this._adapter.focusDropdownInput()}),this._setDropdownWidth(),this._adapter.notifyDropdownVisibleChange(!0),this.bindKeyBoardEvent(),this._adapter.registerClickOutsideHandler(r=>{this.close({event:r}),this._notifyBlur(r),this._adapter.updateFocusState(!1)})}toggle2SearchInput(e){e?this._adapter.toggleInputShow(e,()=>this.focusInput()):this._adapter.toggleInputShow(e,()=>{})}close(e){const{event:t,closeCb:n,notToggleInput:s}=e||{},{isFocus:r}=this.getStates();this._adapter.closeMenu(),this._adapter.notifyDropdownVisibleChange(!1),this._adapter.setIsFocusInContainer(!1),r&&this._focusTrigger(),this._adapter.unregisterClickOutsideHandler();const o=this._isFilterable();o&&!s&&this.toggle2SearchInput(!1),this._adapter.once("popoverClose",()=>{o&&this.clearInput(t),n&&n()})}onSelect(e,t,n){if(this._isDisabled())return;e._inputCreateOnly&&this._adapter.notifyCreate(e),this._isMultiple()?this._handleMultipleSelect(e,n):this._handleSingleSelect(e,n),this._adapter.updateFocusIndex(t)}_handleSingleSelect(e,t){var{value:n,label:s}=e,r=no(e,["value","label"]);const o=new Map().set(s,Object.assign({value:n,label:s},r));this._notifySelect(n,Object.assign({value:n,label:s},r));const l=this._isFilterable();this._isControlledComponent()?this.close({event:t,notToggleInput:!0,closeCb:()=>{this._notifyChange(o),l&&this.toggle2SearchInput(!1)}}):(this._adapter.updateSelection(o),this._notifyChange(o),this.close({event:t,closeCb:()=>{this.updateOptionsActiveStatus(o)}}))}_handleMultipleSelect(e,t){var{value:n,label:s}=e,r=no(e,["value","label"]);const o=this._adapter.getMaxLimit(),l=this._adapter.getSelections(),{autoClearSearchValue:c}=this.getProps();if(l.has(s))this._notifyDeselect(n,Object.assign({value:n,label:s},r)),l.delete(s);else if(o&&l.size>=o){this._adapter.notifyMaxLimit(Object.assign({value:n,label:s},ye(r,"_scrollIndex")));return}else this._notifySelect(n,Object.assign({value:n,label:s},r)),l.set(s,Object.assign({value:n,label:s},r));if(this._isControlledComponent())this._notifyChange(l),this._isFilterable()&&(c&&this.clearInput(t),this.focusInput());else{this._adapter.updateSelection(l),this.updateOverflowItemCount(l.size),this._adapter.rePositionDropdown();let{options:d}=this.getStates();this._isFilterable()&&(c&&(this.clearInput(t),d=this._filterOption(d,"")),this.focusInput()),this.updateOptionsActiveStatus(l,d),this._notifyChange(l)}}clearSelected(){const e=new Map;this._isControlledComponent()?(this._notifyChange(e),this._adapter.notifyClear()):(this._adapter.updateSelection(e),this.updateOptionsActiveStatus(e),this._notifyChange(e),this._adapter.notifyClear());const{isOpen:t}=this.getStates();t&&this._adapter.rePositionDropdown()}updateOptionsActiveStatus(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getState("options");const{allowCreate:n}=this.getProps(),s=t.map(r=>(e.has(r.label)?(r._selected=!0,n&&delete r._inputCreateOnly):(r._inputCreateOnly&&(r._show=!1),r._selected=!1),r));this._adapter.updateOptions(s)}removeTag(e){const t=this._adapter.getSelections();t.delete(e.label),this._isControlledComponent()?(this._notifyDeselect(e.value,e),this._notifyChange(t)):(this._notifyDeselect(e.value,e),this._adapter.updateSelection(t),this.updateOverflowItemCount(t.size),this.updateOptionsActiveStatus(t),this._adapter.rePositionDropdown(),this._notifyChange(t))}clearInput(e){const{inputValue:t}=this.getStates();if(t!==""){this._adapter.updateInputValue(""),this._adapter.notifySearch("",e);const{options:n}=this.getStates(),{remote:s}=this.getProps();let r=n;s||(r=this._filterOption(n,"")),this._adapter.updateOptions(r)}}focusInput(){this._adapter.focusInput(),this._adapter.updateFocusState(!0),this._adapter.setIsFocusInContainer(!1)}handleInputChange(e,t){this._adapter.updateInputValue(e);const{options:n,isOpen:s}=this.getStates(),{allowCreate:r,remote:o}=this.getProps();let l=n;o||(l=this._filterOption(n,e)),l=this._createOptionByInput(r,l,e),this._adapter.updateOptions(l),this._adapter.notifySearch(e,t),this._isMultiple()&&this._adapter.rePositionDropdown()}_filterOption(e,t){const n=this.getProp("filter");if(n){if(typeof n=="boolean"&&n){const s=t.toLowerCase();return e.map(r=>{const o=r.label.toString().toLowerCase(),l=r._parentGroup&&r._parentGroup.label,c=o.includes(s),d=Ce(l)&&l.toLowerCase().includes(s);return c||d?r._show=!0:r._show=!1,r})}else if(typeof n=="function")return e.map(s=>(n(t,s)?s._show=!0:s._show=!1,s))}else return e}_createOptionByInput(e,t,n){if(e)if(n){const s={_show:!0,_selected:!1,value:n,label:n,_inputCreateOnly:!0};let r=-1,o=-1;t.forEach((l,c)=>{!l._show&&!l._inputCreateOnly||(l.label===n&&(o=c),l._inputCreateOnly&&(r=c,l.value=n,l.label=n,l._show=!0))}),r===-1&&o===-1&&t.push(s),o!==-1&&(t=t.filter(l=>!l._inputCreateOnly))}else t=t.filter(s=>!s._inputCreateOnly);return t}bindKeyBoardEvent(){this._keydownHandler=e=>{this._handleKeyDown(e)},this._adapter.registerKeyDown(this._keydownHandler)}unBindKeyBoardEvent(){this._keydownHandler&&this._adapter.unregisterKeyDown()}_handleKeyDown(e){const t=e.keyCode,{loading:n,filter:s,multiple:r,disabled:o}=this.getProps(),{isOpen:l}=this.getStates();if(!(n||o))switch(t){case je.UP:e.preventDefault(),this._handleArrowKeyDown(-1);break;case je.DOWN:e.preventDefault(),this._handleArrowKeyDown(1);break;case je.BACKSPACE:this._handleBackspaceKeyDown();break;case je.ENTER:Et(e),this._handleEnterKeyDown(e);break;case je.ESC:l&&this.close({event:e}),s&&!r&&this._focusTrigger();break;case je.TAB:this._handleTabKeyDown(e);break}}handleContainerKeyDown(e){const t=e.keyCode,{isOpen:n}=this.getStates();switch(t){case je.TAB:n&&this._handleTabKeyDown(e);break}}_getEnableFocusIndex(e){const{focusIndex:t,options:n}=this.getStates(),s=n.filter(l=>l._show),r=s.length;let o=t+e;if(o<0&&(o=r-1),o>=r&&(o=0),e>0){let l=-1;for(let c=0;c<s.length&&(!s[c].disabled&&(l=c),!(l>=o));c++);o=l}else{let l=s.length;for(let c=r-1;c>=0&&(!s[c].disabled&&(l=c),!(l<=o));c--);o=l}this._adapter.updateFocusIndex(o),this._adapter.updateScrollTop(o)}_handleArrowKeyDown(e){const{isOpen:t}=this.getStates();t?this._getEnableFocusIndex(e):this.open()}_handleTabKeyDown(e){const{isOpen:t}=this.getStates();if(this._adapter.updateFocusState(!1),t){const n=this._adapter.getContainer(),s=this._adapter.getFocusableElements(n);s.length>0?e.shiftKey?this._handlePanelOpenShiftTabKeyDown(s,e):this._handlePanelOpenTabKeyDown(s,e):(this.close({event:e}),this._notifyBlur(e))}else this._notifyBlur(e)}_handlePanelOpenTabKeyDown(e,t){const n=this._adapter.getActiveElement();this._adapter.getIsFocusInContainer()?n===e[e.length-1]&&(this._focusTrigger(),this.close({event:t}),Et(t)):(e[0].focus(),this._adapter.setIsFocusInContainer(!0),Et(t))}_handlePanelOpenShiftTabKeyDown(e,t){const n=this._adapter.getActiveElement();this._adapter.getIsFocusInContainer()?n===e[0]&&(this._focusTrigger(),this._adapter.setIsFocusInContainer(!1),Et(t)):(this.close({event:t}),this._notifyBlur(t))}_handleEnterKeyDown(e){const{isOpen:t,options:n,focusIndex:s}=this.getStates();if(!t)this.open();else if(s!==-1){const r=n.filter(l=>l._show),{length:o}=r;if(o<=s)return;if(r&&o){const l=r[s];if(l.disabled)return;this.onSelect(l,s,e)}}else this.close({event:e})}_handleBackspaceKeyDown(){if(this._isMultiple()){const e=this._adapter.getSelections(),{inputValue:t}=this.getStates(),n=e.size;if(n&&!t){const s=[...e.keys()];let r=n-1,o=s[r],l=e.get(o),c=!1;if(l.disabled&&r===0)return;for(;l.disabled&&r!==0;)r=r-1,o=s[r],l=e.get(o),r==0&&l.disabled&&(c=!0);c||this.removeTag(l)}}}_notifyChange(e){const{onChangeWithObject:t}=this.getProps(),n=this.getState("selections");let s;const r=[...e.values()],o=this._isMultiple();if(this._diffSelections(e,n,o))switch(!0){case t:this._notifyChangeWithObject(e);break;case(!t&&!o):s=r.length?r[0].value:void 0,this._adapter.notifyChange(s);break;case(!t&&o):s=r.length?r.map(c=>c.value):[],this._adapter.notifyChange(s);break}}_removeInternalKey(e){let t=Object.assign({},e);return delete t._parentGroup,delete t._show,delete t._selected,delete t._scrollIndex,delete t._keyInJsx,"_keyInOptionList"in t&&(t.key=t._keyInOptionList,delete t._keyInOptionList),t}_notifySelect(e,t){const n=this._removeInternalKey(t);this._adapter.notifySelect(e,n)}_notifyDeselect(e,t){const n=this._removeInternalKey(t);this._adapter.notifyDeselect(e,n)}_diffSelections(e,t,n){let s=!0,r=!0;if(!n){const o=[...e.values()],l=[...t.values()],c=o[0]?o[0].value:o[0],d=l[0]?l[0].value:l[0];r=!re(c,d);const u=o[0]?o[0].label:o[0],h=l[0]?l[0].label:l[0];s=!re(u,h)}return r||s}_notifyChangeWithObject(e){this.getState("selections");const t=[];for(const n of e.entries()){let s=Object.assign({label:n[0]},n[1]);s=this._removeInternalKey(s),t.push(s)}this._isMultiple()?this._adapter.notifyChange(t):this._adapter.notifyChange(t[0])}_notifyBlur(e){this._adapter.notifyBlur(e)}_notifyFocus(e){this._adapter.notifyFocus(e)}handleMouseEnter(e){this._adapter.updateHovering(!0),this._adapter.notifyMouseEnter(e)}handleMouseLeave(e){this._adapter.updateHovering(!1),this._adapter.notifyMouseLeave(e)}handleClearClick(e){const{filter:t,searchPosition:n}=this.getProps();t&&n===_e.SEARCH_POSITION_TRIGGER&&this.clearInput(e),this.focus(void 0,!1),this.clearSelected(),e.stopPropagation()}handleKeyPress(e){e&&e.key===ja&&this.handleClick(e)}handleClearBtnEnterPress(e){Yt(e)&&this.handleClearClick(e)}handleOptionMouseEnter(e){this._adapter.updateFocusIndex(e)}handleListScroll(e){this._adapter.notifyListScroll(e)}handleTriggerFocus(e){this.bindKeyBoardEvent(),this._adapter.setIsFocusInContainer(!1)}handleTriggerBlur(e){const{filter:t,autoFocus:n}=this.getProps(),{isOpen:s,isFocus:r}=this.getStates();r&&!s&&(this._notifyBlur(e),this._adapter.updateFocusState(!1))}handleInputBlur(e){const{filter:t,autoFocus:n}=this.getProps(),{showInput:s,isOpen:r}=this.getStates(),o=this._isMultiple();t&&!o&&(s||n)&&!r&&this.toggle2SearchInput(!1)}selectAll(){const{options:e}=this.getStates(),{onChangeWithObject:t}=this.getProps();let n=[];if(!this._isMultiple()){console.warn(`[Semi Select]: It seems that you have called the selectAll method in the single-selection Select.
Please note that this is not a legal way to use it`);return}t?n=e:n=e.map(r=>r.value),this.handleValueChange(n),this._adapter.notifyChange(n)}checkMultipleProps(e){if(this._isMultiple()){const t=e||this.getProps(),{defaultValue:n,value:s}=t,r=s||n;!Xt(r)&&!Array.isArray(r)&&$e(!0,"[Semi Select] defaultValue/value should be array type in multiple mode")}}updateScrollTop(){this._adapter.updateScrollTop()}updateOverflowItemCount(e,t){const{maxTagCount:n,ellipsisTrigger:s}=this.getProps();s&&(t?this._adapter.updateOverflowItemCount(t):typeof n=="number"&&(e-n>0?this._adapter.updateOverflowItemCount(e-n):this._adapter.updateOverflowItemCount(0)))}updateIsFullTags(){const{isFullTags:e}=this.getStates();e||this._adapter.setState({isFullTags:!0})}handlePopoverClose(){this._adapter.emit("popoverClose")}handleSlotMouseEnter(){this._adapter.updateFocusIndex(-1)}}const lt=al.PREFIX,Ki=gi.TAG_SIZE,Rd=gi.AVATAR_SHAPE;class Ht extends L.PureComponent{renderNTag(e,t){const{size:n,showPopover:s,popoverProps:r,onPlusNMouseEnter:o}=this.props;let l=b.createElement(mt,{closable:!1,size:n,color:"grey",style:{backgroundColor:"transparent"},key:"_+n",onMouseEnter:o},"+",e);return s&&(l=b.createElement(yt,Object.assign({showArrow:!0,content:t,trigger:"hover",position:"top",autoAdjustOverflow:!0,className:`${lt}-rest-group-popover`},r,{key:"_+n_Popover"}),l)),l}renderMergeTags(e){const{maxTagCount:t,tagList:n,restCount:s}=this.props,r=s||n.length-t;let o=e;const l=e.slice(0,t),c=e.slice(t);let d=null;return r>0&&(d=this.renderNTag(r,c),l.push(d),o=l),o}renderAllTags(){const{tagList:e,size:t,mode:n,avatarShape:s,onTagClose:r}=this.props;return e.map(l=>{if(n==="custom")return l;const c=Object.assign({},l);return c.size||(c.size=t),c.avatarShape||(c.avatarShape=s),c.tagKey||(typeof c.children=="string"||typeof c.children=="number"?c.tagKey=c.children:c.tagKey=Math.random()),b.createElement(mt,Object.assign({},c,{key:c.tagKey,onClose:(d,u,h)=>{c.onClose&&c.onClose(d,u,h),r&&r(d,u,h)}}))})}render(){const{style:e,className:t,maxTagCount:n,size:s}=this.props,r=M({[`${lt}-group`]:!0,[`${lt}-group-max`]:n,[`${lt}-group-small`]:s==="small",[`${lt}-group-large`]:s==="large"},t),o=this.renderAllTags(),l=typeof n>"u"?o:this.renderMergeTags(o);return b.createElement("div",{style:e,className:r},l)}}Ht.defaultProps={style:{},className:"",size:Ki[0],avatarShape:"square",onTagClose:()=>{},onPlusNMouseEnter:()=>{}};Ht.propTypes={children:a.node,style:a.object,className:a.string,maxTagCount:a.number,restCount:a.number,tagList:a.array,size:a.oneOf(Ki),mode:a.string,onTagClose:a.func,showPopover:a.bool,popoverProps:a.object,avatarShape:a.oneOf(Rd)};var Ed=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const so=(i,e,t,n)=>{const s=i.props;if(!i||!s)return null;const r=Object.assign(Object.assign({value:s.value,label:s.label||s.children||s.value,_show:!0,_selected:!1,_scrollIndex:t},s),{_parentGroup:e});return r._keyInJsx=n||i.key,r},xd=i=>{let e=[],t=[];const n={label:"",children:[],_show:!1};let s=b.Children.toArray(i);s=s.filter(l=>l&&l.props);let r="",o=-1;return s.forEach(l=>{if(l.type.isSelectOption){r="option",o++;const c=so(l,void 0,o);n.children.push(c),t.push(c)}else if(l.type.isSelectOptionGroup){r="group";let c=l.props,{children:d}=c,u=Ed(c,["children"]);u.key=l.key;let h=[];Array.isArray(d)?h=d.map(y=>y.key):h.push(d.key),d=b.Children.toArray(d);const g=d.map((y,p)=>{let f=y.key;return h[p]===null&&(f=l.key+""+y.key),o++,so(y,u,o,f)}),m=Object.assign(Object.assign({},l.props),{children:g,key:l.key});e.push(m),t=t.concat(g)}else $e(!0,"[Semi Select] The children of `Select` should be `Select.Option` or `Select.OptionGroup`")}),r==="option"&&(e=[n]),{optionGroups:e,options:t}},Td=i=>{let{index:e,data:t,style:n}=i;const{visibleOptions:s,renderOption:r}=t,o=s[e];return r(o,e,n)};var ro=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let He=class extends L.PureComponent{onClick(e,t){var{value:n,label:s,children:r}=e,o=ro(e,["value","label","children"]);const{props:l}=this;l.disabled||l.onSelect(Object.assign(Object.assign({},o),{value:n,label:s||r}),t)}renderOptionContent(e){let{config:t,children:n,inputValue:s,prefixCls:r}=e;return Ce(n)&&s?b.createElement(zs,{searchWords:t.searchWords,sourceString:t.sourceString,highlightClassName:t.highlightClassName}):n}render(){const e=this.props,{children:t,disabled:n,value:s,selected:r,label:o,empty:l,emptyContent:c,onSelect:d,focused:u,showTick:h,className:g,style:m,onMouseEnter:y,prefixCls:p,renderOptionItem:f,inputValue:S,semiOptionId:v}=e,w=ro(e,["children","disabled","value","selected","label","empty","emptyContent","onSelect","focused","showTick","className","style","onMouseEnter","prefixCls","renderOptionItem","inputValue","semiOptionId"]),_=M(p,{[`${p}-disabled`]:n,[`${p}-selected`]:r,[`${p}-focused`]:u,[`${p}-empty`]:l,[g]:g}),O=M([`${p}-icon`]);if(l)return c===null?null:b.createElement(Ee,{componentName:"Select"},E=>b.createElement("div",{className:_,"x-semi-prop":"emptyContent"},c||E.emptyText));if(typeof f=="function"){const E=M(g,{[`${p}-custom`]:!0,[`${p}-custom-selected`]:r});return f(Object.assign({disabled:n,focused:u,selected:r,style:m,label:o,value:s,inputValue:S,onMouseEnter:k=>y(k),onClick:k=>this.onClick(Object.assign({value:s,label:o,children:t},w),k),className:E},w))}const I={searchWords:[S],sourceString:t,highlightClassName:`${p}-keyword`};return b.createElement("div",Object.assign({className:_,onClick:E=>{this.onClick(Object.assign({value:s,label:o,children:t},w),E)},onMouseEnter:E=>y&&y(E),role:"option",id:v,"aria-selected":r?"true":"false","aria-disabled":n?"true":"false",style:m},qt(w)),h?b.createElement("div",{className:O},b.createElement(za,null)):null,Ce(t)?b.createElement("div",{className:`${p}-text`},this.renderOptionContent({children:t,config:I,inputValue:S,prefixCls:p})):t)}};He.isSelectOption=!0;He.propTypes={children:a.node,disabled:a.bool,value:a.oneOfType([a.string,a.number]),selected:a.bool,label:a.node,empty:a.bool,emptyContent:a.node,onSelect:a.func,focused:a.bool,showTick:a.bool,className:a.string,style:a.object,onMouseEnter:a.func,prefixCls:a.string,renderOptionItem:a.func,inputValue:a.string};He.defaultProps={prefixCls:qs.PREFIX_OPTION};var Id=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const Pd=qs.PREFIX_GROUP;class nn extends he{render(){const e=this.props,{label:t,className:n,style:s}=e,r=Id(e,["label","className","style"]),o=M(n,{[Pd]:!0});return!t&&typeof t!="number"?null:b.createElement("div",Object.assign({className:o,style:s},this.getDataAttr(r)),t)}}nn.isSelectOptionGroup=!0;nn.propTypes={children:a.oneOfType([a.array,a.node]),label:a.node,className:a.string,style:a.object};var Ad=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const $=qs.PREFIX,Dd=0;class Te extends he{constructor(e){super(e),this.setOptionContainerEl=t=>this.optionContainerEl={current:t},this.handleInputChange=(t,n)=>this.foundation.handleInputChange(t,n),this.getTagItem=(t,n,s)=>{const{size:r,disabled:o}=this.props,l=t[0],{value:c}=t[1],d=t[1].disabled||o,u=(y,p)=>{p&&typeof p.preventDefault=="function"&&p.preventDefault(),this.foundation.removeTag({label:l,value:c})},{content:h,isRenderInTag:g}=s(t[1],{index:n,disabled:d,onClose:u}),m={disabled:d,closable:!d,onClose:u};return g?b.createElement(mt,Object.assign({},m,{color:"white",size:r||"large",key:c,tabIndex:-1}),h):b.createElement(L.Fragment,{key:c},h)},this.state={isOpen:!1,isFocus:!1,options:[],selections:new Map,dropdownMinWidth:null,optionKey:Dd,inputValue:"",showInput:!1,focusIndex:e.defaultActiveFirstOption?0:-1,keyboardEventSet:{},optionGroups:[],isHovering:!1,isFocusInContainer:!1,isFullTags:!1,overflowItemCount:0},this.selectOptionListID="",this.selectID="",this.virtualizeListRef=b.createRef(),this.inputRef=b.createRef(),this.dropdownInputRef=b.createRef(),this.triggerRef=b.createRef(),this.optionsRef=b.createRef(),this.optionContainerEl=b.createRef(),this.clickOutsideHandler=null,this.onSelect=this.onSelect.bind(this),this.onClear=this.onClear.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.renderOption=this.renderOption.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.eventManager=new Fa,this.foundation=new Od(this.adapter)}get adapter(){var e=this;const t={registerKeyDown:r=>{const o={onKeyDown:r};this.setState({keyboardEventSet:o})},unregisterKeyDown:()=>{this.setState({keyboardEventSet:{}})},updateFocusIndex:r=>{this.setState({focusIndex:r})},scrollToFocusOption:()=>{}},n={updateInputValue:r=>{this.setState({inputValue:r})},toggleInputShow:(r,o)=>{this.setState({showInput:r},()=>{o()})},focusInput:()=>{const{preventScroll:r}=this.props;this.inputRef&&this.inputRef.current&&this.inputRef.current.focus({preventScroll:r})},focusDropdownInput:()=>{const{preventScroll:r}=this.props;this.dropdownInputRef&&this.dropdownInputRef.current&&this.dropdownInputRef.current.focus({preventScroll:r})}},s={notifyMaxLimit:r=>this.props.onExceed(r),getMaxLimit:()=>this.props.max,registerClickOutsideHandler:r=>{const o=l=>{const c=this.triggerRef&&this.triggerRef.current,d=this.optionContainerEl&&this.optionContainerEl.current,u=l.target,h=l.composedPath&&l.composedPath()||[u];!(d&&d.contains(u))&&!(c&&c.contains(u))&&!(h.includes(c)||h.includes(d))&&r(l)};this.clickOutsideHandler=o,document.addEventListener("mousedown",o,!1)},unregisterClickOutsideHandler:()=>{this.clickOutsideHandler&&(document.removeEventListener("mousedown",this.clickOutsideHandler,!1),this.clickOutsideHandler=null)},rePositionDropdown:()=>{let{optionKey:r}=this.state;r=r+1,this.setState({optionKey:r})},notifyDeselect:(r,o)=>{delete o._parentGroup,this.props.onDeselect(r,o)}};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},super.adapter),t),n),s),{on:(r,o)=>this.eventManager.on(r,o),off:r=>this.eventManager.off(r),once:(r,o)=>this.eventManager.once(r,o),emit:r=>this.eventManager.emit(r),getOptionsFromChildren:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.props.children,o=[],l=[];const{optionList:c}=e.props;if(c&&c.length)l=c.map((d,u)=>Object.assign({_show:!0,_selected:!1,_scrollIndex:u},d)),o[0]={children:l,label:""};else{const d=xd(r);o=d.optionGroups,l=d.options}return e.setState({optionGroups:o}),l},updateOptions:r=>{this.setState({options:r})},openMenu:r=>{this.setState({isOpen:!0},()=>{r==null||r()})},closeMenu:()=>{this.setState({isOpen:!1})},getTriggerWidth:()=>{const r=this.triggerRef.current;return r&&r.getBoundingClientRect().width},setOptionWrapperWidth:r=>{this.setState({dropdownMinWidth:r})},updateSelection:r=>{this.setState({selections:r})},getSelections:()=>new Map(this.state.selections),notifyChange:r=>{this.props.onChange(r)},notifySelect:(r,o)=>{delete o._parentGroup,this.props.onSelect(r,o)},notifyDropdownVisibleChange:r=>{this.props.onDropdownVisibleChange(r)},notifySearch:(r,o)=>{this.props.onSearch(r,o)},notifyCreate:r=>{this.props.onCreate(r)},notifyMouseEnter:r=>{this.props.onMouseEnter(r)},notifyMouseLeave:r=>{this.props.onMouseLeave(r)},notifyFocus:r=>{this.props.onFocus(r)},notifyBlur:r=>{this.props.onBlur(r)},notifyClear:()=>{this.props.onClear()},notifyListScroll:r=>{this.props.onListScroll(r)},updateHovering:r=>{this.setState({isHovering:r})},updateFocusState:r=>{this.setState({isFocus:r})},updateOverflowItemCount:r=>{this.setState({overflowItemCount:r})},focusTrigger:()=>{try{const{preventScroll:r}=this.props;this.triggerRef.current.focus({preventScroll:r})}catch{}},getContainer:()=>this.optionContainerEl&&this.optionContainerEl.current,getFocusableElements:r=>$a(r),getActiveElement:()=>Ka(),setIsFocusInContainer:r=>{this.setState({isFocusInContainer:r})},getIsFocusInContainer:()=>this.state.isFocusInContainer,updateScrollTop:r=>{let o;"renderOptionItem"in this.props?(o=`.${$}-option-custom-selected`,r!==void 0&&(o=`.${$}-option-custom:nth-child(${r+1})`)):(o=`.${$}-option-selected`,r!==void 0&&(o=`.${$}-option:nth-child(${r+1})`));let l=document.querySelector(`#${$}-${this.selectOptionListID} ${o}`);if(Array.isArray(l)&&(l=l[0]),l){const c=l.parentNode;c.scrollTop=l.offsetTop-c.offsetTop-c.clientHeight/2+l.clientHeight/2}}})}componentDidMount(){this.foundation.init(),this.selectOptionListID=jt(),this.selectID=this.props.id||jt()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e,t){const n=b.Children.toArray(e.children).map(o=>o.key),s=b.Children.toArray(this.props.children).map(o=>o.key);let r=!1;(!re(n,s)||!re(e.optionList,this.props.optionList))&&(r=!0,this.foundation.handleOptionListChange()),(!re(this.props.value,e.value)||r)&&("value"in this.props?this.foundation.handleValueChange(this.props.value):this.foundation.handleOptionListChangeHadDefaultValue())}renderTriggerInput(){const{size:e,multiple:t,disabled:n,inputProps:s,filter:r}=this.props,o=x(s,"className"),l=M(`${$}-input`,{[`${$}-input-single`]:!t,[`${$}-input-multiple`]:t},o),{inputValue:c,focusIndex:d}=this.state,u=Object.assign({value:c,disabled:n,className:l,onChange:this.handleInputChange},s);let h={};return t&&(h={width:c?`${c.length*16}px`:"2px"},u.style=h),b.createElement(fr,Object.assign({ref:this.inputRef,size:e,"aria-activedescendant":d!==-1?`${this.selectID}-option-${d}`:"",onFocus:g=>{t&&r&&this.setState({isFocus:!0}),g.stopPropagation()},onBlur:g=>this.foundation.handleInputBlur(g)},u))}renderDropdownInput(){const{size:e,multiple:t,disabled:n,inputProps:s,filter:r,searchPosition:o,searchPlaceholder:l}=this.props,{inputValue:c,focusIndex:d}=this.state,u=M(`${$}-dropdown-search-wrapper`,{}),h=x(s,"className"),g=M(`${$}-dropdown-input`,{[`${$}-dropdown-input-single`]:!t,[`${$}-dropdown-input-multiple`]:t},h),m=Object.assign(Object.assign({value:c,disabled:n,className:g,onChange:this.handleInputChange,placeholder:l,showClear:!0},s),{onKeyDown:y=>this.foundation._handleKeyDown(y)});return b.createElement("div",{className:u},b.createElement(fr,Object.assign({ref:this.dropdownInputRef,prefix:b.createElement(Il,null),"aria-activedescendant":d!==-1?`${this.selectID}-option-${d}`:""},m)))}close(){this.foundation.close()}open(){this.foundation.open()}clearInput(){this.foundation.clearInput()}selectAll(){this.foundation.selectAll()}deselectAll(){this.foundation.clearSelected()}focus(){this.foundation.focus()}rePosition(){let{optionKey:e}=this.state;e=e+1,this.setState({optionKey:e})}onSelect(e,t,n){this.foundation.onSelect(e,t,n)}onClear(e){e.nativeEvent.stopImmediatePropagation(),this.foundation.handleClearClick(e)}search(e,t){this.handleInputChange(e,t)}renderEmpty(){return b.createElement(He,{empty:!0,emptyContent:this.props.emptyContent})}renderLoading(){const e=`${$}-loading-wrapper`;return b.createElement("div",{className:e},b.createElement(mi,null))}renderOption(e,t,n){const{focusIndex:s,inputValue:r}=this.state,{renderOptionItem:o}=this.props;let l;const c=t===s;let d=n||{};return e.style&&(d=Object.assign(Object.assign({},d),e.style)),e._inputCreateOnly?l=this.renderCreateOption(e,c,t,n):("key"in e&&(e._keyInOptionList=e.key),l=b.createElement(He,Object.assign({showTick:!0},e,{selected:e._selected,onSelect:(u,h)=>this.onSelect(u,t,h),focused:c,onMouseEnter:()=>this.onOptionHover(t),style:d,key:e._keyInOptionList||e._keyInJsx||e.label+e.value+t,renderOptionItem:o,inputValue:r,semiOptionId:`${this.selectID}-option-${t}`}),e.label)),l}renderCreateOption(e,t,n,s){const{renderCreateItem:r}=this.props;if(typeof r>"u")return b.createElement(He,Object.assign({key:e.key||e.label+e.value,onSelect:(c,d)=>this.onSelect(c,n,d),onMouseEnter:()=>this.onOptionHover(n),showTick:!0},e,{focused:t,style:s}),b.createElement(Ee,{componentName:"Select"},c=>b.createElement(b.Fragment,null,b.createElement("span",{className:`${$}-create-tips`},c.createText),e.value)));const o=r(e.value,t,s);return b.createElement("div",{role:"button","aria-label":"Use the input box to create an optional item",onClick:l=>this.onSelect(e,n,l),key:e.key||e.label},o)}onOptionHover(e){this.foundation.handleOptionMouseEnter(e)}renderWithGroup(e){const t=[],n=new Map;return e.forEach((s,r)=>{const o=s._parentGroup,l=this.renderOption(s,r);if(o&&!n.has(o.label)){const c=typeof o.label=="string"||typeof o.label=="number"?o.label:o.key,d=b.createElement(nn,Object.assign({},o,{key:c}));n.set(o.label,!0),t.push(d)}t.push(l)}),t}renderVirtualizeList(e){const{virtualize:t}=this.props,{direction:n}=this.context,{height:s,width:r,itemSize:o}=t;return b.createElement(Oi,{ref:this.virtualizeListRef,height:s||Fi.LIST_HEIGHT,itemCount:e.length,itemSize:o,itemData:{visibleOptions:e,renderOption:this.renderOption},width:r||"100%",style:{direction:n}},Td)}renderOptions(e){const{dropdownMinWidth:t,options:n,selections:s}=this.state,{maxHeight:r,dropdownClassName:o,dropdownStyle:l,outerTopSlot:c,innerTopSlot:d,outerBottomSlot:u,innerBottomSlot:h,loading:g,virtualize:m,multiple:y,emptyContent:p,searchPosition:f,filter:S}=this.props,v=n.filter(E=>E._show);let w=this.renderWithGroup(v);m&&(w=this.renderVirtualizeList(v));const _=Object.assign({minWidth:t},l),O=M({[`${$}-option-list`]:!0,[`${$}-option-list-chosen`]:s.size}),I=!n.length||!n.some(E=>E._show);return b.createElement("div",{id:`${$}-${this.selectOptionListID}`,className:M({[`${$}-option-list-wrapper`]:!(I&&p===null)},o),style:_,ref:this.setOptionContainerEl,onKeyDown:E=>this.foundation.handleContainerKeyDown(E)},c?b.createElement("div",{className:`${$}-option-list-outer-top-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},c):null,f===_e.SEARCH_POSITION_DROPDOWN&&S?this.renderDropdownInput():null,b.createElement("div",{style:{maxHeight:`${r}px`},className:O,role:"listbox","aria-multiselectable":y,onScroll:E=>this.foundation.handleListScroll(E)},d?b.createElement("div",{className:`${$}-option-list-inner-top-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},d):null,g?this.renderLoading():I?this.renderEmpty():w,h?b.createElement("div",{className:`${$}-option-list-inner-bottom-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},h):null),u?b.createElement("div",{className:`${$}-option-list-outer-bottom-slot`,onMouseEnter:()=>this.foundation.handleSlotMouseEnter()},u):null)}renderSingleSelection(e,t){let{renderSelectedItem:n,searchPosition:s}=this.props;const{placeholder:r}=this.props,{showInput:o,inputValue:l}=this.state;let c="";const d=[...e];if(typeof n>"u"&&(n=m=>m.label),d.length){const m=d[0][1];c=n(m)}const u=s===_e.SEARCH_POSITION_TRIGGER,h=M({[`${$}-selection-text`]:!0,[`${$}-selection-placeholder`]:!c&&c!==0,[`${$}-selection-text-hide`]:l&&o&&u,[`${$}-selection-text-inactive`]:!l&&o&&u}),g=`${$}-content-wrapper`;return b.createElement(b.Fragment,null,b.createElement("div",{className:g},b.createElement("span",{className:h,"x-semi-prop":"placeholder"},c||c===0?c:r),t&&o&&u?this.renderTriggerInput():null))}renderTag(e,t,n){const{size:s,disabled:r}=this.props;let{renderSelectedItem:o}=this.props;const l=e[0],{value:c}=e[1],d=e[1].disabled||r,u=(p,f)=>{f&&typeof f.preventDefault=="function"&&f.preventDefault(),this.foundation.removeTag({label:l,value:c})};typeof o>"u"&&(o=p=>({isRenderInTag:!0,content:p.label}));const{content:h,isRenderInTag:g}=o(e[1],{index:t,disabled:d,onClose:u}),m={disabled:d,closable:!d,onClose:u},y=n&&!ue(this.props.renderSelectedItem)?b.createElement(Ba,{size:"small",ellipsis:{rows:1,showTooltip:{type:"popover",opts:{style:{width:"auto",fontSize:12}}}}},h):h;return g?b.createElement(mt,Object.assign({},m,{color:"white",size:s||"large",key:c,style:{maxWidth:"100%"}}),y):b.createElement(L.Fragment,{key:c},y)}renderNTag(e,t){const{size:n,showRestTagsPopover:s,restTagsPopoverProps:r}=this.props;let o=b.createElement(mt,{closable:!1,size:n||"large",color:"grey",className:`${$}-content-wrapper-collapse-tag`,key:`_+${e}`,style:{marginRight:0,flexShrink:0}},"+",e);return s&&(o=b.createElement(yt,Object.assign({showArrow:!0,content:b.createElement(Qt,{spacing:2,wrap:!0,style:{maxWidth:"400px"}},t.map((l,c)=>this.renderTag(l,c))),trigger:"hover",position:"top",autoAdjustOverflow:!0},r,{key:`_+${e}_Popover`}),o)),o}renderOverflow(e,t){return e.length&&e[0]?this.renderTag(e[0],t,!0):null}handleOverflow(e){const{overflowItemCount:t,selections:n}=this.state,{maxTagCount:s}=this.props,r=n.size-s>0?n.size-s+e.length-1:e.length-1;t!==r&&this.foundation.updateOverflowItemCount(n.size,r)}renderCollapsedTags(e,t){const{overflowItemCount:n}=this.state,s=typeof t=="number"?e.slice(0,t):e;return b.createElement("div",{className:`${$}-content-wrapper-collapse`},b.createElement(Qe,{items:s,itemKey:r=>{var o;return(o=r==null?void 0:r[1])===null||o===void 0?void 0:o.value},overflowRenderer:r=>this.renderOverflow(r,t-1),onOverflow:r=>this.handleOverflow(r),visibleItemRenderer:(r,o)=>this.renderTag(r,o)}),n>0&&this.renderNTag(n,e.slice(e.length-n)))}renderOneLineTags(e,t){let{renderSelectedItem:n}=this.props;const{showRestTagsPopover:s,restTagsPopoverProps:r,maxTagCount:o}=this.props,{isFullTags:l}=this.state;let c;if(typeof n>"u"&&(n=d=>({isRenderInTag:!0,content:d.label})),s){const u=(l?e:e.slice(0,o)).map((h,g)=>this.getTagItem(h,g,n));c=b.createElement(Ht,{tagList:u,maxTagCount:t,restCount:l?void 0:e.length-o,size:"large",mode:"custom",showPopover:s,popoverProps:r,onPlusNMouseEnter:()=>{this.foundation.updateIsFullTags()}})}else{const u=e.slice(0,o).map((h,g)=>this.getTagItem(h,g,n));c=b.createElement(Ht,{tagList:u,maxTagCount:t,restCount:e.length-o,size:"large",mode:"custom"})}return c}renderMultipleSelection(e,t){let{renderSelectedItem:n,searchPosition:s}=this.props;const{placeholder:r,maxTagCount:o,expandRestTagsOnClick:l,ellipsisTrigger:c}=this.props,{inputValue:d,isOpen:u}=this.state,h=[...e];typeof n>"u"&&(n=_=>({isRenderInTag:!0,content:_.label}));const g=M({[`${$}-content-wrapper`]:!0,[`${$}-content-wrapper-one-line`]:o&&!u,[`${$}-content-wrapper-empty`]:!h.length}),m=M({[`${$}-selection-text`]:!0,[`${$}-selection-placeholder`]:!h.length,[`${$}-selection-text-hide`]:h&&h.length}),y=r&&!d?b.createElement("span",{className:m},r):null,p=h.length>o?o:void 0,f=!o,S=c?this.renderCollapsedTags(h,p):this.renderOneLineTags(h,p),v=f||l&&u?h.map((_,O)=>this.renderTag(_,O)):S,w=t&&s===_e.SEARCH_POSITION_TRIGGER;return b.createElement(b.Fragment,null,b.createElement("div",{className:g},h&&h.length?v:y,w?this.renderTriggerInput():null))}onMouseEnter(e){this.foundation.handleMouseEnter(e)}onMouseLeave(e){this.foundation.handleMouseLeave(e)}onKeyPress(e){this.foundation.handleKeyPress(e)}handlePopoverVisibleChange(e){const{virtualize:t}=this.props,{selections:n}=this.state;if(e)if(t){let s=-1;if(n.forEach(r=>{const o=x(r,"_scrollIndex");gt(o)&&o>=0&&(s=s!==-1&&s<o?s:o)}),s!==-1)try{this.virtualizeListRef.current.scrollToItem(s,"center")}catch{}}else this.foundation.updateScrollTop()}renderSuffix(){const{suffix:e}=this.props,t=M({[`${$}-suffix`]:!0,[`${$}-suffix-text`]:e&&Ce(e),[`${$}-suffix-icon`]:hr(e)});return b.createElement("div",{className:t,"x-semi-prop":"suffix"},e)}renderPrefix(){const{prefix:e,insetLabel:t,insetLabelId:n}=this.props,s=e||t,r=M({[`${$}-prefix`]:!0,[`${$}-inset-label`]:t,[`${$}-prefix-text`]:s&&Ce(s),[`${$}-prefix-icon`]:hr(s)});return b.createElement("div",{className:r,id:n,"x-semi-prop":"prefix,insetLabel"},s)}renderSelection(){const e=this.props,{disabled:t,multiple:n,filter:s,style:r,id:o,size:l,className:c,validateStatus:d,showArrow:u,suffix:h,prefix:g,insetLabel:m,placeholder:y,triggerRender:p,arrowIcon:f,clearIcon:S,borderless:v}=e,w=Ad(e,["disabled","multiple","filter","style","id","size","className","validateStatus","showArrow","suffix","prefix","insetLabel","placeholder","triggerRender","arrowIcon","clearIcon","borderless"]),{selections:_,isOpen:O,keyboardEventSet:I,inputValue:E,isHovering:k,isFocus:N,showInput:P,focusIndex:A}=this.state,F=typeof p=="function",K=!!s,z=F?M(c):M($,c,{[`${$}-borderless`]:v,[`${$}-open`]:O,[`${$}-focus`]:N,[`${$}-disabled`]:t,[`${$}-single`]:!n,[`${$}-multiple`]:n,[`${$}-filterable`]:K,[`${$}-small`]:l==="small",[`${$}-large`]:l==="large",[`${$}-error`]:d==="error",[`${$}-warning`]:d==="warning",[`${$}-no-arrow`]:!u,[`${$}-with-prefix`]:g||m,[`${$}-with-suffix`]:h}),q=this.props.showClear&&(_.size||E)&&!t&&(k||O),V=u?b.createElement("div",{className:`${$}-arrow`,"x-semi-prop":"arrowIcon"},f):b.createElement("div",{className:`${$}-arrow-empty`}),W=S||b.createElement(ll,null),G=F?b.createElement(yi,{value:Array.from(_.values()),inputValue:E,onChange:this.handleInputChange,onSearch:this.handleInputChange,onRemove:Q=>this.foundation.removeTag(Q),onClear:this.onClear,disabled:t,triggerRender:p,placeholder:y,componentName:"Select",componentProps:Object.assign({},this.props)}):[b.createElement(L.Fragment,{key:"prefix"},g||m?this.renderPrefix():null),b.createElement(L.Fragment,{key:"selection"},b.createElement("div",{className:M(`${$}-selection`)},n?this.renderMultipleSelection(_,K):this.renderSingleSelection(_,K))),b.createElement(L.Fragment,{key:"suffix"},h?this.renderSuffix():null),b.createElement(L.Fragment,{key:"clearicon"},q?b.createElement("div",{className:M(`${$}-clear`),onClick:this.onClear},W):V)],se=t||K&&P||K&&n?-1:0;return b.createElement("div",Object.assign({role:"combobox","aria-disabled":t,"aria-expanded":O,"aria-controls":`${$}-${this.selectOptionListID}`,"aria-haspopup":"listbox","aria-label":_.size?"selected":"","aria-invalid":this.props["aria-invalid"],"aria-errormessage":this.props["aria-errormessage"],"aria-labelledby":this.props["aria-labelledby"],"aria-describedby":this.props["aria-describedby"],"aria-required":this.props["aria-required"],className:z,ref:Q=>{this.triggerRef.current=Q},onClick:Q=>this.foundation.handleClick(Q),style:r,id:this.selectID,tabIndex:se,"aria-activedescendant":A!==-1?`${this.selectID}-option-${A}`:"",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onFocus:Q=>this.foundation.handleTriggerFocus(Q),onBlur:Q=>this.foundation.handleTriggerBlur(Q),onKeyPress:this.onKeyPress},I,this.getDataAttr(w)),G)}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",{children:n,position:s=t,zIndex:r,getPopupContainer:o,motion:l,autoAdjustOverflow:c,mouseLeaveDelay:d,mouseEnterDelay:u,spacing:h,stopPropagation:g,dropdownMargin:m,rePosKey:y}=this.props,{isOpen:p,optionKey:f}=this.state,S=this.renderSelection(),v=y!==void 0?`${f}-${y}`:f;return b.createElement(yt,{getPopupContainer:o,motion:l,margin:m,autoAdjustOverflow:c,mouseLeaveDelay:d,mouseEnterDelay:u,zIndex:r,ref:this.optionsRef,content:()=>this.renderOptions(n),visible:p,trigger:"custom",rePosKey:v,position:s,spacing:h,stopPropagation:g,disableArrowKeyDown:!0,onVisibleChange:w=>this.handlePopoverVisibleChange(w),afterClose:()=>this.foundation.handlePopoverClose()},S)}}Te.contextType=Ls;Te.Option=He;Te.OptGroup=nn;Te.propTypes={"aria-describedby":a.string,"aria-errormessage":a.string,"aria-invalid":a.bool,"aria-labelledby":a.string,"aria-required":a.bool,autoFocus:a.bool,autoClearSearchValue:a.bool,borderless:a.bool,children:a.node,clearIcon:a.node,defaultValue:a.oneOfType([a.string,a.number,a.array,a.object]),ellipsisTrigger:a.bool,value:a.oneOfType([a.string,a.number,a.array,a.object]),placeholder:a.node,onChange:a.func,multiple:a.bool,filter:a.oneOfType([a.func,a.bool]),max:a.number,maxTagCount:a.number,maxHeight:a.oneOfType([a.string,a.number]),style:a.object,className:a.string,size:a.oneOf(_e.SIZE_SET),disabled:a.bool,emptyContent:a.node,expandRestTagsOnClick:a.bool,onDropdownVisibleChange:a.func,zIndex:a.number,position:a.oneOf(_e.POSITION_SET),onSearch:a.func,getPopupContainer:a.func,dropdownClassName:a.string,dropdownStyle:a.object,dropdownMargin:a.oneOfType([a.number,a.object]),outerTopSlot:a.node,innerTopSlot:a.node,inputProps:a.object,outerBottomSlot:a.node,innerBottomSlot:a.node,optionList:a.array,dropdownMatchSelectWidth:a.bool,loading:a.bool,defaultOpen:a.bool,validateStatus:a.oneOf(_e.STATUS),defaultActiveFirstOption:a.bool,triggerRender:a.func,stopPropagation:a.bool,searchPosition:a.string,motion:a.bool,onChangeWithObject:a.bool,suffix:a.node,prefix:a.node,insetLabel:a.node,insetLabelId:a.string,showClear:a.bool,showArrow:a.bool,renderSelectedItem:a.func,allowCreate:a.bool,renderCreateItem:a.func,onMouseEnter:a.func,onMouseLeave:a.func,clickToHide:a.bool,onExceed:a.func,onCreate:a.func,remote:a.bool,onDeselect:a.func,onSelect:a.func,autoAdjustOverflow:a.bool,mouseEnterDelay:a.number,mouseLeaveDelay:a.number,spacing:a.oneOfType([a.number,a.object]),rePosKey:a.oneOfType([a.string,a.number]),onBlur:a.func,onFocus:a.func,onClear:a.func,virtualize:a.object,renderOptionItem:a.func,onListScroll:a.func,arrowIcon:a.node,preventScroll:a.bool};Te.__SemiComponentName__="Select";Te.defaultProps=ks(Te.__SemiComponentName__,{stopPropagation:!0,motion:!0,borderless:!1,zIndex:ci.DEFAULT_Z_INDEX,filter:!1,multiple:!1,disabled:!1,defaultOpen:!1,allowCreate:!1,placeholder:"",onDropdownVisibleChange:H,onChangeWithObject:!1,onChange:H,onSearch:H,onMouseEnter:H,onMouseLeave:H,onDeselect:H,onSelect:H,onCreate:H,onExceed:H,onFocus:H,onBlur:H,onClear:H,onListScroll:H,maxHeight:Fi.LIST_HEIGHT,dropdownMatchSelectWidth:!0,defaultActiveFirstOption:!0,showArrow:!0,showClear:!1,searchPosition:_e.SEARCH_POSITION_TRIGGER,remote:!1,autoAdjustOverflow:!0,autoClearSearchValue:!0,arrowIcon:b.createElement(Ms,{"aria-label":""}),showRestTagsPopover:!1,restTagsPopoverProps:{},expandRestTagsOnClick:!1,ellipsisTrigger:!1});var oo=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const Z=Cd.PREFIX,{Option:Nd}=Te;class sn extends he{constructor(e){super(e);const t=e.total,n=e.pageSize||e.pageSizeOpts[0]||Vs.DEFAULT_PAGE_SIZE,s=e.size==="small"&&e.hoverShowPageSelect&&!e.disabled;this.state={total:t,showTotal:e.showTotal,currentPage:e.currentPage||e.defaultCurrentPage,pageSize:n,pageList:[],prevDisabled:!1,nextDisabled:!1,restLeftPageList:[],restRightPageList:[],quickJumpPage:"",allPageNumbers:s?Array.from({length:Math.ceil(t/n)},(r,o)=>o+1):[]},this.foundation=new _d(this.adapter),this.renderDefaultPage=this.renderDefaultPage.bind(this),this.renderSmallPage=this.renderSmallPage.bind(this),$e(!!(e.showSizeChanger&&e.hideOnSinglePage),"[Semi Pagination] You should not use showSizeChanger and hideOnSinglePage in ths same time. At this time, hideOnSinglePage no longer takes effect, otherwise there may be a problem that the switch entry disappears")}get adapter(){return Object.assign(Object.assign({},super.adapter),{setPageList:e=>{const{pageList:t,restLeftPageList:n,restRightPageList:s}=e;this.setState({pageList:t,restLeftPageList:n,restRightPageList:s})},setDisabled:(e,t)=>{this.setState({prevDisabled:e,nextDisabled:t})},updateTotal:e=>this.setState({total:e}),updatePageSize:e=>this.setState({pageSize:e}),updateQuickJumpPage:e=>this.setState({quickJumpPage:e}),updateAllPageNumbers:e=>this.setState({allPageNumbers:e}),setCurrentPage:e=>{this.setState({currentPage:e})},registerKeyDownHandler:e=>{document.addEventListener("keydown",e)},unregisterKeyDownHandler:e=>{document.removeEventListener("keydown",e)},notifyPageChange:e=>{this.props.onPageChange(e)},notifyPageSizeChange:e=>{this.props.onPageSizeChange(e)},notifyChange:(e,t)=>{this.props.onChange(e,t)}})}componentDidMount(){this.foundation.init()}componentWillUnmount(){this.foundation.destroy()}componentDidUpdate(e){const t={currentPage:this.props.currentPage,total:this.props.total,pageSize:this.props.pageSize};let n=!1,s=!1;e.currentPage!==this.props.currentPage&&(n=!0),e.total!==this.props.total&&(n=!0,s=!0),e.pageSize!==this.props.pageSize&&(n=!0,s=!0),n&&this.foundation.updatePage(t.currentPage,t.total,t.pageSize),s&&this.foundation.updateAllPageNumbers(t.total,t.pageSize)}renderPrevBtn(){const{prevText:e,disabled:t}=this.props,{prevDisabled:n}=this.state,s=n||t,r=M({[`${Z}-item`]:!0,[`${Z}-prev`]:!0,[`${Z}-item-disabled`]:s});return b.createElement("li",{role:"button","aria-disabled":!!s,"aria-label":"Previous",onClick:o=>!s&&this.foundation.goPrev(o),className:r,"x-semi-prop":"prevText"},e||b.createElement(bi,{size:"large"}))}renderNextBtn(){const{nextText:e,disabled:t}=this.props,{nextDisabled:n}=this.state,s=n||t,r=M({[`${Z}-item`]:!0,[`${Z}-item-disabled`]:s,[`${Z}-next`]:!0});return b.createElement("li",{role:"button","aria-disabled":!!s,"aria-label":"Next",onClick:o=>!s&&this.foundation.goNext(o),className:r,"x-semi-prop":"nextText"},e||b.createElement(js,{size:"large"}))}renderPageSizeSwitch(e){const{direction:t}=this.context,n=t==="rtl"?"bottomRight":"bottomLeft",{showSizeChanger:s,popoverPosition:r=n,disabled:o,popoverZIndex:l}=this.props,{pageSize:c}=this.state,d=M(`${Z}-switch`);if(!s)return null;const u=this.foundation.pageSizeInOpts(),h=e.pageSize,g=u.map(m=>b.createElement(Nd,{value:m,key:m},b.createElement("span",null,h.replace("${pageSize}",m.toString()))));return b.createElement("div",{className:d},b.createElement(Te,{"aria-label":"Page size selector",disabled:o,onChange:m=>this.foundation.changePageSize(m),value:c,key:c+h,position:r||"bottomRight",clickToHide:!0,zIndex:l,dropdownClassName:`${Z}-select-dropdown`},g))}renderQuickJump(e){const{showQuickJumper:t,disabled:n}=this.props,{quickJumpPage:s,total:r,pageSize:o}=this.state;if(!t)return null;const c=this.foundation._getTotalPageNumber(r,o)===1||n,d=M({[`${Z}-quickjump`]:!0,[`${Z}-quickjump-disabled`]:c});return b.createElement("div",{className:d},b.createElement("span",null,e.jumpTo),b.createElement(cl,{value:s,className:`${Z}-quickjump-input-number`,hideButtons:!0,disabled:c,onBlur:u=>this.foundation.handleQuickJumpBlur(),onEnterPress:u=>this.foundation.handleQuickJumpEnterPress(u.target.value),onChange:u=>this.foundation.handleQuickJumpNumberChange(u)}),b.createElement("span",null,e.page))}renderPageList(){const{pageList:e,currentPage:t,restLeftPageList:n,restRightPageList:s}=this.state,{popoverPosition:r,popoverZIndex:o,disabled:l}=this.props;return e.map((c,d)=>{const u=M(`${Z}-item`,{[`${Z}-item-active`]:t===c,[`${Z}-item-all-disabled`]:l,[`${Z}-item-all-disabled-active`]:t===c&&l}),h=b.createElement("li",{key:`${c}${d}`,onClick:()=>!l&&this.foundation.goPage(c,d),className:u,"aria-label":c==="..."?"More":`Page ${c}`,"aria-current":t===c?"page":!1},c);if(c==="..."&&!l){let g;return d<3?g=n:g=s,b.createElement(yt,{rePosKey:this.props.currentPage,trigger:"hover",content:this.renderRestPageList(g),key:`${c}${d}`,position:r,zIndex:o},h)}return h})}renderRestPageList(e){const{direction:t}=this.context,n=M(`${Z}-rest-item`),s=e.length,r=c=>{const{index:d,style:u}=c,h=e[d];return b.createElement("div",{role:"listitem",key:`${h}${d}`,className:n,onClick:()=>this.foundation.goPage(h,d),style:u,"aria-label":`${h}`},h)},o=32,l=s>=5?o*5:o*s;return b.createElement(Oi,{className:`${Z}-rest-list`,itemData:e,itemSize:o,width:78,itemCount:s,height:l,style:{direction:t}},r)}renderSmallPageSelect(e){const t=this.state.allPageNumbers,n=this.renderRestPageList(t);return b.createElement(yt,{content:n},e)}renderSmallPage(e){const t=this.props,{className:n,style:s,hideOnSinglePage:r,hoverShowPageSelect:o,showSizeChanger:l,disabled:c}=t,d=oo(t,["className","style","hideOnSinglePage","hoverShowPageSelect","showSizeChanger","disabled"]),u=M(`${Z}-small`,Z,n,{[`${Z}-disabled`]:c}),{currentPage:h,total:g,pageSize:m}=this.state,y=Math.ceil(g/m);if(y<2&&r&&!l)return null;const p=M({[`${Z}-item`]:!0,[`${Z}-item-small`]:!0,[`${Z}-item-all-disabled`]:c}),f=b.createElement("div",{className:p},h,"/",y," ");return b.createElement("div",Object.assign({className:u,style:s},this.getDataAttr(d)),this.renderPrevBtn(),o&&!c?this.renderSmallPageSelect(f):f,this.renderNextBtn(),this.renderQuickJump(e))}renderDefaultPage(e){const{total:t,pageSize:n}=this.state,s=this.props,{showTotal:r,className:o,style:l,hideOnSinglePage:c,showSizeChanger:d,disabled:u}=s,h=oo(s,["showTotal","className","style","hideOnSinglePage","showSizeChanger","disabled"]),g=M(o,`${Z}`,{[`${Z}-disabled`]:u}),m=`${Z}-total`;if(Math.ceil(t/n)<2&&c&&!d)return null;const p=Math.ceil(t/n),f=e.total.replace("${total}",p.toString());return b.createElement("ul",Object.assign({className:g,style:l},this.getDataAttr(h)),r?b.createElement("span",{className:m},f):null,this.renderPrevBtn(),this.renderPageList(),this.renderNextBtn(),this.renderPageSizeSwitch(e),this.renderQuickJump(e))}render(){const{size:e}=this.props;return b.createElement(Ee,{componentName:"Pagination"},t=>e==="small"?this.renderSmallPage(t):this.renderDefaultPage(t))}}sn.contextType=Ls;sn.propTypes={total:a.number,showTotal:a.bool,pageSize:a.number,pageSizeOpts:a.array,size:a.string,currentPage:a.number,defaultCurrentPage:a.number,onPageChange:a.func,onPageSizeChange:a.func,onChange:a.func,prevText:a.node,nextText:a.node,showSizeChanger:a.bool,popoverZIndex:a.number,popoverPosition:a.string,style:a.object,className:a.string,hideOnSinglePage:a.bool,hoverShowPageSelect:a.bool,showQuickJumper:a.bool,disabled:a.bool,preventPageChangeOnPageSizeChange:a.bool};sn.defaultProps={total:1,popoverZIndex:ci.DEFAULT_Z_INDEX,showTotal:!1,pageSize:null,pageSizeOpts:Vs.PAGE_SIZE_OPTION,defaultCurrentPage:1,size:"default",onPageChange:H,onPageSizeChange:H,onChange:H,showSizeChanger:!1,className:"",hideOnSinglePage:!1,showQuickJumper:!1,disabled:!1,preventPageChangeOnPageSizeChange:!1};var Gn,io;function kd(){if(io)return Gn;io=1;var i=Jo(),e=1/0;function t(n){var s=n==null?0:n.length;return s?i(n,e):[]}return Gn=t,Gn}var Ld=kd();const Md=te(Ld);var Yn,ao;function jd(){if(ao)return Yn;ao=1;var i=Ds();function e(t,n){var s;return i(t,function(r,o,l){return s=n(r,o,l),!s}),!!s}return Yn=e,Yn}var Xn,lo;function zd(){if(lo)return Xn;lo=1;var i=Ha(),e=nt(),t=jd(),n=_t(),s=Ns();function r(o,l,c){var d=n(o)?i:t;return c&&s(o,l,c)&&(l=void 0),d(o,e(l,3))}return Xn=r,Xn}var Fd=zd();const Nt=te(Fd);var Zn,co;function Kd(){if(co)return Zn;co=1;var i=Ds();function e(t,n){var s=[];return i(t,function(r,o,l){n(r,o,l)&&s.push(r)}),s}return Zn=e,Zn}var Qn,uo;function $d(){if(uo)return Qn;uo=1;var i=Wa(),e=Kd(),t=nt(),n=_t();function s(r,o){var l=n(r)?i:e;return l(r,t(o,3))}return Qn=s,Qn}var Bd=$d();const Je=te(Bd);var Jn,ho;function Hd(){if(ho)return Jn;ho=1;var i=As();function e(t,n,s){s=typeof s=="function"?s:void 0;var r=s?s(t,n):void 0;return r===void 0?i(t,n,void 0,s):!!r}return Jn=e,Jn}var Wd=Hd();const Ud=te(Wd),ce={PREFIX:`${X}-table`},B={SIZE_SMALL:"small",SIZE_MIDDLE:"middle",SIZES:["small","default","middle"],LAYOUTS:["","auto","fixed"],PAGINATION_POSITIONS:["bottom","top","both"],SORT_DIRECTIONS:["ascend","descend"],FIXED_SET:[!1,!0,"left","right"],ALIGNS:["left","right","center"],DEFAULT_KEY_COLUMN_SELECTION:"column-selection",DEFAULT_KEY_COLUMN_EXPAND:"column-expand",DEFAULT_KEY_COLUMN_TITLE:"column-title",DEFAULT_KEY_COLUMN_SORTER:"column-sorter",DEFAULT_KEY_COLUMN_FILTER:"column-filter",DEFAULT_KEY_COLUMN_SCROLLBAR:"column-scrollbar",DEFAULT_COMPONENTS:{body:{cell:"td"}},EXPAND_RELATED_PROPS:["expandedRowRender","dataSource","hideExpandedColumn","childrenRecordName","rowExpandable"]},st=1,Gs=0,$i=16,Bi=16,Hi=12,Wi=12,Ui=8,Vi=8,Ys=20,po=Ys+st+Gs+$i+Bi,Vd=$i+Bi+st,fo=Ys+st+Gs+Hi+Wi,qd=Hi+Wi+st,go=Ys+st+Gs+Vi+Ui,Gd=Ui+Vi+st,ne={DEFAULT_PAGE_SIZE:10,DEFAULT_WIDTH_COLUMN_EXPAND:60,DEFAULT_WIDTH_COLUMN_SELECTION:60,DEFAULT_INDENT_WIDTH:20,DEFAULT_CELL_PADDING_LEFT:16,DEFAULT_CELL_PADDING_RIGHT:16,DEFAULT_CELL_BORDER_WIDTH_LEFT:1,DEFAULT_CELL_BORDER_WIDTH_RIGHT:1,DEFAULT_VIRTUALIZED_SECTION_ROW_HEIGHT:po,DEFAULT_VIRTUALIZED_ROW_HEIGHT:po,DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT:Vd,DEFAULT_VIRTUALIZED_SECTION_ROW_MIDDLE_HEIGHT:fo,DEFAULT_VIRTUALIZED_ROW_MIDDLE_HEIGHT:fo,DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT:qd,DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT:go,DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT:go,DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT:Gd};class qi{constructor(e){this._prefix=e}_isEmpty(e){return e==null||e===""}_baseLog(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"log";if(typeof console[e]=="function"){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];const r=[...n];this._isEmpty(this._prefix)||r.unshift(this._prefix,":"),console[e](...r)}}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("log",...t)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("warn",...t)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("error",...t)}info(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._baseLog("info",...t)}}function Yd(i,e,t){return Ud(i,e,function(n,s){if(typeof n=="function"&&typeof s=="function")return gr(n)===gr(s)})}function mo(i,e){e=Array.isArray(e)?e:["key","dataIndex"];let t=null;return le(e,n=>{if(t=x(i,n),t!=null)return!1}),t}function et(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2?arguments[2]:void 0;e=e<0||typeof e!="number"?0:e,t=t>i.length||typeof t!="number"?i.length:t;let n=0;return le(i,(s,r)=>{r>=e&&r<t&&(n+=typeof s=="number"&&!isNaN(s)?s:0)}),n}function Es(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["key"];const n=Je(i,r=>r.fixed===!0||r.fixed==="left"),s=Ze(n,r=>t.every(o=>r[o]!=null&&r[o]===e[o]));return n.length>0&&s===n.length-1}function xs(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["key"];const n=Je(i,r=>r.fixed==="right"),s=Ze(n,r=>t.every(o=>r[o]!=null&&r[o]===e[o]));return n.length>0&&s===0}function kt(i){return["left",!0].includes(x(i,"fixed"))}function Lt(i){return["right"].includes(x(i,"fixed"))}function Xd(i){return[B.DEFAULT_KEY_COLUMN_EXPAND,B.DEFAULT_KEY_COLUMN_SCROLLBAR,B.DEFAULT_KEY_COLUMN_SELECTION].includes(i)}function Gi(i){return x(i,"key")===B.DEFAULT_KEY_COLUMN_EXPAND}function Zd(i){return x(i,"key")===B.DEFAULT_KEY_COLUMN_SCROLLBAR}function Qd(i){return x(i,"key")===B.DEFAULT_KEY_COLUMN_SELECTION}function Xs(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[B.DEFAULT_KEY_COLUMN_SCROLLBAR];return Je(i,t=>!e.includes(t.key))}function De(i,e){return e===void 0&&(e="key"),typeof e=="function"?e(i):x(i,e)}function es(i,e){return e!=null&&Kt(i,e)}function Jd(i,e){return e!==null&&i.has(e)}function eu(i,e){return e!==null&&i.has(e)}function bo(i,e,t){return t===void 0&&(t="key"),We(i,n=>e!=null&&e!==""&&De(n,t)===e)}function tu(i,e){return e===void 0&&(e="children"),x(i,e)}function Yi(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;return e===void 0&&(e="__expanded_row"),i+e}function nu(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const t={};return i==="small"?(t.height=e?ne.DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT:ne.DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,t.minHeight=ne.DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT):i==="middle"?(t.height=e?ne.DEFAULT_VIRTUALIZED_SECTION_ROW_MIDDLE_HEIGHT:ne.DEFAULT_VIRTUALIZED_ROW_MIDDLE_HEIGHT,t.minHeight=ne.DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT):(t.height=e?ne.DEFAULT_VIRTUALIZED_SECTION_ROW_HEIGHT:ne.DEFAULT_VIRTUALIZED_ROW_HEIGHT,t.minHeight=ne.DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT),t}function Ye(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"children";const t=[];if(Array.isArray(i)&&i.length)for(const n of i)Array.isArray(n[e])&&n[e].length?t.push(...Ye(n[e],e)):(ou(n),t.push(n));return t}function Wt(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"children",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const n=[];return le(i,(s,r)=>{if(s.key==null){const o=s.dataIndex||r;s.key=`${t}-${o}`}Array.isArray(s[e])&&s[e].length&&n.push(...s[e])}),n.length&&Wt(n,e,t+1),i}function Xi(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"children",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const s=[];return Array.isArray(i)&&i.length&&n<=e&&i.forEach(r=>{const o=r[t];Array.isArray(o)&&o.length&&n<e?s.push(...Xi(o,e,t,n+1)):s.push(r)}),s}function Mt(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"children",n;return le(i,s=>{if(s&&s.key!=null&&!n&&s.key===e.key&&(n=s),s&&Array.isArray(s[t])&&!n&&(n=Mt(s[t],e,t)),n)return!1}),n}function su(i){const{expandedRowRender:e,dataSource:t,hideExpandedColumn:n,childrenRecordName:s,rowExpandable:r}=i,o=typeof e=="function";return n&&o||!o&&t.some(l=>{const c=x(l,s);return!!(Array.isArray(c)&&c.length||r(l))})}function Zi(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t;const n=e.findIndex(s=>i.dataIndex===s.dataIndex?(t=Object.assign(Object.assign({},s),i),!0):!1);return n>-1?e.splice(n,1,t):e.push(t),[...e]}function ru(i,e){const t=[...e];for(const n of i)if(!Xt(n.width)){const s=n.key,r=Ze(t,o=>o.key===s);r!==-1&&(t[r].width=x(n,"width"))}return t}function Qi(i){let{dataSource:e,getCheckboxProps:t,childrenRecordName:n,rowKey:s}=i;const r=[];if(Array.isArray(e)&&e.length&&typeof t=="function")for(const o of e){const l=t(o),c=typeof s=="function"?s(o):x(o,s);l&&l.disabled&&r.push(c);const d=x(o,n);if(Array.isArray(d)&&d.length){const u=Qi({dataSource:d,getCheckboxProps:t});r.push(...u)}}return r}function ou(i){if(typeof i=="object"&&i!==null){const{filters:e,sorter:t,dataIndex:n,onFilter:s}=i,r=new qi("[@douyinfe/semi-ui Table]");(Array.isArray(e)||ue(s)||ue(t))&&Xt(n)&&r.warn("The column with sorter or filter must pass the 'dataIndex' prop")}}function iu(i){let{dataSource:e,childrenRecordName:t="children"}=i,n=!1;if(Array.isArray(e))for(const s of e){const r=x(s,t);if(Array.isArray(r)&&r.length){n=!0;break}}return n}function Ji(i,e){if(e==="rtl")switch(i){case"left":return"right";case"right":return"left";default:return i}return i}function au(i,e){if(e==="rtl")switch(i){case"left":return"flex-end";case"right":return"flex-start";default:return i}else switch(i){case"left":return"flex-start";case"right":return"flex-end";default:return i}}function Zs(i){return i===!0||x(i,"showTitle",!0)}class lu{constructor(e){this._state=Object.assign({},e),this._listeners=[]}subscribe(e){return this._listeners.push(e),()=>{const n=this._listeners.indexOf(e);n>-1&&this._listeners.splice(n,1)}}setState(e){Object.assign(this._state,Object.assign({},e));for(const t of this._listeners)typeof t=="function"&&t(this._state)}getState(){return this._state}}var cu=Ua();const wt=te(cu);var ts,yo;function du(){if(yo)return ts;yo=1;function i(e,t,n,s){for(var r=n-1,o=e.length;++r<o;)if(s(e[r],t))return r;return-1}return ts=i,ts}var ns,So;function uu(){if(So)return ns;So=1;var i=ii(),e=pi(),t=du(),n=di(),s=Va(),r=Array.prototype,o=r.splice;function l(c,d,u,h){var g=h?t:e,m=-1,y=d.length,p=c;for(c===d&&(d=s(d)),u&&(p=i(c,n(u)));++m<y;)for(var f=0,S=d[m],v=u?u(S):S;(f=g(p,v,f,h))>-1;)p!==c&&o.call(p,f,1),o.call(c,f,1);return c}return ns=l,ns}var ss,wo;function hu(){if(wo)return ss;wo=1;var i=uu();function e(t,n){return t&&t.length&&n&&n.length?i(t,n):t}return ss=e,ss}var rs,vo;function pu(){if(vo)return rs;vo=1;var i=ei(),e=hu(),t=i(e);return rs=t,rs}var fu=pu();const gu=te(fu);function mu(i){return new Set(i)}function bu(i,e){if(i===e&&(e=mu(e)),Pe(i)&&i.size&&Pe(e)&&e.size){for(const t of e)i.has(t)&&i.delete(t);return i}return i}function Co(i,e){if(i!==null&&i.length&&e!==null&&e.length){const t=new Set(i),n=new Set(e),s=bu(t,n);return Array.from(s)}return i}function yu(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"ascend";switch(e){case"descend":return(t,n)=>{const s=Number(i(t,n,e));return s!==0?-s:s};case"ascend":default:return(t,n)=>i(t,n,e)}}class vt extends ge{static initColumnsFilteredValueAndSorterOrder(e){return e.forEach(t=>{vt.initFilteredValue(t),vt.initSorterOrder(t)}),e}static initFilteredValue(e){const{defaultFilteredValue:t,filteredValue:n}=e;ft(n)&&(Array.isArray(t)&&t.length?e.filteredValue=t:e.filteredValue=[])}static initSorterOrder(e){const{defaultSortOrder:t,sortOrder:n,sorter:s}=e;s&&ft(n)&&(ft(t)?e.sortOrder=!1:e.sortOrder=t)}constructor(e){super(Object.assign({},e)),this.setPage=(s,r)=>{s=s||this._adapter.getCurrentPage();const o=this.getState("pagination"),{dataSource:l,pagination:c,disabledRowKeys:d,allRowKeys:u}=this.getCurrentPageData(null,Object.assign(Object.assign({},o),{currentPage:s,pageSize:r}));!this._pagerIsControlled()&&s>0&&(this._adapter.setDisabledRowKeys(d),this._adapter.setAllRowKeys(u),this._adapter.setPagination(c),this._adapter.setDataSource(l)),this._notifyChange(c,void 0,void 0,{changeType:"pagination"})},this.setCachedFilteredSortedDataSource=s=>{this._adapter.setCachedFilteredSortedDataSource(s);const r=this.getAllRowKeys(s);this._adapter.setCachedFilteredSortedRowKeys(r)},this.handleMouseDown=s=>{var r,o;this.mouseDownTarget={targetName:(r=s.target)===null||r===void 0?void 0:r.tagName,className:(o=s.target)===null||o===void 0?void 0:o.className}},this.isSortOrderValid=s=>B.SORT_DIRECTIONS.includes(s)||s===!1;const t=this._adapter.getHandleColumns(),n=this._adapter.getMergePagination();this.mouseDownTarget=null,this.memoizedWithFnsColumns=Ke(t,re),this.memoizedFilterColumns=Ke(Xs),this.memoizedFlattenFnsColumns=Ke(Ye),this.memoizedPagination=Ke(n,re)}init(){const e=[...this.getProp("dataSource")],{queries:t}=this._adapter.getStates(),n=this.getFilteredSortedDataSource(e,t),s=this.getAllDisabledRowKeys(n),r=this.getCurrentPageData(n);this.setAdapterPageData(r),this.initExpandedRowKeys(r),this.initSelectedRowKeys(r),this.setCachedFilteredSortedDataSource(n),this.setAllDisabledRowKeys(s)}initExpandedRowKeys(){let{groups:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{defaultExpandAllRows:t,defaultExpandedRowKeys:n=[],expandedRowKeys:s=[],dataSource:r=[],expandAllRows:o,defaultExpandAllGroupRows:l,expandAllGroupRows:c}=this.getProps(),d=[];t||o?this._addNoDuplicatedItemsToArr(d,this.getAllRowKeys(r),e&&wt(e)&&e.size?Array.from(e.keys()):[]):l||c?this._addNoDuplicatedItemsToArr(d,s,e&&wt(e)&&e.size?Array.from(e.keys()):[]):Array.isArray(n)&&n.length?this._addNoDuplicatedItemsToArr(d,n):Array.isArray(s)&&s.length&&this._addNoDuplicatedItemsToArr(d,s),this._adapter.setExpandedRowKeys(d)}initSelectedRowKeys(e){let{disabledRowKeys:t}=e;const n=this.getProp("rowSelection"),s=[];if(n){const r=x(n,"selectedRowKeys"),o=x(n,"defaultSelectedRowKeys");Array.isArray(r)?this._addNoDuplicatedItemsToArr(s,r):Array.isArray(o)&&this._addNoDuplicatedItemsToArr(s,o),Array.isArray(t)&&t.length&&gu(s,...t),this._adapter.setSelectedRowKeys(s)}}getFilteredSortedDataSource(e,t){const n=this.filterDataSource(e,t.filter(r=>{const o=r.filteredValue?r.filteredValue:r.defaultFilteredValue;return ue(r.onFilter)&&Array.isArray(o)&&o.length}));return this.sortDataSource(n,t.filter(r=>r&&ue(r.sorter)))}getCurrentPageData(e,t,n){const s=this._adapter.getCachedFilteredSortedDataSource();e=e??[...s],t=t??(this.getState("pagination")&&Object.assign({},this.getState("pagination"))),n=n??[...this.getState("queries")];let r;if(this.getProp("groupBy")!=null){const{groups:d,dataSource:u}=this.groupDataSource(e);e=u,r=d}t=this.normalizePagination(t,e),e=this.limitPageDataSource(e,t);const o=this.getAllDisabledRowKeys(e),l=this.getAllRowKeys(e);return{dataSource:e,groups:r,pagination:t,disabledRowKeys:o,allRowKeys:l,queries:n}}groupDataSource(e,t){t=t??this.getProp("groupBy");const n=new Map,s=[];return t!=null&&le(e,(r,o)=>{const l=typeof t=="function"?t(r):x(r,t);if(l!=null&&l!==""){const c=this.getRecordKey(r);let d=n.get(l);Pe(d)?d.add(c):(d=new Set([c]),n.set(l,d))}}),n&&n.size?n.forEach((r,o)=>{Pe(r)&&r.forEach(l=>{s.push(this._getRecord(l))})}):s.push(...e),{groups:n,dataSource:s}}sortDataSource(e,t){return le(t,n=>{const{sorter:s,sortOrder:r,defaultSortOrder:o,sortChildrenRecord:l}=n,c=this.isSortOrderValid(r)?r:o;if(ue(s)&&c&&B.SORT_DIRECTIONS.includes(c)){if(l){const d=this.getProp("childrenRecordName");e=e&&e.map(u=>{const h=this._getRecordChildren(u);return Array.isArray(h)&&h.length?Object.assign(Object.assign({},u),{[d]:this.sortDataSource(h,[n])}):u})}return e.sort(yu(s,c)),!1}}),e}filterDataSource(e,t){let n=null,s=!1;const r=this.getProp("childrenRecordName");return le(t,o=>{const{onFilter:l,filteredValue:c,filterChildrenRecord:d,defaultFilteredValue:u}=o,h=Array.isArray(c)?c:u;typeof l=="function"&&Array.isArray(h)&&h.length&&(s=!0,n===null?n=new Map:(e=Array.from(n&&n.values()),n=new Map),le(e,g=>{le(h,m=>{const y=x(g,r),p=this.getRecordKey(g);let f;if(Array.isArray(y)&&y.length&&d&&(f=this.filterDataSource(y,[o])),Array.isArray(f)&&f.length){if(p!=null){const S=x(n.get(p),r,[]);n.set(p,Object.assign(Object.assign({},g),{[r]:f.reduce((v,w)=>(v.find(_=>this.getRecordKey(_)===this.getRecordKey(w))==null&&v.push(w),v),[...S])}))}}else l(m,g)&&n.set(p,g)})}))}),s&&(e=Array.from(n&&n.values())),e}limitPageDataSource(e,t){e=e??this.getProp("dataSource"),t=t??this.getState("pagination");let n=e;const s=x(t,"currentPage");if(this.getProp("pagination")!==!1&&s&&e&&t&&!this._pagerIsControlled()){const{pageSize:r=ne.DEFAULT_PAGE_SIZE}=t,o=(s-1)*r,l=s*r;n=gd(e,o,l)}return n}normalizePagination(e,t){e=e??this._getPagination(),t=t??this._getDataSource();const n=this.getProp("pagination");if(e&&(e=typeof e=="object"?Object.assign({},e):{},e=Zt({total:t&&t.length||0,pageSize:ne.DEFAULT_PAGE_SIZE,currentPage:x(n,"defaultCurrentPage",1),position:B.PAGINATION_POSITIONS[0]},e),!this._pagerIsControlled())){const s=x(n,"total",t.length),{currentPage:r,pageSize:o}=e,l=Math.ceil(s/o);e.total=s,r>l&&(e.currentPage=1)}return e}setAdapterPageData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{pagination:t,dataSource:n,disabledRowKeys:s,allRowKeys:r,groups:o}=e;this._adapter.setDisabledRowKeys(s),this._adapter.setAllRowKeys(r),this._adapter.setPagination(t),this._adapter.setGroups(o),this._adapter.setDataSource(n)}destroy(){}setAllDisabledRowKeys(e){this._adapter.setAllDisabledRowKeys(e)}handleClick(e){}handleMouseEnter(e){}handleMouseLeave(e){}stopPropagation(e){this._adapter.stopPropagation(e)}_addNoDuplicatedItemsToArr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];for(const r of n)if(Array.isArray(r))for(const o of r)e.includes(o)||e.push(o);return e}_notifyChange(e,t,n,s){e=e??this._getPagination(),t=t??this._getAllFilters(),n=n??this._getAllSorters()[0],x(this.getProp("scroll"),"scrollToFirstRowOnChange")&&this._adapter.resetScrollY(),this._adapter.notifyChange({pagination:Object.assign({},e),filters:[...t],sorter:n,extra:Object.assign({},s)})}_rowExpansionIsControlled(){return Array.isArray(this.getProp("expandedRowKeys"))}_pagerIsControlled(){return x(this.getProp("pagination"),"currentPage")!=null}_selectionIsControlled(){return Array.isArray(x(this.getProp("rowSelection"),"selectedRowKeys"))}_sorterIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return!!(t&&t.sortOrder!=null)}_filterIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return!!(t&&Array.isArray(t.filteredValue))}_filterShowIsControlled(e){const t=e&&this.getQuery(e,this.getState("flattenColumns"));return!!(t&&(t.filterDropdownVisible===!0||t.filterDropdownVisible===!1))}_getSelectedRowKeys(){const e=this.getState("rowSelection");return[...x(e,"selectedRowKeys",[])]}_getSelectedRowKeysSet(){const e=this.getState("rowSelection");return x(e,"selectedRowKeysSet",new Set)}_getDataSource(){return this.getProp("dataSource")||[]}_getRecord(e){return We(this.getProp("dataSource"),t=>e!=null&&e!==""&&this.getRecordKey(t)===e)}_getRecordChildren(e){return x(e,this.getProp("childrenRecordName"))}_getPagination(){return this.getState("pagination")||{}}_getAllFilters(e){e=e||this.getState("queries");const t=[];return le(e,n=>{Array.isArray(n.filteredValue)&&(n.filteredValue.length||this._filterIsControlled(n.dataIndex))&&t.push(n)}),t}_getAllSorters(e){return e=e||this.getState("queries"),Je(e,t=>t.sorter&&t.sortOrder)}_filterQueries(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["dataIndex"];t=t??this.getState("queries");const s=[],r=[];return le(t,(o,l)=>{Nt(n,d=>d&&e[d]!=null&&e[d]===o[d])&&(s.push(o),r.push(l))}),{filteredQueries:s,filteredIndexes:r}}_mergeToQueries(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:["dataIndex"];t=t??this.getState("queries"),t=[...t],e=Object.assign({},e);const{filteredQueries:s,filteredIndexes:r}=this._filterQueries(e,t,n);return le(s,(o,l)=>{t[r[l]]=Object.assign({},e)}),t}getRecordKey(e){if(!e)return;const t=this.getProp("rowKey");return typeof t=="function"?t(e):x(e,t)}isEmpty(e){return e=e??this.getProp("dataSource"),!(Array.isArray(e)&&e.length>0)}buildKeyEntities(e){e=e??this._getDataSource();const t=this.getProp("childrenRecordName"),n=this.getProp("rowKey"),s=l=>l.map(c=>{const d=typeof n=="function"?n(c):x(c,n),u=x(c,t),h=Object.assign({key:d},c);return Array.isArray(u)&&u.length&&(h.children=s(u)),h}),r=s(e),{keyEntities:o}=rc(r,{key:"key",children:"children"});return o}calcCheckedKeysForSelect(e,t,n,s){const r=this._adapter.getKeyEntities(),o=String(e);return!r||!r[o]?(t?n.add(o):n.delete(o),{checkedKeys:n,halfCheckedKeys:s}):t?Tr(o,r,n,s):Ir(o,r,n,s)}handleSelectRow(e,t,n){if(this.stopPropagation(n),typeof t=="boolean"&&e!=null){const s=this._adapter.getCheckRelation(),r=this._getSelectedRowKeys(),o=[...this._adapter.getHalfCheckedRowKeys()||[]];let l=-1;const c=this.getSelectedRows(null,[e])[0];let d;if(s==="related"){this._adapter.getKeyEntities();const u=new Set(r.map(f=>String(f))),h=new Set(o.map(f=>String(f))),{checkedKeys:g,halfCheckedKeys:m}=this.calcCheckedKeysForSelect(String(e),t,u,h),y=[...g],p=[...m];d=this.getSelectedRows(null,y),this._adapter.setHalfCheckedRowKeys(p),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(y),this._adapter.notifySelect(c,t,d,n),this._adapter.notifySelectionChange(y,d)}else(l=r.indexOf(e))>-1&&t===!1?(r.splice(l,1),d=this.getSelectedRows(null,r),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(r),this._adapter.notifySelect(c,t,d,n),this._adapter.notifySelectionChange(r,d)):r.indexOf(e)===-1&&t===!0&&(r.push(e),d=this.getSelectedRows(null,r),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(r),this._adapter.notifySelect(c,t,d,n),this._adapter.notifySelectionChange(r,d))}}handleSelectAllRow(e,t){if(this.stopPropagation(t),typeof e=="boolean"){const n=this._adapter.getCheckRelation(),s=this._getSelectedRowKeys();let r=[...s];const o=this._getSelectedRowKeysSet();let l=[...this._adapter.getCachedFilteredSortedRowKeys()];const c=this._adapter.getAllDisabledRowKeys(),d=this._adapter.getAllDisabledRowKeysSet();let u;if(n==="related"){const h=this._adapter.getKeyEntities(),g=[...this._adapter.getHalfCheckedRowKeys()||[]];let m=new Set(r.map(v=>String(v))),y=new Set(g.map(v=>String(v)));if(e){const v=l.filter(w=>!d.has(w));for(const w of v){const _=String(w);if(!m.has(_)&&h&&h[_]){const O=Tr(_,h,m,y);m=O.checkedKeys,y=O.halfCheckedKeys}}u=v}else{const v=[...m];for(const w of v)if(h&&h[w]){const _=Ir(w,h,m,y);m=_.checkedKeys,y=_.halfCheckedKeys}u=[...s]}r=[...m];const p=[...y],f=this.getSelectedRows(null,u||[]),S=this.getSelectedRows(null,r||[]);this._adapter.setHalfCheckedRowKeys(p),this._selectionIsControlled()||this._adapter.setSelectedRowKeys(r),this._adapter.notifySelectAll(e,S,f,t),this._adapter.notifySelectionChange(r,S)}else{if(e){for(const m of l)!d.has(m)&&!o.has(m)&&r.push(m);l=Co(l,[...c,...s]),u=[...l]}else r=Co(r,l),u=[...s];const h=this.getSelectedRows(null,u||[]),g=this.getSelectedRows(null,r||[]);this._selectionIsControlled()||this._adapter.setSelectedRowKeys(r),this._adapter.notifySelectAll(e,g,h,t),this._adapter.notifySelectionChange(r,g)}}}getSelectedRows(e,t,n){e=e??this._getDataSource(),t=t??this._getSelectedRowKeys(),Pe(n)||(n=new Set(t));const s=this.getProp("childrenRecordName"),r=[];if(Pe(n)&&n.size&&Array.isArray(e)&&e.length&&(r.push(...e.filter(o=>n.has(this.getRecordKey(o)))),r.length<t.length))for(const o of e){const l=x(o,s);if(Array.isArray(l)&&l.length){const c=this.getSelectedRows(l,t,n);r.push(...c)}}return r}getAllDisabledRowKeys(e,t){e=e??this._getDataSource(),t=t??x(this.getProp("rowSelection"),"getCheckboxProps");const n=this.getProp("childrenRecordName"),s=[];if(Array.isArray(e)&&e.length&&typeof t=="function")for(const r of e){const o=t(r);o&&o.disabled&&s.push(this.getRecordKey(r));const l=x(r,n);if(Array.isArray(l)&&l.length){const c=this.getAllDisabledRowKeys(l,t);s.push(...c)}}return s}getAllRowKeys(e){e=e??this._getDataSource();const t=this.getProp("childrenRecordName"),n=[];if(Array.isArray(e)&&e.length)for(const s of e){const r=[],o=x(s,t);Array.isArray(o)&&o.length&&r.push(...this.getAllRowKeys(o)),n.push(this.getRecordKey(s),...r)}return n}hasRowSelected(e,t){return!!(Array.isArray(e)&&e.length&&Pe(t)&&t.size&&e.filter(n=>t.has(n)).length)}handleRowExpanded(e,t,n){this.stopPropagation(n);const s=[...this.getState("expandedRowKeys")],r=s.indexOf(t),o=typeof t=="string"||typeof t=="number";o&&e&&r===-1?s.push(t):o&&!e&&r>-1&&s.splice(r,1),this._rowExpansionIsControlled()||this._adapter.setExpandedRowKeys(s);const l=this.getSelectedRows(null,s);let c=this.getSelectedRows(null,[t])[0];const d=this._getGroups();if(d){d.has(t)&&(c={groupKey:t});for(let u=0,h=s.length;u<h;u++)d.has(t)&&l.push({groupKey:s[u]})}this._adapter.notifyExpand(e,c,n),this._adapter.notifyExpandedRowsChange(l)}_getGroups(){return this._adapter.getProp("groupBy")!==null?this._adapter.getState("groups"):null}allIsSelected(e,t,n){const s=Je(n,r=>r!=null&&!t.has(r));if(s&&s.length){for(const r of s)if(r!=null&&!e.has(r))return!1;return!0}else return n.length&&n.every(o=>e.has(o))||!1}allIsNotSelected(e,t){for(const n of t)if(n!=null&&Array.isArray(e)&&e.includes(n))return!0;return!1}formatPaginationInfo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";const s=x(this.getProp("pagination"),"formatPageText"),{total:r,pageSize:o,currentPage:l}=e,c=Math.min((l-1)*o+1,r),d=Math.min(l*o,r);return(s||s!==!1&&t&&r>0)&&(n=typeof s=="function"?s({currentStart:c,currentEnd:d,total:r}):t.replace("${currentStart}",c).replace("${currentEnd}",d).replace("${total}",r)),n}toggleShowFilter(e,t){let n=this.getQuery(e);const s=t;n=Object.assign(Object.assign({},n),{filterDropdownVisible:s}),this._filterShowIsControlled(),this._adapter.notifyFilterDropdownVisibleChange(s,e)}handleFilterSelect(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getQuery(e),s=[...this._adapter.getState("queries")];const{filteredValue:r}=t;n=Object.assign(Object.assign({},n),{filteredValue:r}),s=Zi(n,s);const o=this._mergeToQueries(n,null),l=this._getAllFilters(o);this._filterIsControlled(e)||(this._adapter.setQueries(s),this.handleClickFilterOrSorter(s)),this._notifyChange(null,l,void 0,{changeType:"filter"})}handleSort(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;var n,s,r,o;if(t){if(this.mouseDownTarget&&((n=this.mouseDownTarget)===null||n===void 0?void 0:n.targetName)==="SPAN"&&(!((o=(r=(s=this.mouseDownTarget)===null||s===void 0?void 0:s.className)===null||r===void 0?void 0:r.includes)===null||o===void 0)&&o.call(r,"react-resizable-handle")))return;this.mouseDownTarget=null}const{dataIndex:l}=e;let c=this.getState("queries"),d=null;c=[...c],le(c,(u,h,g)=>{if(u.sorter){const m=Object.assign({},u),y=x(m,"sortOrder"),p=x(m,"defaultSortOrder",!1);let f=this.isSortOrderValid(y)?y:p;l&&l===m.dataIndex?f===B.SORT_DIRECTIONS[0]?f=B.SORT_DIRECTIONS[1]:f===B.SORT_DIRECTIONS[1]?f=!1:f=B.SORT_DIRECTIONS[0]:f=!1,g[h]=Object.assign(Object.assign({},m),{sortOrder:f}),l===m.dataIndex&&(d=g[h])}}),this._sorterIsControlled(l)||(this._adapter.setQueries(c),this.handleClickFilterOrSorter(c)),this._notifyChange(null,null,d,{changeType:"sorter"})}handleClickFilterOrSorter(e){const t=[...this.getProp("dataSource")],n=this.getFilteredSortedDataSource(t,e),s=this.getAllDisabledRowKeys(n);this.setCachedFilteredSortedDataSource(n),this.setAllDisabledRowKeys(s);const r=this.getCurrentPageData(n);this.setAdapterPageData(r)}getQuery(e,t){if(t=t||this.getState("queries"),e!=null)return We(t,n=>n.dataIndex===e)}getCellWidths(e,t,n){return this._adapter.getCellWidths(e,t,n)}setHeadWidths(e,t){return this._adapter.setHeadWidths(e,t)}getHeadWidths(e){return this._adapter.getHeadWidths(e)}mergedRowExpandable(e){return this._adapter.mergedRowExpandable(e)}setBodyHasScrollbar(e){this._adapter.setBodyHasScrollbar(e)}}const ea={align:a.oneOf(B.ALIGNS),className:a.string,colSpan:a.number,dataIndex:a.string,defaultSortOrder:a.oneOf(B.SORT_DIRECTIONS),filterChildrenRecord:a.bool,filterDropdownProps:a.object,filterDropdown:a.node,filterDropdownVisible:a.bool,filterIcon:a.func,filterMultiple:a.bool,filteredValue:a.arrayOf(a.any),filters:a.array,fixed:a.oneOf(B.FIXED_SET),onCell:a.func,onFilter:a.func,onFilterDropdownVisibleChange:a.func,onHeaderCell:a.func,onSorterChange:a.func,render:a.func,renderFilterDropdownItem:a.func,sortChildrenRecord:a.bool,sortDirections:a.arrayOf(a.string),sortOrder:a.oneOfType([a.bool,a.string]),sorter:a.oneOfType([a.bool,a.func]),title:a.oneOfType([a.func,a.node]),useFullRender:a.bool,width:a.oneOfType([a.number,a.string]),showSortTip:a.bool};class rn extends b.PureComponent{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(e)}render(){return null}}rn.propTypes=Object.assign({},ea);rn.elementType="Column";function Ut(i){if(i){const e=[];return b.Children.forEach(i,t=>{if(b.isValidElement(t)&&(t.type===rn||x(t,"type.elementType")==="Column")){const n=ye(t.props,["children"]);Array.isArray(t.props.children)&&t.props.children.length&&(n.children=Ut(t.props.children)),e.push(Object.assign({key:t.key},n))}}),e}return[]}const ke=b.createContext({headWidths:[],setHeadWidths:H,handleRowExpanded:H}),Su=i=>{let{children:e,anyColumnFixed:t,flattenedColumns:n,tableWidth:s,headWidths:r,setHeadWidths:o,getHeadWidths:l,getCellWidths:c,handleRowExpanded:d,renderExpandIcon:u,renderSelection:h,getVirtualizedListRef:g,setBodyHasScrollbar:m,direction:y,handleRowSelection:p,headerStyle:f,rowSpanHover:S}=i;const v=L.useMemo(()=>({anyColumnFixed:t,flattenedColumns:n,renderExpandIcon:u,renderSelection:h,setHeadWidths:o,getHeadWidths:l,getCellWidths:c,headWidths:r,tableWidth:s,handleRowExpanded:d,getVirtualizedListRef:g,setBodyHasScrollbar:m,direction:y,handleRowSelection:p,headerStyle:f,rowSpanHover:S}),[t,n,u,h,o,l,c,r,s,d,g,m,y,p,f,S]);return b.createElement(ke.Provider,{value:v},e)};class wu extends ge{handleChange(e){const t=e.target.checked;this._adapter.notifyChange(t,e)}}class Vt extends he{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyChange:function(){return e.props.onChange(...arguments)}})}constructor(e){super(e),this.handleChange=t=>this.foundation.handleChange(t),this.foundation=new wu(this.adapter)}render(){const{selected:e,getCheckboxProps:t,indeterminate:n,disabled:s,prefixCls:r,className:o}=this.props,l=this.props["aria-label"];let c={onChange:this.handleChange,disabled:s,indeterminate:n,checked:e};typeof t=="function"&&(c=Object.assign(Object.assign({},c),t()));const d=M(`${r}-selection-wrap`,{[`${r}-selection-disabled`]:s},o);return b.createElement("span",{className:d},b.createElement(xe,Object.assign({"aria-label":l},c)))}}Vt.propTypes={columnTitle:a.string,getCheckboxProps:a.func,type:a.string,onChange:a.func,selected:a.bool,disabled:a.bool,indeterminate:a.bool,prefixCls:a.string,className:a.string,"aria-label":a.string};Vt.defaultProps={disabled:!1,onChange:H,prefixCls:ce.PREFIX};class Qs extends L.PureComponent{render(){const{pagination:e,prefixCls:t,info:n,renderPagination:s}=this.props,r=x(e,"total"),o=s&&ue(s)?s(e):null;return b.createElement("div",{className:`${t}-pagination-outer`},L.isValidElement(o)?o:b.createElement(b.Fragment,null,b.createElement("span",{className:`${t}-pagination-info`},n),b.createElement("span",{className:`${t}-pagination-wrapper`},r>0?b.createElement(sn,Object.assign({},e,{key:x(e,"pageSize","pagination")})):null)))}}Qs.propTypes={style:a.object,prefixCls:a.string,pagination:a.object,info:a.oneOfType([a.string,a.node]),renderPagination:a.func};Qs.defaultProps={prefixCls:ce.PREFIX};var vu=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};function ta(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;const{filterMultiple:s=!0,filters:r=[],filteredValue:o=[],filterDropdownVisible:l,onSelect:c=H,onFilterDropdownVisibleChange:d=H,trigger:u="click",position:h="bottom",renderFilterDropdown:g,renderFilterDropdownItem:m,filterConfirmMode:y="immediate",tempFilteredValue:p,setTempFilteredValue:f,confirm:S,clear:v,close:w,reset:_}=i??{},O=y==="confirm"?p??[]:o,I=Ne(i,["tempFilteredValue","setTempFilteredValue","confirm","clear","close","filters"]),E=typeof g=="function"?g(I):b.createElement(Fe.Menu,null,Array.isArray(r)&&r.map((A,F)=>{const K=Q=>{const pe=Q&&Q.nativeEvent;if(pe&&(pe.stopImmediatePropagation(),pe.stopPropagation(),pe.preventDefault()),y==="confirm"){let de=[...p??[...o]];de.includes(A.value);const ie=de.indexOf(A.value);ie>-1?de.splice(ie,1):s?de.push(A.value):de=[A.value],f==null||f(de)}else{let oe=[...o];const de=oe.includes(A.value),ie=oe.indexOf(A.value);return ie>-1?oe.splice(ie,1):s?oe.push(A.value):oe=[A.value],c({value:A.value,filteredValue:oe,included:!de,domEvent:pe})}},z=O.includes(A.value),{text:q}=A,{value:V}=A,W=`${t}_${F}`,G=typeof m=="function"?m({onChange:K,filterMultiple:s,value:V,text:q,checked:z,filteredValue:O,level:t}):null;let se=G&&b.isValidElement(G)?b.cloneElement(G,{key:W}):b.createElement(Fe.Item,{key:W,onClick:K},s?b.createElement(xe,{checked:z},q):b.createElement(dl,{checked:z},q));if(Array.isArray(A.children)&&A.children.length){const Q=Object.assign(Object.assign({},i),{filters:A.children,trigger:"hover",position:"right"});delete Q.filterDropdownVisible,se=ta(Q,se,t+1,n)}return se}),y==="confirm"&&t===0&&b.createElement("div",{style:{padding:"8px 12px",borderTop:"1px solid var(--semi-color-border)",display:"flex",justifyContent:"flex-end"}},b.createElement(Qt,null,b.createElement(Ft,{size:"small",onClick:()=>_==null?void 0:_()},(n==null?void 0:n.resetFilter)||"Reset"),b.createElement(Ft,{size:"small",theme:"solid",onClick:()=>S==null?void 0:S({closeDropdown:!0})},(n==null?void 0:n.confirmFilter)||"OK")))),{filterDropdownVisible:k}=i,N=vu(i,["filterDropdownVisible"]),P=Object.assign(Object.assign({},N),{trigger:u,position:h,render:E,onVisibleChange:A=>d(A)});return l!=null&&(P.visible=l),b.createElement(Fe,Object.assign({},P,{key:`Dropdown_level_${t}`,className:`${ce.PREFIX}-column-filter-dropdown`}),e)}function Cu(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefixCls:e=ce.PREFIX,filteredValue:t,filterIcon:n="filter",filterDropdownProps:s,onSelect:r,filterDropdownVisible:o,renderFilterDropdown:l,onFilterDropdownVisibleChange:c,filterConfirmMode:d="immediate"}=i;let{filterDropdown:u=null}=i;const h=typeof o<"u",m=!h&&(typeof l=="function"||d==="confirm"),[y,p]=L.useState(t),[f,S]=L.useState(t),v=m?!1:o,[w,_]=L.useState(v);L.useEffect(()=>{typeof o<"u"&&_(o)},[o]),L.useEffect(()=>{p(t)},[t]);const O=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const q=(z==null?void 0:z.filteredValue)||y;re(q,t)||r({filteredValue:q}),z.closeDropdown&&_(!1)},I=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};p([]),r({filteredValue:[]}),z.closeDropdown&&_(!1)},E=()=>{_(!1)},k=()=>{p(f)},N=z=>{m&&_(z),z&&d==="confirm"&&(S(t),p(t)),c(z)},P={tempFilteredValue:y,setTempFilteredValue:p,confirm:O,clear:I,close:E,reset:k,filters:i.filters},A=M(`${e}-column-filter`,{on:Array.isArray(t)&&t.length});let F;typeof n=="function"?F=n(Array.isArray(t)&&t.length>0):L.isValidElement(n)?F=n:F=b.createElement("div",{className:A},"​",b.createElement(xl,{role:"button","aria-label":"Filter data with this column","aria-haspopup":"listbox",tabIndex:-1,size:"default"}));const K=Object.assign(Object.assign(Object.assign(Object.assign({},i),s),P),{filterDropdownVisible:h?o:w,onFilterDropdownVisibleChange:N});return b.createElement(Ee,{componentName:"Table"},z=>b.isValidElement(u)?u:ta(K,F,0,z))}var os,_o;function _u(){if(_o)return os;_o=1;var i=qa(),e=4;function t(n){return i(n,e)}return os=t,os}var Ou=_u();const Ru=te(Ou);let is,as;const Oo={position:"absolute",top:"-9999px",width:"50px",height:"50px"};function Eu(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"vertical";if(typeof document>"u"||typeof window>"u")return 0;const e=i==="vertical";if(e&&is)return is;if(!e&&as)return as;const t=document.createElement("div");Object.keys(Oo).forEach(s=>{t.style[s]=Oo[s]}),e?t.style.overflowY="scroll":t.style.overflowX="scroll",document.body.appendChild(t);let n=0;return e?(n=t.offsetWidth-t.clientWidth,is=n):(n=t.offsetHeight-t.clientHeight,as=n),document.body.removeChild(t),n}function na(i){return typeof i=="number"?i-ne.DEFAULT_CELL_PADDING_LEFT-ne.DEFAULT_CELL_PADDING_RIGHT-ne.DEFAULT_CELL_BORDER_WIDTH_LEFT-ne.DEFAULT_CELL_BORDER_WIDTH_RIGHT-Eu("vertical"):void 0}function Ro(i,e){return Zt({},{table:"table",header:{outer:"table",wrapper:"thead",row:"tr",cell:"th"},body:e?{outer:"div",wrapper:"div",row:"div",cell:"div",colgroup:{wrapper:"div",col:"div"}}:{outer:"table",wrapper:"tbody",row:"tr",cell:"td",colgroup:{wrapper:"colgroup",col:"col"}},footer:{wrapper:"tfoot",row:"tr",cell:"td"}},i)}const bt=new qi("[@douyinfe/semi-ui Table]");function Ts(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const s=[],r=n?we:Ru;return Bt(e,o=>{o=Object.assign({},o);const l=mo(o,t),c=l!=null&&We(i,d=>mo(d,t)===l);c?s.push(r(Object.assign(Object.assign({},c),o))):s.push(r(o))}),s}function sa(i){switch(i){case B.SORT_DIRECTIONS[0]:return B.SORT_DIRECTIONS[1];case B.SORT_DIRECTIONS[1]:return"cancelSort";default:return B.SORT_DIRECTIONS[0]}}class Js extends L.PureComponent{render(){const{prefixCls:e,onClick:t,sortOrder:n,style:s,title:r,sortIcon:o,showTooltip:l}=this.props,c="default",d=M(`${e}-column-sorter-up`,{on:n===B.SORT_DIRECTIONS[0]}),u=M(`${e}-column-sorter-down`,{on:n===B.SORT_DIRECTIONS[1]}),h={"aria-label":`Current sort order is ${n?`${n}ing`:"none"}`,"aria-roledescription":"Sort data with this column"},g=()=>{if(typeof o=="function")return o({sortOrder:n});{const m=b.createElement("div",{style:s,className:`${e}-column-sorter`},b.createElement("span",{className:`${d}`},b.createElement(Sl,{size:c})),b.createElement("span",{className:`${u}`},b.createElement(bl,{size:c})));if(l){let y=sa(n);return b.createElement(Ee,{componentName:"Table"},(p,f)=>b.createElement(ui,{content:p[y]},m))}return m}};return b.createElement("div",Object.assign({role:"button"},h,{tabIndex:-1,className:`${e}-column-sorter-wrapper`,onClick:t,onKeyPress:m=>Yt(m)&&t(m)}),r,g())}}Js.propTypes={className:a.string,style:a.object,onClick:a.func,prefixCls:a.string,sortOrder:a.oneOfType([a.string,a.bool]),sortIcon:a.func,showTooltip:a.bool};Js.defaultProps={prefixCls:ce.PREFIX,onClick:H,sortOrder:!1,showTooltip:!1};function xu(i){const{expanded:e,componentType:t="expand",onClick:n=H,onMouseEnter:s=H,onMouseLeave:r=H,expandIcon:o,prefixCls:l=ce.PREFIX,motion:c=!0}=i;let d;b.isValidElement(o)?d=o:typeof o=="function"?d=o(e):t==="tree"?d=e&&!c?b.createElement(Al,{size:"small"}):b.createElement(Nl,{size:"small"}):d=e&&!c?b.createElement(Ms,null):b.createElement(js,null);const u=L.useCallback(h=>{typeof n=="function"&&n(!e,h)},[e]);if(c){const h=d;d=b.createElement(hi,{animationState:e?"enter":"leave",startClassName:`${ce.PREFIX}-expandedIcon-${e?"show":"hide"}`},g=>{let{animationClassName:m}=g;return b.cloneElement(h,{className:(h.props.className||"")+" "+m})})}return b.createElement("span",{role:"button","aria-label":"Expand this row",tabIndex:-1,onClick:u,onMouseEnter:s,onMouseLeave:r,className:`${l}-expand-icon`,onKeyPress:h=>Yt(h)&&u(h)},d)}class on extends b.PureComponent{render(){const{columns:e,className:t,style:n,prefixCls:s,components:r}=this.props,o=x(r,"colgroup.wrapper","colgroup"),l=x(r,"colgroup.col","col"),c=Ye(e).map((u,h)=>{const g={};return u.width&&(g.width=u.width,g.minWidth=g.width),b.createElement(l,{className:M(`${s}-col`,u.className),key:u.key||u.dataIndex||h,style:g})}),d=M(`${s}-colgroup`,t);return b.createElement(o,{className:d,style:n},c)}}on.propTypes={columns:a.array,prefixCls:a.string,className:a.string,style:a.object,components:a.object};on.defaultProps={columns:[],prefixCls:ce.PREFIX};var Tu=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class an extends he{get adapter(){return Object.assign({},super.adapter)}constructor(e){super(e),this.cacheRef=t=>{if(this.headerNode=t,t&&this.context.setHeadWidths){const{prefixCls:n,row:s,index:r}=this.props,o=`.${n}-row-head`,l=t&&t.querySelectorAll&&t.querySelectorAll(o);this.context.setHeadWidths(Bt(l,(c,d)=>{let u=x(s,[d,"column","width"]);const h=x(s,[d,"column","key"]);return typeof u!="number"&&(u=c&&c.getBoundingClientRect().width||0),{width:u,key:h}}),r)}},this.headerNode=null}componentDidUpdate(e){e.columns!==this.props.columns&&this.headerNode&&this.cacheRef(this.headerNode)}render(){const{components:e,row:t,prefixCls:n,onHeaderRow:s,index:r,style:o,columns:l}=this.props,{getCellWidths:c,direction:d,headerStyle:u}=this.context,h=d==="rtl",g=Xi(l,r),m=c(g),y=x(e,"header.row","tr"),p=x(e,"header.cell","th"),f=s(l,r)||{};Ae(f,"className",M(x(f,"className"),`${n}-row`));const S=Bt(t,(v,w)=>{const{column:_}=v,O=Tu(v,["column"]),I=typeof _.onHeaderCell=="function"?_.onHeaderCell(_,w,r):{};let E=Object.assign(Object.assign({},u),I.style);if(_.align){const V=Ji(_.align,d);E=Object.assign(Object.assign({},E),{textAlign:V}),I.className=M(I.className,_.className,{[`${n}-align-${V}`]:!!V})}let k,N,P,A;if(h?(k=Lt(_),N=kt(_),P=xs(g,_),A=Es(g,_)):(k=kt(_),N=Lt(_),P=Es(g,_),A=xs(g,_)),I.className=M(`${n}-row-head`,_.className,I.className,{[`${n}-cell-fixed-left`]:k,[`${n}-cell-fixed-left-last`]:P,[`${n}-cell-fixed-right`]:N,[`${n}-cell-fixed-right-first`]:A,[`${n}-row-head-ellipsis`]:_.ellipsis,[`${n}-row-head-clickSort`]:_.clickToSort}),m.length&&g.length){const V=Ze(g,W=>W&&W.key!=null&&W.key===_.key);if(V>-1){if(kt(_)){const W=h?"right":"left";E=Object.assign(Object.assign({},E),{position:"sticky",[W]:et(m,0,V)})}else if(Lt(_)){const W=h?"left":"right";E=Object.assign(Object.assign({},E),{position:"sticky",[W]:et(m,V+1)})}}}Object.assign(O,{resize:_.resize});const F=ye(Object.assign(Object.assign({},O),I),["colStart","colEnd","hasSubColumns","parents","level"]),{rowSpan:K,colSpan:z}=F;if(K===0||z===0)return null;if(typeof _.clickToSort=="function")if(F.onClick){const V=F.onClick;F.onClick=W=>{V(W),_.clickToSort(W)}}else F.onClick=_.clickToSort;if(typeof _.mouseDown=="function")if(F.onMouseDown){const V=F.onMouseDown;F.onMouseDown=W=>{V(W),_.mouseDown(W)}}else F.onMouseDown=_.mouseDown;const q=b.createElement(p,Object.assign({role:"columnheader","aria-colindex":w+1},F,{style:E,key:_.key||_.dataIndex||w}));if(typeof _.clickToSort=="function"&&_.showSortTip===!0){let V=sa(_.sortOrder);return b.createElement(Ee,{componentName:"Table",key:_.key||_.dataIndex||w},(W,G)=>b.createElement(ui,{content:W[V]},q))}return q});return b.createElement(y,Object.assign({role:"row","aria-rowindex":r+1},f,{style:o,ref:this.cacheRef}),S)}}an.contextType=ke;an.propTypes={components:a.object,row:a.array,prefixCls:a.string,onHeaderRow:a.func,index:a.oneOfType([a.string,a.number]),style:a.object,columns:a.array,fixed:a.oneOfType([a.bool,a.string]),selectedRowKeysSet:a.instanceOf(Set).isRequired};an.defaultProps={onHeaderRow:H,prefixCls:ce.PREFIX,columns:[],components:{header:{wrapper:"thead",row:"tr",cell:"th"}}};function Iu(i){const e=[];function t(s,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;e[l]=e[l]||[];let d=r;return s.map(h=>{const g={key:h.key,className:h.className||"",children:ue(h.title)?h.title():h.title,column:h,colStart:d,level:c,parents:o};let m=1;const y=h.children;y&&y.length>0&&(m=t(y,d,[...o,g],l+1,c+1).reduce((S,v)=>S+v,0),g.hasSubColumns=!0),"colSpan"in h&&({colSpan:m}=h),"rowSpan"in h&&(g.rowSpan=h.rowSpan),h.key===B.DEFAULT_KEY_COLUMN_SCROLLBAR&&(g["x-type"]=B.DEFAULT_KEY_COLUMN_SCROLLBAR),g.colSpan=m,g.colEnd=g.colStart+m-1,e[l].push(g),d+=m;const p=h==null?void 0:h.ellipsis;return Zs(p)&&typeof g.children=="string"&&(g.title=g.children),m})}t(i,0);const n=e.length;for(let s=0;s<n;s+=1)e[s].forEach(r=>{!("rowSpan"in r)&&!r.hasSubColumns&&(r.rowSpan=n-s)});return e}class er extends he{get adapter(){return Object.assign({},super.adapter)}render(){const{components:e,columns:t,prefixCls:n,fixed:s,onHeaderRow:r,forwardedRef:o,selectedRowKeysSet:l}=this.props,c=Iu(t),d=e.header.wrapper;return b.createElement(d,{className:`${n}-thead`,ref:o},c.map((u,h)=>b.createElement(an,{prefixCls:n,key:h,index:h,fixed:s,columns:t,row:u,components:e,onHeaderRow:r,selectedRowKeysSet:l})))}}er.propTypes={components:a.any,columns:a.array,columnManager:a.object,prefixCls:a.string,onHeaderRow:a.func,onDidUpdate:a.func,fixed:a.oneOfType([a.bool,a.string]),selectedRowKeysSet:a.instanceOf(Set).isRequired};er.defaultProps={columns:[],prefixCls:ce.PREFIX,onHeaderRow:H,onDidUpdate:H,components:{header:{wrapper:"thead",row:"tr",cell:"th"}}};const ra=b.forwardRef((i,e)=>b.createElement(er,Object.assign({},i,{forwardedRef:e})));class tr extends b.PureComponent{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{selectedRowKeysSet:new Set};super(e)}render(){const{scroll:e,prefixCls:t,fixed:n,forwardedRef:s,handleBodyScroll:r,columns:o,components:l,onDidUpdate:c,showHeader:d,tableLayout:u,bodyHasScrollBar:h,sticky:g}=this.props,m=x(l,"header.outer","table"),y=x(e,"x"),p={},f={};y&&!n&&(f.width=y),h&&(p.overflowY="scroll");const S=b.createElement(on,{columns:o,prefixCls:t}),v=b.createElement(ra,Object.assign({},this.props,{columns:o,components:l,onDidUpdate:c})),w=M(`${t}-header`,{[`${t}-header-sticky`]:g,[`${t}-header-hidden`]:!d}),_=x(g,"top",0);return typeof _=="number"&&(p.top=_),b.createElement("div",{key:"headTable",style:p,className:w,ref:s,onScroll:r},b.createElement(m,{style:f,className:M(t,{[`${t}-fixed`]:u==="fixed"})},S,v))}}tr.propTypes={tableLayout:a.string,bodyHasScrollBar:a.bool,columns:a.array,components:a.object,dataSource:a.array,fixed:a.oneOfType([a.bool,a.string]),handleBodyScroll:a.func,prefixCls:a.string,forwardedRef:a.oneOfType([a.object,a.func]),scroll:a.shape({x:a.oneOfType([a.number,a.string,a.bool]),y:a.oneOfType([a.number,a.string])}),selectedRowKeysSet:a.instanceOf(Set).isRequired,showHeader:a.bool,onDidUpdate:a.func,onHeaderRow:a.func};tr.defaultProps={handleBodyScroll:H};const Pu=b.forwardRef((i,e)=>b.createElement(tr,Object.assign({},i,{forwardedRef:e})));var ls,Eo;function Au(){if(Eo)return ls;Eo=1;var i=ji(),e=i("length");return ls=e,ls}var cs,xo;function nr(){if(xo)return cs;xo=1;var i="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",s=e+t+n,r="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+i+s+r+"]");function c(d){return l.test(d)}return cs=c,cs}var ds,To;function Du(){if(To)return ds;To=1;var i="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",s=e+t+n,r="\\ufe0e\\ufe0f",o="["+i+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+c+")",u="[^"+i+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",m="\\u200d",y=d+"?",p="["+r+"]?",f="(?:"+m+"(?:"+[u,h,g].join("|")+")"+p+y+")*",S=p+y+f,v="(?:"+[u+l+"?",l,h,g,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+v+S,"g");function _(O){for(var I=w.lastIndex=0;w.test(O);)++I;return I}return ds=_,ds}var us,Io;function Nu(){if(Io)return us;Io=1;var i=Au(),e=nr(),t=Du();function n(s){return e(s)?t(s):i(s)}return us=n,us}var hs,Po;function ku(){if(Po)return hs;Po=1;var i=Ga(),e=Ya(),t=Gt(),n=Qo(),s=Nu(),r="[object Map]",o="[object Set]";function l(c){if(c==null)return 0;if(t(c))return n(c)?s(c):c.length;var d=e(c);return d==r||d==o?c.size:i(c).length}return hs=l,hs}var Lu=ku();const xt=te(Lu);var ps,Ao;function Mu(){if(Ao)return ps;Ao=1;var i=fi(),e=nt(),t=Jt(),n=Math.max,s=Math.min;function r(o,l,c){var d=o==null?0:o.length;if(!d)return-1;var u=d-1;return c!==void 0&&(u=t(c),u=c<0?n(d+u,0):s(u,d-1)),i(o,e(l,3),u,!0)}return ps=r,ps}var ju=Mu();const zu=te(ju);class Fu extends ge{init(){this.initVirtualizedData(),this.initExpandBtnShouldInRow()}destroy(){this.unobserveBodyResize()}initVirtualizedData(e){this._adapter.setVirtualizedData(this.flattenData(this.getProp("dataSource")),e)}initExpandBtnShouldInRow(e){const t=this.getProps(),n=su(t);this._adapter.setCachedExpandBtnShouldInRow(n),!Re(e)&&!e&&(e=B.EXPAND_RELATED_PROPS.map(r=>x(t,r,void 0))),this._adapter.setCachedExpandRelatedProps(e)}flattenData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];const r=[],{rowKey:o,childrenRecordName:l,expandedRowRender:c,expandedRowKeys:d,groups:u}=this.getProps();return t===0&&wt(u)?u.forEach((h,g)=>{const m=e.findIndex(y=>h.has(De(y,o)));if(m>-1){const y=zu(e,f=>h.has(De(f,o))),p=Kt(d,g);r.push({key:g,level:t,sectionRow:!0,group:h,groupKey:g,expanded:p}),p&&r.push(...this.flattenData(e.slice(m,y+1),t+1,[...n],[...s]))}}):e.forEach((h,g)=>{const m=De(h,o),y=tu(h,l);t&&s.push(m);const p={key:m,record:h,level:t,parentKeys:[...n],childrenKeys:[...s]};r.push(p);const f=[];Kt(d,m)&&(Array.isArray(y)&&y.length?f.push(...this.flattenData(y,t+1,[...p.parentKeys],[...p.childrenKeys])):c&&f.push({key:Yi(m),level:t,expandedRow:!0,record:h}),r.push(...f))}),r}observeBodyResize(e){const{scroll:t}=this.getProps();if(x(t,"y"))return this._adapter.observeBodyResize(e)}unobserveBodyResize(){return this._adapter.unobserveBodyResize()}}var fs,Do;function Ku(){if(Do)return fs;Do=1;function i(){return!0}return fs=i,fs}var $u=Ku();const Bu=te($u);function Hu(i,e){if(i===e)return!0;if(!i||!e)return!1;const t=Object.keys(i),n=Object.keys(e),s=t.length;if(n.length!==s)return!1;for(let r=0;r<s;r++){const o=t[r];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}class Wu extends ge{handleClick(e){const{expanded:t,rowKey:n}=this.getProps();this._adapter.notifyClick(n,e,t)}handleDoubleClick(e){this._adapter.notifyDoubleClick(this.getProp("record"),e)}handleMouseEnter(e){const t=this.getProp("record");this._adapter.notifyMouseEnter(t,e)}handleMouseLeave(e){const t=this.getProp("record");this._adapter.notifyMouseLeave(t,e)}}class Uu extends ge{handleClick(e){this._adapter.notifyClick(this.getProp("record"),e)}}function No(i){return i&&!b.isValidElement(i)&&Object.prototype.toString.call(i)==="[object Object]"}class Ct extends he{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){const{onClick:t}=e.props;typeof t=="function"&&t(...arguments)}})}constructor(e){super(e),this.setRef=t=>this.ref=t,this.handleClick=t=>{this.foundation.handleClick(t);const n=this.adapter.getCache("customCellProps");n&&typeof n.onClick=="function"&&n.onClick(t)},this.ref=L.createRef(),this.foundation=new Uu(this.adapter)}shouldComponentUpdate(e){const t=this.props,{column:n,expandIcon:s}=t,r=Qd(n),{shouldCellUpdate:o}=n;if(typeof o=="function")return o(e,t);const l=Gi(n)||s;if((r||l)&&!re(e,this.props))return!0;{const c=["selected","expanded","expandIcon","disabled"],d=ye(t,c),u=ye(e,c);if(!re(u,d))return!0}return!1}componentDidUpdate(){this.props.onDidUpdate(this.ref)}getTdProps(){const{record:e,index:t,column:n={},fixedLeft:s,fixedRight:r,width:o,height:l}=this.props;let c={},d={};const{direction:u}=this.context,h=u==="rtl";if(s||typeof s=="number"?Ae(c,h?"style.right":"style.left",typeof s=="number"?s:0):(r||typeof r=="number")&&Ae(c,h?"style.left":"style.right",typeof r=="number"?r:0),o!=null&&Ae(c,"style.width",o),l!=null&&Ae(c,"style.height",l),n.onCell){d=n.onCell(e,t),this.adapter.setCache("customCellProps",Object.assign({},d)),c=Object.assign(Object.assign({},c),ye(d,["style","className","onClick"]));const y=x(d,"style")||{};c.style=Object.assign(Object.assign({},c.style),y)}if(n.align){const y=Ji(n.align,u),p=au(n.align,u);c.style=Object.assign(Object.assign({},c.style),{textAlign:y,justifyContent:p})}return{tdProps:c,customCellProps:d}}renderText(e){const{record:t,indentSize:n,prefixCls:s,indent:r,index:o,expandIcon:l,renderExpandIcon:c,column:d={},hovered:u}=this.props,{dataIndex:h,render:g,useFullRender:m}=d;let y,p,f;typeof h=="number"?y=x(t,h):!h||h.length===0?y=t:y=x(t,h);const S=r&&n?b.createElement("span",{style:{paddingLeft:`${n*r}px`},className:`${s}-row-indent indent-level-${r}`}):null,v=typeof c=="function"?c(t):l;if(g){const w={expandIcon:v,isHovering:u};if(m){const{renderSelection:_}=this.context,O=typeof _=="function"?_(t):null;Object.assign(w,{selection:O,indentText:S})}y=g(y,t,o,w),No(y)&&(e=y.props?Zt(e,y.props):e,p=e.colSpan,f=e.rowSpan,y=y.children)}return{text:y,indentText:S,rowSpan:f,colSpan:p,realExpandIcon:v,tdProps:e}}renderInner(e,t,n){const{prefixCls:s,isSection:r,expandIcon:o,column:l={}}=this.props,{tableWidth:c,anyColumnFixed:d}=this.context,{useFullRender:u}=l;let h=null;return u?h=e:h=[b.createElement(L.Fragment,{key:"indentText"},t),b.createElement(L.Fragment,{key:"expandIcon"},o?n:null),b.createElement(L.Fragment,{key:"text"},e)],r&&(h=b.createElement("div",{className:M(`${s}-section-inner`),style:{width:d?na(c):void 0}},h)),h}render(){const{prefixCls:e,column:t={},component:n,fixedLeft:s,fixedRight:r,lastFixedLeft:o,firstFixedRight:l,colIndex:c}=this.props,{direction:d}=this.context,u=d==="rtl",{className:h,ellipsis:g}=t,m=s||typeof s=="number",y=r||typeof r=="number",{tdProps:p,customCellProps:f}=this.getTdProps(),S=this.renderText(p);let{text:v}=S;const{indentText:w,rowSpan:_,colSpan:O,realExpandIcon:I,tdProps:E}=S;let k;if(Zs(g)&&typeof v=="string"&&(k=v),_===0||O===0)return null;No(v)&&(v=null);const P=this.renderInner(v,w,I);let A,F,K,z;u?(A=y,F=l,K=m,z=o):(A=m,F=o,K=y,z=l);const q=M(h,`${e}-row-cell`,x(f,"className"),{[`${e}-cell-fixed-left`]:A,[`${e}-cell-fixed-left-last`]:F,[`${e}-cell-fixed-right`]:K,[`${e}-cell-fixed-right-first`]:z,[`${e}-row-cell-ellipsis`]:g});return b.createElement(n,Object.assign({role:"gridcell","aria-colindex":c+1,className:q,onClick:this.handleClick,title:k},E,{ref:this.setRef}),P)}}Ct.contextType=ke;Ct.defaultProps={indent:0,indentSize:ne.DEFAULT_INDENT_WIDTH,onClick:H,prefixCls:ce.PREFIX,component:"td",onDidUpdate:H,column:{}};Ct.propTypes={record:a.object,prefixCls:a.string,index:a.number,fixedLeft:a.oneOfType([a.bool,a.number]),lastFixedLeft:a.bool,fixedRight:a.oneOfType([a.bool,a.number]),firstFixedRight:a.bool,indent:a.number,indentSize:a.number,column:a.object,expandIcon:a.any,renderExpandIcon:a.func,hideExpandedColumn:a.bool,component:a.any,onClick:a.func,onDidUpdate:a.func,isSection:a.bool,width:a.oneOfType([a.string,a.number]),height:a.oneOfType([a.string,a.number]),selected:a.bool,expanded:a.bool,colIndex:a.number,hovered:a.bool};var ko=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const oa={anyColumnFixed:a.bool,cellWidths:a.array.isRequired,className:a.string,columns:a.array.isRequired,components:a.object.isRequired,disabled:a.bool,expandIcon:a.oneOfType([a.bool,a.func,a.node]),expandableRow:a.bool,expanded:a.bool,displayNone:a.bool,expandedRow:a.bool,fixed:a.oneOfType([a.string,a.bool]),height:a.oneOfType([a.string,a.number]),hideExpandedColumn:a.bool,hovered:a.bool,indent:a.number,indentSize:a.number,index:a.number,isSection:a.bool,level:a.number,onDidUpdate:a.func,onHover:a.func,onRow:a.func,onRowClick:a.func,onRowContextMenu:a.func,onRowDoubleClick:a.func,onRowMouseEnter:a.func,onRowMouseLeave:a.func,prefixCls:a.string,record:a.object,renderExpandIcon:a.func,replaceClassName:a.string,rowExpandable:a.func,rowKey:a.oneOfType([a.string,a.number]).isRequired,selected:a.bool,store:a.object,style:a.object,virtualized:a.oneOfType([a.object,a.bool]),visible:a.bool.isRequired};class rt extends he{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{notifyClick:function(){return e.props.onRowClick(...arguments)},notifyDoubleClick:function(){return e.props.onRowDoubleClick(...arguments)},notifyMouseLeave:function(){e.props.onHover(!1,e.props.rowKey),e.props.onRowMouseLeave(...arguments)},notifyMouseEnter:function(){e.props.onHover(!0,e.props.rowKey),e.props.onRowMouseEnter(...arguments)}})}constructor(e){super(e),this.renderExpandIcon=t=>{const{renderExpandIcon:n}=this.props;return n(t,!0)},this.handleMouseEnter=t=>{this.foundation.handleMouseEnter(t);const n=this.adapter.getCache("customRowProps");typeof(n==null?void 0:n.onMouseEnter)=="function"&&n.onMouseEnter(t)},this.handleMouseLeave=t=>{this.foundation.handleMouseLeave(t);const n=this.adapter.getCache("customRowProps");typeof(n==null?void 0:n.onMouseLeave)=="function"&&n.onMouseLeave(t)},this.handleClick=t=>{this.foundation.handleClick(t);const n=this.adapter.getCache("customRowProps");n&&typeof n.onClick=="function"&&n.onClick(t);const{handleRowSelection:s}=this.context,{rowKey:r,selected:o,disabled:l,record:c}=this.props;typeof s=="function"&&!l&&s(r,!o,t)},this.foundation=new Wu(this.adapter)}componentDidMount(){const{onRow:e,index:t,record:n,disabled:s,selected:r}=this.props;if(typeof this.adapter.getCache("customRowProps")>"u"){const l=e(n,t,{disabled:s,selected:r})||{},{className:c,style:d}=l,u=ko(l,["className","style"]);this.adapter.setCache("customRowProps",Object.assign({},u))}}shouldComponentUpdate(e){const t=["cellWidths"];return!Hu(ye(e,t),ye(this.props,t))||!re(Ne(e,t),Ne(this.props,t))}renderCells(){const{columns:e,record:t,index:n,prefixCls:s,fixed:r,components:o,expandableRow:l,level:c,expandIcon:d,rowExpandable:u,isSection:h,expandedRow:g,virtualized:m,indentSize:y,hideExpandedColumn:p,cellWidths:f,selected:S,expanded:v,disabled:w,onDidUpdate:_,hovered:O}=this.props,I=x(o,"body.cell",B.DEFAULT_COMPONENTS.body.cell),E=[],k=u(t);let N=0;return le(e,(P,A)=>{const F=x(P,"key"),K={};if(r!=="right"&&(Xd(F)&&N++,l&&A===N&&(K.renderExpandIcon=this.renderExpandIcon,(p||h)&&(K.expandIcon=d??!0)),c!=null&&A===N&&(K.indent=c,!l&&p&&(d!==!1||!(typeof d=="boolean")&&d!==null)&&(K.indent=c+1))),Gi(P)&&!k)E.push(b.createElement(Ct,{key:A,colIndex:A,isSection:h}));else if(!Zd(P)){const z={};I!==B.DEFAULT_COMPONENTS.body.cell&&m&&!g&&(z.width=x(f,A)),E.push(b.createElement(Ct,Object.assign({colIndex:A},K,z,{hideExpandedColumn:p,indentSize:y,isSection:h,prefixCls:`${s}`,column:P,key:A,index:n,record:t,component:I,fixedLeft:kt(P)&&et(f,0,A),lastFixedLeft:Es(e,P),fixedRight:Lt(P)&&et(f,A+1),firstFixedRight:xs(e,P),selected:S,expanded:v,disabled:w,onDidUpdate:_,hovered:O})))}}),E}render(){const{style:e}=this.props,{components:t,prefixCls:n,selected:s,disabled:r,onRow:o,index:l,className:c,replaceClassName:d,record:u,hovered:h,expanded:g,displayNone:m,expandableRow:y,level:p,expandedRow:f,isSection:S,rowKey:v}=this.props,w=t.body.row,_=o(u,l,{disabled:r,selected:s})||{},{className:O,style:I}=_,E=ko(_,["className","style"]);this.adapter.setCache("customRowProps",Object.assign({},E));const k=Object.assign(Object.assign({},e),I),N=typeof d=="string"&&d.length?M(d,O):M(c,`${n}-row`,{[`${n}-row-selected`]:s,[`${n}-row-expanded`]:g,[`${n}-row-hovered`]:h,[`${n}-row-hidden`]:m},O),P={};return typeof l=="number"&&(P["aria-rowindex"]=l+1),y&&(P["aria-expanded"]=g),(g||f)&&(P["aria-level"]=2),typeof p=="number"&&(P["aria-level"]=p+1),S&&(P["aria-level"]=1),b.createElement(w,Object.assign({role:"row"},P,E,{style:k,className:N,"data-row-key":v,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleClick}),this.renderCells())}}rt.propTypes=oa;rt.contextType=ke;rt.defaultProps={columns:[],rowExpandable:Bu,components:{body:{row:"tr",cell:"td"}},prefixCls:ce.PREFIX,onRow:H,onRowClick:H,onRowDoubleClick:H,onRowMouseEnter:H,onRowMouseLeave:H,onHover:H,onDidUpdate:H,visible:!0,hovered:!1,selected:!1,disabled:!1};var Vu=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class ln extends L.PureComponent{render(){const{record:e,columns:t=[],prefixCls:n,className:s,expanded:r,expandedRowRender:o,renderExpandIcon:l,index:c,store:d,components:u,style:h,virtualized:g,indentSize:m,cellWidths:y,displayNone:p}=this.props,{tableWidth:f,anyColumnFixed:S,getCellWidths:v}=this.context,w=o(e,c,r);let _=null;const O={};let I={};if(Ps(w))return null;if(L.isValidElement(w))_=w;else if(w&&Object.prototype.toString.call(w)==="[object Object]"){const P=w,{children:A,fixed:F}=P,K=Vu(P,["children","fixed"]);_=A,I=Object.assign({},K)}x(u,"body.cell")!==B.DEFAULT_COMPONENTS.body.cell?(g&&Ae(O,"style.height","100%"),Ae(O,"style.display","block"),Ae(O,"style.width",et(y,0,t.length))):O.colSpan=Xs(t).length;const E=[Object.assign({render:()=>({props:O,children:b.createElement("div",{className:M(`${n}-expand-inner`),style:{width:S?na(f):void 0}},_)})},I)],k=M(s,`${n}-row-expand`),N=v(E);return b.createElement(rt,{style:h,components:u,className:k,expandedRow:!0,renderExpandIcon:l,rowKey:`${e.key}-expanded-row`,columns:E,store:d,virtualized:g,indentSize:m,cellWidths:N,displayNone:p})}}ln.contextType=ke;ln.propTypes={cellWidths:a.array.isRequired,className:a.string,columns:a.array,components:a.object,defaultExpandAllRows:a.bool,defaultExpandedRowKeys:a.array,expandIcon:a.oneOfType([a.object,a.node,a.func]),expandRowByClick:a.bool,expanded:a.bool,expandedRowKeys:a.array,expandedRowRender:a.func,indentSize:a.number,index:a.oneOfType([a.string,a.number]),onExpand:a.func,onExpandedRowsChange:a.func,prefixCls:a.string,record:a.object,renderExpandIcon:a.func,store:a.object,style:a.object,virtualized:a.oneOfType([a.bool,a.object])};ln.defaultProps={record:{},prefixCls:ce.PREFIX};var qu=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const ia={record:a.object,index:a.number,columns:a.array,group:a.object.isRequired,groupKey:a.oneOfType([a.string,a.number]).isRequired,data:a.array,renderGroupSection:a.func,onGroupedRow:a.func,clickGroupedRowToExpand:a.bool,components:a.object,expanded:a.bool,prefixCls:a.string,onExpand:a.func,virtualized:a.oneOfType([a.bool,a.object]),style:a.object,renderExpandIcon:a.func,className:a.string,store:a.object,rowKey:a.oneOfType([a.string,a.number,a.func])};class cn extends L.PureComponent{constructor(){var e;super(...arguments),e=this,this.onRow=function(){const{onGroupedRow:t,clickGroupedRowToExpand:n,onExpand:s,groupKey:r,expanded:o}=e.props,l={};return typeof t=="function"&&Object.assign(l,t(...arguments)),Object.assign(Object.assign({},l),{onClick:c=>{typeof s=="function"&&n&&s(!o,r,c),typeof l.onClick=="function"&&l.onClick(c)}})},this.collectGroupedData=()=>{const{data:t,group:n,rowKey:s}=this.props;return Array.isArray(t)&&t.length&&Pe(n)?t.filter(r=>{const o=typeof s=="function"?s(r):x(r,s);return o!=null&&o!==""&&n.has(o)}):[]},this.renderExpandIcon=t=>{const{renderExpandIcon:n,groupKey:s}=this.props;return typeof n=="function"?n(t,!1,s):null}}isInnerColumnKey(e){return e!=null?[B.DEFAULT_KEY_COLUMN_EXPAND,B.DEFAULT_KEY_COLUMN_SELECTION].includes(e):!1}render(){const{record:e,columns:t=[],prefixCls:n,className:s,expanded:r,renderGroupSection:o,components:l,index:c,store:d,group:u,groupKey:h,virtualized:g,style:m}=this.props,y={};let p={},f=null;const S=typeof o=="function"?o(h,[...u]):null;if(L.isValidElement(S))f=S;else if(S&&Object.prototype.toString.call(S)==="[object Object]"){const I=S,{children:E}=I,k=qu(I,["children"]);f=E,p=Object.assign({},k)}y.colSpan=Xs(t).length;const v=[Object.assign({render:()=>({props:y,children:f})},p)],w=M(s,`${n}-row-section`,{on:r}),{getCellWidths:_}=this.context,O=_(v,null,!0);return b.createElement(rt,{components:l,virtualized:g,index:c,onRow:this.onRow,expanded:r,expandIcon:!0,isSection:!0,record:e,replaceClassName:w,expandableRow:!0,renderExpandIcon:this.renderExpandIcon,rowKey:h,columns:v,store:d,style:m,cellWidths:O})}}cn.contextType=ke;cn.propTypes=ia;cn.defaultProps={prefixCls:ce.PREFIX,components:{body:{row:"tr",cell:"td"}}};var Lo=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class sr extends he{constructor(e,t){var n;super(e),n=this,this.onRowHover=(o,l)=>{const{store:c}=this.props,{rowSpanHover:d}=this.context;if(c){const u=o?l:null;x(c.getState(),"hoveredRowKey")!==u&&c.setState({hoveredRowKey:u})}if(d){const u=String(l);if(o){const h=this.getHoveredRowKeysFromDOM(u);this.updateRowHoverClass(h)}else this.updateRowHoverClass([])}},this.updateRowHoverClass=o=>{var l;const c=this.ref.current;if(!c){this.hoveredRowKeySet.clear();return}const d=((l=c.closest)===null||l===void 0?void 0:l.call(c,`.${this.props.prefixCls}-wrapper`))||c,u=new Set(o);for(const h of this.hoveredRowKeySet)u.has(h)||d.querySelectorAll(`tr[data-row-key="${this.cssEscape(h)}"]`).forEach(m=>m.classList.remove(`${this.props.prefixCls}-row-hovered`));for(const h of u)this.hoveredRowKeySet.has(h)||d.querySelectorAll(`tr[data-row-key="${this.cssEscape(h)}"]`).forEach(m=>m.classList.add(`${this.props.prefixCls}-row-hovered`));this.hoveredRowKeySet=u},this.getHoveredRowKeysFromDOM=o=>{var l;const c=new Set;c.add(o);const d=this.ref.current,u=(l=d==null?void 0:d.querySelector(".semi-table-tbody"))!==null&&l!==void 0?l:d;if(!u)return Array.from(c);const h=u.querySelector(`tr[data-row-key="${this.cssEscape(o)}"]`);if(!h)return Array.from(c);const g=Array.from(u.querySelectorAll("tr[data-row-key]")),m=g.indexOf(h);return m===-1||g.forEach((y,p)=>{y.querySelectorAll("td[rowspan]").forEach(S=>{const v=parseInt(S.getAttribute("rowspan")||"1",10);if(v>1){const w=p+v-1;if(m>=p&&m<=w)for(let _=p;_<=w&&_<g.length;_++){const O=g[_].getAttribute("data-row-key");O&&c.add(O)}}})}),Array.from(c)},this.cssEscape=o=>{const l=globalThis.CSS;return l&&typeof l.escape=="function"?l.escape(o):o.replace(/\\/g,"\\\\").replace(/"/g,'\\"')},this.forwardRef=o=>{const{forwardedRef:l}=this.props;this.ref.current=o,this.foundation.observeBodyResize(o),typeof l=="function"?l(o):l&&typeof l=="object"&&(l.current=o)},this.setListRef=o=>{this.listRef.current=o;const{getVirtualizedListRef:l}=this.context;l&&(this.props.virtualized?l(this.listRef):console.warn("getVirtualizedListRef only works with virtualized. See https://semi.design/en-US/show/table for more information."))},this.itemSize=o=>{const{virtualized:l,size:c}=this.props,{virtualizedData:d}=this.state,u=x(d,o),h=nu(c,u.sectionRow),g=x(l,"itemSize",h.height);let m=g;return typeof g=="function"&&(m=g(o,{expandedRow:x(u,"expandedRow",!1),sectionRow:x(u,"sectionRow",!1)})),m<h.minHeight&&bt.warn(`The computed real \`itemSize\` cannot be less than ${h.minHeight}`),m},this.itemKey=(o,l)=>x(l,[o,"key"],o),this.handleRowClick=(o,l,c)=>{const{handleRowExpanded:d}=this.context;d(!c,o,l)},this.handleVirtualizedScroll=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const l=x(n.props.virtualized,"onScroll");typeof l=="function"&&l(o)},this.handleVirtualizedBodyScroll=o=>{const{handleBodyScroll:l}=this.props,c=x(o,"nativeEvent.target.scrollLeft"),d=x(o,"nativeEvent.target.scrollTop");d===this.state.cache.virtualizedScrollTop&&this.handleVirtualizedScroll({horizontalScrolling:!0}),this.state.cache.virtualizedScrollLeft=c,this.state.cache.virtualizedScrollTop=d,typeof l=="function"&&l(o)},this.getVirtualizedRowWidth=()=>{const{getCellWidths:o}=this.context,{columns:l}=this.props,c=o(l);return et(c,0,xt(l))},this.renderVirtualizedRow=o=>{const{index:l,style:c}=o,{virtualizedData:d,cachedExpandBtnShouldInRow:u}=this.state,{flattenedColumns:h}=this.context,g=x(d,[l],{}),{key:m,parentKeys:y,expandedRow:p,sectionRow:f}=g,S=Lo(g,["key","parentKeys","expandedRow","sectionRow"]),v=this.getVirtualizedRowWidth(),w=u,_=Object.assign(Object.assign(Object.assign(Object.assign({},this.props),{style:Object.assign(Object.assign({},c),{width:v})}),S),{columns:h,index:l,expandBtnShouldInRow:w});return f?this.renderSectionRow(_):p?this.renderExpandedRow(_):this.renderBaseRow(_)},this.renderTbody=b.forwardRef(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;return b.createElement("div",Object.assign({},o,{onScroll:function(){o.onScroll&&o.onScroll(...arguments)},className:M(o.className,`${n.props.prefixCls}-tbody`),style:Object.assign({},o.style),ref:l}))}),this.renderOuter=b.forwardRef((o,l)=>{const{children:c}=o,d=Lo(o,["children"]),{handleWheel:u,prefixCls:h,emptySlot:g,dataSource:m}=this.props,y=this.getVirtualizedRowWidth(),p=M(`${h}`,`${h}-fixed`);return b.createElement("div",Object.assign({},d,{ref:l,onWheel:function(){u&&u(...arguments),d.onWheel&&d.onWheel(...arguments)},onScroll:function(){n.handleVirtualizedBodyScroll(...arguments),d.onScroll&&d.onScroll(...arguments)}}),b.createElement("div",{style:{width:y},className:p},c),xt(m)===0&&g)}),this.onItemsRendered=o=>{this.state.cache.virtualizedScrollLeft&&this.ref.current&&(this.ref.current.scrollLeft=this.state.cache.virtualizedScrollLeft)},this.renderVirtualizedBody=o=>{const{scroll:l,prefixCls:c,virtualized:d,columns:u}=this.props,{virtualizedData:h}=this.state,{getCellWidths:g}=this.context,m=g(u);if(!xt(m))return null;const y=x(l,"y"),p=typeof y=="number",f=p?y:600;p||bt.warn('You have to specific "scroll.y" which must be a number for table virtualization!');const S={width:"100%",height:h!=null&&h.length?f:null,overflowX:"auto",overflowY:"auto"},v=M(`${c}-body`);return b.createElement(wc,Object.assign({},typeof d=="object"?d:{},{initialScrollOffset:this.state.cache.virtualizedScrollTop,onScroll:this.handleVirtualizedScroll,onItemsRendered:this.onItemsRendered,ref:this.setListRef,className:v,outerRef:this.forwardRef,height:h!=null&&h.length?f:0,width:S.width,itemData:h,itemSize:this.itemSize,itemCount:h.length,itemKey:this.itemKey,innerElementType:this.renderTbody,outerElementType:this.renderOuter,style:Object.assign(Object.assign({},S),{direction:o}),direction:o}),this.renderVirtualizedRow)},this.renderSectionRow=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{groupKey:void 0};const{dataSource:l,rowKey:c,group:d,groupKey:u,index:h}=o,g=Object.keys(ia),m=Ne(o,g),{handleRowExpanded:y}=n.context;return b.createElement(cn,Object.assign({},m,{record:{groupKey:u,records:[...d].map(p=>bo(l,p,c))},index:h,onExpand:y,data:l,key:u||h}))},this.renderExpandedRow=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{renderExpandIcon:()=>null};const{style:l,components:c,renderExpandIcon:d,expandedRowRender:u,record:h,columns:g,expanded:m,index:y,rowKey:p,virtualized:f,displayNone:S}=o;let v=De(h,p);v==null&&(v=y);const{flattenedColumns:w,getCellWidths:_}=n.context;return w!==n.flattenedColumns&&(n.flattenedColumns=w,n.cellWidths=_(w)),b.createElement(ln,{style:l,components:c,renderExpandIcon:d,expandedRowRender:u,record:h,columns:g,expanded:m,index:y,virtualized:f,key:Yi(v),cellWidths:n.cellWidths,displayNone:S})},this.renderGroupedRows=()=>{const{groups:o,dataSource:l,rowKey:c,expandedRowKeys:d,keepDOM:u}=this.props,{flattenedColumns:h}=this.context,g=new Map,m=[];o!=null&&Array.isArray(l)&&l.length&&l.forEach(p=>{const f=De(p,c);o.forEach((S,v)=>{if(S.has(f))return g.has(v)||g.set(v,new Set([])),g.get(v).add(f),!1})});let y=-1;return g.forEach((p,f)=>{const S=es(d,f);if(m.push(this.renderSectionRow(Object.assign(Object.assign({},this.props),{columns:h,index:++y,group:p,groupKey:f,expanded:S}))),S||u){const v=[];p.forEach(w=>{const _=bo(l,w,c);_!=null&&v.push(_)}),m.push(this.renderBodyRows(v,void 0,[],!S))}}),m},this.renderBody=o=>{const{scroll:l,prefixCls:c,columns:d,components:u,fixed:h,handleWheel:g,headerRef:m,handleBodyScroll:y,anyColumnFixed:p,showHeader:f,emptySlot:S,includeHeader:v,dataSource:w,onScroll:_,groups:O,expandedRowRender:I,tableLayout:E}=this.props,k=x(l,"x"),N=x(l,"y"),P={},A={},F=x(u,"body.outer","table"),K=x(u,"body.wrapper")||"tbody";N&&(P.maxHeight=N),k&&(A.width=k),p&&xt(w)&&(P.overflow="auto",P.WebkitTransform="translate3d (0, 0, 0)");const z=b.createElement(on,{components:x(u,"body"),columns:d,prefixCls:c}),q=`${c}-body`,V=b.createElement("div",{key:"bodyTable",className:q,style:P,ref:this.forwardRef,onMouseLeave:()=>{this.context.rowSpanHover&&this.updateRowHoverClass([])},onWheel:g,onScroll:y},b.createElement(F,{role:wt(O)||ue(I)||iu({dataSource:w})?"treegrid":"grid","aria-rowcount":w&&w.length,"aria-colcount":d&&d.length,style:A,className:M(c,{[`${c}-fixed`]:E==="fixed"})},z,v&&f?b.createElement(ra,Object.assign({},this.props,{ref:m,components:u,columns:d})):null,b.createElement(K,{className:`${c}-tbody`,onScroll:_},wt(O)?this.renderGroupedRows():this.renderBodyRows(w))),S);return h&&d.length?b.createElement("div",{key:"bodyTable",className:`${c}-body-outer`},V):V},this.ref=b.createRef(),this.state={virtualizedData:[],cache:{virtualizedScrollTop:null,virtualizedScrollLeft:null},cachedExpandBtnShouldInRow:null,cachedExpandRelatedProps:[],hoveredRowKey:null},this.listRef=b.createRef();const{flattenedColumns:s,getCellWidths:r}=t;this.foundation=new Fu(this.adapter),this.flattenedColumns=s,this.cellWidths=r(s),this.observer=null,this.hoveredRowKeySet=new Set}componentDidMount(){const{store:e}=this.props;e&&(this.unsubscribe=e.subscribe(t=>{const{hoveredRowKey:n}=t;n!==this.state.hoveredRowKey&&this.setState({hoveredRowKey:n})}))}componentWillUnmount(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVirtualizedData:(e,t)=>this.setState({virtualizedData:e},t),setCachedExpandBtnShouldInRow:e=>this.setState({cachedExpandBtnShouldInRow:e}),setCachedExpandRelatedProps:e=>this.setState({cachedExpandRelatedProps:e}),observeBodyResize:e=>{const{setBodyHasScrollbar:t}=this.context,n=()=>{const s=()=>{const{offsetWidth:o,clientWidth:l}=e,c=l<o;t(c)};(window.requestAnimationFrame||window.setTimeout)(s)};e&&(x(window,"ResizeObserver")?(this.observer&&(this.observer.unobserve(e),this.observer=null),this.observer=new ResizeObserver(n),this.observer.observe(e)):bt.warn("The current browser does not support ResizeObserver,and the table may be misaligned after plugging and unplugging the mouse and keyboard.You can try to refresh it."))},unobserveBodyResize:()=>{const e=this.ref.current;this.observer&&(this.observer.unobserve(e),this.observer=null)}})}componentDidUpdate(e,t){const{virtualized:n,dataSource:s,expandedRowKeys:r,columns:o,scroll:l}=this.props;n&&(e.dataSource!==s||e.expandedRowKeys!==r||e.columns!==o)&&this.foundation.initVirtualizedData();const d=B.EXPAND_RELATED_PROPS.map(g=>x(this.props,g,void 0));re(d,t.cachedExpandRelatedProps)||this.foundation.initExpandBtnShouldInRow(d);const u=x(l,"y"),h=this.ref.current;u&&u!==x(e,"scroll.y")&&this.foundation.observeBodyResize(h)}renderBaseRow(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{rowKey:t,columns:n,expandedRowKeys:s,rowExpandable:r,record:o,index:l,level:c,expandBtnShouldInRow:d,selectedRowKeysSet:u,disabledRowKeysSet:h,expandRowByClick:g}=e,m=Object.keys(oa),y=Ne(e,m);let p=De(o,t);p==null&&(p=l);const f=es(s,p),S=r&&r(o),v={level:void 0,expanded:f};(S||d)&&(v.level=c,v.expandableRow=S,g&&(v.onRowClick=this.handleRowClick));const w={selected:Jd(u,p),disabled:eu(h,p)},{getCellWidths:_}=this.context,O=_(n,null,!0),{hoveredRowKey:I}=this.state,E=I===p;return b.createElement(rt,Object.assign({},y,v,w,{key:p,rowKey:p,cellWidths:O,hovered:E,onHover:this.onRowHover}))}renderBodyRows(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const{rowKey:r,expandedRowRender:o,expandedRowKeys:l,childrenRecordName:c,rowExpandable:d,keepDOM:u}=this.props,h=typeof o=="function",g=this.state.cachedExpandBtnShouldInRow,{flattenedColumns:m}=this.context;return le(e,(y,p)=>{let f=De(y,r);f==null&&(f=p);const S=x(y,c),v=!!(Array.isArray(S)&&S.length);n.push(this.renderBaseRow(Object.assign(Object.assign({},this.props),{columns:m,expandBtnShouldInRow:g,displayNone:s,record:y,key:f,level:t,index:p})));const w=es(l,f),_=w||u;if(h&&d&&d(y)&&_){const O=this.renderExpandedRow(Object.assign(Object.assign({},this.props),{columns:m,level:t,index:p,record:y,expanded:w,displayNone:s||!w}));Ps(O)||n.push(O)}if(v&&_){const O=this.renderBodyRows(S,t+1,[],s||!w);n.push(...O)}}),n}render(){const{virtualized:e}=this.props,{direction:t}=this.context;return e?this.renderVirtualizedBody(t):this.renderBody(t)}}sr.contextType=ke;sr.propTypes={anyColumnFixed:a.bool,childrenRecordName:a.string,columns:a.array,components:a.object,dataSource:a.array,disabledRowKeysSet:a.instanceOf(Set).isRequired,emptySlot:a.node,expandRowByClick:a.bool,expandedRowKeys:a.array,expandedRowRender:a.func,fixed:a.oneOfType([a.string,a.bool]),forwardedRef:a.oneOfType([a.object,a.func]),groups:a.instanceOf(Map),handleBodyScroll:a.func,handleWheel:a.func,headerRef:a.oneOfType([a.object,a.func]),includeHeader:a.bool,onScroll:a.func,prefixCls:a.string,renderExpandIcon:a.func,rowExpandable:a.func,rowKey:a.oneOfType([a.string,a.bool,a.func]),scroll:a.object,selectedRowKeysSet:a.instanceOf(Set).isRequired,showHeader:a.bool,size:a.string,store:a.object,virtualized:a.oneOfType([a.bool,a.object])};const Gu=b.forwardRef(function(e,t){return b.createElement(sr,Object.assign({},e,{forwardedRef:t}))});var Yu=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};let ot=class extends he{get adapter(){var e=this;return Object.assign(Object.assign({},super.adapter),{resetScrollY:()=>{const{scroll:t={}}=this.props;!!x(t,"y")?this.bodyWrapRef.current&&(this.bodyWrapRef.current.scrollTop=0):this.wrapRef.current&&this.wrapRef.current.scrollIntoView({behavior:"smooth",block:"start"})},setSelectedRowKeys:t=>{this.setState({rowSelection:Object.assign(Object.assign({},this.state.rowSelection),{selectedRowKeys:[...t],selectedRowKeysSet:new Set(t)})})},setDisabledRowKeys:t=>{this.setState({disabledRowKeys:t,disabledRowKeysSet:new Set(t)})},setCurrentPage:t=>{const{pagination:n}=this.state;typeof n=="object"?this.setState({pagination:Object.assign(Object.assign({},n),{currentPage:t})}):this.setState({pagination:{currentPage:t}})},setPagination:t=>this.setState({pagination:t}),setGroups:t=>this.setState({groups:t}),setDataSource:t=>this.setState({dataSource:t}),setExpandedRowKeys:t=>this.setState({expandedRowKeys:[...t]}),setQuery:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=[...e.state.queries];n=Zi(t,n),e.setState({queries:n})},setQueries:t=>this.setState({queries:t}),setFlattenData:t=>this.setState({flattenData:t}),setAllRowKeys:t=>this.setState({allRowKeys:t}),setHoveredRowKey:t=>{this.store.setState({hoveredRowKey:t})},setHoveredRowKeys:t=>{this.store.setState({hoveredRowKeys:t})},setCachedFilteredSortedDataSource:t=>{this.cachedFilteredSortedDataSource=t},setCachedFilteredSortedRowKeys:t=>{this.cachedFilteredSortedRowKeys=t,this.cachedFilteredSortedRowKeysSet=new Set(t)},setAllDisabledRowKeys:t=>{const n=new Set(t);this.setState({allDisabledRowKeys:t,allDisabledRowKeysSet:n})},getCurrentPage:()=>x(this.state,"pagination.currentPage",1),getCurrentPageSize:()=>x(this.state,"pagination.pageSize",ne.DEFAULT_PAGE_SIZE),getCachedFilteredSortedDataSource:()=>this.cachedFilteredSortedDataSource,getCachedFilteredSortedRowKeys:()=>this.cachedFilteredSortedRowKeys,getCachedFilteredSortedRowKeysSet:()=>this.cachedFilteredSortedRowKeysSet,getAllDisabledRowKeys:()=>this.state.allDisabledRowKeys,getAllDisabledRowKeysSet:()=>this.state.allDisabledRowKeysSet,getHalfCheckedRowKeys:()=>this.state.halfCheckedRowKeys||[],getHalfCheckedRowKeysSet:()=>this.state.halfCheckedRowKeysSet||new Set,setHalfCheckedRowKeys:t=>{this.setState({halfCheckedRowKeys:t,halfCheckedRowKeysSet:new Set(t)})},getKeyEntities:()=>this.state.keyEntities||{},setKeyEntities:t=>{this.setState({keyEntities:t})},getCheckRelation:()=>{const{rowSelection:t}=this.state;return t&&typeof t=="object"?x(t,"checkRelation","unRelated"):"unRelated"},notifyFilterDropdownVisibleChange:(t,n)=>this._invokeColumnFn(n,"onFilterDropdownVisibleChange",t),notifyChange:function(){return e.props.onChange(...arguments)},notifyExpand:function(){return e.props.onExpand(...arguments)},notifyExpandedRowsChange:function(){return e.props.onExpandedRowsChange(...arguments)},notifySelect:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e._invokeRowSelection("onSelect",...n)},notifySelectAll:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e._invokeRowSelection("onSelectAll",...n)},notifySelectInvert:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e._invokeRowSelection("onSelectInvert",...n)},notifySelectionChange:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e._invokeRowSelection("onChange",...n)},isAnyColumnFixed:t=>Nt(this.getColumns(t||this.props.columns,this.props.children),n=>!!n.fixed),useFixedHeader:()=>{const{scroll:t,sticky:n}=this.props;return!!(x(t,"y")||n)},getTableLayout:()=>{let t=!1;const{flattenColumns:n}=this.state;return Array.isArray(n)&&(t=n.some(s=>!!s.ellipsis||!!s.fixed)),this.adapter.useFixedHeader()&&(t=!0),t?"fixed":"auto"},setHeadWidths:function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Yd(e.state.headWidths[n],t)||e.setState(s=>{const r=[...s.headWidths];return r[n]=[...t],{headWidths:r}})},getHeadWidths:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e.state.headWidths.length&&typeof t=="number"?(e.state.headWidths[t]||[]).map(s=>s.width):[]},getCellWidths:function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Array.isArray(t)&&t.length&&(n=n==null&&e.state.headWidths.length?Md(e.state.headWidths):[],Array.isArray(n)&&n.length)?t.reduce((r,o)=>{const l=o.key===B.DEFAULT_KEY_COLUMN_SCROLLBAR&&s?null:We(n,c=>c&&c.key!=null&&c.key===o.key);return l&&r.push(l.width),r},[]):[]},mergedRowExpandable:t=>{const{expandedRowRender:n,childrenRecordName:s,rowExpandable:r}=this.props,o=x(t,s),l=typeof n=="function",c=typeof r=="function",d=Array.isArray(o)&&o.length,u=c&&r(t);return(l||d)&&(!c||u)||!(l||d)&&u},isAnyColumnUseFullRender:t=>Nt(t,n=>!!n.useFullRender),getNormalizeColumns:()=>this.normalizeColumns,getHandleColumns:()=>this.handleColumns,getMergePagination:()=>this.mergePagination,setBodyHasScrollbar:t=>{t!==this.state.bodyHasScrollBar&&this.setState({bodyHasScrollBar:t})},stopPropagation(t){t&&typeof t=="object"&&(typeof t.stopPropagation=="function"&&t.stopPropagation(),t.nativeEvent&&typeof t.nativeEvent.stopPropagation=="function"?t.nativeEvent.stopPropagation():typeof t.stopImmediatePropagation=="function"&&t.stopImmediatePropagation())}})}constructor(e,t){var n;super(e),n=this,this._warnIfNoKey=()=>{(this.props.rowSelection||this.props.expandedRowRender)&&Nt(this.props.dataSource,u=>this.foundation.getRecordKey(u)==null)&&bt.error('You must specify a key for each element in the dataSource or use "rowKey" to specify an attribute name as the primary key!')},this._invokeRowSelection=function(u){const h=x(n.state,["rowSelection",u]);if(typeof h=="function"){for(var g=arguments.length,m=new Array(g>1?g-1:0),y=1;y<g;y++)m[y-1]=arguments[y];h(...m)}},this._invokeColumnFn=function(u,h){if(u&&h){const p=n.foundation.getQuery(u),f=x(p,h,null);if(typeof f=="function"){for(var g=arguments.length,m=new Array(g>2?g-2:0),y=2;y<g;y++)m[y-2]=arguments[y];f(...m)}}},this._cacheHeaderRef=u=>{this.headerWrapRef.current=u},this.getCurrentPageData=()=>{const u=this.foundation.getCurrentPageData(),h=["dataSource","groups"].reduce((g,m)=>(u[m]&&(g[m]=u[m]),g),{});return we(h)},this.getColumns=(u,h)=>!Array.isArray(u)||!u||!u.length?Ut(h):u,this.getCellWidths=function(){return n.foundation.getCellWidths(...arguments)},this.setHeadWidths=function(){return n.foundation.setHeadWidths(...arguments)},this.getHeadWidths=function(){return n.foundation.getHeadWidths(...arguments)},this.mergedRowExpandable=function(){return n.foundation.mergedRowExpandable(...arguments)},this.setBodyHasScrollbar=function(){return n.foundation.setBodyHasScrollbar(...arguments)},this.handleWheel=u=>{const{scroll:h={}}=this.props;if(window.navigator.userAgent.match(/Trident\/7\./)&&h.y){u.preventDefault();const g=u.deltaY,{target:m}=u,y=this.bodyWrapRef.current;let p=0;this.lastScrollTop?p=this.lastScrollTop+g:p=g,y&&m!==y&&(y.scrollTop=p)}},this.handleBodyScrollLeft=u=>{if(u.currentTarget!==u.target)return;const{target:h}=u,g=this.headerWrapRef.current,m=this.bodyWrapRef.current;h.scrollLeft!==this.lastScrollLeft&&(h===m&&g?g.scrollLeft=h.scrollLeft:h===g&&m&&(m.scrollLeft=h.scrollLeft),this.setScrollPositionClassName()),this.lastScrollLeft=h.scrollLeft},this.handleWindowResize=()=>{this.syncTableWidth(),this.setScrollPositionClassName()},this.handleBodyScrollTop=u=>{const{target:h}=u;if(u.currentTarget!==h)return;const{scroll:g={}}=this.props,m=this.headerWrapRef.current,y=this.bodyWrapRef.current;if(h.scrollTop!==this.lastScrollTop&&g.y&&h!==m){const{scrollTop:p}=h;y&&h!==y&&(y.scrollTop=p)}this.lastScrollTop=h.scrollTop},this.handleBodyScroll=u=>{this.handleBodyScrollLeft(u),this.handleBodyScrollTop(u)},this.setScrollPosition=u=>{const{prefixCls:h}=this.props,g=[`${h}-scroll-position-both`,`${h}-scroll-position-middle`,`${h}-scroll-position-left`,`${h}-scroll-position-right`];this.position=u,this.scrollPosition=u;const m=this.wrapRef.current;if(m&&m.nodeType)if(u==="both"){const y=[`${h}-scroll-position-left`,`${h}-scroll-position-right`];m.classList.remove(...vr(g,y)),m.classList.add(...y)}else{const y=[`${h}-scroll-position-${u}`];m.classList.remove(...vr(g,y)),m.classList.add(...y)}},this.setScrollPositionClassName=()=>{const u=this.bodyWrapRef.current;if(u&&u.children&&u.children.length){const h=u.scrollLeft===0,g=Math.abs(u.scrollLeft)+1>=u.children[0].getBoundingClientRect().width-u.getBoundingClientRect().width;h&&g?this.setScrollPosition("both"):h?this.setScrollPosition("left"):g?this.setScrollPosition("right"):this.scrollPosition!=="middle"&&this.setScrollPosition("middle")}},this.syncTableWidth=()=>{var u;const h=(u=this.rootWrapRef)===null||u===void 0?void 0:u.current;if(!h)return;const g=h.getBoundingClientRect().width,m=this.state.tableWidth;typeof m=="number"&&Math.abs(m-g)<.5||this.setState({tableWidth:g})},this.observeTableWrapperResize=()=>{const u=this.rootWrapRef.current;if(!u)return;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null);const h=x(window,"ResizeObserver");h&&(this.resizeObserver=new h(g=>{const m=()=>{this.syncTableWidth(),this.setScrollPositionClassName()};typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(m):window.setTimeout(m,0)}),this.resizeObserver.observe(u))},this.needSyncTableWidth=()=>this.adapter.isAnyColumnFixed()||this.props.showHeader&&this.adapter.useFixedHeader(),this.bindWindowResize=()=>{this.hasBindWindowResize||this.debouncedWindowResize&&(window.addEventListener("resize",this.debouncedWindowResize),this.hasBindWindowResize=!0)},this.unbindWindowResize=()=>{this.hasBindWindowResize&&(this.debouncedWindowResize&&window.removeEventListener("resize",this.debouncedWindowResize),this.hasBindWindowResize=!1)},this.syncResizeListeners=()=>{if(this.needSyncTableWidth()){const h=this.hasBindWindowResize;this.bindWindowResize(),this.resizeObserver||this.observeTableWrapperResize(),h||this.handleWindowResize()}else this.unbindWindowResize(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},this.renderSelection=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=arguments.length>2?arguments[2]:void 0;const{rowSelection:m,allDisabledRowKeysSet:y,halfCheckedRowKeysSet:p,keyEntities:f}=n.state;if(m&&typeof m=="object"){const{selectedRowKeys:S=[],selectedRowKeysSet:v=new Set,getCheckboxProps:w,disabled:_,renderCell:O,checkRelation:I="unRelated"}=m,E=n.cachedFilteredSortedRowKeys,k=n.cachedFilteredSortedRowKeysSet,N=n.foundation.allIsSelected(v,y,E),A=n.foundation.hasRowSelected(S,k)&&!N;if(h){const F=x(m,"key",B.DEFAULT_KEY_COLUMN_SELECTION),K=b.createElement(Vt,{"aria-label":`${N?"Deselect":"Select"} all rows`,disabled:_,key:F,selected:N,indeterminate:A,onChange:(q,V)=>{n.toggleSelectAllRow(q,V)}}),z=(q,V)=>n.toggleSelectAllRow(q,V);return ue(O)?O({selected:N,record:u,originNode:K,inHeader:h,disabled:_,indeterminate:A,selectAll:z}):K}else{const F=n.foundation.getRecordKey(u),K=v.has(F),z=I==="related"&&p&&p.has(F),q=()=>typeof w=="function"?w(u):{},V=b.createElement(Vt,{"aria-label":`${K?"Deselect":"Select"} this row`,getCheckboxProps:q,selected:K,indeterminate:z,onChange:(G,se)=>n.toggleSelectRow(G,F,se)}),W=(G,se)=>n.toggleSelectRow(G,F,se);return ue(O)?O({selected:K,record:u,index:g,originNode:V,inHeader:!1,disabled:_,indeterminate:z,selectRow:W}):V}}return null},this.renderRowSelectionCallback=function(u){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=arguments.length>2?arguments[2]:void 0;return n.renderSelection(h,!1,g)},this.renderTitleSelectionCallback=()=>this.renderSelection(void 0,!0),this.normalizeSelectionColumn=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{rowSelection:h,prefixCls:g}=u;let m={};if(h){const y=["selectedRowKeys","selectedRowKeysSet"];m={key:B.DEFAULT_KEY_COLUMN_SELECTION},Re(h)&&(m=Object.assign(Object.assign({},m),ye(h,y))),m.className=M(m.className,`${g}-column-selection`),m.title=n.renderTitleSelectionCallback,m.render=n.renderRowSelectionCallback}return m},this.normalizeScrollbarColumn=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{scrollbarWidth:h=0}=u;return{key:B.DEFAULT_KEY_COLUMN_SCROLLBAR,width:h,fixed:"right"}},this.renderExpandIcon=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const{expandedRowKeys:m}=n.state,{expandIcon:y}=n.props,p=typeof g=="string"||typeof g=="number"?g:n.foundation.getRecordKey(u);return b.createElement(xu,{key:p,componentType:h?"tree":"expand",expanded:Kt(m,p),expandIcon:y,onClick:(f,S)=>n.handleRowExpanded(f,p,S)})},this.handleRowExpanded=function(){return n.foundation.handleRowExpanded(...arguments)},this.normalizeExpandColumn=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=null;const{prefixCls:g,expandCellFixed:m,expandIcon:y}=u;return h={fixed:m,key:B.DEFAULT_KEY_COLUMN_EXPAND},h.className=M(h.className,`${g}-column-expand`),h.render=y!==!1?function(){let p=arguments.length>1?arguments[1]:void 0;return n.adapter.mergedRowExpandable(p)?n.renderExpandIcon(p):null}:()=>null,h},this.addFnsInColumn=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefixCls:h}=n.props;if(u&&(u.sorter||u.filters||u.onFilter||u.useFullRender)){let g=typeof u.sorter=="function"||u.sorter===!0,m=Array.isArray(u.filters)&&u.filters.length||L.isValidElement(u.filterDropdown)||typeof u.renderFilterDropdown=="function",y=!1;const f=!("sortOrder"in u)&&u.showSortTip===!0,{dataIndex:S,title:v,useFullRender:w}=u,_=g&&!m&&!w,O=n.foundation.getQuery(S),I={},E=[];w&&(I.selection=n.renderSelection(null,!0));const k=x(O,"sortOrder"),N=x(O,"defaultSortOrder",!1),P=n.foundation.isSortOrderValid(k)?k:N,A=Zs(u.ellipsis),F=typeof v!="function"&&b.createElement("span",{className:`${h}-row-head-title`,key:B.DEFAULT_KEY_COLUMN_TITLE,title:A&&typeof v=="string"?v:void 0},v);if(g){const W=b.createElement(Js,{key:B.DEFAULT_KEY_COLUMN_SORTER,sortOrder:P,sortIcon:u.sortIcon,onClick:w||m?G=>n.foundation.handleSort(u,G):null,title:F,showTooltip:!_&&f});w&&(I.sorter=W),y=!0,E.push(W)}else E.push(F);const K=x(O,"filteredValue"),z=x(O,"defaultFilteredValue"),q=K||z;if(m){const W=b.createElement(Cu,Object.assign({key:B.DEFAULT_KEY_COLUMN_FILTER},ye(O,"children"),{filteredValue:q,onFilterDropdownVisibleChange:G=>n.foundation.toggleShowFilter(S,G),onSelect:G=>n.foundation.handleFilterSelect(S,G)}));w&&(I.filter=W),y=!0,E.push(W)}const V=typeof v=="function"?()=>v(I):y?b.createElement("div",{className:`${h}-operate-wrapper`},E):E;u=Object.assign(Object.assign({},u),{title:V}),_&&(u.clickToSort=W=>{n.foundation.handleSort(u,W,!0)},u.mouseDown=n.foundation.handleMouseDown,u.sortOrder=P,u.showSortTip=f)}return u},this.toggleSelectRow=(u,h,g)=>{this.foundation.handleSelectRow(h,u,g)},this.handleRowClickSelection=(u,h,g)=>{const{rowSelection:m}=this.state;if(x(m,"clickRow",!1)&&m){const p=x(m,"disabled",!1),f=x(m,"getCheckboxProps");if(p)return;const S=this.cachedFilteredSortedDataSource.find(v=>this.foundation.getRecordKey(v)===u);if(S&&typeof f=="function"&&f(S).disabled)return;this.foundation.handleSelectRow(u,h,g)}},this.toggleSelectAllRow=(u,h)=>{this.foundation.handleSelectAllRow(u,h)},this.renderPagination=(u,h)=>{if(!u)return null;const g=this.foundation.memoizedPagination(u);return b.createElement(Ee,{componentName:"Table"},m=>{const y=this.foundation.formatPaginationInfo(g,m.pageText);return b.createElement(Qs,{info:y,pagination:g,renderPagination:h})})},this.renderTitle=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{title:h}=u;const{prefixCls:g,dataSource:m}=u;return typeof h=="function"&&(h=h(m)),L.isValidElement(h)||typeof h=="string"?b.createElement("div",{className:`${g}-title`,"x-semi-prop":"title"},h):null},this.renderEmpty=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{prefixCls:h,empty:g,dataSource:m}=u,y=`${h}-placeholder`;return n.foundation.isEmpty(m)?b.createElement(Ee,{componentName:"Table",key:"emptyText"},(f,S)=>b.createElement("div",{className:y},b.createElement("div",{className:`${h}-empty`,"x-semi-prop":"empty"},g||f.emptyText))):null},this.renderFooter=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{footer:h}=u;const{prefixCls:g,dataSource:m}=u;return typeof h=="function"&&(h=h(m)),L.isValidElement(h)||typeof h=="string"?b.createElement("div",{className:`${g}-footer`,key:"footer","x-semi-prop":"footer"},h):null},this.renderMainTable=u=>{const h=this.adapter.useFixedHeader(),g=this.renderEmpty(u);return[this.renderTable(Object.assign(Object.assign({},u),{fixed:!1,useFixedHeader:h,headerRef:this._cacheHeaderRef,bodyRef:this.bodyWrapRef,includeHeader:!h,emptySlot:g})),this.renderFooter(u)]},this.renderTable=u=>{const{columns:h,filteredColumns:g,fixed:m,useFixedHeader:y,scroll:p,prefixCls:f,anyColumnFixed:S,includeHeader:v,showHeader:w,components:_,headerRef:O,bodyRef:I,onHeaderRow:E,rowSelection:k,dataSource:N,bodyHasScrollBar:P,disabledRowKeysSet:A,sticky:F}=u,K=x(k,"selectedRowKeysSet",new Set),z=this.adapter.getTableLayout(),q=m||y?b.createElement(Pu,{key:"head",tableLayout:z,ref:O,columns:g,prefixCls:f,fixed:m,handleBodyScroll:this.handleBodyScrollLeft,components:_,scroll:p,showHeader:w,selectedRowKeysSet:K,onHeaderRow:E,dataSource:N,bodyHasScrollBar:P,sticky:F}):null,V=b.createElement(Gu,Object.assign({},ye(u,["rowSelection","headWidths"]),{key:"body",ref:I,columns:g,fixed:m,prefixCls:f,handleWheel:this.handleWheel,handleBodyScroll:this.handleBodyScroll,anyColumnFixed:S,tableLayout:z,includeHeader:v,showHeader:w,scroll:p,components:_,store:this.store,selectedRowKeysSet:K,disabledRowKeysSet:A}));return[q,V]},this.handleColumns=(u,h)=>{const{hideExpandedColumn:g,scroll:m,prefixCls:y,expandCellFixed:p,expandIcon:f,rowSelection:S}=this.props,v="children";let w=we(h);const _=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Array.isArray(O)&&O.length&&le(O,(I,E,k)=>{const N=n.addFnsInColumn(I),P=I[v];if(Array.isArray(P)&&P.length){const A=[...P];_(A),N[v]=A}k[E]=N})};if(_(w),!g){const O=this.normalizeExpandColumn({prefixCls:y,expandCellFixed:p,expandIcon:f}),I=Ze(w,E=>E.key===B.DEFAULT_KEY_COLUMN_EXPAND);O&&(I>-1?w[I]=Object.assign(Object.assign({},O),w[I]):O.fixed==="right"?w=[...w,O]:w=[O,...w])}if(S&&!x(S,"hidden")){const O=Ze(w,E=>E.key===B.DEFAULT_KEY_COLUMN_SELECTION),I=this.normalizeSelectionColumn({rowSelection:S,prefixCls:y});O>-1?w[O]=Object.assign(Object.assign({},I),w[O]):I.fixed==="right"?w=[...w,I]:w=[I,...w]}return Wt(w),w},this.normalizeColumns=(u,h)=>we(this.getColumns(u,h)),this.mergePagination=u=>{const h=u==null?void 0:u.onChange,{scroll:g}=this.props;return x(g,"scrollToFirstRowOnChange")?Object.assign(Object.assign({},u),{onChange:(f,S)=>{this.foundation.setPage(f,S),typeof h=="function"&&h(f,S)}}):Object.assign({onChange:this.foundation.setPage},u)},this.foundation=new vt(this.adapter);const s=this.getColumns(e.columns,e.children),r=Ye(s),o=vt.initColumnsFilteredValueAndSorterOrder(we(r)),l=this.foundation.getFilteredSortedDataSource(this.props.dataSource,o),c=bd(this.props.pagination)?this.props.pagination:{},d=this.foundation.getCurrentPageData(l,c,o);this.state={cachedColumns:s,cachedChildren:e.children,flattenColumns:r,components:Ro(e.components,e.virtualized),queries:o,dataSource:d.dataSource,flattenData:[],expandedRowKeys:[...e.expandedRowKeys||[],...e.defaultExpandedRowKeys||[]],rowSelection:e.rowSelection?Re(e.rowSelection)?Object.assign({},e.rowSelection):{}:null,pagination:d.pagination,groups:null,allRowKeys:[],disabledRowKeys:[],disabledRowKeysSet:new Set,allDisabledRowKeys:[],allDisabledRowKeysSet:new Set,headWidths:[],bodyHasScrollBar:!1,prePropRowSelection:void 0,prePagination:void 0,halfCheckedRowKeys:[],halfCheckedRowKeysSet:new Set,keyEntities:{}},this.rootWrapRef=L.createRef(),this.wrapRef=L.createRef(),this.bodyWrapRef=L.createRef(),this.headerWrapRef=L.createRef(),this.store=new lu({hoveredRowKey:null,hoveredRowKeys:[]}),this.debouncedWindowResize=ul(this.handleWindowResize,150),this.cachedFilteredSortedDataSource=[],this.cachedFilteredSortedRowKeys=[],this.cachedFilteredSortedRowKeysSet=new Set,this.resizeObserver=null,this.hasBindWindowResize=!1}static getDerivedStateFromProps(e,t){const n={},{rowSelection:s,dataSource:r,childrenRecordName:o,rowKey:l,pagination:c}=e;if(e.columns&&e.children&&bt.warn("columns should not given by object and children at the same time"),e.columns&&e.columns!==t.cachedColumns){const d=Ye(e.columns);n.flattenColumns=d,n.queries=Ts(t.queries,d,null,!1),n.cachedColumns=e.columns,n.cachedChildren=null}else if(e.children&&e.children!==t.cachedChildren){const d=Ut(e.children),u=Ye(d),h=Ts(t.queries,u,null,!1);n.flattenColumns=u,n.queries=[...h],n.cachedColumns=[...d],n.cachedChildren=e.children}if(s!==t.prePropRowSelection){let d={};Re(t.rowSelection)&&(d=Object.assign(Object.assign({},d),t.rowSelection)),Re(s)&&(d=Object.assign(Object.assign({},d),s));const u=x(s,"selectedRowKeys"),h=x(s,"getCheckboxProps");if(u&&Array.isArray(u)&&(d.selectedRowKeysSet=new Set(u)),ue(h)){const g=Qi({dataSource:r,getCheckboxProps:h,childrenRecordName:o,rowKey:l}),m=new Set(g);n.disabledRowKeys=g,n.disabledRowKeysSet=m,n.allDisabledRowKeys=g,n.allDisabledRowKeysSet=m}n.rowSelection=d,n.prePropRowSelection=s}if(c!==t.prePagination){let d={};Re(t.pagination)&&(d=Object.assign(Object.assign({},d),t.pagination)),Re(c)&&(d=Object.assign(Object.assign({},d),c)),n.pagination=d,n.prePagination=c}return n}componentDidMount(){super.componentDidMount(),this.setScrollPosition("left");const{dataSource:e,childrenRecordName:t}=this.props;if(x(this.state.rowSelection,"checkRelation","unRelated")==="related"&&e&&e.length){const s=this.foundation.buildKeyEntities(e);this.adapter.setKeyEntities(s)}typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>this.setScrollPositionClassName()):setTimeout(()=>this.setScrollPositionClassName(),0),this.syncResizeListeners()}componentDidUpdate(e,t){const{dataSource:n,expandedRowKeys:s,expandAllRows:r,expandAllGroupRows:o,virtualized:l,components:c,pagination:d}=this.props,{pagination:u,queries:h,cachedColumns:g,cachedChildren:m,groups:y}=this.state,p={};this._warnIfNoKey(),Array.isArray(s)&&s!==e.expandedRowKeys&&this.setState({expandedRowKeys:s}),(c!==e.components||l!==e.virtualized)&&this.setState({components:Ro(c,l)}),(r!==e.expandAllRows||o!==e.expandAllGroupRows)&&this.foundation.initExpandedRowKeys({groups:y});const f=x(this.props.rowSelection,"getCheckboxProps"),S=x(e.rowSelection,"getCheckboxProps");if(n!==e.dataSource||h!==t.queries||f!==S){const v=[...n],w=this.foundation.getFilteredSortedDataSource(v,h),_=this.foundation.getAllDisabledRowKeys(w);if(this.foundation.setCachedFilteredSortedDataSource(w),this.foundation.setAllDisabledRowKeys(_),p.dataSource=w,x(this.state.rowSelection,"checkRelation","unRelated")==="related"){const I=this.foundation.buildKeyEntities(v);this.adapter.setKeyEntities(I)}this.props.groupBy&&(p.groups=null)}if(n!==e.dataSource&&(p.pagination=Re(u)?Object.assign(Object.assign({},u),{currentPage:Re(d)&&d.currentPage?d.currentPage:1}):u),Object.keys(p).length){const{pagination:v=null,queries:w=null,dataSource:_=null}=p,O=this.foundation.getCurrentPageData(_,v,w);this.adapter.setAllRowKeys(O.allRowKeys),this.adapter.setDisabledRowKeys(O.disabledRowKeys),"dataSource"in p&&((this.props.defaultExpandAllRows&&O.groups&&O.groups.size||this.props.expandAllRows||this.props.expandAllGroupRows)&&this.foundation.initExpandedRowKeys(O),p.pagination=O.pagination);const I=Object.keys(p);for(const E of I)this.setState({[E]:O[E]})}this.syncResizeListeners()}componentWillUnmount(){super.componentWillUnmount(),this.unbindWindowResize(),this.debouncedWindowResize&&(this.debouncedWindowResize.cancel(),this.debouncedWindowResize=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}render(){let e=this.props,{scroll:t,prefixCls:n,className:s,style:r={},bordered:o,id:l,pagination:c,virtualized:d,size:u,renderPagination:h,getVirtualizedListRef:g,loading:m,hideExpandedColumn:y,rowSelection:p}=e,f=Yu(e,["scroll","prefixCls","className","style","bordered","id","pagination","virtualized","size","renderPagination","getVirtualizedListRef","loading","hideExpandedColumn","rowSelection"]),{rowSelection:S,expandedRowKeys:v,headWidths:w,tableWidth:_,pagination:O,dataSource:I,queries:E,cachedColumns:k,bodyHasScrollBar:N}=this.state;r=Object.assign({},r);let P;if(this.adapter.isAnyColumnUseFullRender(E))P=this.handleColumns(E,k);else{const oe=p&&!x(p,"hidden");P=this.foundation.memoizedWithFnsColumns(E,k,oe,y,N)}const A=this.foundation.memoizedFilterColumns(P),F=this.foundation.memoizedFlattenFnsColumns(P),K=this.adapter.isAnyColumnFixed(P),z=Object.assign(Object.assign(Object.assign({},f),this.state),{virtualized:d,scroll:t,prefixCls:n,size:u,hideExpandedColumn:y,columns:P,anyColumnFixed:K,rowExpandable:this.mergedRowExpandable,pagination:O,dataSource:I,rowSelection:S,expandedRowKeys:v,renderExpandIcon:this.renderExpandIcon,filteredColumns:A}),q=x(t,"x"),V=x(t,"y");d&&typeof r.width!="number"&&(r.width=q);const W=M({[`${n}-${B.SIZE_SMALL}`]:u===B.SIZE_SMALL,[`${n}-${B.SIZE_MIDDLE}`]:u===B.SIZE_MIDDLE,[`${n}-virtualized`]:!!d,[`${n}-bordered`]:o,[`${n}-fixed-header`]:!!V,[`${n}-scroll-position-left`]:["both","left"].includes(this.position),[`${n}-scroll-position-right`]:["both","right"].includes(this.position)}),G=O&&c?this.renderPagination(O,h):null,se=x(c,"position","bottom"),Q=Object.assign(Object.assign({},this.context),{headWidths:w,tableWidth:_,anyColumnFixed:K,flattenedColumns:F,renderExpandIcon:this.renderExpandIcon,renderSelection:this.renderSelection,setHeadWidths:this.setHeadWidths,getHeadWidths:this.getHeadWidths,getCellWidths:this.getCellWidths,handleRowExpanded:this.handleRowExpanded,getVirtualizedListRef:g,setBodyHasScrollbar:this.setBodyHasScrollbar,handleRowSelection:this.handleRowClickSelection,headerStyle:z.headerStyle,rowSpanHover:z.rowSpanHover}),pe=this.getDataAttr(f);return b.createElement("div",Object.assign({ref:this.rootWrapRef,className:M(s,`${n}-wrapper`,`${n}-wrapper-${z.direction}`),"data-column-fixed":K,style:r,id:l},pe),b.createElement(Su,Object.assign({},Q,{direction:z.direction}),b.createElement(mi,{spinning:m,size:"large"},b.createElement("div",{ref:this.wrapRef,className:W},b.createElement(b.Fragment,{key:"pagination-top"},["top","both"].includes(se)?G:null),this.renderTitle({title:z.title,dataSource:z.dataSource,prefixCls:z.prefixCls}),b.createElement("div",{className:`${n}-container`},this.renderMainTable(Object.assign({},z))),b.createElement(b.Fragment,{key:"pagination-bottom"},["bottom","both"].includes(se)?G:null)))))}};ot.contextType=ke;ot.propTypes={className:a.string,style:a.object,prefixCls:a.string,components:a.any,bordered:a.bool,loading:a.bool,size:a.oneOf(B.SIZES),tableLayout:a.oneOf(B.LAYOUTS),columns:a.arrayOf(a.shape(ea)),hideExpandedColumn:a.bool,id:a.string,expandIcon:a.oneOfType([a.bool,a.func,a.node]),expandCellFixed:a.oneOf(B.FIXED_SET),title:a.oneOfType([a.string,a.node,a.func]),onHeaderRow:a.func,showHeader:a.bool,indentSize:a.number,rowKey:a.oneOfType([a.func,a.string,a.number]),onRow:a.func,onExpandedRowsChange:a.func,onExpand:a.func,rowExpandable:a.func,expandedRowRender:a.func,expandedRowKeys:a.array,defaultExpandAllRows:a.bool,expandAllRows:a.bool,defaultExpandAllGroupRows:a.bool,expandAllGroupRows:a.bool,defaultExpandedRowKeys:a.array,pagination:a.oneOfType([a.object,a.bool]),renderPagination:a.func,footer:a.oneOfType([a.func,a.string,a.node]),empty:a.node,dataSource:a.array,childrenRecordName:a.string,rowSelection:a.oneOfType([a.object,a.bool]),onChange:a.func,scroll:a.shape({x:a.oneOfType([a.number,a.string,a.bool]),y:a.oneOfType([a.number,a.string])}),groupBy:a.oneOfType([a.string,a.number,a.func]),headerStyle:a.object,renderGroupSection:a.oneOfType([a.func]),onGroupedRow:a.func,clickGroupedRowToExpand:a.bool,virtualized:a.oneOfType([a.object,a.bool]),dropdownPrefixCls:a.string,expandRowByClick:a.bool,getVirtualizedListRef:a.func,rowSpanHover:a.bool};ot.defaultProps={tableLayout:"",dataSource:[],prefixCls:ce.PREFIX,rowSelection:null,className:"",childrenRecordName:"children",size:"default",loading:!1,bordered:!1,expandCellFixed:!1,hideExpandedColumn:!0,showHeader:!0,indentSize:ne.DEFAULT_INDENT_WIDTH,onChange:H,pagination:!0,rowKey:"key",defaultExpandedRowKeys:[],defaultExpandAllRows:!1,defaultExpandAllGroupRows:!1,expandAllRows:!1,expandAllGroupRows:!1,onFilterDropdownVisibleChange:H,onExpand:H,onExpandedRowsChange:H,expandRowByClick:!1};var gs,Mo;function Xu(){if(Mo)return gs;Mo=1;var i=ai();function e(t,n,s){var r=t.length;return s=s===void 0?r:s,!n&&s>=r?t:i(t,n,s)}return gs=e,gs}var ms,jo;function Zu(){if(jo)return ms;jo=1;var i=Xa(),e=Za(),t="[object RegExp]";function n(s){return e(s)&&i(s)==t}return ms=n,ms}var bs,zo;function Qu(){if(zo)return bs;zo=1;var i=Zu(),e=di(),t=Qa(),n=t&&t.isRegExp,s=n?e(n):i;return bs=s,bs}var ys,Fo;function Ju(){if(Fo)return ys;Fo=1;function i(e){return e.split("")}return ys=i,ys}var Ss,Ko;function eh(){if(Ko)return Ss;Ko=1;var i="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",s=e+t+n,r="\\ufe0e\\ufe0f",o="["+i+"]",l="["+s+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+c+")",u="[^"+i+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",m="\\u200d",y=d+"?",p="["+r+"]?",f="(?:"+m+"(?:"+[u,h,g].join("|")+")"+p+y+")*",S=p+y+f,v="(?:"+[u+l+"?",l,h,g,o].join("|")+")",w=RegExp(c+"(?="+c+")|"+v+S,"g");function _(O){return O.match(w)||[]}return Ss=_,Ss}var ws,$o;function th(){if($o)return ws;$o=1;var i=Ju(),e=nr(),t=eh();function n(s){return e(s)?t(s):i(s)}return ws=n,ws}var vs,Bo;function nh(){if(Bo)return vs;Bo=1;var i=Ja(),e=Xu(),t=nr(),n=Ns(),s=Qu(),r=th(),o=el(),l=4294967295;function c(d,u,h){return h&&typeof h!="number"&&n(d,u,h)&&(u=h=void 0),h=h===void 0?l:h>>>0,h?(d=o(d),d&&(typeof u=="string"||u!=null&&!s(u))&&(u=i(u),!u&&t(d))?e(r(d),0,h):d.split(u,h)):[]}return vs=c,vs}var sh=nh();const aa=te(sh);function rh(i){const e=aa(i,/\s+/);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];const r=Je(n,o=>!e.includes(o));return M(i,...r)}function oh(i){const e=aa(i,/\s+/);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Bt(n,r=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}),M(...e)}var ct={exports:{}},dt={},ut={exports:{}},Tt={exports:{}},Ho;function ih(){if(Ho)return Tt.exports;Ho=1;function i(t){var n,s,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(s=i(t[n]))&&(r&&(r+=" "),r+=s)}else for(s in t)t[s]&&(r&&(r+=" "),r+=s);return r}function e(){for(var t,n,s=0,r="",o=arguments.length;s<o;s++)(t=arguments[s])&&(n=i(t))&&(r&&(r+=" "),r+=n);return r}return Tt.exports=e,Tt.exports.clsx=e,Tt.exports}var Cs,Wo;function ah(){if(Wo)return Cs;Wo=1;var i={},e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,r=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,l=(C,R)=>{for(var T in R)t(C,T,{get:R[T],enumerable:!0})},c=(C,R,T,D)=>{if(R&&typeof R=="object"||typeof R=="function")for(let j of s(R))!o.call(C,j)&&j!==T&&t(C,j,{get:()=>R[j],enumerable:!(D=n(R,j))||D.enumerable});return C},d=(C,R,T)=>(T=C!=null?e(r(C)):{},c(!C||!C.__esModule?t(T,"default",{value:C,enumerable:!0}):T,C)),u=C=>c(t({},"__esModule",{value:!0}),C),h={};l(h,{DraggableCore:()=>Le,default:()=>Rt}),Cs=u(h);var g=d(St()),m=d(zt()),y=d(pr()),p=ih();function f(C,R){for(let T=0,D=C.length;T<D;T++)if(R.apply(R,[C[T],T,C]))return C[T]}function S(C){return typeof C=="function"||Object.prototype.toString.call(C)==="[object Function]"}function v(C){return typeof C=="number"&&!isNaN(C)}function w(C){return parseInt(C,10)}function _(C,R,T){if(C[R])return new Error(`Invalid prop ${R} passed to ${T} - do not set this, set it on the child.`)}var O=["Moz","Webkit","O","ms"];function I(C="transform"){var R,T;if(typeof window>"u")return"";const D=(T=(R=window.document)==null?void 0:R.documentElement)==null?void 0:T.style;if(!D||C in D)return"";for(let j=0;j<O.length;j++)if(E(C,O[j])in D)return O[j];return""}function E(C,R){return R?`${R}${k(C)}`:C}function k(C){let R="",T=!0;for(let D=0;D<C.length;D++)T?(R+=C[D].toUpperCase(),T=!1):C[D]==="-"?T=!0:R+=C[D];return R}var N=I(),P="";function A(C,R){var T;P||(P=(T=f(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(j){return S(C[j])}))!=null?T:"");const D=C[P];return S(D)?!!D.call(C,R):!1}function F(C,R,T){let D=C;do{if(A(D,R))return!0;if(D===T)return!1;D=D.parentNode}while(D);return!1}function K(C,R,T,D){if(!C)return;const j={capture:!0,...D},J=T;C.addEventListener?C.addEventListener(R,J,j):C.attachEvent?C.attachEvent("on"+R,J):C["on"+R]=J}function z(C,R,T,D){if(!C)return;const j={capture:!0,...D},J=T;C.removeEventListener?C.removeEventListener(R,J,j):C.detachEvent?C.detachEvent("on"+R,J):C["on"+R]=null}function q(C){let R=C.clientHeight;const T=C.ownerDocument.defaultView.getComputedStyle(C);return R+=w(T.borderTopWidth),R+=w(T.borderBottomWidth),R}function V(C){let R=C.clientWidth;const T=C.ownerDocument.defaultView.getComputedStyle(C);return R+=w(T.borderLeftWidth),R+=w(T.borderRightWidth),R}function W(C){let R=C.clientHeight;const T=C.ownerDocument.defaultView.getComputedStyle(C);return R-=w(T.paddingTop),R-=w(T.paddingBottom),R}function G(C){let R=C.clientWidth;const T=C.ownerDocument.defaultView.getComputedStyle(C);return R-=w(T.paddingLeft),R-=w(T.paddingRight),R}function se(C,R,T){const j=R===R.ownerDocument.body?{left:0,top:0}:R.getBoundingClientRect(),J=(C.clientX+R.scrollLeft-j.left)/T,Y=(C.clientY+R.scrollTop-j.top)/T;return{x:J,y:Y}}function Q(C,R){const T=oe(C,R,"px");return{[E("transform",N)]:T}}function pe(C,R){return oe(C,R,"")}function oe({x:C,y:R},T,D){let j=`translate(${C}${D},${R}${D})`;if(T){const J=`${typeof T.x=="string"?T.x:T.x+D}`,Y=`${typeof T.y=="string"?T.y:T.y+D}`;j=`translate(${J}, ${Y})`+j}return j}function de(C,R){return C.targetTouches&&f(C.targetTouches,T=>R===T.identifier)||C.changedTouches&&f(C.changedTouches,T=>R===T.identifier)}function ie(C){if(C.targetTouches&&C.targetTouches[0])return C.targetTouches[0].identifier;if(C.changedTouches&&C.changedTouches[0])return C.changedTouches[0].identifier}function Ot(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0}function ha(C,R){if(!C)return;let T=C.getElementById("react-draggable-style-el");if(!T){T=C.createElement("style"),T.type="text/css",T.id="react-draggable-style-el";const D=R??Ot();D&&T.setAttribute("nonce",D),T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,C.getElementsByTagName("head")[0].appendChild(T)}C.body&&pa(C.body,"react-draggable-transparent-selection")}function or(C){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ir(C)}):ir(C)}function ir(C){if(C)try{C.body&&fa(C.body,"react-draggable-transparent-selection");const R=C.selection;if(R)R.empty();else{const T=(C.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function pa(C,R){C.classList?C.classList.add(R):C.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(C.className+=` ${R}`)}function fa(C,R){C.classList?C.classList.remove(R):C.className=C.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}function ga(C,R,T){if(!C.props.bounds)return[R,T];let{bounds:D}=C.props;D=typeof D=="string"?D:ya(D);const j=fn(C);if(typeof D=="string"){const{ownerDocument:J}=j,Y=J.defaultView;if(!Y)throw new Error("Cannot resolve the owner window of the draggable node.");let ee;if(D==="parent"?ee=j.parentNode:ee=j.getRootNode().querySelector(D),!(ee instanceof Y.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const fe=ee,Me=Y.getComputedStyle(j),Ue=Y.getComputedStyle(fe);D={left:-j.offsetLeft+w(Ue.paddingLeft)+w(Me.marginLeft),top:-j.offsetTop+w(Ue.paddingTop)+w(Me.marginTop),right:G(fe)-V(j)-j.offsetLeft+w(Ue.paddingRight)-w(Me.marginRight),bottom:W(fe)-q(j)-j.offsetTop+w(Ue.paddingBottom)-w(Me.marginBottom)}}return v(D.right)&&(R=Math.min(R,D.right)),v(D.bottom)&&(T=Math.min(T,D.bottom)),v(D.left)&&(R=Math.max(R,D.left)),v(D.top)&&(T=Math.max(T,D.top)),[R,T]}function ar(C,R,T){const D=Math.round(R/C[0])*C[0],j=Math.round(T/C[1])*C[1];return[D,j]}function ma(C){return C.props.axis==="both"||C.props.axis==="x"}function ba(C){return C.props.axis==="both"||C.props.axis==="y"}function un(C,R,T){const D=typeof R=="number"?de(C,R):null;if(typeof R=="number"&&!D)return null;const j=fn(T),J=T.props.offsetParent||j.offsetParent||j.ownerDocument.body;return se(D||C,J,T.props.scale)}function hn(C,R,T){const D=!v(C.lastX),j=fn(C);return D?{node:j,deltaX:0,deltaY:0,lastX:R,lastY:T,x:R,y:T}:{node:j,deltaX:R-C.lastX,deltaY:T-C.lastY,lastX:C.lastX,lastY:C.lastY,x:R,y:T}}function pn(C,R){const T=C.props.scale;return{node:R.node,x:C.state.x+R.deltaX/T,y:C.state.y+R.deltaY/T,deltaX:R.deltaX/T,deltaY:R.deltaY/T,lastX:C.state.x,lastY:C.state.y}}function ya(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function fn(C){const R=C.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}var gn=d(St()),ae=d(zt()),Sa=d(pr());function Se(...C){i.DRAGGABLE_DEBUG&&console.log(...C)}var me={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Ie=me.mouse,Le=class extends gn.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&(typeof C.button=="number"&&C.button!==0||C.ctrlKey))return!1;const R=this.findDOMNode();if(!R||!R.ownerDocument||!R.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:T}=R;if(this.props.disabled||!(C.target instanceof T.defaultView.Node)||this.props.handle&&!F(C.target,this.props.handle,R)||this.props.cancel&&F(C.target,this.props.cancel,R))return;C.type==="touchstart"&&!this.props.allowMobileScroll&&C.preventDefault();const D=ie(C);this.touchIdentifier=D;const j=un(C,D,this);if(j==null)return;const{x:J,y:Y}=j,ee=hn(this,J,Y);Se("DraggableCore: handleDragStart: %j",ee),Se("calling",this.props.onStart),!(this.props.onStart(C,ee)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ha(T,this.props.nonce),this.dragging=!0,this.lastX=J,this.lastY=Y,K(T,Ie.move,this.handleDrag),K(T,Ie.stop,this.handleDragStop))},this.handleDrag=C=>{const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let Y=T-this.lastX,ee=D-this.lastY;if([Y,ee]=ar(this.props.grid,Y,ee),!Y&&!ee)return;T=this.lastX+Y,D=this.lastY+ee}const j=hn(this,T,D);if(Se("DraggableCore: handleDrag: %j",j),this.props.onDrag(C,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const Y=document.createEvent("MouseEvents");Y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Y)}return}this.lastX=T,this.lastY=D},this.handleDragStop=C=>{if(!this.dragging)return;const R=un(C,this.touchIdentifier,this);if(R==null)return;let{x:T,y:D}=R;if(Array.isArray(this.props.grid)){let ee=T-this.lastX||0,fe=D-this.lastY||0;[ee,fe]=ar(this.props.grid,ee,fe),T=this.lastX+ee,D=this.lastY+fe}const j=hn(this,T,D);if(this.props.onStop(C,j)===!1||this.mounted===!1)return!1;const Y=this.findDOMNode();Y&&this.props.enableUserSelectHack&&or(Y.ownerDocument),Se("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,Y&&(Se("DraggableCore: Removing handlers"),z(Y.ownerDocument,Ie.move,this.handleDrag),z(Y.ownerDocument,Ie.stop,this.handleDragStop))},this.onMouseDown=C=>(Ie=me.mouse,this.handleDragStart(C)),this.onMouseUp=C=>(Ie=me.mouse,this.handleDragStop(C)),this.onTouchStart=C=>(Ie=me.touch,this.handleDragStart(C)),this.onTouchEnd=C=>(Ie=me.touch,this.handleDragStop(C))}componentDidMount(){this.mounted=!0;const C=this.findDOMNode();C&&K(C,me.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const C=this.findDOMNode();if(C){const{ownerDocument:R}=C;z(R,me.mouse.move,this.handleDrag),z(R,me.touch.move,this.handleDrag),z(R,me.mouse.stop,this.handleDragStop),z(R,me.touch.stop,this.handleDragStop),z(C,me.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&or(R)}}findDOMNode(){var C;if((C=this.props)!=null&&C.nodeRef)return this.props.nodeRef.current;const R=Sa.default;return typeof R.findDOMNode=="function"?R.findDOMNode(this):(Se("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return gn.cloneElement(gn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Le.displayName="DraggableCore",Le.propTypes={allowAnyClick:ae.default.bool,allowMobileScroll:ae.default.bool,children:ae.default.node.isRequired,disabled:ae.default.bool,enableUserSelectHack:ae.default.bool,offsetParent:function(C,R){if(C[R]&&C[R].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ae.default.arrayOf(ae.default.number),handle:ae.default.string,cancel:ae.default.string,nodeRef:ae.default.object,nonce:ae.default.string,onStart:ae.default.func,onDrag:ae.default.func,onStop:ae.default.func,onMouseDown:ae.default.func,scale:ae.default.number,className:_,style:_,transform:_},Le.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Rt=class extends g.Component{constructor(C){super(C),this.onDragStart=(R,T)=>{if(Se("Draggable: onDragStart: %j",T),this.props.onStart(R,pn(this,T))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(R,T)=>{if(!this.state.dragging)return!1;Se("Draggable: onDrag: %j",T);const D=pn(this,T),j={x:D.x,y:D.y,slackX:0,slackY:0};if(this.props.bounds){const{x:Y,y:ee}=j;j.x+=this.state.slackX,j.y+=this.state.slackY;const[fe,Me]=ga(this,j.x,j.y);j.x=fe,j.y=Me,j.slackX=this.state.slackX+(Y-j.x),j.slackY=this.state.slackY+(ee-j.y),D.x=j.x,D.y=j.y,D.deltaX=j.x-this.state.x,D.deltaY=j.y-this.state.y}if(this.props.onDrag(R,D)===!1)return!1;this.setState(j)},this.onDragStop=(R,T)=>{if(!this.state.dragging||this.props.onStop(R,pn(this,T))===!1)return!1;Se("Draggable: onDragStop: %j",T);const j={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:Y,y:ee}=this.props.position;j.x=Y,j.y=ee}this.setState(j)},this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:C},{prevPropsPosition:R}){return C&&(!R||C.x!==R.x||C.y!==R.y)?(Se("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:R}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var C;if((C=this.props)!=null&&C.nodeRef)return this.props.nodeRef.current;const R=y.default;return typeof R.findDOMNode=="function"?R.findDOMNode(this):null}render(){const{axis:C,bounds:R,children:T,defaultPosition:D,defaultClassName:j,defaultClassNameDragging:J,defaultClassNameDragged:Y,position:ee,positionOffset:fe,scale:Me,...Ue}=this.props;let mn={},lr=null;const cr=!!!ee||this.state.dragging,dr=ee||D,ur={x:ma(this)&&cr?this.state.x:dr.x,y:ba(this)&&cr?this.state.y:dr.y};this.state.isElementSVG?lr=pe(ur,fe):mn=Q(ur,fe);const bn=g.Children.only(T),wa=(0,p.clsx)(bn.props.className||"",j,{[J]:this.state.dragging,[Y]:this.state.dragged});return g.createElement(Le,{...Ue,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},g.cloneElement(bn,{className:wa,style:{...bn.props.style,...mn},transform:lr}))}};return Rt.displayName="Draggable",Rt.propTypes={...Le.propTypes,axis:m.default.oneOf(["both","x","y","none"]),bounds:m.default.oneOfType([m.default.shape({left:m.default.number,right:m.default.number,top:m.default.number,bottom:m.default.number}),m.default.string,m.default.oneOf([!1])]),defaultClassName:m.default.string,defaultClassNameDragging:m.default.string,defaultClassNameDragged:m.default.string,defaultPosition:m.default.shape({x:m.default.number,y:m.default.number}),positionOffset:m.default.shape({x:m.default.oneOfType([m.default.number,m.default.string]),y:m.default.oneOfType([m.default.number,m.default.string])}),position:m.default.shape({x:m.default.number,y:m.default.number}),className:_,style:_,transform:_},Rt.defaultProps={...Le.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1},Cs}var Uo;function la(){if(Uo)return ut.exports;Uo=1;const i=ah(),e=i.DraggableCore,t=i.default||i;return ut.exports=t,ut.exports.default=t,ut.exports.DraggableCore=e,ut.exports}var It={},Vo;function lh(){if(Vo)return It;Vo=1,It.__esModule=!0,It.cloneElement=l;var i=e(St());function e(c){return c&&c.__esModule?c:{default:c}}function t(c,d){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(c);d&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,h)}return u}function n(c){for(var d=1;d<arguments.length;d++){var u=arguments[d]!=null?arguments[d]:{};d%2?t(Object(u),!0).forEach(function(h){s(c,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):t(Object(u)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(u,h))})}return c}function s(c,d,u){return(d=r(d))in c?Object.defineProperty(c,d,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[d]=u,c}function r(c){var d=o(c,"string");return typeof d=="symbol"?d:d+""}function o(c,d){if(typeof c!="object"||!c)return c;var u=c[Symbol.toPrimitive];if(u!==void 0){var h=u.call(c,d);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(c)}function l(c,d){return d.style&&c.props.style&&(d.style=n(n({},c.props.style),d.style)),d.className&&c.props.className&&(d.className=c.props.className+" "+d.className),i.default.cloneElement(c,d)}return It}var ht={},qo;function ca(){if(qo)return ht;qo=1,ht.__esModule=!0,ht.resizableProps=void 0;var i=e(zt());la();function e(t){return t&&t.__esModule?t:{default:t}}return ht.resizableProps={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:typeof Element<"u"?i.default.instanceOf(Element):i.default.any,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const r=n[0];return r.axis==="both"||r.axis==="y"?i.default.number.isRequired(...n):i.default.number(...n)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const r=n[0];return r.axis==="both"||r.axis==="x"?i.default.number.isRequired(...n):i.default.number(...n)}},ht}var Go;function da(){if(Go)return dt;Go=1,dt.__esModule=!0,dt.default=void 0;var i=r(St()),e=la(),t=lh(),n=ca();const s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function r(y,p){if(typeof WeakMap=="function")var f=new WeakMap,S=new WeakMap;return(r=function(v,w){if(!w&&v&&v.__esModule)return v;var _,O,I={__proto__:null,default:v};if(v===null||typeof v!="object"&&typeof v!="function")return I;if(_=w?S:f){if(_.has(v))return _.get(v);_.set(v,I)}for(const E in v)E!=="default"&&{}.hasOwnProperty.call(v,E)&&((O=(_=Object.defineProperty)&&Object.getOwnPropertyDescriptor(v,E))&&(O.get||O.set)?_(I,E,O):I[E]=v[E]);return I})(y,p)}function o(){return o=Object.assign?Object.assign.bind():function(y){for(var p=1;p<arguments.length;p++){var f=arguments[p];for(var S in f)({}).hasOwnProperty.call(f,S)&&(y[S]=f[S])}return y},o.apply(null,arguments)}function l(y,p){if(y==null)return{};var f={};for(var S in y)if({}.hasOwnProperty.call(y,S)){if(p.indexOf(S)!==-1)continue;f[S]=y[S]}return f}function c(y,p){var f=Object.keys(y);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(y);p&&(S=S.filter(function(v){return Object.getOwnPropertyDescriptor(y,v).enumerable})),f.push.apply(f,S)}return f}function d(y){for(var p=1;p<arguments.length;p++){var f=arguments[p]!=null?arguments[p]:{};p%2?c(Object(f),!0).forEach(function(S){u(y,S,f[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(f)):c(Object(f)).forEach(function(S){Object.defineProperty(y,S,Object.getOwnPropertyDescriptor(f,S))})}return y}function u(y,p,f){return(p=h(p))in y?Object.defineProperty(y,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):y[p]=f,y}function h(y){var p=g(y,"string");return typeof p=="symbol"?p:p+""}function g(y,p){if(typeof y!="object"||!y)return y;var f=y[Symbol.toPrimitive];if(f!==void 0){var S=f.call(y,p);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(y)}let m=class extends i.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(p,f){const S=this.props,v=S.minConstraints,w=S.maxConstraints,_=S.lockAspectRatio;if(!v&&!w&&!_)return[p,f];if(_){const P=this.props.width/this.props.height,A=p-this.props.width,F=f-this.props.height;Math.abs(A)>Math.abs(F*P)?f=p/P:p=f*P}const O=p,I=f;let E=this.slack||[0,0],k=E[0],N=E[1];return p+=k,f+=N,v&&(p=Math.max(v[0],p),f=Math.max(v[1],f)),w&&(p=Math.min(w[0],p),f=Math.min(w[1],f)),this.slack=[k+(O-p),N+(I-f)],[p,f]}resizeHandler(p,f){return(S,v)=>{var w,_,O,I;let E=v.node,k=v.deltaX,N=v.deltaY;p==="onResizeStart"&&this.resetData();const P=(this.props.axis==="both"||this.props.axis==="x")&&f!=="n"&&f!=="s",A=(this.props.axis==="both"||this.props.axis==="y")&&f!=="e"&&f!=="w";if(!P&&!A)return;const F=f[0],K=f[f.length-1],z=E.getBoundingClientRect();if(this.lastHandleRect!=null){if(K==="w"){const ie=z.left-this.lastHandleRect.left;k+=ie}if(F==="n"){const ie=z.top-this.lastHandleRect.top;N+=ie}}this.lastHandleRect=z,K==="w"&&(k=-k),F==="n"&&(N=-N);const q=(w=(_=this.lastSize)==null?void 0:_.width)!=null?w:this.props.width,V=(O=(I=this.lastSize)==null?void 0:I.height)!=null?O:this.props.height;let W=q+(P?k/this.props.transformScale:0),G=V+(A?N/this.props.transformScale:0);var se=this.runConstraints(W,G);if(W=se[0],G=se[1],p==="onResizeStop"&&this.lastSize){var Q=this.lastSize;W=Q.width,G=Q.height}const pe=W!==q||G!==V;p!=="onResizeStop"&&(this.lastSize={width:W,height:G});const oe=typeof this.props[p]=="function"?this.props[p]:null;oe&&!(p==="onResize"&&!pe)&&(S.persist==null||S.persist(),oe(S,{node:E,size:{width:W,height:G},handle:f})),p==="onResizeStop"&&this.resetData()}}renderResizeHandle(p,f){const S=this.props.handle;if(!S)return i.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+p,ref:f});if(typeof S=="function")return S(p,f);const v=typeof S.type=="string",w=d({ref:f},v?{}:{handleAxis:p});return i.cloneElement(S,w)}render(){const p=this.props,f=p.children,S=p.className,v=p.draggableOpts;p.width,p.height,p.handle,p.handleSize,p.lockAspectRatio,p.axis,p.minConstraints,p.maxConstraints,p.onResize,p.onResizeStop,p.onResizeStart;const w=p.resizeHandles;p.transformScale;const _=l(p,s);return(0,t.cloneElement)(f,d(d({},_),{},{className:(S?S+" ":"")+"react-resizable",children:[...i.Children.toArray(f.props.children),...w.map(O=>{var I;const E=(I=this.handleRefs[O])!=null?I:this.handleRefs[O]=i.createRef();return i.createElement(e.DraggableCore,o({},v,{nodeRef:E,key:"resizableHandle-"+O,onStop:this.resizeHandler("onResizeStop",O),onStart:this.resizeHandler("onResizeStart",O),onDrag:this.resizeHandler("onResize",O)}),this.renderResizeHandle(O,E))})]}))}};return dt.default=m,m.propTypes=n.resizableProps,m.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},dt}var pt={},Yo;function ch(){if(Yo)return pt;Yo=1,pt.__esModule=!0,pt.default=void 0;var i=o(St()),e=r(zt()),t=r(da()),n=ca();const s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function r(p){return p&&p.__esModule?p:{default:p}}function o(p,f){if(typeof WeakMap=="function")var S=new WeakMap,v=new WeakMap;return(o=function(w,_){if(!_&&w&&w.__esModule)return w;var O,I,E={__proto__:null,default:w};if(w===null||typeof w!="object"&&typeof w!="function")return E;if(O=_?v:S){if(O.has(w))return O.get(w);O.set(w,E)}for(const k in w)k!=="default"&&{}.hasOwnProperty.call(w,k)&&((I=(O=Object.defineProperty)&&Object.getOwnPropertyDescriptor(w,k))&&(I.get||I.set)?O(E,k,I):E[k]=w[k]);return E})(p,f)}function l(){return l=Object.assign?Object.assign.bind():function(p){for(var f=1;f<arguments.length;f++){var S=arguments[f];for(var v in S)({}).hasOwnProperty.call(S,v)&&(p[v]=S[v])}return p},l.apply(null,arguments)}function c(p,f){var S=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);f&&(v=v.filter(function(w){return Object.getOwnPropertyDescriptor(p,w).enumerable})),S.push.apply(S,v)}return S}function d(p){for(var f=1;f<arguments.length;f++){var S=arguments[f]!=null?arguments[f]:{};f%2?c(Object(S),!0).forEach(function(v){u(p,v,S[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(S)):c(Object(S)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(S,v))})}return p}function u(p,f,S){return(f=h(f))in p?Object.defineProperty(p,f,{value:S,enumerable:!0,configurable:!0,writable:!0}):p[f]=S,p}function h(p){var f=g(p,"string");return typeof f=="symbol"?f:f+""}function g(p,f){if(typeof p!="object"||!p)return p;var S=p[Symbol.toPrimitive];if(S!==void 0){var v=S.call(p,f);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(p)}function m(p,f){if(p==null)return{};var S={};for(var v in p)if({}.hasOwnProperty.call(p,v)){if(f.indexOf(v)!==-1)continue;S[v]=p[v]}return S}let y=class extends i.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(f,S)=>{const v=S.size;this.props.onResize?(f.persist==null||f.persist(),this.setState(v,()=>this.props.onResize&&this.props.onResize(f,S))):this.setState(v)}}static getDerivedStateFromProps(f,S){return S.propsWidth!==f.width||S.propsHeight!==f.height?{width:f.width,height:f.height,propsWidth:f.width,propsHeight:f.height}:null}render(){const f=this.props,S=f.handle,v=f.handleSize;f.onResize;const w=f.onResizeStart,_=f.onResizeStop,O=f.draggableOpts,I=f.minConstraints,E=f.maxConstraints,k=f.lockAspectRatio,N=f.axis;f.width,f.height;const P=f.resizeHandles,A=f.style,F=f.transformScale,K=m(f,s);return i.createElement(t.default,{axis:N,draggableOpts:O,handle:S,handleSize:v,height:this.state.height,lockAspectRatio:k,maxConstraints:E,minConstraints:I,onResizeStart:w,onResize:this.onResize,onResizeStop:_,resizeHandles:P,transformScale:F,width:this.state.width},i.createElement("div",l({},K,{style:d(d({},A),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return pt.default=y,y.propTypes=d(d({},n.resizableProps),{},{children:e.default.element}),pt}var Xo;function dh(){return Xo||(Xo=1,ct.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ct.exports.Resizable=da().default,ct.exports.ResizableBox=ch().default),ct.exports}var uh=dh(),hh=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class ph extends b.PureComponent{render(){const e=this.props,{onResize:t,onResizeStart:n,onResizeStop:s,width:r,resize:o}=e,l=hh(e,["onResize","onResizeStart","onResizeStop","width","resize"]);if(typeof r!="number"||o===!1)return b.createElement("th",Object.assign({},l));let{children:c}=l;return c=b.Children.map(c,(d,u)=>b.createElement(b.Fragment,{key:u},d)),b.createElement(uh.Resizable,{width:r,height:0,onResize:t,onResizeStart:n,onResizeStop:s,draggableOpts:{enableUserSelectHack:!1},axis:"x"},b.createElement("th",Object.assign({},l),c))}}var fh=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const gh=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;const{components:t,columns:n,resizable:s}=i,r=fh(i,["components","columns","resizable"]),o="children",l=x(s,"onResize",H),c=x(s,"onResizeStart",H),d=x(s,"onResizeStop",H),u=Array.isArray(n)&&n.length?n:Ut(i.children),h=Wt(we(u),o),g=Wt(we(u),o);typeof i.expandedRowRender=="function"&&!i.hideExpandedColumn&&!We(h,E=>E.key===B.DEFAULT_KEY_COLUMN_EXPAND)&&g.unshift({key:B.DEFAULT_KEY_COLUMN_EXPAND,width:ne.DEFAULT_WIDTH_COLUMN_EXPAND}),i.rowSelection&&!x(i.rowSelection,"hidden")&&!We(h,E=>E.key===B.DEFAULT_KEY_COLUMN_SELECTION)&&g.unshift({width:x(i,"rowSelection.width",ne.DEFAULT_WIDTH_COLUMN_SELECTION),key:B.DEFAULT_KEY_COLUMN_SELECTION});const[m,y]=L.useState(g);L.useEffect(()=>{const E=ru(m,g);y(Ts(m,E))},[n,i.expandedRowRender,i.hideExpandedColumn,i.rowSelection]);const p=L.useMemo(()=>Zt({header:{cell:ph}},t),[t]),f=x(s,"handlerClassName","resizing"),S=E=>(k,N)=>{let{size:P}=N;const A=we(m),F=Mt(A,E,o);let K=Object.assign(Object.assign({},F),{width:P.width});const z=l(K)||{};K=Object.assign(Object.assign({},K),z),Object.assign(F,K),y(A)},v=E=>k=>{if(typeof window<"u"){const K=window.getSelection();K&&K.removeAllRanges()}const N=we(m),P=Mt(N,E,o);let A=Object.assign(Object.assign({},P),{className:rh(P.className,f)});const F=c(A)||{};A=Object.assign(Object.assign({},A),F),Object.assign(P,A),y(N)},w=E=>k=>{const N=we(m),P=Mt(N,E,o);let A=Object.assign(Object.assign({},P),{className:oh(P.className,f)});const F=d(A)||{};A=Object.assign(Object.assign({},A),F),Object.assign(P,A),y(N)},_=function(E,k){let N=arguments.length>3?arguments[3]:void 0;return Object.assign(Object.assign({},E),{onHeaderCell:P=>Object.assign(Object.assign({},N),{width:P.width,onResize:S(P),onResizeStart:v(P),onResizeStop:w(P)})})},O=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Array.isArray(E)&&E.length?E.map((N,P)=>{var A,F;const K=(F=(A=N.onHeaderCell)===null||A===void 0?void 0:A.call(N,N,P,k))!==null&&F!==void 0?F:{};Object.assign(N,_(N,P,k,K));const z=N[o];return Array.isArray(z)&&z.length&&(N[o]=O(z,k+1)),N}):[]},I=L.useMemo(()=>O(m),[m]);return b.createElement(ot,Object.assign({},r,{columns:I,components:p,ref:e}))},mh=b.forwardRef(gh);class it extends b.PureComponent{constructor(e){super(e),this.getCurrentPageData=()=>this.tableRef.current&&this.tableRef.current.getCurrentPageData(),this.tableRef=b.createRef()}render(){var e;const t=this.props,n=(e=this.props.direction)!==null&&e!==void 0?e:this.context.direction;return t.resizable?b.createElement(mh,Object.assign({},t,{ref:this.tableRef,direction:n})):b.createElement(ot,Object.assign({},t,{ref:this.tableRef,direction:n}))}}it.Column=rn;it.DEFAULT_KEY_COLUMN_SELECTION=B.DEFAULT_KEY_COLUMN_SELECTION;it.DEFAULT_KEY_COLUMN_EXPAND=B.DEFAULT_KEY_COLUMN_EXPAND;it.propTypes=Object.assign(Object.assign({},ot.propTypes),{resizable:a.oneOfType([a.bool,a.object])});it.defaultProps={hideExpandedColumn:!0};it.contextType=Ls;const U={TABS:`${X}-tabs`,TABS_BAR:`${X}-tabs-bar`,TABS_BAR_LINE:`${X}-tabs-bar-line`,TABS_BAR_CARD:`${X}-tabs-bar-card`,TABS_BAR_BUTTON:`${X}-tabs-bar-button`,TABS_BAR_SLASH:`${X}-tabs-bar-slash`,TABS_BAR_EXTRA:`${X}-tabs-bar-extra`,TABS_TAB:`${X}-tabs-tab`,TABS_TAB_ACTIVE:`${X}-tabs-tab-active`,TABS_TAB_DISABLED:`${X}-tabs-tab-disabled`,TABS_CONTENT:`${X}-tabs-content`,TABS_PANE:`${X}-tabs-pane`,TABS_PANE_INACTIVE:`${X}-tabs-pane-inactive`,TABS_PANE_ACTIVE:`${X}-tabs-pane-active`,TABS_PANE_MOTION_OVERLAY:`${X}-tabs-pane-motion-overlay`,TABS_PANE_ANIMATE_LEFT_SHOW:`${X}-tabs-pane-animate-leftShow`,TABS_PANE_ANIMATE_RIGHT_SHOW:`${X}-tabs-pane-animate-rightShow`,TABS_PANE_ANIMATE_TOP_SHOW:`${X}-tabs-pane-animate-topShow`,TABS_PANE_ANIMATE_BOTTOM_SHOW:`${X}-tabs-pane-animate-bottomShow`},Xe={TYPE_MAP:["line","card","button","slash"],SIZE:["small","medium","large"],POSITION_MAP:["top","left"]};class bh extends ge{constructor(e){super(Object.assign({},e)),this.destroy=H,this.handlePrevent=t=>{t.stopPropagation(),t.preventDefault()},this.handleKeyDown=(t,n,s)=>{const{preventScroll:r}=this.getProps(),o=[...t.target.parentNode.childNodes].filter(l=>x(l,"attributes.data-tabkey.value","").includes("semiTab")&&x(l,"attributes.aria-disabled.value","")!=="true");switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.determineOrientation(t,o);break;case"Backspace":case"Delete":this.handleDeleteKeyDown(t,o,n,s);break;case"Enter":case" ":this.handleTabClick(n,t),this.handlePrevent(t);break;case"Home":o[0].focus({preventScroll:r}),this.handlePrevent(t);break;case"End":o[o.length-1].focus({preventScroll:r}),this.handlePrevent(t);break}}}init(){this._adapter.collectPane()}_notifyChange(e){const{activeKey:t}=this.getStates();t!==e&&this._adapter.notifyChange(e)}handleTabClick(e,t){this._isInProps("activeKey")?this._notifyChange(e):(this._notifyChange(e),this.handleNewActiveKey(e)),this._adapter.notifyTabClick(e,t)}handleNewActiveKey(e){const{activeKey:t}=this.getStates();t!==e&&this._adapter.setNewActiveKey(e)}getDefaultActiveKey(){let e;const t=this.getProps();return"activeKey"in t?e=t.activeKey:"defaultActiveKey"in t?e=t.defaultActiveKey:e=this._adapter.getDefaultActiveKeyFromChildren(),e}handleTabListChange(){this._adapter.collectPane()}handleTabPanesChange(){this._adapter.collectPane(),this._adapter.collectActiveKey()}handleTabDelete(e){this._adapter.notifyTabDelete(e)}determineOrientation(e,t){const{tabPosition:n}=this.getProps();n==="left"?(e.key==="ArrowUp"||e.key==="ArrowDown")&&(this.switchTabOnArrowPress(e,t),this.handlePrevent(e)):(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(this.switchTabOnArrowPress(e,t),this.handlePrevent(e))}handleDeleteKeyDown(e,t,n,s){const{preventScroll:r}=this.getProps();if(s){this.handleTabDelete(n);const o=t.indexOf(e.target);t.length!==1&&t[o+1>=t.length?o-1:o+1].focus({preventScroll:r})}}switchTabOnArrowPress(e,t){const{preventScroll:n}=this.getProps(),s=t.indexOf(e.target),r={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1};r[e.key]&&s!==void 0&&(t[s+r[e.key]]?t[s+r[e.key]].focus({preventScroll:n}):e.key==="ArrowLeft"||e.key==="ArrowUp"?t[t.length-1].focus({preventScroll:n}):(e.key==="ArrowRight"||e.key=="ArrowDown")&&t[0].focus({preventScroll:n}))}}var yh=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const Sh=(i,e)=>{const{tab:t,size:n,type:s,icon:r,selected:o,closable:l,disabled:c,itemKey:d,deleteTabItem:u,tabPosition:h,handleKeyDown:g,onClick:m}=i,y=yh(i,["tab","size","type","icon","selected","closable","disabled","itemKey","deleteTabItem","tabPosition","handleKeyDown","onClick"]),p=L.useMemo(()=>l?b.createElement(hl,{"aria-label":"Close",role:"button",className:`${U.TABS_TAB}-icon-close`,onClick:O=>u(d,O)}):null,[s,l,u,d]),f=L.useCallback(O=>b.createElement("span",{className:`${U.TABS_BAR}-icon`},O),[]),S=L.useCallback(O=>{g&&g(O,d,l)},[g,d,l]),v=L.useCallback(O=>{!c&&m&&m(d,O)},[d,c,m]),w=r?f(r):null,_=M(U.TABS_TAB,`${U.TABS_TAB}-${s}`,`${U.TABS_TAB}-${h}`,`${U.TABS_TAB}-single`,{[U.TABS_TAB_ACTIVE]:o,[U.TABS_TAB_DISABLED]:c,[`${U.TABS_TAB}-small`]:n==="small",[`${U.TABS_TAB}-medium`]:n==="medium"});return b.createElement("div",Object.assign({role:"tab",id:`semiTab${d}`,"data-tabkey":`semiTab${d}`,"aria-controls":`semiTabPanel${d}`,"aria-disabled":c?"true":"false","aria-selected":o?"true":"false",tabIndex:o?0:-1,onKeyDown:S,onClick:v,className:_},y,{ref:e}),w,t,p)},rr=L.forwardRef(Sh);rr.elementType="Tabs.TabItem";var wh=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class Is extends b.Component{constructor(e){var t;super(e),t=this,this.getEffectiveCollapsible=()=>{const{collapsible:n}=this.props;return n==="auto"?this.state.shouldCollapse:n||!1},this.checkOverflow=()=>{if(this.props.collapsible!=="auto"||this.state.shouldCollapse)return;const n=this.tabBarRef.current;if(!n)return;const s=this.isTabsWrapped(n)||n.scrollWidth>n.clientWidth+1;s!==this.state.shouldCollapse&&this.setState({shouldCollapse:s})},this.isTabsWrapped=n=>{var s;if(this.props.tabPosition==="left")return!1;const r=Array.from(n.querySelectorAll(`.${U.TABS_TAB}`));if(r.length<=1)return!1;const o=(s=r[0])===null||s===void 0?void 0:s.offsetTop;return typeof o!="number"?!1:r.some(l=>l.offsetTop!==o)},this.handleResize=()=>{this.props.collapsible==="auto"&&this.checkOverflow()},this.handleItemClick=(n,s)=>{this.props.onTabClick(n,s)},this.handleKeyDown=(n,s,r)=>{this.props.handleKeyDown(n,s,r)},this.renderTabItem=n=>{const{size:s,type:r,deleteTabItem:o,handleKeyDown:l,tabPosition:c}=this.props,d=this._isActive(n.itemKey);return b.createElement(rr,Object.assign({},Ne(n,["disabled","icon","itemKey","tab","closable"]),{key:this._getBarItemKeyByItemKey(n.itemKey),selected:d,size:s,type:r,tabPosition:c,handleKeyDown:l,deleteTabItem:o,onClick:this.handleItemClick}))},this.scrollTabItemIntoViewByKey=function(n){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"nearest",r=arguments.length>2?arguments[2]:void 0;const o=document.querySelector(`[data-uuid="${t.state.uuid}"] .${U.TABS_TAB}[data-scrollkey="${n}"]`);o==null||o.scrollIntoView({behavior:r||"smooth",block:s,inline:s})},this.scrollActiveTabItemIntoView=(n,s)=>{const r=this._getBarItemKeyByItemKey(this.props.activeKey);this.scrollTabItemIntoViewByKey(r,n,s)},this.renderTabComponents=n=>n.map(s=>this.renderTabItem(s)),this.handleArrowClick=(n,s)=>{const r=s==="start"?n.pop():n.shift();if(!r)return;const o=this._getBarItemKeyByItemKey(r.itemKey);this.scrollTabItemIntoViewByKey(o)},this.renderCollapse=(n,s,r)=>{var o;const l=M({[`${U.TABS_BAR}-arrow-${r}`]:r,[`${U.TABS_BAR}-arrow`]:!0});if(li(n))return b.createElement("div",{role:"presentation",className:l},b.createElement(Ft,{disabled:!0,icon:s,theme:"borderless"}));const{dropdownClassName:c,dropdownStyle:d,showRestInDropdown:u,dropdownProps:h}=this.props,{rePosKey:g}=this.state,m=!n.length,y=b.createElement(Fe.Menu,null,n.map(v=>{const{icon:w,tab:_,itemKey:O}=v,I=w?this.renderIcon(v.icon):null;return b.createElement(Fe.Item,{key:O,onClick:E=>this.handleItemClick(O,E),active:this._isActive(O)},I,_)})),p=b.createElement("div",{role:"presentation",className:l,onClick:v=>this.handleArrowClick(n,r)},b.createElement(Ft,{disabled:m,icon:s,theme:"borderless"})),f=M(c,{[`${U.TABS_BAR}-dropdown`]:!0}),S=(o=h==null?void 0:h[r])!==null&&o!==void 0?o:{};return b.createElement(b.Fragment,null,u?b.createElement(Fe,Object.assign({className:f,clickToHide:!0,clickTriggerToHide:!0,key:`${g}-${r}`,position:r==="start"?"bottomLeft":"bottomRight",render:m?null:y,showTick:!0,style:d,trigger:"hover",disableFocusListener:!0},S),p):p)},this.renderOverflow=n=>n.map((s,r)=>{const o=r===0?"start":"end",l=r===0?b.createElement(bi,null):b.createElement(js,null),c=this.renderCollapse(s,l,o);return this.props.renderArrow?this.props.renderArrow(s,o,()=>this.handleArrowClick(s,o),c):c}),this.renderCollapsedTab=()=>{const{list:n}=this.props,s=n.map(r=>{const{itemKey:o}=r;return Object.assign({key:this._getBarItemKeyByItemKey(o),active:this._isActive(o)},r)});return b.createElement(Qe,{items:s,overflowRenderDirection:this.props.arrowPosition,wrapperStyle:this.props.visibleTabsStyle,overflowRenderer:this.renderOverflow,renderMode:"scroll",className:`${U.TABS_BAR}-overflow-list`,visibleItemRenderer:this.renderTabItem,onVisibleStateChange:r=>{var o,l;const c=new Map;if(r.forEach((d,u)=>{c.set(this._getItemKeyByBarItemKey(u),d)}),this.isFirstShowInViewport&&Array.from(c.values()).some(u=>u)&&(this.scrollActiveTabItemIntoView("nearest","auto"),this.isFirstShowInViewport=!1),this.props.collapsible==="auto"&&Array.from(c.values()).some(u=>u)){const u=Array.from(c.values()).some(h=>!h);u!==this.state.shouldCollapse&&this.setState({shouldCollapse:u})}(l=(o=this.props).onVisibleTabsChange)===null||l===void 0||l.call(o,c)}})},this.renderWithMoreTrigger=()=>{const{list:n,more:s}=this.props;let r=[],o=b.createElement("div",{className:M({[`${U.TABS_BAR}-more-trigger`]:!0,[`${U.TABS_BAR}-more-trigger-${this.props.type}`]:!0})},b.createElement(Ee,{componentName:"Tabs"},(c,d)=>b.createElement("div",{className:`${U.TABS_BAR}-more-trigger-content`},b.createElement("div",null,c.more),b.createElement(Ms,{className:`${U.TABS_BAR}-more-trigger-content-icon`})))),l;if(typeof s=="number")l=n.length-Math.min(s,n.length),r=n.slice(0,l).map(c=>this.renderTabItem(c));else if(typeof s=="object")l=n.length-Math.min(s.count,n.length),r=n.slice(0,l).map(c=>this.renderTabItem(c)),s.render&&(o=s.render());else if(s!==void 0)throw new Error("[Semi Tabs]: invalid tab props format: more");return b.createElement(b.Fragment,null,r,this.renderMoreDropdown(n.slice(l),s==null?void 0:s.dropdownProps,o))},this.renderMoreDropdown=(n,s,r)=>b.createElement(Fe,Object.assign({trigger:"hover",showTick:!0,position:"bottomLeft",className:`${U.TABS_BAR}-more-dropdown-${this.props.type}`,clickToHide:!0,menu:n.map(o=>({node:"item",name:o.tab,icon:o.icon,onClick:l=>this.props.onTabClick(o.itemKey,l),active:this.props.activeKey===o.itemKey}))},s),r),this._isActive=n=>n===this.props.activeKey,this._getBarItemKeyByItemKey=n=>`${n}-bar`,this._getItemKeyByBarItemKey=n=>n.replace(/-bar$/,""),this.state={endInd:e.list.length,rePosKey:0,startInd:0,uuid:"",currentVisibleItems:[],shouldCollapse:!1},this.isFirstShowInViewport=!0,this.tabBarRef=L.createRef()}componentDidMount(){this.setState({uuid:tl()}),this.props.collapsible==="auto"&&requestAnimationFrame(()=>this.checkOverflow())}componentDidUpdate(e){e.activeKey!==this.props.activeKey&&this.getEffectiveCollapsible()&&this.scrollActiveTabItemIntoView(),this.props.collapsible==="auto"&&e.list!==this.props.list&&this.checkOverflow()}renderIcon(e){return b.createElement("span",null,e)}renderExtra(){const{tabBarExtraContent:e,type:t,size:n}=this.props,s={float:"right"},r=e&&e.props?e.props.style:{},o=M(U.TABS_BAR_EXTRA,{[`${U.TABS_BAR}-${t}-extra`]:t,[`${U.TABS_BAR}-${t}-extra-${n}`]:n});if(e){const l=Object.assign(Object.assign({},s),r);return b.createElement("div",{className:o,style:l,"x-semi-prop":"tabBarExtraContent"},e)}return null}render(){const e=this.props,{type:t,style:n,className:s,list:r,tabPosition:o,more:l,collapsible:c}=e,d=wh(e,["type","style","className","list","tabPosition","more","collapsible"]),u=this.getEffectiveCollapsible(),h=M(s,{[U.TABS_BAR]:!0,[U.TABS_BAR_LINE]:t==="line",[U.TABS_BAR_CARD]:t==="card",[U.TABS_BAR_BUTTON]:t==="button",[U.TABS_BAR_SLASH]:t==="slash",[`${U.TABS_BAR}-${o}`]:o,[`${U.TABS_BAR}-collapse`]:u}),g=this.renderExtra(),m=u?this.renderCollapsedTab():l?this.renderWithMoreTrigger():this.renderTabComponents(r),y=b.createElement("div",Object.assign({role:"tablist","aria-orientation":o==="left"?"vertical":"horizontal",className:h,style:n},qt(d),{"data-uuid":this.state.uuid,ref:this.tabBarRef}),m,g);return c==="auto"?b.createElement(Pt,{onResize:this.handleResize},y):y}}Is.propTypes={activeKey:a.string,className:a.string,collapsible:a.oneOfType([a.bool,a.oneOf(["auto"])]),list:a.array,onTabClick:a.func,size:a.oneOf(Xe.SIZE),style:a.object,tabBarExtraContent:a.node,tabPosition:a.oneOf(Xe.POSITION_MAP),type:a.oneOf(Xe.TYPE_MAP),closable:a.bool,deleteTabItem:a.func,more:a.oneOfType([a.number,a.object])};const ua=b.createContext({});var vh=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};class dn extends L.PureComponent{constructor(){super(...arguments),this.ref=L.createRef(),this.getDirection=(e,t,n,s)=>{if(t!==null&&e!==null&&Array.isArray(n)&&n.length){const r=n.findIndex(c=>c.itemKey===e),o=n.findIndex(c=>c.itemKey===t),l=n.findIndex(c=>c.itemKey===s);return r===o?l>r:o<r}return!1},this.shouldRender=()=>{const{itemKey:e}=this.props,{activeKey:t,lazyRender:n}=this.context,s=t===e;return this._active=this._active||s,n?this._active:!0}}render(){const{tabPaneMotion:e,tabPosition:t,prevActiveKey:n}=this.context,s=this.props,{className:r,style:o,children:l,itemKey:c,tabIndex:d}=s,u=vh(s,["className","style","children","itemKey","tabIndex"]),h=this.context.activeKey===c,g=M(r,{[U.TABS_PANE_INACTIVE]:!h,[U.TABS_PANE_ACTIVE]:h,[U.TABS_PANE]:!0}),m=this.shouldRender(),y=(()=>{const S=this.getDirection(this.context.activeKey,c,this.context.panes,n);return t==="top"?S?U.TABS_PANE_ANIMATE_RIGHT_SHOW:U.TABS_PANE_ANIMATE_LEFT_SHOW:S?U.TABS_PANE_ANIMATE_BOTTOM_SHOW:U.TABS_PANE_ANIMATE_TOP_SHOW})(),p=!this.context.panes.find(S=>S.itemKey===n),f=e&&h&&!p&&!this.context.forceDisableMotion;return b.createElement("div",Object.assign({ref:this.ref,role:"tabpanel",id:`semiTabPanel${c}`,"aria-labelledby":`semiTab${c}`,className:g,style:o,"aria-hidden":h?"false":"true",tabIndex:d||0},qt(u),{"x-semi-prop":"children"}),b.createElement(hi,{motion:f,animationState:h?"enter":"leave",startClassName:y},S=>{let{animationClassName:v,animationEventsNeedBind:w}=S;return b.createElement("div",Object.assign({className:M(U.TABS_PANE_MOTION_OVERLAY,v),"x-semi-prop":"children"},w),m?l:null)}))}}dn.isTabPane=!0;dn.contextType=ua;dn.propTypes={className:a.string,style:a.object,children:a.node,disabled:a.bool,itemKey:a.string,tab:a.node,icon:a.node,closable:a.bool};var Ch=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const Zo=["className","style","disabled","itemKey","tab","icon"];class tt extends he{constructor(e){super(e),this.setContentRef=t=>{this.contentRef={current:t}},this.getPanes=()=>{const{tabList:t,children:n}=this.props;return Array.isArray(t)&&t.length?t:b.Children.map(n,s=>{if(s){const{tab:r,icon:o,disabled:l,itemKey:c,closable:d}=s.props;return{tab:r,icon:o,disabled:l,itemKey:c,closable:d}}})},this.onTabClick=(t,n)=>{this.foundation.handleTabClick(t,n)},this.rePosChildren=(t,n)=>{const s=[],r=b.Children.toArray(t);return t.length&&(s.push(...r.filter(o=>o.props&&o.props.itemKey===n)),s.push(...r.filter(o=>o.props&&o.props.itemKey!==n))),s},this.getActiveItem=()=>{const{activeKey:t}=this.state,{children:n,tabList:s}=this.props;return s||!Array.isArray(n)?n:b.Children.toArray(n).filter(r=>L.isValidElement(r)&&r.type&&r.type.isTabPane?r.props.itemKey===t:!0)},this.deleteTabItem=(t,n)=>{n.stopPropagation(),this.foundation.handleTabDelete(t)},this.foundation=new bh(this.adapter),this.state={activeKey:this.foundation.getDefaultActiveKey(),panes:this.getPanes(),prevActiveKey:null,forceDisableMotion:!1},this.contentRef=L.createRef(),this.contentHeight="auto"}get adapter(){return Object.assign(Object.assign({},super.adapter),{collectPane:()=>{const e=this.getPanes();this.setState({panes:e})},collectActiveKey:()=>{const{tabList:e,children:t,activeKey:n}=this.props;if(typeof n<"u")return;const{activeKey:s}=this.state,r=this.getPanes();r.findIndex(o=>o.itemKey===s)===-1&&(r.length>0?this.setState({activeKey:r[0].itemKey}):this.setState({activeKey:""}))},notifyTabClick:(e,t)=>{this.props.onTabClick(e,t)},notifyChange:e=>{this.props.onChange(e)},setNewActiveKey:e=>{this.setState({activeKey:e})},getDefaultActiveKeyFromChildren:()=>{const{tabList:e,children:t}=this.props;let n="";return(e||b.Children.toArray(t).map(r=>L.isValidElement(r)?r.props:null)).forEach(r=>{r&&!n&&!r.disabled&&(n=r.itemKey)}),n},notifyTabDelete:e=>{this.props.onTabClose&&this.props.onTabClose(e)}})}static getDerivedStateFromProps(e,t){const n={};return!Xt(e.activeKey)&&e.activeKey!==t.activeKey&&(t.prevActiveKey=t.activeKey,n.activeKey=e.activeKey),n}componentDidUpdate(e,t){const n=b.Children.toArray(e.children).map(o=>Ne(L.isValidElement(o)?o.props:null,Zo)),s=b.Children.toArray(this.props.children).map(o=>Ne(L.isValidElement(o)?o.props:null,Zo)),r=this.props.tabList||e.tabList;if(re(this.props.tabList,e.tabList)||this.foundation.handleTabListChange(),t.activeKey!==this.state.activeKey&&t.activeKey!==this.state.prevActiveKey&&this.setState({prevActiveKey:t.activeKey}),e.activeKey!==this.props.activeKey){const o=(()=>{const l=new Set(n.map(c=>c.itemKey));return s.map(c=>c.itemKey).filter(c=>!l.has(c))})();this.setState({forceDisableMotion:o.includes(this.props.activeKey)})}!re(n,s)&&!r&&this.foundation.handleTabPanesChange()}render(){const e=this.props,{children:t,className:n,collapsible:s,contentStyle:r,keepDOM:o,lazyRender:l,renderTabBar:c,showRestInDropdown:d,size:u,style:h,tabBarClassName:g,tabBarExtraContent:m,tabBarStyle:y,tabPaneMotion:p,tabPosition:f,type:S,more:v,onVisibleTabsChange:w,visibleTabsStyle:_,arrowPosition:O,renderArrow:I,dropdownProps:E}=e,k=Ch(e,["children","className","collapsible","contentStyle","keepDOM","lazyRender","renderTabBar","showRestInDropdown","size","style","tabBarClassName","tabBarExtraContent","tabBarStyle","tabPaneMotion","tabPosition","type","more","onVisibleTabsChange","visibleTabsStyle","arrowPosition","renderArrow","dropdownProps"]),{panes:N,activeKey:P}=this.state,A=M(n,{[U.TABS]:!0,[`${U.TABS}-${f}`]:f}),F=M({[U.TABS_CONTENT]:!0,[`${U.TABS_CONTENT}-${f}`]:f}),K={activeKey:P,className:g,collapsible:s,list:N,onTabClick:this.onTabClick,showRestInDropdown:d,size:u,style:y,tabBarExtraContent:m,tabPosition:f,type:S,deleteTabItem:this.deleteTabItem,handleKeyDown:this.foundation.handleKeyDown,more:v,onVisibleTabsChange:w,visibleTabsStyle:_,arrowPosition:O,renderArrow:I,dropdownProps:E},z=c?c(K,Is):b.createElement(Is,Object.assign({},K)),q=o?t:this.getActiveItem();return b.createElement("div",Object.assign({className:A,style:h},this.getDataAttr(k)),z,b.createElement(ua.Provider,{value:{activeKey:P,lazyRender:l,panes:N,tabPaneMotion:p,tabPosition:f,prevActiveKey:this.state.prevActiveKey,forceDisableMotion:this.state.forceDisableMotion}},b.createElement("div",{ref:this.setContentRef,className:F,style:Object.assign({},r)},q)))}}tt.TabPane=dn;tt.TabItem=rr;tt.propTypes={activeKey:a.string,className:a.string,collapsible:a.oneOfType([a.bool,a.oneOf(["auto"])]),contentStyle:a.oneOfType([a.object]),defaultActiveKey:a.string,keepDOM:a.bool,lazyRender:a.bool,onChange:a.func,onTabClick:a.func,renderTabBar:a.func,showRestInDropdown:a.bool,size:a.oneOf(Xe.SIZE),style:a.object,tabBarClassName:a.string,tabBarExtraContent:a.node,tabBarStyle:a.object,tabList:a.array,tabPaneMotion:a.bool,tabPosition:a.oneOf(Xe.POSITION_MAP),type:a.oneOf(Xe.TYPE_MAP),onTabClose:a.func,preventScroll:a.bool,more:a.oneOfType([a.number,a.object]),arrowPosition:a.string,renderArrow:a.func,dropdownProps:a.object};tt.__SemiComponentName__="Tabs";tt.defaultProps=ks(tt.__SemiComponentName__,{children:[],collapsible:!1,keepDOM:!0,lazyRender:!1,onChange:()=>{},onTabClick:()=>{},size:"large",tabPaneMotion:!0,tabPosition:"top",type:"line",onTabClose:()=>{},showRestInDropdown:!0,arrowPosition:"both"});export{bi as I,it as T,pl as V,_s as _,tt as a,dn as b,mr as c,Pe as d,Kt as e,js as f,Ze as g,gd as h,$t as i,We as j,Bt as k,yi as l,Jt as r};