UNPKG

@cloudquery/plugin-config-ui-lib

Version:

Plugin configuration UI library for CloudQuery Cloud App

1 lines 979 kB
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),n=require("@mui/material/Button"),r=require("@mui/material/Stack"),a=require("@mui/material/Tooltip"),i=require("react"),o=require("@mui/icons-material/Close"),s=require("@mui/icons-material/ExpandMore"),l=require("@mui/material/Accordion"),c=require("@mui/material/AccordionSummary"),u=require("@mui/material/Alert"),d=require("@mui/material/AlertTitle"),p=require("@mui/material/Card"),g=require("@mui/material/CardContent"),m=require("@mui/material/LinearProgress"),f=require("@mui/material/Typography"),b=require("@mui/material/styles"),h=require("@mui/icons-material/Download"),y=require("@mui/material/Box"),E=require("@mui/material/MenuItem"),v=require("react-dom"),S=require("@mui/material/Backdrop"),T=require("@mui/material/CircularProgress"),A=require("@mui/material/IconButton"),w=require("@mui/material/Modal"),I=require("@mui/icons-material/Link"),k=require("@mui/material/Divider"),R=require("@mui/material/Link"),C=require("@mui/icons-material/ContentCopy"),_=require("@mui/icons-material/ContentCopyRounded"),x=require("@mui/material/Tab"),N=require("@mui/material/Tabs"),O=require("yup"),L=require("@mui/icons-material/ChevronRight"),D=require("@mui/material/Step"),P=require("@mui/material/StepLabel"),M=require("@mui/material/Stepper"),F=require("@mui/material/CardHeader"),U=require("@mui/material/List"),B=require("@mui/material/ListItem"),$=require("@mui/material/FilledInput"),j=require("@mui/material/FormLabel"),G=require("@mui/material/InputLabel"),H=require("@mui/material/OutlinedInput"),z=require("@mui/material/PaginationItem"),V=require("@mui/material/TableCell"),q=require("@mui/material/TableRow");require("@mui/lab/themeAugmentation");var W=require("@mui/material/colors"),Y=require("@emotion/cache"),K=require("@emotion/react"),Z=require("@mui/material/CssBaseline"),X=require("@mui/material/FormHelperText"),Q=require("@mui/material/TextField"),J=require("@mui/icons-material"),ee=require("@mui/material/Skeleton"),te=require("@mui/material/AccordionDetails"),ne=require("@mui/icons-material/Check"),re=require("@mui/material/FormControl"),ae=require("@mui/material/Checkbox"),ie=require("@mui/material/FormControlLabel"),oe=require("@mui/material/Switch"),se=require("@mui/material/Autocomplete"),le=require("@mui/material/InputBase"),ce=require("@mui/x-date-pickers/AdapterDayjs"),ue=require("@mui/x-date-pickers/DateTimeField"),de=require("@mui/x-date-pickers/LocalizationProvider"),pe=require("@mui/x-date-pickers"),ge=require("@mui/material/Radio"),me=require("@mui/material/ToggleButton"),fe=require("@mui/material/ToggleButtonGroup"),be=require("@mui/icons-material/FilterAlt"),he=require("@mui/material/Menu"),ye=require("@mui/material/RadioGroup"),Ee=require("@mui/icons-material/Search");function ve(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var Se=ve(O);function Te(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 Ae(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 we="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_API_BASE_URL||process.env.REACT_APP_CLOUDQUERY_API_BASE_URL||"https://api.cloudquery.io",Ie="undefined"!=typeof window&&window.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||process.env.REACT_APP_CLOUDQUERY_OAUTH_CONNECTOR_URL||"https://cloud.cloudquery.io/auth/connector",ke="b25b8efe-63fd-4c32-9f87-059cfd649128",Re="************",Ce=e=>Ae(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")?"":we}${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 _e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ne,Oe={exports:{}};var Le=(Ne||(Ne=1,Oe.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}()),Oe.exports),De=xe(Le);function Pe(t,n){const r={debug:n.info.dark,error:n.error.main,fatal:n.error.dark,info:n.text.primary,panic:n.error.dark,trace:n.info.main,warn:n.warning.main};return t.replace(/}\s*{/g,"}\n{").split("\n").map((t=>{try{const n=JSON.parse(t),{level:a,time:i}=n,o=Te(n,["level","time"]),s=r[a.toLowerCase()];return{logLevel:a.toLowerCase(),logLine:e.jsxs(e.Fragment,{children:["[",De(i).format("YYYY-MM-DD HH:mm:ss:SSS"),"] |"," ",e.jsx("span",{style:{color:s},children:a.toUpperCase().padEnd(5," ")})," |"," ",e.jsx("span",{style:{color:s,wordBreak:"break-word"},children:JSON.stringify(o)})]}),logText:`${De(i).format("YYYY-MM-DD HH:mm:ss:SSS")} | ${a.toUpperCase().padEnd(5," ")} | ${JSON.stringify(o)}`}}catch(e){return}})).filter(Boolean)}function Me({LoadingSkeleton:n,children:a,data:i,emptyAction:o,emptyCondensed:s,emptyImage:l,emptyMessage:c,emptyTitle:u,errorMessage:d,errorTitle:p,isError:g,isLoading:m,loaderText:f,errorActionText:b}){return g?e.jsxs(t.Box,{padding:3,textAlign:"center",width:"100%",children:[e.jsx(t.Typography,{marginBottom:2,variant:"h5",children:null!=p?p:"Something went wrong"}),e.jsx(t.Typography,{variant:"body1",whiteSpace:"pre-line",children:d||`Error occurred when trying to ${b}.`})]}):m||!g&&!i&&!1===m?e.jsx(e.Fragment,{children:n?e.jsx(n,{}):e.jsx(r,{padding:1,width:"100%",children:e.jsxs(t.Box,{alignItems:"center",display:"flex",flexDirection:"column",gap:2,height:150,justifyContent:"center",children:[e.jsx(t.CircularProgress,{}),!!f&&e.jsx(t.Typography,{variant:"body1",children:f})]})})}):i&&Array.isArray(i)&&0===i.length?e.jsx(t.Box,{sx:{bgcolor:"background.paper",borderRadius:2.5,padding:s?5:9},textAlign:"center",width:"100%",children:e.jsxs(r,{spacing:3,children:[l&&e.jsx(t.Box,{display:"flex",justifyContent:"center",width:"100%",children:l}),e.jsxs(r,{alignItems:"center",spacing:2,children:[e.jsx(t.Typography,{color:"text.primary",variant:"h5",children:u}),!!c&&e.jsx(t.Typography,{maxWidth:"600px",sx:{color:"text.secondary"},variant:"body1",whiteSpace:"pre-line",children:c})]}),o&&e.jsx("div",{children:o})]})}):e.jsx(e.Fragment,{children:a(i)})}function Fe(e){return()=>e}function Ue(e){e()}function Be(e,t){return n=>e(t(n))}function $e(e,t){return()=>e(t)}function je(e){return void 0!==e}function Ge(){}function He(e,t){return t(e),e}function ze(e,t){return t(e)}function Ve(...e){return e}function qe(e,t){return e(1,t)}function We(e,t){e(0,t)}function Ye(e){e(2)}function Ke(e){return e(4)}function Ze(e,t){return qe(e,function(e,t){return n=>e(t,n)}(t,0))}function Xe(e,t){const n=e(1,(e=>{n(),t(e)}));return n}function Qe(e){let t,n;return r=>a=>{t=a,n&&clearTimeout(n),n=setTimeout((()=>{r(t)}),e)}}function Je(e,t){return e===t}function et(e=Je){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function tt(e){return t=>n=>{e(n)&&t(n)}}function nt(e){return t=>Be(t,e)}function rt(e){return t=>()=>{t(e)}}function at(e,...t){const n=function(...e){return t=>e.reduceRight(ze,t)}(...t);return(t,r)=>{switch(t){case 2:return void Ye(e);case 1:return qe(e,n(r))}}}function it(e,t){return n=>r=>{n(t=e(t,r))}}function ot(e){return t=>n=>{e>0?e--:t(n)}}function st(e){let t,n=null;return r=>a=>{n=a,!t&&(t=setTimeout((()=>{t=void 0,r(n)}),e))}}function lt(...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);qe(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 ct(e){let t=e;const n=dt();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return n(e,r)}}function ut(e,t){return He(ct(t),(t=>Ze(e,t)))}function dt(){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 pt(e){return He(dt(),(t=>Ze(e,t)))}function gt(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:mt(),singleton:n}}const mt=()=>Symbol();function ft(...e){const t=dt(),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);qe(e,(e=>{n[i]=e,r|=o,r===a&&We(t,n)}))})),function(e,i){switch(e){case 2:return void Ye(t);case 1:return r===a&&i(n),qe(t,i)}}}function bt(e,t=Je){return at(e,et(t))}function ht(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Ue)}}(...e.map((e=>qe(e,n))))}}}var yt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(yt||{});const Et={0:"debug",3:"error",1:"log",2:"warn"},vt=gt((()=>{const e=ct(3);return{log:ct(((t,n,r=1)=>{var a;r>=(null!=(a=(typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL)?a:Ke(e))&&console[Et[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)})),logLevel:e}}),[],{singleton:!0});function St(e,t,n){return Tt(e,t,n).callbackRef}function Tt(e,t,n){const r=i.useRef(null);let a=e=>{};const o=i.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==o||o.observe(e),r.current=e):(r.current&&(null==o||o.unobserve(r.current)),r.current=null)},{callbackRef:a,ref:r}}function At(e,t,n,r,a,o,s,l,c){const u=i.useCallback((n=>{const i=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},yt.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,l?"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=s?l?s.scrollLeft:s.scrollTop:u?l?d.scrollX||d.document.documentElement.scrollLeft:d.scrollY||d.document.documentElement.scrollTop:l?c.scrollLeft:c.scrollTop,g=s?l?s.scrollWidth:s.scrollHeight:u?l?d.document.documentElement.scrollWidth:d.document.documentElement.scrollHeight:l?c.scrollWidth:c.scrollHeight,m=s?l?s.offsetWidth:s.offsetHeight:u?l?d.innerWidth:d.innerHeight:l?c.offsetWidth:c.offsetHeight;r({scrollHeight:g,scrollTop:Math.max(p,0),viewportHeight:m}),null==o||o(l?wt("column-gap",getComputedStyle(n).columnGap,a):wt("row-gap",getComputedStyle(n).rowGap,a)),null!==i&&e(i)}),[e,t,a,o,s,r,l]);return Tt(u,n,c)}function wt(e,t,n){return"normal"!==t&&!(null!=t&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,yt.WARN),"normal"===t?0:parseInt(null!=t?t:"0",10)}function It(e,t,n){const r=i.useRef(null),a=i.useCallback((n=>{if(null==n||!n.offsetParent)return;const a=n.getBoundingClientRect(),i=a.width;let o,l;if(t){const e=t.getBoundingClientRect(),n=a.top-e.top;l=e.height-Math.max(0,n),o=n+t.scrollTop}else{const e=s.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,a.top),o=a.top+e.scrollY}r.current={offsetTop:o,visibleHeight:l,visibleWidth:i},e(r.current)}),[e,t]),{callbackRef:o,ref:s}=Tt(a,!0,n),l=i.useCallback((()=>{a(s.current)}),[a,s]);return i.useEffect((()=>{var e;if(t){t.addEventListener("scroll",l);const e=new ResizeObserver((()=>{requestAnimationFrame(l)}));return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}{const t=null==(e=s.current)?void 0:e.ownerDocument.defaultView;return null==t||t.addEventListener("scroll",l),null==t||t.addEventListener("resize",l),()=>{null==t||t.removeEventListener("scroll",l),null==t||t.removeEventListener("resize",l)}}}),[l,t,s]),o}const kt=gt((()=>{const e=dt(),t=dt(),n=ct(0),r=dt(),a=ct(0),i=dt(),o=dt(),s=ct(0),l=ct(0),c=ct(0),u=ct(0),d=dt(),p=dt(),g=ct(!1),m=ct(!1),f=ct(!1);return Ze(at(e,nt((({scrollTop:e})=>e))),t),Ze(at(e,nt((({scrollHeight:e})=>e))),o),Ze(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}),Rt={lvl:0};function Ct(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 _t(e){return e===Rt}function xt(e,t){if(!_t(e))return t===e.k?e.v:t<e.k?xt(e.l,t):xt(e.r,t)}function Nt(e,t,n="k"){if(_t(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Nt(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Nt(e.l,t,n)}function Ot(e,t,n){return _t(e)?Ht(t,n,1):t===e.k?Bt(e,{k:t,v:n}):t<e.k?zt(Bt(e,{l:Ot(e.l,t,n)})):zt(Bt(e,{r:Ot(e.r,t,n)}))}function Lt(){return Rt}function Dt(e,t,n){if(_t(e))return[];return function(e){return Ct(e,(({k:e,v:t})=>({index:e,value:t})))}(Ft(e,Nt(e,t)[0],n))}function Pt(e,t){if(_t(e))return Rt;const{k:n,l:r,r:a}=e;if(t===n){if(_t(r))return a;if(_t(a))return r;{const[t,n]=Gt(r);return Ut(Bt(e,{k:t,l:$t(r),v:n}))}}return Ut(Bt(e,t<n?{l:Pt(r,t)}:{r:Pt(a,t)}))}function Mt(e){return _t(e)?[]:[...Mt(e.l),{k:e.k,v:e.v},...Mt(e.r)]}function Ft(e,t,n){if(_t(e))return[];const{k:r,l:a,r:i,v:o}=e;let s=[];return r>t&&(s=s.concat(Ft(a,t,n))),r>=t&&r<=n&&s.push({k:r,v:o}),r<=n&&(s=s.concat(Ft(i,t,n))),s}function Ut(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(jt(t))return Vt(Bt(e,{lvl:n-1}));if(!_t(t)&&!_t(t.r))return Bt(t.r,{l:Bt(t,{r:t.r.l}),lvl:n,r:Bt(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(jt(e))return qt(Bt(e,{lvl:n-1}));if(_t(r)||_t(r.l))throw new Error("Unexpected empty nodes");{const t=r.l,a=jt(t)?r.lvl-1:r.lvl;return Bt(t,{l:Bt(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:qt(Bt(r,{l:t.r,lvl:a}))})}}function Bt(e,t){return Ht(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 $t(e){return _t(e.r)?e.l:Ut(Bt(e,{r:$t(e.r)}))}function jt(e){return _t(e)||e.lvl>e.r.lvl}function Gt(e){return _t(e.r)?[e.k,e.v]:Gt(e.r)}function Ht(e,t,n,r=Rt,a=Rt){return{k:e,l:r,lvl:n,r:a,v:t}}function zt(e){return qt(Vt(e))}function Vt(e){const{l:t}=e;return _t(t)||t.lvl!==e.lvl?e:Bt(t,{r:Bt(e,{l:t.r})})}function qt(e){const{lvl:t,r:n}=e;return _t(n)||_t(n.r)||n.lvl!==t||n.r.lvl!==t?e:Bt(n,{l:Bt(e,{r:n.l}),lvl:t+1})}function Wt(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function Yt(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const Kt=gt((()=>({recalcInProgress:ct(!1)})),[],{singleton:!0});function Zt(e,t,n){return e[Xt(e,t,n)]}function Xt(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 Qt(e,t){return Math.round(e.getBoundingClientRect()[t])}function Jt(e){return!_t(e.groupOffsetTree)}function en({index:e},t){return t===e?0:t<e?-1:1}function tn({offset:e},t){return t===e?0:t<e?-1:1}function nn(e,t,n){if(0===t.length)return 0;const{index:r,offset:a,size:i}=Zt(t,e,en),o=e-r,s=i*o+(o-1)*n+a;return s>0?s+n:s}function rn(e,t){if(!Jt(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function an(e,t,n){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;{let r=rn("LAST"===e.index?n:e.index,t);return r=Math.max(0,r,Math.min(n,r)),r}}function on(e,t,n,r=0){return r>0&&(t=Math.max(t,Zt(e,r,en).offset)),Ct(function(e,t,n,r){const a=Xt(e,t,r),i=Xt(e,n,r,a);return e.slice(a,i+1)}(e,t,n,tn),un)}function sn(e,[t,n,r,a]){t.length>0&&r("received item sizes",t,yt.DEBUG);const i=e.sizeTree;let o=i,s=0;if(n.length>0&&_t(i)&&2===t.length){const e=t[0].size,r=t[1].size;o=n.reduce(((t,n)=>Ot(Ot(t,n,e),n+1,r)),o)}else[o,s]=function(e,t){let n=_t(e)?0:1/0;for(const r of t){const{endIndex:t,size:a,startIndex:i}=r;if(n=Math.min(n,i),_t(e)){e=Ot(e,0,a);continue}const o=Dt(e,i-1,t+1);if(o.some(dn(r)))continue;let s=!1,l=!1;for(const{end:n,start:r,value:i}of o)s?(t>=r||a===i)&&(e=Pt(e,r)):(l=i!==a,s=!0),n>t&&t>=r&&i!==a&&(e=Ot(e,t+1,i));l&&(e=Ot(e,i,a))}return[e,n]}(o,t);if(o===i)return e;const{lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d}=cn(e.offsetTree,s,o,a);return{groupIndices:n,groupOffsetTree:n.reduce(((e,t)=>Ot(e,t,nn(t,d,a))),Lt()),lastIndex:l,lastOffset:c,lastSize:u,offsetTree:d,sizeTree:o}}function ln(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 cn(e,t,n,r){let a=e,i=0,o=0,s=0,l=0;if(0!==t){l=Xt(a,t-1,en),s=a[l].offset;const e=Nt(n,t-1);i=e[0],o=e[1],a.length&&a[l].size===Nt(n,t)[1]&&(l-=1),a=a.slice(0,l+1)}else a=[];for(const{start:e,value:l}of Dt(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 un(e){return{index:e.index,value:e}}function dn(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 pn={offsetHeight:"height",offsetWidth:"width"},gn=gt((([{log:e},{recalcInProgress:t}])=>{const n=dt(),r=dt(),a=ut(r,0),i=dt(),o=dt(),s=ct(0),l=ct([]),c=ct(void 0),u=ct(void 0),d=ct(((e,t)=>Qt(e,pn[t]))),p=ct(void 0),g=ct(0),m={groupIndices:[],groupOffsetTree:Lt(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Lt()},f=ut(at(n,lt(l,e,g),it(sn,m),et()),m),b=ut(at(l,et(),it(((e,t)=>({current:t,prev:e.current})),{current:[],prev:[]}),nt((({prev:e})=>e))),[]);Ze(at(l,tt((e=>e.length>0)),lt(f,g),nt((([e,t,n])=>{const r=e.reduce(((e,r,a)=>Ot(e,r,nn(r,t.offsetTree,n)||a)),Lt());return{...t,groupIndices:e,groupOffsetTree:r}}))),f),Ze(at(r,lt(f),tt((([e,{lastIndex:t}])=>e<t)),nt((([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}]))),n),Ze(c,u);const h=ut(at(c,nt((e=>void 0===e))),!0);Ze(at(u,tt((e=>void 0!==e&&_t(Ke(f).sizeTree))),nt((e=>[{endIndex:0,size:e,startIndex:0}]))),n);const y=pt(at(n,lt(f),it((({sizes:e},[t,n])=>({changed:n!==e,sizes:n})),{changed:!1,sizes:m}),nt((e=>e.changed))));qe(at(s,it(((e,t)=>({diff:e.prev-t,prev:t})),{diff:0,prev:0}),nt((e=>e.diff))),(e=>{const{groupIndices:n}=Ke(f);if(e>0)We(t,!0),We(i,e+ln(e,n));else if(e<0){const t=Ke(b);t.length>0&&(e-=ln(-e,t)),We(o,e)}})),qe(at(s,lt(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},yt.ERROR)}));const E=pt(i);Ze(at(i,lt(f),nt((([e,t])=>{const n=t.groupIndices.length>0,r=[],a=t.lastSize;if(n){const n=xt(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=Mt(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 Mt(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=pt(at(o,lt(f,g),nt((([e,{offsetTree:t},n])=>nn(-e,t,n)))));return Ze(at(o,lt(f,g),nt((([e,t,n])=>{if(t.groupIndices.length>0){if(_t(t.sizeTree))return t;let r=Lt();const a=Ke(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=Mt(t.sizeTree).reduce(((t,{k:n,v:r})=>Ot(t,Math.max(0,n+e),r)),r),i!==-e){r=Ot(r,0,xt(t.sizeTree,s));r=Ot(r,1,Nt(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...cn(t.offsetTree,0,r,n)}}{const r=Mt(t.sizeTree).reduce(((t,{k:n,v:r})=>Ot(t,Math.max(0,n+e),r)),Lt());return{...t,sizeTree:r,...cn(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}}),Ve(vt,Kt),{singleton:!0});function mn(e){return e.reduce(((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e)),{groupIndices:[],totalCount:0})}const fn=gt((([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:a}])=>{const i=dt(),o=dt(),s=pt(at(i,nt(mn)));return Ze(at(s,nt((e=>e.totalCount))),n),Ze(at(s,nt((e=>e.groupIndices))),e),Ze(at(ft(a,t,r),tt((([e,t])=>Jt(t))),nt((([e,t,n])=>Nt(t.groupOffsetTree,Math.max(e-n,0),"v")[0])),et(),nt((e=>[e]))),o),{groupCounts:i,topItemsIndexes:o}}),Ve(gn,kt)),bn=gt((([{log:e}])=>{const t=ct(!1),n=pt(at(t,tt((e=>e)),et()));return qe(t,(t=>{t&&Ke(e)("props updated",{},yt.DEBUG)})),{didMount:n,propsReady:t}}),Ve(vt),{singleton:!0}),hn=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function yn(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!hn)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const En=gt((([{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=dt(),m=dt(),f=ct(0);let b=null,h=null,y=null;function E(){b&&(b(),b=null),y&&(y(),y=null),h&&(clearTimeout(h),h=null),We(l,!1)}return Ze(at(g,lt(n,d,r,f,s,o,p),lt(e,i,a),nt((([[e,n,r,a,i,o,s,c],d,p,f])=>{const v=yn(e),{align:S,behavior:T,offset:A}=v,w=a-1,I=an(v,n,w);let k=nn(I,n.offsetTree,d)+o;"end"===S?(k+=p+Nt(n.sizeTree,I)[1]-r+f,I===w&&(k+=s)):"center"===S?k+=(p+Nt(n.sizeTree,I)[1]-r+f)/2:k-=i,A&&(k+=A);const R=t=>{E(),t?(c("retrying to scroll to",{location:e},yt.DEBUG),We(g,e)):(We(m,!0),c("list did not change, scroll successful",{},yt.DEBUG))};if(E(),"smooth"===T){let e=!1;y=qe(t,(t=>{e=e||t})),b=Xe(u,(()=>{R(e)}))}else b=Xe(at(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),We(l,!0),c("scrolling from index to",{behavior:T,index:I,top:k},yt.DEBUG),{behavior:T,top:k}}))),c),{scrollTargetReached:m,scrollToIndex:g,topListHeight:f}}),Ve(gn,kt,vt),{singleton:!0});function vn(e,t){0==e?t():requestAnimationFrame((()=>{vn(e-1,t)}))}function Sn(e,t){const n=t-1;return"number"==typeof e?e:"LAST"===e.index?n:e.index}const Tn=gt((([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:a,scrollToIndex:i},{didMount:o}])=>{const s=ct(!0),l=ct(0),c=ct(!0);return Ze(at(o,lt(l),tt((([e,t])=>!!t)),rt(!1)),s),Ze(at(o,lt(l),tt((([e,t])=>!!t)),rt(!1)),c),qe(at(ft(t,o),lt(s,n,e,c),tt((([[,e],t,{sizeTree:n},r,a])=>e&&(!_t(n)||je(r))&&!t&&!a)),lt(l)),(([,e])=>{Xe(a,(()=>{We(c,!0)})),vn(4,(()=>{Xe(r,(()=>{We(s,!0)})),We(i,e)}))})),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:s}}),Ve(gn,kt,En,bn),{singleton:!0});function An(e,t){return Math.abs(e-t)<1.01}const wn="up",In="down",kn={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Rn=gt((([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:a,viewportHeight:i}])=>{const o=ct(!1),s=ct(!0),l=dt(),c=dt(),u=ct(4),d=ct(0),p=ut(at(ht(at(bt(a),ot(1),rt(!0)),at(bt(a),ot(1),rt(!1),Qe(100))),et()),!1),g=ut(at(ht(at(n,rt(!0)),at(n,rt(!1),Qe(200))),et()),!1);Ze(at(ft(bt(a),bt(d)),nt((([e,t])=>e<=t)),et()),s),Ze(at(s,st(50)),c);const m=pt(at(ft(r,bt(i),bt(t),bt(e),bt(u)),it(((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}}),kn),et(((e,t)=>e&&e.atBottom===t.atBottom)))),f=ut(at(r,it(((e,{scrollHeight:t,scrollTop:n,viewportHeight:r})=>{if(An(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}),tt((e=>e.changed)),nt((e=>e.jump))),0);Ze(at(m,nt((e=>e.atBottom))),o),Ze(at(o,st(50)),l);const b=ct(In);Ze(at(r,nt((({scrollTop:e})=>e)),et(),it(((e,t)=>Ke(g)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?wn:In,prevScrollTop:t}),{direction:In,prevScrollTop:0}),nt((e=>e.direction))),b),Ze(at(r,st(50),rt("none")),b);const h=ct(0);return Ze(at(p,tt((e=>!e)),rt(0)),h),Ze(at(a,st(100),lt(p),tt((([e,t])=>!!t)),it((([e,t],[n])=>[t,n]),[0,0]),nt((([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}}),Ve(kt)),Cn="top",_n="bottom",xn="none";function Nn(e,t,n){return"number"==typeof e?n===wn&&t===Cn||n===In&&t===_n?e:0:n===wn?t===Cn?e.main:e.reverse:t===_n?e.main:e.reverse}function On(e,t){var n;return"number"==typeof e?e:null!=(n=e[t])?n:0}const Ln=gt((([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:a}])=>{const i=dt(),o=ct(0),s=ct(0),l=ct(0),c=ut(at(ft(bt(r),bt(a),bt(n),bt(i,Yt),bt(l),bt(o),bt(t),bt(e),bt(s)),nt((([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=xn;const m=On(c,Cn),f=On(c,_n);return r-=l,a+=n+s,(r+=n+s)>e+d-m&&(g=wn),(a-=l)<e-p+t+f&&(g=In),g!==xn?[Math.max(u-n-Nn(i,Cn,g)-m,0),u-p-s+t+Nn(i,_n,g)+f]:null})),tt((e=>null!=e)),et(Yt)),[0,0]);return{increaseViewportBy:s,listBoundary:i,overscan:l,topListHeight:o,visibleRange:c}}),Ve(kt),{singleton:!0});const Dn={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Pn(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:Fn(e,a,i),offsetBottom:g,offsetTop:c,top:p,topItems:Fn(t,a,i),topListHeight:t.reduce(((e,t)=>t.size+e),0),totalCount:n}}function Mn(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=Sn(t,s);return Pn(Array.from({length:s}).map(((e,t)=>({data:i[t+l],index:t+l,offset:0,size:0}))),[],s,a,n,r)}function Fn(e,t,n){if(0===e.length)return[];if(!Jt(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=Dt(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 Un=gt((([{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=ct([]),b=ct(0),h=dt();Ze(i.topItemsIndexes,f);const y=ut(at(ft(g,m,bt(l,Yt),bt(a),bt(r),bt(c),u,bt(f),bt(t),bt(n),e),tt((([e,t,,n,,,,,,,r])=>{const a=r&&r.length!==n;return e&&!t&&!a})),nt((([,,[e,t],n,r,a,i,o,s,l,c])=>{const u=r,{offsetTree:d,sizeTree:p}=u,g=Ke(b);if(0===n)return{...Dn,totalCount:n};if(0===e&&0===t)return 0===g?{...Dn,totalCount:n}:Mn(g,a,r,s,l,c||[]);if(_t(p))return g>0?null:Pn(function(e,t,n){if(Jt(t)){const r=rn(e,t);return[{index:Nt(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}]}(Sn(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 Dt(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 Pn([],m,n,l,u,s);const f=o.length>0?o[o.length-1]+1:0,h=on(d,e,t,f);if(0===h.length)return null;const y=n-1,E=He([],(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 Pn(E,m,n,l,u,s)})),tt((e=>null!==e)),et()),Dn);Ze(at(e,tt(je),nt((e=>null==e?void 0:e.length))),a),Ze(at(y,nt((e=>e.topListHeight))),d),Ze(d,s),Ze(at(y,nt((e=>[e.top,e.bottom]))),o),Ze(at(y,nt((e=>e.items))),h);const E=pt(at(y,tt((({items:e})=>e.length>0)),lt(a,e),tt((([{items:e},t])=>e[e.length-1].originalIndex===t-1)),nt((([,e,t])=>[e-1,t])),et(Yt),nt((([e])=>e)))),v=pt(at(y,st(200),tt((({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length)),nt((({items:e})=>e[0].index)),et())),S=pt(at(y,tt((({items:e})=>e.length>0)),nt((({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}})),et(Wt)));return{endReached:E,initialItemCount:b,itemsRendered:h,listState:y,rangeChanged:S,startReached:v,topItemsIndexes:f,...p}}),Ve(gn,fn,Ln,Tn,En,Rn,bn,Kt),{singleton:!0}),Bn=gt((([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:a}])=>{const i=dt(),o=ut(at(ft(n,e,r,t,a),nt((([e,t,n,r,a])=>e+t+n+r+a.offsetBottom+a.bottom))),0);return Ze(bt(o),i),{totalListHeight:o,totalListHeightChanged:i}}),Ve(kt,Un),{singleton:!0}),$n=gt((([{viewportHeight:e},{totalListHeight:t}])=>{const n=ct(!1),r=ut(at(ft(n,e,t),tt((([e])=>e)),nt((([,e,t])=>Math.max(0,e-t))),st(0),et()),0);return{alignToBottom:n,paddingTopAddition:r}}),Ve(kt,Bn),{singleton:!0});function jn(e){return!!e&&("smooth"===e?"smooth":"auto")}const Gn=gt((([{listRefresh:e,totalCount:t},{atBottomState:n,isAtBottom:r},{scrollToIndex:a},{scrolledToInitialItem:i},{didMount:o,propsReady:s},{log:l},{scrollingInProgress:c}])=>{const u=ct(!1),d=dt();let p=null;function g(e){We(a,{align:"end",behavior:e,index:"LAST"})}function m(e){const t=Xe(n,(t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&!p&&(Ke(l)("scrolling to bottom due to increased size",{},yt.DEBUG),g("auto"))}));setTimeout(t,100)}return qe(at(ft(at(bt(t),ot(1)),o),lt(bt(u),r,i,c),nt((([[e,t],n,r,a,i])=>{let o=t&&a,s="auto";return o&&(s=((e,t)=>"function"==typeof e?jn(e(t)):t&&jn(e))(n,r||i),o=o&&!!s),{followOutputBehavior:s,shouldFollow:o,totalCount:e}})),tt((({shouldFollow:e})=>e))),(({followOutputBehavior:t,totalCount:n})=>{p&&(p(),p=null),p=Xe(e,(()=>{Ke(l)("following output to ",{totalCount:n},yt.DEBUG),g(t),p=null}))})),qe(at(ft(bt(u),t,s),tt((([e,,t])=>e&&t)),it((({value:e},[,t])=>({refreshed:e===t,value:t})),{refreshed:!1,value:0}),tt((({refreshed:e})=>e)),lt(u,t)),(([,e])=>{Ke(i)&&m(!1!==e)})),qe(d,(()=>{m(!1!==Ke(u))})),qe(ft(bt(u),n),(([e,t])=>{e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")})),{autoscrollToBottom:d,followOutput:u}}),Ve(gn,Rn,En,Tn,bn,vt,kt)),Hn=gt((([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:a},{initialItemCount:i,listState:o},{didMount:s}])=>(Ze(at(s,lt(i),tt((([,e])=>0!==e)),lt(a,r,t,n,e),nt((([[,e],t,n,r,a,i=[]])=>Mn(e,t,n,r,a,i)))),o),{})),Ve(gn,Tn,Un,bn),{singleton:!0}),zn=gt((([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=ct(0);return qe(at(e,lt(r),tt((([,e])=>0!==e)),nt((([,e])=>({top:e})))),(e=>{Xe(at(n,ot(1),tt((e=>e.items.length>1))),(()=>{requestAnimationFrame((()=>{We(t,e)}))}))})),{initialScrollTop:r}}),Ve(bn,kt,Un),{singleton:!0}),Vn=({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,qn=gt((([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:a,headerHeight:i,scrollingInProgress:o,scrollTop:s,viewportHeight:l},{scrollToIndex:c}])=>{const u=dt();return Ze(at(u,lt(t,l,n,i,a,r,s),lt(e),nt((([[e,t,n,r,a,i,s,l],c])=>{const{align:u,behavior:d,calculateViewLocation:p=Vn,done:g,...m}=e,f=an(e,t,r-1),b=nn(f,t.offsetTree,c)+a+i,h=p({itemBottom:b+Nt(t.sizeTree,f)[1],itemTop:b,locationParams:{align:u,behavior:d,...m},viewportBottom:l+n-s,viewportTop:l+i});return h?g&&Xe(at(o,tt((e=>!e)),ot(Ke(o)?1:2)),g):g&&g(),h})),tt((e=>null!==e))),c),{scrollIntoView:u}}),Ve(gn,kt,En,Un,vt),{singleton:!0}),Wn=gt((([{scrollVelocity:e}])=>{const t=ct(!1),n=dt(),r=ct(!1);return Ze(at(e,lt(r,t,n),tt((([e,t])=>!!t)),nt((([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})),et()),t),qe(at(ft(t,e,n),lt(r)),(([[e,t,n],r])=>{e&&r&&r.change&&r.change(t,n)})),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}}),Ve(Rn),{singleton:!0}),Yn=gt((([{scrollContainerState:e,scrollTo:t}])=>{const n=dt(),r=dt(),a=dt(),i=ct(!1),o=ct(void 0);return Ze(at(ft(n,r),nt((([{scrollHeight:e,scrollTop:t,viewportHeight:n},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:n})))),e),Ze(at(t,lt(r),nt((([e,{offsetTop:t}])=>({...e,top:e.top+t})))),a),{customScrollParent:o,useWindowScroll:i,windowScrollContainerState:n,windowScrollTo:a,windowViewportRect:r}}),Ve(kt)),Kn=gt((([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:a},{didMount:i},{useWindowScroll:o,windowScrollContainerState:s,windowViewportRect:l}])=>{const c=dt(),u=ct(void 0),d=ct(null),p=ct(null);return Ze(s,d),Ze(l,p),qe(at(c,lt(t,r,o,d,p,n)),(([e,t,n,r,a,i,o])=>{const s=function(e){return Mt(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})})),Ze(at(u,tt(je),nt(Zn)),a),Ze(at(i,lt(u),tt((([,e])=>void 0!==e)),et(),nt((([,e])=>e.ranges))),e),{getState:c,restoreStateFrom:u}}),Ve(gn,kt,Tn,bn,Yn));function Zn(e){return{align:"start",index:0,offset:e.scrollTop}}const Xn=gt((([{topItemsIndexes:e}])=>{const t=ct(0);return Ze(at(t,tt((e=>e>=0)),nt((e=>Array.from({length:e}).map(((e,t)=>t))))),e),{topItemCount:t}}),Ve(Un));function Qn(e){let t,n=!1;return()=>(n||(n=!0,t=e()),t)}const Jn=Qn((()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent))),er=gt((([{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=pt(at(l,lt(o),it((([,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]),tt((([e])=>0!==e)),lt(r,s,n,a,g,m),tt((([,e,t,n,,,r])=>!r&&!n&&0!==e&&t===wn)),nt((([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},yt.DEBUG),e)))));function b(n){n>0?(We(t,{behavior:"auto",top:-n}),We(e,0)):(We(e,0),We(t,{behavior:"auto",top:-n}))}return qe(at(f,lt(e,i)),(([t,n,r])=>{r&&Jn()?We(e,n-t):b(-t)})),qe(at(ft(ut(i,!1),e,m),tt((([e,t,n])=>!e&&!n&&0!==t)),nt((([e,t])=>t)),st(1)),b),Ze(at(d,nt((e=>({top:-e})))),t),qe(at(c,lt(p,u),nt((([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=xt(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=>{We(e,n),requestAnimationFrame((()=>{We(t,{top:n}),requestAnimationFrame((()=>{We(e,0),We(m,!1)}))}))})),{deviation:e}}),Ve(kt,Rn,Un,gn,vt,Kt)),tr=gt((([e,t,n,r,a,i,o,s,l,c])=>({...e,...t,...n,...r,...a,...i,...o,...s,...l,...c})),Ve(Ln,Hn,bn,Wn,Bn,zn,$n,Yn,qn,vt)),nr=gt((([{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])=>(Ze(v.rangeChanged,I.scrollSeekRangeChanged),Ze(at(I.windowViewportRect,nt((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})),Ve(gn,Tn,kt,Kn,Gn,Un,En,er,Xn,fn,tr));function rr(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 ar=typeof document<"u"?i.useLayoutEffect:i.useEffect;function ir(t,n,r){const a=Object.keys(n.required||{}),o=Object.keys(n.optional||{}),s=Object.keys(n.methods||{}),l=Object.keys(n.events||{}),c=i.createContext({});function u(e,t){e.propsReady&&We(e.propsReady,!1);for(const r of a){We(e[n.required[r]],t[r])}for(const r of o)if(r in t){We(e[n.optional[r]],t[r])}e.propsReady&&We(e.propsReady,!0)}function d(e){return l.reduce(((t,r)=>(t[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=qe(e,i),t):(r(),Ge);case 2:return r(),void(n=null)}}}(e[n.events[r]]),t)),{})}const p=i.forwardRef(((p,g)=>{const{children:m,...f}=p,[b]=i.useState((()=>He(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)}(t),(e=>{u(e,f)})))),[h]=i.useState($e(d,b));ar((()=>{for(const e of l)e in f&&qe(h[e],f[e]);return()=>{Object.values(h).map(Ye)}}),[f,h,b]),ar((()=>{u(b,f)})),i.useImperativeHandle(g,Fe(function(e){return s.reduce(((t,r)=>(t[r]=t=>{We(e[n.methods[r]],t)},t)),{})}(b)));const y=r;return e.jsx(c.Provider,{value:b,children:r?e.jsx(y,{...rr([...a,...o,...l],f),children:m}):m})})),g=i.version.startsWith("18")?e=>{const t=i.useContext(c)[e],n=i.useCallback((e=>qe(t,e)),[t]);return i.useSyncExternalStore(n,(()=>Ke(t)),(()=>Ke(t)))}:e=>{const t=i.useContext(c)[e],[n,r]=i.useState($e(Ke,t));return ar((()=>qe(t,(e=>{e!==n&&r(Fe(e))}))),[t,n]),n};return{Component:p,useEmitter:(e,t)=>{const n=i.useContext(c)[e];ar((()=>qe(n,t)),[t,n])},useEmitterValue:g,usePublisher:e=>{const t=i.useContext(c);return i.useCallback((n=>{We(t[e],n)}),[t,e])}}}const or=i.createContext(void 0),sr=i.createContext(void 0),lr=typeof document<"u"?i.useLayoutEffect:i.useEffect;function cr(e){return"self"in e}function ur(e,t,n,r=Ge,a,o){const s=i.useRef(null),l=i.useRef(null),c=i.useRef(null),u=i.useCallback((n=>{let r,a,i;const s=n.target;if(function(e){return"body"in e}(s)||cr(s)){const e=cr(s)?s:s.defaultView;i=o?e.scrollX:e.scrollY,r=o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,a=o?e.innerWidth:e.innerHeight}else i=o?s.scrollLeft:s.scrollTop,r=o?s.scrollWidth:s.scrollHeight,a=o?s.offsetWidth:s.offsetHeight;const u=()=>{e({scrollHeight:r,scrollTop:Math.max(i,0),viewportHeight:a})};n.suppressFlushSync?u():v.flushSync(u),null!==l.current&&(i===l.current||i<=0||i===r-a)&&(l.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))}),[e,t,o]);return i.useEffect((()=>{const e=a||s.current;return r(a||s.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{r(null),e.removeEventListener("scroll",u)}}),[s,u,n,r,a]),{scrollByCallback:function(e){o&&(e={behavior:e.behavior,left:e.top}),s.current.scrollBy(e)},scrollerRef:s,scrollToCallback:function(n){const r=s.current;if(!r||(o?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const a="smooth"===n.behavior;let i,u,d;cr(r)?(u=Math.max(Qt(r.document.documentElement,o?"width":"height"),o?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),i=o?r.innerWidth:r.innerHeight,d=o?window.scrollX:window.scrollY):(u=r[o?"scrollWidth":"scrollHeight"],i=Qt(r,o?"width":"height"),d=r[o?"scrollLeft":"scrollTop"]);const p=u-i;if(n.top=Math.ceil(Math.max(Math.min(p,n.top),0)),An(i,u)||n.top===d)return e({scrollHeight:u,scrollTop:d,viewportHeight:i}),void(a&&t(!0));a?(l.current=n.top,c.current&&clearTimeout(c.current),c.current=setTimeout((()=>{c.current=null,l.current=null,t(!0)}),1e3)):l.current=null,o&&(n={behavior:n.behavior,left:n.top}),r.scrollTo(n)}}}const dr="-webkit-sticky",pr="sticky",gr=Qn((()=>{if(typeof document>"u")return pr;const e=document.createElement("div");return e.style.position=dr,e.style.position===dr?dr:pr}));function mr(e){return e}const fr=gt((()=>{const e=ct((e=>`Item ${e}`)),t=ct(null),n=ct((e=>`Group ${e}`)),r=ct({}),a=ct(mr),i=ct("div"),o=ct(Ge),s=(e,t=null)=>ut(at(r,nt((t=>t[e])),et()),t);return{components:r,computeItemKey:a,context:t,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:n,HeaderComponent:s("Header"),HeaderFooterTag:i,Ite