@cloudquery/plugin-config-ui-lib
Version:
Plugin configuration UI library for CloudQuery Cloud App
1 lines • 973 kB
JavaScript
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{Box as r,Typography as a,CircularProgress as i,AccordionDetails as o,Divider as s,Tooltip as l,InputAdornment as c,IconButton as u,FormControl as d,FormHelperText as p,Stack as g,SvgIcon as m,Collapse as f,FormControlLabel as b,Alert as h,AlertTitle as y,Button as E}from"@mui/material";import v,{buttonClasses as S}from"@mui/material/Button";import T from"@mui/material/Stack";import A from"@mui/material/Tooltip";import w,{useState as I,useRef as k,useCallback as R,useEffect as _,createElement as C,useMemo as N,useLayoutEffect as O,createContext as x,useContext as L,Suspense as D,forwardRef as P,useId as M}from"react";import F from"@mui/icons-material/Close";import U from"@mui/icons-material/ExpandMore";import B from"@mui/material/Accordion";import $,{accordionSummaryClasses as G}from"@mui/material/AccordionSummary";import H,{alertClasses as z}from"@mui/material/Alert";import j from"@mui/material/AlertTitle";import V,{cardClasses as q}from"@mui/material/Card";import W,{cardContentClasses as Y}from"@mui/material/CardContent";import K,{linearProgressClasses as Z}from"@mui/material/LinearProgress";import X from"@mui/material/Typography";import{useTheme as Q,alpha as J,createTheme as ee,ThemeProvider as te,styled as ne}from"@mui/material/styles";import re from"@mui/icons-material/Download";import ae from"@mui/material/Box";import ie,{menuItemClasses as oe}from"@mui/material/MenuItem";import se from"react-dom";import{backdropClasses as le}from"@mui/material/Backdrop";import ce from"@mui/material/CircularProgress";import ue from"@mui/material/IconButton";import de from"@mui/material/Modal";import pe from"@mui/icons-material/Link";import ge from"@mui/material/Divider";import me from"@mui/material/Link";import fe from"@mui/icons-material/ContentCopy";import be from"@mui/icons-material/ContentCopyRounded";import he from"@mui/material/Tab";import ye from"@mui/material/Tabs";import*as Ee from"yup";import ve from"@mui/icons-material/ChevronRight";import Se from"@mui/material/Step";import Te from"@mui/material/StepLabel";import Ae from"@mui/material/Stepper";import we,{cardHeaderClasses as Ie}from"@mui/material/CardHeader";import ke from"@mui/material/List";import Re from"@mui/material/ListItem";import{filledInputClasses as _e}from"@mui/material/FilledInput";import{formLabelClasses as Ce}from"@mui/material/FormLabel";import{inputLabelClasses as Ne}from"@mui/material/InputLabel";import{outlinedInputClasses as Oe}from"@mui/material/OutlinedInput";import{paginationItemClasses as xe}from"@mui/material/PaginationItem";import{tableCellClasses as Le}from"@mui/material/TableCell";import{tableRowClasses as De}from"@mui/material/TableRow";import"@mui/lab/themeAugmentation";import{common as Pe}from"@mui/material/colors";import Me from"@emotion/cache";import{CacheProvider as Fe}from"@emotion/react";import Ue from"@mui/material/CssBaseline";import Be from"@mui/material/FormHelperText";import $e from"@mui/material/TextField";import{VisibilityOff as Ge,Visibility as He,AttachMoney as ze,ArrowDropDown as je,ArrowDropUp as Ve,Close as qe}from"@mui/icons-material";import We from"@mui/material/Skeleton";import Ye from"@mui/material/AccordionDetails";import Ke from"@mui/icons-material/Check";import Ze from"@mui/material/FormControl";import Xe from"@mui/material/Checkbox";import Qe from"@mui/material/FormControlLabel";import Je from"@mui/material/Switch";import et from"@mui/material/Autocomplete";import{inputBaseClasses as tt}from"@mui/material/InputBase";import{AdapterDayjs as nt}from"@mui/x-date-pickers/AdapterDayjs";import{DateTimeField as rt}from"@mui/x-date-pickers/DateTimeField";import{LocalizationProvider as at}from"@mui/x-date-pickers/LocalizationProvider";import{LocalizationProvider as it,DateField as ot}from"@mui/x-date-pickers";import st from"@mui/material/Radio";import lt from"@mui/material/ToggleButton";import ct from"@mui/material/ToggleButtonGroup";import ut from"@mui/icons-material/FilterAlt";import dt from"@mui/material/Menu";import pt from"@mui/material/RadioGroup";import gt from"@mui/icons-material/Search";function mt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function ft(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const bt="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_API_BASE_URL||process.env.REACT_APP_CLOUDQUERY_API_BASE_URL||"https://api.cloudquery.io",ht="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||process.env.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||"https://cloud.cloudquery.io/auth/connector",yt="b25b8efe-63fd-4c32-9f87-059cfd649128",Et="************",vt=e=>ft(void 0,void 0,void 0,(function*(){const{data:t,headers:n,method:r,params:a,signal:i,streamData:o,url:s}=e;let l="";for(const[e,t]of Object.entries(a||{}))l+=Array.isArray(t)?`${t.map((t=>`${e}=${encodeURIComponent(t)}`)).join("&")}&`:`${e}=${encodeURIComponent(t)}&`;const c=`${s}${l?`?${l}`:""}`,u=`${s.startsWith("http")?"":bt}${c}`,d=yield fetch(u,Object.assign(Object.assign({method:r},t?{body:JSON.stringify(t)}:{}),{credentials:"include",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},n),signal:i})),p=o?{}:yield d.json().catch((()=>({})));if(d.ok&&205!==d.status)return{data:p,headers:d.headers,response:d,status:d.status,statusText:d.statusText};throw{data:o?yield d.json().catch((()=>({}))):p,headers:d.headers,isCustom:!0,message:"There was an error during the API request",payload:t,status:d.status}}));var St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var At,wt={exports:{}};var It=(At||(At=1,wt.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",a="second",i="minute",o="hour",s="day",l="week",c="month",u="quarter",d="year",p="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},h=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:h,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+h(r,2,"0")+":"+h(a,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),a=t.clone().add(r,c),i=n-a<0,o=t.clone().add(r+(i?-1:1),c);return+(-(r+(n-a)/(i?a-o:o-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:l,d:s,D:p,h:o,m:i,s:a,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},E="en",v={};v[E]=b;var S="$isDayjsObject",T=function(e){return e instanceof k||!(!e||!e[S])},A=function e(t,n,r){var a;if(!t)return E;if("string"==typeof t){var i=t.toLowerCase();v[i]&&(a=i),n&&(v[i]=n,a=i);var o=t.split("-");if(!a&&o.length>1)return e(o[0])}else{var s=t.name;v[s]=t,a=s}return!r&&a&&(E=a),a||!r&&E},w=function(e,t){if(T(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},I=y;I.l=A,I.i=T,I.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function b(e){this.$L=A(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[S]=!0}var h=b.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(I.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(m);if(r){var a=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],a,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return I},h.isValid=function(){return!(this.$d.toString()===g)},h.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},h.isAfter=function(e,t){return w(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<w(e)},h.$g=function(e,t,n){return I.u(e)?this[t]:this.set(n,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,t){var n=this,r=!!I.u(t)||t,u=I.p(e),g=function(e,t){var a=I.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?a:a.endOf(s)},m=function(e,t){return I.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},f=this.$W,b=this.$M,h=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?g(1,0):g(31,11);case c:return r?g(1,b):g(0,b+1);case l:var E=this.$locale().weekStart||0,v=(f<E?f+7:f)-E;return g(r?h-v:h+(6-v),b);case s:case p:return m(y+"Hours",0);case o:return m(y+"Minutes",1);case i:return m(y+"Seconds",2);case a:return m(y+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(e,t){var n,l=I.p(e),u="set"+(this.$u?"UTC":""),g=(n={},n[s]=u+"Date",n[p]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[o]=u+"Hours",n[i]=u+"Minutes",n[a]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],m=l===s?this.$D+(t-this.$W):t;if(l===c||l===d){var f=this.clone().set(p,1);f.$d[g](m),f.init(),this.$d=f.set(p,Math.min(this.$D,f.daysInMonth())).$d}else g&&this.$d[g](m);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[I.p(e)]()},h.add=function(r,u){var p,g=this;r=Number(r);var m=I.p(u),f=function(e){var t=w(g);return I.w(t.date(t.date()+Math.round(e*r)),g)};if(m===c)return this.set(c,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return f(1);if(m===l)return f(7);var b=(p={},p[i]=t,p[o]=n,p[a]=e,p)[m]||1,h=this.$d.getTime()+r*b;return I.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||g;var r=e||"YYYY-MM-DDTHH:mm:ssZ",a=I.z(this),i=this.$H,o=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,a,i){return e&&(e[n]||e(t,r))||a[n].slice(0,i)},p=function(e){return I.s(i%12||12,e,"0")},m=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,(function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return I.s(t.$y,4,"0");case"M":return s+1;case"MM":return I.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return I.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return I.s(i,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return m(i,o,!0);case"A":return m(i,o,!1);case"m":return String(o);case"mm":return I.s(o,2,"0");case"s":return String(t.$s);case"ss":return I.s(t.$s,2,"0");case"SSS":return I.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")}))},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(r,p,g){var m,f=this,b=I.p(p),h=w(r),y=(h.utcOffset()-this.utcOffset())*t,E=this-h,v=function(){return I.m(f,h)};switch(b){case d:m=v()/12;break;case c:m=v();break;case u:m=v()/3;break;case l:m=(E-y)/6048e5;break;case s:m=(E-y)/864e5;break;case o:m=E/n;break;case i:m=E/t;break;case a:m=E/e;break;default:m=E}return g?m:I.a(m)},h.daysInMonth=function(){return this.endOf(c).$D},h.$locale=function(){return v[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=A(e,t,!0);return r&&(n.$L=r),n},h.clone=function(){return I.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},b}(),R=k.prototype;return w.prototype=R,[["$ms",r],["$s",a],["$m",i],["$H",o],["$W",s],["$M",c],["$y",d],["$D",p]].forEach((function(e){R[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,k,w),e.$i=!0),w},w.locale=A,w.isDayjs=T,w.unix=function(e){return w(1e3*e)},w.en=v[E],w.Ls=v,w.p={},w}()),wt.exports),kt=Tt(It);function Rt(r,a){const i={debug:a.info.dark,error:a.error.main,fatal:a.error.dark,info:a.text.primary,panic:a.error.dark,trace:a.info.main,warn:a.warning.main};return r.replace(/}\s*{/g,"}\n{").split("\n").map((r=>{try{const a=JSON.parse(r),{level:o,time:s}=a,l=mt(a,["level","time"]),c=i[o.toLowerCase()];return{logLevel:o.toLowerCase(),logLine:e(t,{children:["[",kt(s).format("YYYY-MM-DD HH:mm:ss:SSS"),"] |"," ",n("span",{style:{color:c},children:o.toUpperCase().padEnd(5," ")})," |"," ",n("span",{style:{color:c,wordBreak:"break-word"},children:JSON.stringify(l)})]}),logText:`${kt(s).format("YYYY-MM-DD HH:mm:ss:SSS")} | ${o.toUpperCase().padEnd(5," ")} | ${JSON.stringify(l)}`}}catch(e){return}})).filter(Boolean)}function _t({LoadingSkeleton:o,children:s,data:l,emptyAction:c,emptyCondensed:u,emptyImage:d,emptyMessage:p,emptyTitle:g,errorMessage:m,errorTitle:f,isError:b,isLoading:h,loaderText:y,errorActionText:E}){return b?e(r,{padding:3,textAlign:"center",width:"100%",children:[n(a,{marginBottom:2,variant:"h5",children:null!=f?f:"Something went wrong"}),n(a,{variant:"body1",whiteSpace:"pre-line",children:m||`Error occurred when trying to ${E}.`})]}):h||!b&&!l&&!1===h?n(t,{children:o?n(o,{}):n(T,{padding:1,width:"100%",children:e(r,{alignItems:"center",display:"flex",flexDirection:"column",gap:2,height:150,justifyContent:"center",children:[n(i,{}),!!y&&n(a,{variant:"body1",children:y})]})})}):l&&Array.isArray(l)&&0===l.length?n(r,{sx:{bgcolor:"background.paper",borderRadius:2.5,padding:u?5:9},textAlign:"center",width:"100%",children:e(T,{spacing:3,children:[d&&n(r,{display:"flex",justifyContent:"center",width:"100%",children:d}),e(T,{alignItems:"center",spacing:2,children:[n(a,{color:"text.primary",variant:"h5",children:g}),!!p&&n(a,{maxWidth:"600px",sx:{color:"text.secondary"},variant:"body1",whiteSpace:"pre-line",children:p})]}),c&&n("div",{children:c})]})}):n(t,{children:s(l)})}function Ct(e){return()=>e}function Nt(e){e()}function Ot(e,t){return n=>e(t(n))}function xt(e,t){return()=>e(t)}function Lt(e){return void 0!==e}function Dt(){}function Pt(e,t){return t(e),e}function Mt(e,t){return t(e)}function Ft(...e){return e}function Ut(e,t){return e(1,t)}function Bt(e,t){e(0,t)}function $t(e){e(2)}function Gt(e){return e(4)}function Ht(e,t){return Ut(e,function(e,t){return n=>e(t,n)}(t,0))}function zt(e,t){const n=e(1,(e=>{n(),t(e)}));return n}function jt(e){let t,n;return r=>a=>{t=a,n&&clearTimeout(n),n=setTimeout((()=>{r(t)}),e)}}function Vt(e,t){return e===t}function qt(e=Vt){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Wt(e){return t=>n=>{e(n)&&t(n)}}function Yt(e){return t=>Ot(t,e)}function Kt(e){return t=>()=>{t(e)}}function Zt(e,...t){const n=function(...e){return t=>e.reduceRight(Mt,t)}(...t);return(t,r)=>{switch(t){case 2:return void $t(e);case 1:return Ut(e,n(r))}}}function Xt(e,t){return n=>r=>{n(t=e(t,r))}}function Qt(e){return t=>n=>{e>0?e--:t(n)}}function Jt(e){let t,n=null;return r=>a=>{n=a,!t&&(t=setTimeout((()=>{t=void 0,r(n)}),e))}}function en(...e){const t=new Array(e.length);let n=0,r=null;const a=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const o=Math.pow(2,i);Ut(e,(e=>{const s=n;n|=o,t[i]=e,s!==a&&n===a&&r&&(r(),r=null)}))})),e=>i=>{const o=()=>{e([i].concat(t))};n===a?o():r=o}}function tn(e){let t=e;const n=rn();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function nn(e,t){return Pt(tn(t),(t=>Ht(e,t)))}function rn(){const e=[];return(t,n)=>{switch(t){case 0:return void e.slice().forEach((e=>{e(n)}));case 2:return void e.splice(0,e.length);case 1:return e.push(n),()=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function an(e){return Pt(rn(),(t=>Ht(e,t)))}function on(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:sn(),singleton:n}}const sn=()=>Symbol();function ln(...e){const t=rn(),n=new Array(e.length);let r=0;const a=Math.pow(2,e.length)-1;return e.forEach(((e,i)=>{const o=Math.pow(2,i);Ut(e,(e=>{n[i]=e,r|=o,r===a&&Bt(t,n)}))})),function(e,i){switch(e){case 2:return void $t(t);case 1:return r===a&&i(n),Ut(t,i)}}}function cn(e,t=Vt){return Zt(e,qt(t))}function un(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Nt)}}(...e.map((e=>Ut(e,n))))}}}var dn=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(dn||{});const pn={0:"debug",3:"error",1:"log",2:"warn"},gn=on((()=>{const e=tn(3);return{log:tn(((t,n,r=1)=>{var a;r>=(null!=(a=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?a:Gt(e))&&console[pn[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)})),logLevel:e}}),[],{singleton:!0});function mn(e,t,n){return fn(e,t,n).callbackRef}function fn(e,t,n){const r=w.useRef(null);let a=e=>{};const i=w.useMemo((()=>typeof ResizeObserver<"u"?new ResizeObserver((t=>{const r=()=>{const n=t[0].target;null!==n.offsetParent&&e(n)};n?r():requestAnimationFrame(r)})):null),[e,n]);return a=e=>{e&&t?(null==i||i.observe(e),r.current=e):(r.current&&(null==i||i.unobserve(r.current)),r.current=null)},{callbackRef:a,ref:r}}function bn(e,t,n,r,a,i,o,s,l){const c=w.useCallback((n=>{const l=function(e,t,n,r){const a=e.length;if(0===a)return null;const i=[];for(let o=0;o<a;o++){const a=e.item(o);if(void 0===a.dataset.index)continue;const s=parseInt(a.dataset.index),l=parseFloat(a.dataset.knownSize),c=t(a,n);if(0===c&&r("Zero-sized element, this should not happen",{child:a},dn.ERROR),c===l)continue;const u=i[i.length-1];0===i.length||u.size!==c||u.endIndex!==s-1?i.push({endIndex:s,size:c,startIndex:s}):i[i.length-1].endIndex++}return i}(n.children,t,s?"offsetWidth":"offsetHeight",a);let c=n.parentElement;for(;!c.dataset.virtuosoScroller;)c=c.parentElement;const u="window"===c.lastElementChild.dataset.viewportType;let d;u&&(d=c.ownerDocument.defaultView);const p=o?s?o.scrollLeft:o.scrollTop:u?s?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:s?c.scrollLeft:c.scrollTop,g=o?s?o.scrollWidth:o.scrollHeight:u?s?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,m=o?s?o.offsetWidth:o.offsetHeight:u?s?d.innerWidth:d.innerHeight:s?c.offsetWidth:c.offsetHeight;r({scrollHeight:g,scrollTop:Math.max(p,0),viewportHeight:m}),null==i||i(s?hn("column-gap",getComputedStyle(n).columnGap,a):hn("row-gap",getComputedStyle(n).rowGap,a)),null!==l&&e(l)}),[e,t,a,i,o,r,s]);return fn(c,n,l)}function hn(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,dn.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function yn(e,t,n){const r=w.useRef(null),a=w.useCallback((n=>{if(null==n||!n.offsetParent)return;const a=n.getBoundingClientRect(),i=a.width;let s,l;if(t){const e=t.getBoundingClientRect(),n=a.top-e.top;l=e.height-Math.max(0,n),s=n+t.scrollTop}else{const e=o.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,a.top),s=a.top+e.scrollY}r.current={offsetTop:s,visibleHeight:l,visibleWidth:i},e(r.current)}),[e,t]),{callbackRef:i,ref:o}=fn(a,!0,n),s=w.useCallback((()=>{a(o.current)}),[a,o]);return w.useEffect((()=>{var e;if(t){t.addEventListener("scroll",s);const e=new ResizeObserver((()=>{requestAnimationFrame(s)}));return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}{const t=null==(e=o.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",s),null==t||t.addEventListener("resize",s),()=>{null==t||t.removeEventListener("scroll",s),null==t||t.removeEventListener("resize",s)}}}),[s,t,o]),i}const En=on((()=>{const e=rn(),t=rn(),n=tn(0),r=rn(),a=tn(0),i=rn(),o=rn(),s=tn(0),l=tn(0),c=tn(0),u=tn(0),d=rn(),p=rn(),g=tn(!1),m=tn(!1),f=tn(!1);return Ht(Zt(e,Yt((({scrollTop:e})=>e))),t),Ht(Zt(e,Yt((({scrollHeight:e})=>e))),o),Ht(t,a),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:u,headerHeight:s,horizontalDirection:m,scrollBy:p,scrollContainerState:e,scrollHeight:o,scrollingInProgress:g,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:a,viewportHeight:i}}),[],{singleton:!0}),vn={lvl:0};function Sn(e,t){const n=e.length;if(0===n)return[];let{index:r,value:a}=t(e[0]);const i=[];for(let o=1;o<n;o++){const{index:n,value:s}=t(e[o]);i.push({end:n-1,start:r,value:a}),r=n,a=s}return i.push({end:1/0,start:r,value:a}),i}function Tn(e){return e===vn}function An(e,t){if(!Tn(e))return t===e.k?e.v:t<e.k?An(e.l,t):An(e.r,t)}function wn(e,t,n="k"){if(Tn(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=wn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return wn(e.l,t,n)}function In(e,t,n){return Tn(e)?Mn(t,n,1):t===e.k?xn(e,{k:t,v:n}):t<e.k?Fn(xn(e,{l:In(e.l,t,n)})):Fn(xn(e,{r:In(e.r,t,n)}))}function kn(){return vn}function Rn(e,t,n){if(Tn(e))return[];return function(e){return Sn(e,(({k:e,v:t})=>({index:e,value:t})))}(Nn(e,wn(e,t)[0],n))}function _n(e,t){if(Tn(e))return vn;const{k:n,l:r,r:a}=e;if(t===n){if(Tn(r))return a;if(Tn(a))return r;{const[t,n]=Pn(r);return On(xn(e,{k:t,l:Ln(r),v:n}))}}return On(xn(e,t<n?{l:_n(r,t)}:{r:_n(a,t)}))}function Cn(e){return Tn(e)?[]:[...Cn(e.l),{k:e.k,v:e.v},...Cn(e.r)]}function Nn(e,t,n){if(Tn(e))return[];const{k:r,l:a,r:i,v:o}=e;let s=[];return r>t&&(s=s.concat(Nn(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Nn(i,t,n))),s}function On(e){const{l:t,lvl:n,r:r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if(Dn(t))return Un(xn(e,{lvl:n-1}));if(!Tn(t)&&!Tn(t.r))return xn(t.r,{l:xn(t,{r:t.r.l}),lvl:n,r:xn(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(Dn(e))return Bn(xn(e,{lvl:n-1}));if(Tn(r)||Tn(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,a=Dn(t)?r.lvl-1:r.lvl;return xn(t,{l:xn(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:Bn(xn(r,{l:t.r,lvl:a}))})}}function xn(e,t){return Mn(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function Ln(e){return Tn(e.r)?e.l:On(xn(e,{r:Ln(e.r)}))}function Dn(e){return Tn(e)||e.lvl>e.r.lvl}function Pn(e){return Tn(e.r)?[e.k,e.v]:Pn(e.r)}function Mn(e,t,n,r=vn,a=vn){return{k:e,l:r,lvl:n,r:a,v:t}}function Fn(e){return Bn(Un(e))}function Un(e){const{l:t}=e;return Tn(t)||t.lvl!==e.lvl?e:xn(t,{r:xn(e,{l:t.r})})}function Bn(e){const{lvl:t,r:n}=e;return Tn(n)||Tn(n.r)||n.lvl!==t||n.r.lvl!==t?e:xn(n,{l:xn(e,{r:n.l}),lvl:t+1})}function $n(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Gn(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Hn=on((()=>({recalcInProgress:tn(!1)})),[],{singleton:!0});function zn(e,t,n){return e[jn(e,t,n)]}function jn(e,t,n,r=0){let a=e.length-1;for(;r<=a;){const i=Math.floor((r+a)/2),o=n(e[i],t);if(0===o)return i;if(-1===o){if(a-r<2)return i-1;a=i-1}else{if(a===r)return i;r=i+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Vn(e,t){return Math.round(e.getBoundingClientRect()[t])}function qn(e){return!Tn(e.groupOffsetTree)}function Wn({index:e},t){return t===e?0:t<e?-1:1}function Yn({offset:e},t){return t===e?0:t<e?-1:1}function Kn(e,t,n){if(0===t.length)return 0;const{index:r,offset:a,size:i}=zn(t,e,Wn),o=e-r,s=i*o+(o-1)*n+a;return s>0?s+n:s}function Zn(e,t){if(!qn(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function Xn(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=Zn("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function Qn(e,t,n,r=0){return r>0&&(t=Math.max(t,zn(e,r,Wn).offset)),Sn(function(e,t,n,r){const a=jn(e,t,r),i=jn(e,n,r,a);return e.slice(a,i+1)}(e,t,n,Yn),nr)}function Jn(e,[t,n,r,a]){t.length>0&&r("received item sizes",t,dn.DEBUG);const i=e.sizeTree;let o=i,s=0;if(n.length>0&&Tn(i)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce(((t,n)=>In(In(t,n,e),n+1,r)),o)}else[o,s]=function(e,t){let n=Tn(e)?0:1/0;for(const r of t){const{endIndex:t,size:a,startIndex:i}=r;if(n=Math.min(n,i),Tn(e)){e=In(e,0,a);continue}const o=Rn(e,i-1,t+1);if(o.some(rr(r)))continue;let s=!1,l=!1;for(const{end:n,start:r,value:i}of o)s?(t>=r||a===i)&&(e=_n(e,r)):(l=i!==a,s=!0),n>t&&t>=r&&i!==a&&(e=In(e,t+1,i));l&&(e=In(e,i,a))}return[e,n]}(o,t);if(o===i)return e;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=tr(e.offsetTree,s,o,a);return{groupIndices:n,groupOffsetTree:n.reduce(((e,t)=>In(e,t,Kn(t,d,a))),kn()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:o}}function er(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function tr(e,t,n,r){let a=e,i=0,o=0,s=0,l=0;if(0!==t){l=jn(a,t-1,Wn),s=a[l].offset;const e=wn(n,t-1);i=e[0],o=e[1],a.length&&a[l].size===wn(n,t)[1]&&(l-=1),a=a.slice(0,l+1)}else a=[];for(const{start:e,value:l}of Rn(n,t,1/0)){const t=e-i,n=t*o+s+t*r;a.push({index:e,offset:n,size:l}),i=e,s=n,o=l}return{lastIndex:i,lastOffset:s,lastSize:o,offsetTree:a}}function nr(e){return{index:e.index,value:e}}function rr(e){const{endIndex:t,size:n,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===n}const ar={offsetHeight:"height",offsetWidth:"width"},ir=on((([{log:e},{recalcInProgress:t}])=>{const n=rn(),r=rn(),a=nn(r,0),i=rn(),o=rn(),s=tn(0),l=tn([]),c=tn(void 0),u=tn(void 0),d=tn(((e,t)=>Vn(e,ar[t]))),p=tn(void 0),g=tn(0),m={groupIndices:[],groupOffsetTree:kn(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:kn()},f=nn(Zt(n,en(l,e,g),Xt(Jn,m),qt()),m),b=nn(Zt(l,qt(),Xt(((e,t)=>({current:t,prev:e.current})),{current:[],prev:[]}),Yt((({prev:e})=>e))),[]);Ht(Zt(l,Wt((e=>e.length>0)),en(f,g),Yt((([e,t,n])=>{const r=e.reduce(((e,r,a)=>In(e,r,Kn(r,t.offsetTree,n)||a)),kn());return{...t,groupIndices:e,groupOffsetTree:r}}))),f),Ht(Zt(r,en(f),Wt((([e,{lastIndex:t}])=>e<t)),Yt((([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}]))),n),Ht(c,u);const h=nn(Zt(c,Yt((e=>void 0===e))),!0);Ht(Zt(u,Wt((e=>void 0!==e&&Tn(Gt(f).sizeTree))),Yt((e=>[{endIndex:0,size:e,startIndex:0}]))),n);const y=an(Zt(n,en(f),Xt((({sizes:e},[t,n])=>({changed:n!==e,sizes:n})),{changed:!1,sizes:m}),Yt((e=>e.changed))));Ut(Zt(s,Xt(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),Yt((e=>e.diff))),(e=>{const{groupIndices:n}=Gt(f);if(e>0)Bt(t,!0),Bt(i,e+er(e,n));else if(e<0){const t=Gt(b);t.length>0&&(e-=er(-e,t)),Bt(o,e)}})),Ut(Zt(s,en(e)),(([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},dn.ERROR)}));const E=an(i);Ht(Zt(i,en(f),Yt((([e,t])=>{const n=t.groupIndices.length>0,r=[],a=t.lastSize;if(n){const n=An(t.sizeTree,0);let i=0,o=0;for(;i<e;){const e=t.groupIndices[o],s=t.groupIndices.length===o+1?1/0:t.groupIndices[o+1]-e-1;r.push({endIndex:e,size:n,startIndex:e}),r.push({endIndex:e+1+s-1,size:a,startIndex:e+1}),o++,i+=s+1}const s=Cn(t.sizeTree);return i!==e&&s.shift(),s.reduce(((t,{k:n,v:r})=>{let a=t.ranges;return 0!==t.prevSize&&(a=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:r,ranges:a}}),{prevIndex:e,prevSize:0,ranges:r}).ranges}return Cn(t.sizeTree).reduce(((t,{k:n,v:r})=>({prevIndex:n+e,prevSize:r,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]})),{prevIndex:0,prevSize:a,ranges:[]}).ranges}))),n);const v=an(Zt(o,en(f,g),Yt((([e,{offsetTree:t},n])=>Kn(-e,t,n)))));return Ht(Zt(o,en(f,g),Yt((([e,t,n])=>{if(t.groupIndices.length>0){if(Tn(t.sizeTree))return t;let r=kn();const a=Gt(b);let i=0,o=0,s=0;for(;i<-e;){s=a[o];const e=a[o+1]-s-1;o++,i+=e+1}if(r=Cn(t.sizeTree).reduce(((t,{k:n,v:r})=>In(t,Math.max(0,n+e),r)),r),i!==-e){r=In(r,0,An(t.sizeTree,s));r=In(r,1,wn(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...tr(t.offsetTree,0,r,n)}}{const r=Cn(t.sizeTree).reduce(((t,{k:n,v:r})=>In(t,Math.max(0,n+e),r)),kn());return{...t,sizeTree:r,...tr(t.offsetTree,0,r,n)}}}))),f),{beforeUnshiftWith:E,data:p,defaultItemSize:u,firstItemIndex:s,fixedItemSize:c,gap:g,groupIndices:l,itemSize:d,listRefresh:y,shiftWith:o,shiftWithOffset:v,sizeRanges:n,sizes:f,statefulTotalCount:a,totalCount:r,trackItemSizes:h,unshiftWith:i}}),Ft(gn,Hn),{singleton:!0});function or(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{groupIndices:[],totalCount:0})}const sr=on((([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:a}])=>{const i=rn(),o=rn(),s=an(Zt(i,Yt(or)));return Ht(Zt(s,Yt((e=>e.totalCount))),n),Ht(Zt(s,Yt((e=>e.groupIndices))),e),Ht(Zt(ln(a,t,r),Wt((([e,t])=>qn(t))),Yt((([e,t,n])=>wn(t.groupOffsetTree,Math.max(e-n,0),"v")[0])),qt(),Yt((e=>[e]))),o),{groupCounts:i,topItemsIndexes:o}}),Ft(ir,En)),lr=on((([{log:e}])=>{const t=tn(!1),n=an(Zt(t,Wt((e=>e)),qt()));return Ut(t,(t=>{t&&Gt(e)("props updated",{},dn.DEBUG)})),{didMount:n,propsReady:t}}),Ft(gn),{singleton:!0}),cr=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function ur(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!cr)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const dr=on((([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:a,fixedHeaderHeight:i,footerHeight:o,headerHeight:s,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:u,viewportHeight:d},{log:p}])=>{const g=rn(),m=rn(),f=tn(0);let b=null,h=null,y=null;function E(){b&&(b(),b=null),y&&(y(),y=null),h&&(clearTimeout(h),h=null),Bt(l,!1)}return Ht(Zt(g,en(n,d,r,f,s,o,p),en(e,i,a),Yt((([[e,n,r,a,i,o,s,c],d,p,f])=>{const v=ur(e),{align:S,behavior:T,offset:A}=v,w=a-1,I=Xn(v,n,w);let k=Kn(I,n.offsetTree,d)+o;"end"===S?(k+=p+wn(n.sizeTree,I)[1]-r+f,I===w&&(k+=s)):"center"===S?k+=(p+wn(n.sizeTree,I)[1]-r+f)/2:k-=i,A&&(k+=A);const R=t=>{E(),t?(c("retrying to scroll to",{location:e},dn.DEBUG),Bt(g,e)):(Bt(m,!0),c("list did not change, scroll successful",{},dn.DEBUG))};if(E(),"smooth"===T){let e=!1;y=Ut(t,(t=>{e=e||t})),b=zt(u,(()=>{R(e)}))}else b=zt(Zt(t,function(e){return t=>{const n=setTimeout((()=>{t(!1)}),e);return e=>{e&&(t(!0),clearTimeout(n))}}}(150)),R);return h=setTimeout((()=>{E()}),1200),Bt(l,!0),c("scrolling from index to",{behavior:T,index:I,top:k},dn.DEBUG),{behavior:T,top:k}}))),c),{scrollTargetReached:m,scrollToIndex:g,topListHeight:f}}),Ft(ir,En,gn),{singleton:!0});function pr(e,t){0==e?t():requestAnimationFrame((()=>{pr(e-1,t)}))}function gr(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const mr=on((([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:a,scrollToIndex:i},{didMount:o}])=>{const s=tn(!0),l=tn(0),c=tn(!0);return Ht(Zt(o,en(l),Wt((([e,t])=>!!t)),Kt(!1)),s),Ht(Zt(o,en(l),Wt((([e,t])=>!!t)),Kt(!1)),c),Ut(Zt(ln(t,o),en(s,n,e,c),Wt((([[,e],t,{sizeTree:n},r,a])=>e&&(!Tn(n)||Lt(r))&&!t&&!a)),en(l)),(([,e])=>{zt(a,(()=>{Bt(c,!0)})),pr(4,(()=>{zt(r,(()=>{Bt(s,!0)})),Bt(i,e)}))})),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}}),Ft(ir,En,dr,lr),{singleton:!0});function fr(e,t){return Math.abs(e-t)<1.01}const br="up",hr="down",yr={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Er=on((([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:a,viewportHeight:i}])=>{const o=tn(!1),s=tn(!0),l=rn(),c=rn(),u=tn(4),d=tn(0),p=nn(Zt(un(Zt(cn(a),Qt(1),Kt(!0)),Zt(cn(a),Qt(1),Kt(!1),jt(100))),qt()),!1),g=nn(Zt(un(Zt(n,Kt(!0)),Zt(n,Kt(!1),jt(200))),qt()),!1);Ht(Zt(ln(cn(a),cn(d)),Yt((([e,t])=>e<=t)),qt()),s),Ht(Zt(s,Jt(50)),c);const m=an(Zt(ln(r,cn(i),cn(t),cn(e),cn(u)),Xt(((e,[{scrollHeight:t,scrollTop:n},r,a,i,o])=>{const s={scrollHeight:t,scrollTop:n,viewportHeight:r};if(n+r-t>-o){let t,r;return n>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-n):(t="SIZE_DECREASED",r=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:s}}let l;return l=s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:s}}),yr),qt(((e,t)=>e&&e.atBottom===t.atBottom)))),f=nn(Zt(r,Xt(((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(fr(e.scrollHeight,t))return{changed:!1,jump:0,scrollHeight:t,scrollTop:n};{const a=t-(n+r)<1;return e.scrollTop!==n&&a?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}}),{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Wt((e=>e.changed)),Yt((e=>e.jump))),0);Ht(Zt(m,Yt((e=>e.atBottom))),o),Ht(Zt(o,Jt(50)),l);const b=tn(hr);Ht(Zt(r,Yt((({scrollTop:e})=>e)),qt(),Xt(((e,t)=>Gt(g)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?br:hr,prevScrollTop:t}),{direction:hr,prevScrollTop:0}),Yt((e=>e.direction))),b),Ht(Zt(r,Jt(50),Kt("none")),b);const h=tn(0);return Ht(Zt(p,Wt((e=>!e)),Kt(0)),h),Ht(Zt(a,Jt(100),en(p),Wt((([e,t])=>!!t)),Xt((([e,t],[n])=>[t,n]),[0,0]),Yt((([e,t])=>t-e))),h),{atBottomState:m,atBottomStateChange:l,atBottomThreshold:u,atTopStateChange:c,atTopThreshold:d,isAtBottom:o,isAtTop:s,isScrolling:p,lastJumpDueToItemResize:f,scrollDirection:b,scrollVelocity:h}}),Ft(En)),vr="top",Sr="bottom",Tr="none";function Ar(e,t,n){return"number"==typeof e?n===br&&t===vr||n===hr&&t===Sr?e:0:n===br?t===vr?e.main:e.reverse:t===Sr?e.main:e.reverse}function wr(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const Ir=on((([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:a}])=>{const i=rn(),o=tn(0),s=tn(0),l=tn(0),c=nn(Zt(ln(cn(r),cn(a),cn(n),cn(i,Gn),cn(l),cn(o),cn(t),cn(e),cn(s)),Yt((([e,t,n,[r,a],i,o,s,l,c])=>{const u=e-l,d=o+s,p=Math.max(n-u,0);let g=Tr;const m=wr(c,vr),f=wr(c,Sr);return r-=l,a+=n+s,(r+=n+s)>e+d-m&&(g=br),(a-=l)<e-p+t+f&&(g=hr),g!==Tr?[Math.max(u-n-Ar(i,vr,g)-m,0),u-p-s+t+Ar(i,Sr,g)+f]:null})),Wt((e=>null!=e)),qt(Gn)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:o,visibleRange:c}}),Ft(En),{singleton:!0});const kr={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Rr(e,t,n,r,a,i){const{lastIndex:o,lastOffset:s,lastSize:l}=a;let c=0,u=0;if(e.length>0){c=e[0].offset;const t=e[e.length-1];u=t.offset+t.size}const d=n-o,p=c,g=s+d*l+(d-1)*r-u;return{bottom:u,firstItemIndex:i,items:Cr(e,a,i),offsetBottom:g,offsetTop:c,top:p,topItems:Cr(t,a,i),topListHeight:t.reduce(((e,t)=>t.size+e),0),totalCount:n}}function _r(e,t,n,r,a,i){let o=0;if(n.groupIndices.length>0)for(const t of n.groupIndices){if(t-o>=e)break;o++}const s=e+o,l=gr(t,s);return Rr(Array.from({length:s}).map(((e,t)=>({data:i[t+l],index:t+l,offset:0,size:0}))),[],s,a,n,r)}function Cr(e,t,n){if(0===e.length)return[];if(!qn(t))return e.map((e=>({...e,index:e.index+n,originalIndex:e.index})));const r=e[0].index,a=e[e.length-1].index,i=[],o=Rn(t.groupOffsetTree,r,a);let s,l=0;for(const r of e){let e;(!s||s.end<r.index)&&(s=o.shift(),l=t.groupIndices.indexOf(s.start)),e=r.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+n},i.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return i}const Nr=on((([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:a},i,{listBoundary:o,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:u},{topListHeight:d},p,{didMount:g},{recalcInProgress:m}])=>{const f=tn([]),b=tn(0),h=rn();Ht(i.topItemsIndexes,f);const y=nn(Zt(ln(g,m,cn(l,Gn),cn(a),cn(r),cn(c),u,cn(f),cn(t),cn(n),e),Wt((([e,t,,n,,,,,,,r])=>{const a=r&&r.length!==n;return e&&!t&&!a})),Yt((([,,[e,t],n,r,a,i,o,s,l,c])=>{const u=r,{offsetTree:d,sizeTree:p}=u,g=Gt(b);if(0===n)return{...kr,totalCount:n};if(0===e&&0===t)return 0===g?{...kr,totalCount:n}:_r(g,a,r,s,l,c||[]);if(Tn(p))return g>0?null:Rr(function(e,t,n){if(qn(t)){const r=Zn(e,t);return[{index:wn(t.groupOffsetTree,r)[0],offset:0,size:0},{data:null==n?void 0:n[0],index:r,offset:0,size:0}]}return[{data:null==n?void 0:n[0],index:e,offset:0,size:0}]}(gr(a,n),u,c),[],n,l,u,s);const m=[];if(o.length>0){const e=o[0],t=o[o.length-1];let n=0;for(const r of Rn(p,e,t)){const a=r.value,i=Math.max(r.start,e),o=Math.min(r.end,t);for(let e=i;e<=o;e++)m.push({data:null==c?void 0:c[e],index:e,offset:n,size:a}),n+=a}}if(!i)return Rr([],m,n,l,u,s);const f=o.length>0?o[o.length-1]+1:0,h=Qn(d,e,t,f);if(0===h.length)return null;const y=n-1,E=Pt([],(n=>{for(const r of h){const a=r.value;let i=a.offset,o=r.start;const s=a.size;if(a.offset<e){o+=Math.floor((e-a.offset+l)/(s+l));const t=o-r.start;i+=t*s+t*l}o<f&&(i+=(f-o)*s,o=f);const u=Math.min(r.end,y);for(let e=o;e<=u&&!(i>=t);e++)n.push({data:null==c?void 0:c[e],index:e,offset:i,size:s}),i+=s+l}}));return Rr(E,m,n,l,u,s)})),Wt((e=>null!==e)),qt()),kr);Ht(Zt(e,Wt(Lt),Yt((e=>null==e?void 0:e.length))),a),Ht(Zt(y,Yt((e=>e.topListHeight))),d),Ht(d,s),Ht(Zt(y,Yt((e=>[e.top,e.bottom]))),o),Ht(Zt(y,Yt((e=>e.items))),h);const E=an(Zt(y,Wt((({items:e})=>e.length>0)),en(a,e),Wt((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),Yt((([,e,t])=>[e-1,t])),qt(Gn),Yt((([e])=>e)))),v=an(Zt(y,Jt(200),Wt((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),Yt((({items:e})=>e[0].index)),qt())),S=an(Zt(y,Wt((({items:e})=>e.length>0)),Yt((({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}})),qt($n)));return{endReached:E,initialItemCount:b,itemsRendered:h,listState:y,rangeChanged:S,startReached:v,topItemsIndexes:f,...p}}),Ft(ir,sr,Ir,mr,dr,Er,lr,Hn),{singleton:!0}),Or=on((([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:a}])=>{const i=rn(),o=nn(Zt(ln(n,e,r,t,a),Yt((([e,t,n,r,a])=>e+t+n+r+a.offsetBottom+a.bottom))),0);return Ht(cn(o),i),{totalListHeight:o,totalListHeightChanged:i}}),Ft(En,Nr),{singleton:!0}),xr=on((([{viewportHeight:e},{totalListHeight:t}])=>{const n=tn(!1),r=nn(Zt(ln(n,e,t),Wt((([e])=>e)),Yt((([,e,t])=>Math.max(0,e-t))),Jt(0),qt()),0);return{alignToBottom:n,paddingTopAddition:r}}),Ft(En,Or),{singleton:!0});function Lr(e){return!!e&&("smooth"===e?"smooth":"auto")}const Dr=on((([{listRefresh:e,totalCount:t},{atBottomState:n,isAtBottom:r},{scrollToIndex:a},{scrolledToInitialItem:i},{didMount:o,propsReady:s},{log:l},{scrollingInProgress:c}])=>{const u=tn(!1),d=rn();let p=null;function g(e){Bt(a,{align:"end",behavior:e,index:"LAST"})}function m(e){const t=zt(n,(t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!p&&(Gt(l)("scrolling to bottom due to increased size",{},dn.DEBUG),g("auto"))}));setTimeout(t,100)}return Ut(Zt(ln(Zt(cn(t),Qt(1)),o),en(cn(u),r,i,c),Yt((([[e,t],n,r,a,i])=>{let o=t&&a,s="auto";return o&&(s=((e,t)=>"function"==typeof e?Lr(e(t)):t&&Lr(e))(n,r||i),o=o&&!!s),{followOutputBehavior:s,shouldFollow:o,totalCount:e}})),Wt((({shouldFollow:e})=>e))),(({followOutputBehavior:t,totalCount:n})=>{p&&(p(),p=null),p=zt(e,(()=>{Gt(l)("following output to ",{totalCount:n},dn.DEBUG),g(t),p=null}))})),Ut(Zt(ln(cn(u),t,s),Wt((([e,,t])=>e&&t)),Xt((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),Wt((({refreshed:e})=>e)),en(u,t)),(([,e])=>{Gt(i)&&m(!1!==e)})),Ut(d,(()=>{m(!1!==Gt(u))})),Ut(ln(cn(u),n),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")})),{autoscrollToBottom:d,followOutput:u}}),Ft(ir,Er,dr,mr,lr,gn,En)),Pr=on((([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:a},{initialItemCount:i,listState:o},{didMount:s}])=>(Ht(Zt(s,en(i),Wt((([,e])=>0!==e)),en(a,r,t,n,e),Yt((([[,e],t,n,r,a,i=[]])=>_r(e,t,n,r,a,i)))),o),{})),Ft(ir,mr,Nr,lr),{singleton:!0}),Mr=on((([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=tn(0);return Ut(Zt(e,en(r),Wt((([,e])=>0!==e)),Yt((([,e])=>({top:e})))),(e=>{zt(Zt(n,Qt(1),Wt((e=>e.items.length>1))),(()=>{requestAnimationFrame((()=>{Bt(t,e)}))}))})),{initialScrollTop:r}}),Ft(lr,En,Nr),{singleton:!0}),Fr=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...a},viewportBottom:i,viewportTop:o})=>t<o?{...a,align:null!=n?n:"start",behavior:r}:e>i?{...a,align:null!=n?n:"end",behavior:r}:null,Ur=on((([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:a,headerHeight:i,scrollingInProgress:o,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=rn();return Ht(Zt(u,en(t,l,n,i,a,r,s),en(e),Yt((([[e,t,n,r,a,i,s,l],c])=>{const{align:u,behavior:d,calculateViewLocation:p=Fr,done:g,...m}=e,f=Xn(e,t,r-1),b=Kn(f,t.offsetTree,c)+a+i,h=p({itemBottom:b+wn(t.sizeTree,f)[1],itemTop:b,locationParams:{align:u,behavior:d,...m},viewportBottom:l+n-s,viewportTop:l+i});return h?g&&zt(Zt(o,Wt((e=>!e)),Qt(Gt(o)?1:2)),g):g&&g(),h})),Wt((e=>null!==e))),c),{scrollIntoView:u}}),Ft(ir,En,dr,Nr,gn),{singleton:!0}),Br=on((([{scrollVelocity:e}])=>{const t=tn(!1),n=rn(),r=tn(!1);return Ht(Zt(e,en(r,t,n),Wt((([e,t])=>!!t)),Yt((([e,t,n,r])=>{const{enter:a,exit:i}=t;if(n){if(i(e,r))return!1}else if(a(e,r))return!0;return n})),qt()),t),Ut(Zt(ln(t,e,n),en(r)),(([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)})),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}}),Ft(Er),{singleton:!0}),$r=on((([{scrollContainerState:e,scrollTo:t}])=>{const n=rn(),r=rn(),a=rn(),i=tn(!1),o=tn(void 0);return Ht(Zt(ln(n,r),Yt((([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n})))),e),Ht(Zt(t,en(r),Yt((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),a),{customScrollParent:o,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:a,windowViewportRect:r}}),Ft(En)),Gr=on((([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:a},{didMount:i},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=rn(),u=tn(void 0),d=tn(null),p=tn(null);return Ht(s,d),Ht(l,p),Ut(Zt(c,en(t,r,o,d,p,n)),(([e,t,n,r,a,i,o])=>{const s=function(e){return Cn(e).map((({k:e,v:t},n,r)=>{const a=r[n+1];return{endIndex:a?a.k-1:1/0,size:t,startIndex:e}}))}(t.sizeTree);r&&null!==a&&null!==i&&(n=a.scrollTop-i.offsetTop),e({ranges:s,scrollTop:n-=o})})),Ht(Zt(u,Wt(Lt),Yt(Hr)),a),Ht(Zt(i,en(u),Wt((([,e])=>void 0!==e)),qt(),Yt((([,e])=>e.ranges))),e),{getState:c,restoreStateFrom:u}}),Ft(ir,En,mr,lr,$r));function Hr(e){return{align:"start",index:0,offset:e.scrollTop}}const zr=on((([{topItemsIndexes:e}])=>{const t=tn(0);return Ht(Zt(t,Wt((e=>e>=0)),Yt((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),Ft(Nr));function jr(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Vr=jr((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),qr=on((([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:a,isScrolling:i,lastJumpDueToItemResize:o,scrollDirection:s},{listState:l},{beforeUnshiftWith:c,gap:u,shiftWithOffset:d,sizes:p},{log:g},{recalcInProgress:m}])=>{const f=an(Zt(l,en(o),Xt((([,e,t,n],[{bottom:r,items:a,offsetBottom:i,totalCount:o},s])=>{const l=r+i;let c=0;return t===o&&e.length>0&&a.length>0&&(0===a[0].originalIndex&&0===e[0].originalIndex||(c=l-n,0!==c&&(c+=s))),[c,a,o,l]}),[0,[],0,0]),Wt((([e])=>0!==e)),en(r,s,n,a,g,m),Wt((([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===br)),Yt((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},dn.DEBUG),e)))));function b(n){n>0?(Bt(t,{behavior:"auto",top:-n}),Bt(e,0)):(Bt(e,0),Bt(t,{behavior:"auto",top:-n}))}return Ut(Zt(f,en(e,i)),(([t,n,r])=>{r&&Vr()?Bt(e,n-t):b(-t)})),Ut(Zt(ln(nn(i,!1),e,m),Wt((([e,t,n])=>!e&&!n&&0!==t)),Yt((([e,t])=>t)),Jt(1)),b),Ht(Zt(d,Yt((e=>({top:-e})))),t),Ut(Zt(c,en(p,u),Yt((([e,{groupIndices:t,lastSize:n,sizeTree:r},a])=>{function i(e){return e*(n+a)}if(0===t.length)return i(e);{let n=0;const a=An(r,0);let o=0,s=0;for(;o<e;){o++,n+=a;let r=t.length===s+1?1/0:t[s+1]-t[s]-1;o+r>e&&(n-=a,r=e-o+1),o+=r,n+=i(r),s++}return n}}))),(n=>{Bt(e,n),requestAnimationFrame((()=>{Bt(t,{top:n}),requestAnimationFrame((()=>{Bt(e,0),Bt(m,!1)}))}))})),{deviation:e}}),Ft(En,Er,Nr,ir,gn,Hn)),Wr=on((([e,t,n,r,a,i,o,s,l,c])=>({...e,...t,...n,...r,...a,...i,...o,...s,...l,...c})),Ft(Ir,Pr,lr,Br,Or,Mr,xr,$r,Ur,gn)),Yr=on((([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:a,groupIndices:i,itemSize:o,sizeRanges:s,sizes:l,statefulTotalCount:c,totalCount:u,trackItemSizes:d},{initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m},f,b,h,{listState:y,topItemsIndexes:E,...v},{scrollToIndex:S},T,{topItemCount:A},{groupCounts:w},I])=>(Ht(v.rangeChanged,I.scrollSeekRangeChanged),Ht(Zt(I.windowViewportRect,Yt((e=>e.visibleHeight))),f.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:a,groupCounts:w,initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m,sizeRanges:s,topItemCount:A,topItemsIndexes:E,totalCount:u,...h,groupIndices:i,itemSize:o,listState:y,scrollToIndex:S,statefulTotalCount:c,trackItemSizes:d,...v,...I,...f,sizes:l,...b})),Ft(ir,mr,En,Gr,Dr,Nr,dr,qr,zr,sr,Wr));function Kr(e,t){const n={},r={};let a=0;const i=e.length;for(;a<i;)r[e[a]]=1,a+=1;for(const e in t)Object.hasOwn(r,e)||(n[e]=t[e]);return n}const Zr=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Xr(e,t,r){const a=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),s=Object.keys(t.events||{}),l=w.createContext({});function c(e,n){e.propsReady&&Bt(e.propsReady,!1);for(const r of a){Bt(e[t.required[r]],n[r])}for(const r of i)if(r in n){Bt(e[t.optional[r]],n[r])}e.propsReady&&Bt(e.propsReady,!0)}function u(e){return s.reduce(((n,r)=>(n[r]=function(e){let t,n;const r=()=>null==t?void 0:t();return function(a,i){switch(a){case 1:return i?n===i?void 0:(r(),n=i,t=Ut(e,i),t):(r(),Dt);case 2:return r(),void(n=null)}}}(e[t.events[r]]),n)),{})}const d=w.forwardRef(((d,p)=>{const{children:g,...m}=d,[f]=w.useState((()=>Pt(function(e){const t=new Map,n=({constructor:e,dependencies:r,id:a,singleton:i})=>{if(i&&t.has(a))return t.get(a);const o=e(r.map((e=>n(e))));return i&&t.set(a,o),o};return n(e)}(e),(e=>{c(e,m)})))),[b]=w.useState(xt(u,f));Zr((()=>{for(const e of s)e in m&&Ut(b[e],m[e]);return()=>{Object.values(b).map($t)}}),[m,b,f]),Zr((()=>{c(f,m)})),w.useImperativeHandle(p,Ct(function(e){return o.reduce(((n,r)=>(n[r]=n=>{Bt(e[t.methods[r]],n)},n)),{})}(f)));const h=r;return n(l.Provider,{value:f,children:r?n(h,{...Kr([...a,...i,...s],m),children:g}):g})})),p=w.version.startsWith("18")?e=>{const t=w.useContext(l)[e],n=w.useCallback((e=>Ut(t,e)),[t]);return w.useSyncExternalStore(n,(()=>Gt(t)),(()=>Gt(t)))}:e=>{const t=w.useContext(l)[e],[n,r]=w.useState(xt(Gt,t));return Zr((()=>Ut(t,(e=>{e!==n&&r(Ct(e))}))),[t,n]),n};return{Component:d,useEmitter:(e,t)=>{const n=w.useContext(l)[e];Zr((()=>Ut(n,t)),[t,n])},useEmitterValue:p,usePublisher:e=>{const t=w.useContext(l);return w.useCallback((n=>{Bt(t[e],n)}),[t,e])}}}const Qr=w.createContext(void 0),Jr=w.createContext(void 0),ea=typeof document<"u"?w.useLayoutEffect:w.useEffect;function ta(e){return"self"in e}function na(e,t,n,r=Dt,a,i){const o=w.useRef(null),s=w.useRef(null),l=w.useRef(null),c=w.useCallback((n=>{let r,a,o;const c=n.target;if(function(e){return"body"in e}(c)||ta(c)){const e=ta(c)?c:c.defaultView;o=i?e.scrollX:e.scrollY,r=i?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,a=i?e.innerWidth:e.innerHeight}else o=i?c.scrollLeft:c.scrollTop,r=i?c.scrollWidth:c.scrollHeight,a=i?c.offsetWidth:c.offsetHeight;const u=()=>{e({scrollHeight:r,scrollTop:Math.max(o,0),viewportHeight:a})};n.suppressFlushSync?u():se.flushSync(u),null!==s.current&&(o===s.current||o<=0||o===r-a)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))}),[e,t,i]);return w.useEffect((()=>{const e=a||o.current;return r(a||o.current),c({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",c,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",c)}}),[o,c,n,r,a]),{scrollByCallback:function(e){i&&(e={behavior:e.behavior,left:e.top}),o.current.scrollBy(e)},scrollerRef:o,scrollToCallback:function(n){const r=o.current;if(!r||(i?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const a="smooth"===n.behavior;let c,u,d;ta(r)?(u=Math.max(Vn(r.document.documentElement,i?"width":"height"),i?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),c=i?r.innerWidth:r.innerHeight,d=i?window.scrollX:window.scrollY):(u=r[i?"scrollWidth":"scrollHeight"],c=Vn(r,i?"width":"height"),d=r[i?"scrollLeft":"scrollTop"]);const p=u-c;if(n.top=Math.ceil(Math.max(Math.min(p,n.top),0)),fr(c,u)||n.top===d)