text: /*! For license information please see 29.cd41c710.chunk.js.LICENSE.txt */
  (this["webpackJsonpstreamlit-browser"]=this["webpackJsonpstreamlit-browser"]||[]).push([[29],{5747:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return H}));var o,r=n(10),i=n(20),a=n(0),c=n.n(a),d=n(364),l=n(213),s=n(186);!function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(o||(o={}));var u,h=n(23),f=n(13),b=n.n(f),m=b()("div",{target:"e10os9ge0"})((function(e){var t=e.width,n=e.theme;return{width:t,border:"1px solid ".concat(n.colors.fadedText05),boxSizing:"content-box","& .table-top-right":{overflow:"hidden !important",paddingRight:"6px"},"& .table-bottom-left":{overflow:"hidden !important",paddingBottom:"6px"},"& .table-bottom-right":{overflow:"overlay !important"},"& .table-bottom-right:focus-visible":{outline:"none"},"& .table-bottom-right:focus":{outline:"none"}}}),""),g=b()("div",{target:"e10os9ge1"})((function(e){var t=e.theme;return{padding:"".concat(t.spacing.twoXS," ").concat(t.spacing.xs),borderBottom:"1px solid ".concat(t.colors.fadedText05),borderRight:"1px solid ".concat(t.colors.fadedText05),fontSize:t.fontSizes.md,fontFamily:t.fonts.sansSerif,lineHeight:t.lineHeights.table,display:"flex",alignItems:"center",justifyContent:"flex-start"}}),""),v=function(e){return{color:e.colors.fadedText60,borderBottom:"1px solid ".concat(e.colors.fadedText05),borderRight:"1px solid ".concat(e.colors.fadedText05),zIndex:1}},w=function(e){return{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",lineHeight:e.lineHeights.table}},x=b()(g,{target:"e10os9ge2"})((function(e){var t=e.theme;return v(t)}),""),p=b()(g,{target:"e10os9ge3"})((function(e){var t=e.theme;return Object(r.a)(Object(r.a)({userSelect:"none"},v(t)),w(t))}),""),j=b()(g,{target:"e10os9ge4"})((function(e){var t=e.theme;return Object(r.a)(Object(r.a)({userSelect:"none"},v(t)),w(t))}),""),O=b()(g,{target:"e10os9ge5"})((function(e){var t=e.theme;return w(t)}),""),y=b()("div",{target:"e10os9ge6"})((function(e){var t,n=e.verticalLocator,o=e.horizontalLocator,r=e.width,i=e.height;return t={position:"absolute"},Object(h.a)(t,n,"0px"),Object(h.a)(t,o,"0px"),Object(h.a)(t,"width",r),Object(h.a)(t,"height",i),t}),""),C=b()("div",{target:"e10os9ge7"})((function(e){var t=e.theme;return{fontFamily:t.fonts.monospace,color:t.colors.fadedText60,fontStyle:"italic",fontSize:t.fontSizes.md,textAlign:"center"}}),""),S=b()("span",{target:"e10os9ge8"})((function(e){return{color:e.theme.colors.fadedText05,verticalAlign:"top"}}),""),N=n(141),I=n(22),D=!("undefined"===typeof window||!window.document||!window.document.createElement);function R(e){if((!u&&0!==u||e)&&D){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),u=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return u}var E=n(78),G=2*E.a.smPx,W=function(e,t,n,o){var r=Object(s.c)(n),i=r.headerRows,a=r.headerCols,c=r.dataRows,d=r.cols,l=r.rows,u=G*i,h=t-2-R(),f=function(e,t,n,o,r,i){var a=25,c=e>2?200:400,d=function(e){for(var n=e.index,r=8*10/10,c=24,d=100,l=a,s=0;s<Math.min(t,d);s++){var u=-1;u=s<o?s:t>d?Math.floor(Math.random()*t):s;var h=i(n,u).contents,f=(h?h.length:0)*r+c;f>l&&(l=f)}return l},l=[],s=Array.from(Array(e),(function(e,t){return d({index:t})})),u=s.reduce((function(e,t){return e+t}),0),h=r-u,f=function(e){return e.filter((function(e){return e>c}))};if(h<0)l=s.map((function(e){return e>c?c:e}));else{var b=f(s),m=h/b.length;l=s.map((function(e,t){return t in b.keys()?e+m:e}))}var g=l.reduce((function(e,t){return e+t}),0);if(g>r*(2/3)&&g<r){var v=(r-g)/e;g=(l=l.map((function(e){return e+v}))).reduce((function(e,t){return e+t}),0)}var w=Math.min(g,r),x=function(e){var t=e.index;return l[t]},p=l.slice(0,n).reduce((function(e,t){return e+t}));return{elementWidth:w,columnWidth:x,headerWidth:p}}(d,l,a,i,h,o),b=f.elementWidth,m=f.columnWidth,g=f.headerWidth;if(0===c&&b<60){b=60,g=60;for(var v=0,w=0;w<d;w++)v+=m({index:w});v<60&&(m=function(){return 60/d})}var x=l*G,p=(e||300)-2;return e=Math.min(x,p),b+=x>p?R():0,{rowHeight:G,headerHeight:u,border:2,columnWidth:m,headerWidth:g,elementWidth:b,height:e}},T={corner:x,"col-header":p,"row-header":j,data:O};var z=n(91),A=n(75),B=n(5);function k(e){var t,n,r,i=e.CellType,a=e.columnIndex,c=e.contents,d=e.rowIndex,l=e.sortedByUser,s=e.style,u=e.columnSortDirection,h=e.headerClickedCallback,f=c,b=u===o.DESCENDING;null!=h&&0===d&&(t=function(){return h(a)},n="button",r=0,f=null==u?'Sort by column "'.concat(c,'"'):'Sorted by column "'.concat(c,'" (').concat(b?"descending":"ascending",")"));var m=0===d?function(e){switch(e){case o.ASCENDING:return Object(B.jsx)(S,{"data-testid":"sortIcon",children:Object(B.jsx)(A.a,{content:z.ChevronTop,size:"xs",margin:"0 0 0 twoXS"})});case o.DESCENDING:return Object(B.jsx)(S,{"data-testid":"sortIcon",children:Object(B.jsx)(A.a,{content:z.ChevronBottom,size:"xs",margin:"0 0 0 twoXS"})});default:return null}}(u):void 0;return Object(B.jsxs)(i,{style:s,onClick:t,role:n,tabIndex:r,title:f,"data-testid":i.displayName,"data-test-sort-direction":u,children:[c,l?m:""]})}var H=Object(l.a)((function(e){var t=e.element,n=e.height,l=e.width,u=c.a.useRef(null),h=Object(a.useState)(!1),f=Object(i.a)(h,2),b=f[0],g=f[1],v=Object(a.useState)(0),w=Object(i.a)(v,2),x=w[0],p=w[1],j=Object(a.useState)(o.ASCENDING),O=Object(i.a)(j,2),S=O[0],D=O[1],R=Object(s.g)(t.get("data")),E=Object(i.a)(R,2)[1],G=Object(s.c)(t),z=G.headerRows,A=G.headerCols,H=G.dataRows,L=G.cols,M=G.rows,F=function(e){var t=o.ASCENDING;x===e&&(t=S===o.ASCENDING?o.DESCENDING:o.ASCENDING),p(e),D(t),g(!0)},X=function(e){var n=Object(s.c)(t),r=n.headerCols,i=n.dataRows,a=S!==o.DESCENDING;if(x<r||x-r>=e){for(var c=new Array(i),d=0;d<i;d+=1)c[d]=a?d:i-(d+1);return c}return Object(s.d)(t,x-r,a)}(E),J=function(e){var t=e.element,n=e.headerRows,o=e.sortedDataRowIndices;return function(e,r){if(null!=o&&r>=n){var i=r-n;i>=0&&i<o.length?(r=o[i],r+=n):Object(I.d)("Bad sortedDataRowIndices ("+"rowIndex=".concat(r,", ")+"headerRows=".concat(n,", ")+"sortedDataRowIndices.length=".concat(o.length))}var a=Object(s.b)(t,e,r),c=a.contents,d=a.styles,l=a.type;return{Component:T[l],styles:d,contents:Object(N.b)(c)}}}({element:t,headerRows:z,sortedDataRowIndices:X}),U=function(e){return function(t){var n=t.columnIndex,o=t.key,i=t.rowIndex,a=t.style,c=e(n,i),d=c.Component,l=c.styles,s=c.contents,u=0===i?F:void 0,h=n===x?S:void 0,f=i===H,m=n===L-A,g=Object(r.a)(Object(r.a)(Object(r.a)({},a),l),{},{borderBottom:f?"none":void 0,borderRight:m?"none":void 0});return Object(B.jsx)(k,{CellType:d,columnIndex:n,rowIndex:i,style:g,contents:s,sortedByUser:b,columnSortDirection:h,headerClickedCallback:u},o)}}(J),P=W(n,l,t,J),q=P.rowHeight,K=P.headerHeight,Q=P.border,V=P.height,Y=P.elementWidth,Z=P.columnWidth,$=P.headerWidth;return setTimeout((function(){null!=u.current&&u.current.recomputeGridSize()}),0),Object(a.useEffect)((function(){x-A>=E&&(p(0),D(o.ASCENDING),g(!1))}),[x,A,E]),Object(B.jsxs)(m,{width:Y,className:"stDataFrame",children:[Object(B.jsx)(d.MultiGrid,{cellRenderer:U,fixedColumnCount:A,fixedRowCount:z,columnWidth:Z,columnCount:L,enableFixedColumnScroll:!1,enableFixedRowScroll:!1,height:V,rowHeight:q,rowCount:M,width:Y,classNameBottomLeftGrid:"table-bottom-left",classNameBottomRightGrid:"table-bottom-right",classNameTopRightGrid:"table-top-right",ref:u}),Object(B.jsx)(y,{verticalLocator:"top",horizontalLocator:"right",width:Q,height:K}),Object(B.jsx)(y,{verticalLocator:"bottom",horizontalLocator:"left",width:$,height:Q}),0===H?Object(B.jsx)(C,{children:"empty"}):null]})}))}}]);