n(14,f=R));let c=600,g=350,d=!0,p=!1;const m=(R,E)=>`transform: translate(${R}px, ${E}px)`,_=[-4,4],w=[-1,1];function b(){n(8,d=!0),n(9,p=!0);const R=ft(this);Eo(".file-circle-g").select("text").style("opacity",0),R.raise(),R.select("circle").attr("fill","var(--red)"),R.select("text").style("opacity",1)}const k=()=>{const R=Eo(".file-circle-g");R.select("circle").attr("fill","var(--yellow)"),R.select("text").style("opacity",0),n(9,p=!1),setTimeout(()=>{n(8,d=!1)},1e3)};function A(){c=this.offsetWidth,g=this.offsetHeight,n(0,c),n(1,g)}return e.$$.update=()=>{e.$$.dirty&16387&&n(2,o=f.map(R=>({...R,x:c/2,y:g/2,tickCount:0}))),e.$$.dirty&16384&&console.log(f.map(R=>R.size).sort((R,E)=>R-E)),e.$$.dirty&1&&n(13,r=Zh().x(c/2)),e.$$.dirty&2&&n(12,i=ep().y(g/2)),e.$$.dirty&16384&&n(3,s=Ke().domain(fn(f,R=>R.size)).range([12,60])),e.$$.dirty&8&&n(10,l=zh().radius(R=>s(R.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,a=Rd(f.map(R=>R.size).sort((R,E)=>R-E),.85)),e.$$.dirty&1&&Ke().domain(_).range([5,c]),e.$$.dirty&2&&Ke().domain(w).range([g,5]),e.$$.dirty&4&&n(11,u=Jh().nodes(o).on("tick",()=>{n(2,o=[...o])})),e.$$.dirty&15360&&(u.force("x",r),u.force("y",i),u.force("collide",l),u.alpha(.02),u.restart()),e.$$.dirty&19468&&(s.domain(fn(f,R=>R.size)),o.forEach(R=>R.radius=s(R.size)),u.nodes(o),l.radius(R=>R.radius+.5)),e.$$.dirty&768&&d===!1&&(p||Eo(".large").select("text").style("opacity",1))},[c,g,o,s,a,m,b,k,d,p,l,u,i,r,f,A]}class op extends de{constructor(t){super(),pe(this,t,np,tp,ce,{})}}/**
- * table-core
- *
- * Copyright (c) TanStack
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function vt(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return n=>{t.setState(o=>({...o,[e]:vt(n,o[e])}))}}function mo(e){return e instanceof Function}function rp(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ip(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const l=t(i);l!=null&&l.length&&o(l)})};return o(e),n}function Q(e,t,n){let o=[],r;return()=>{let i;n.key&&n.debug&&(i=Date.now());const l=e();if(!(l.length!==o.length||l.some((u,f)=>o[f]!==u)))return r;o=l;let s;if(n.key&&n.debug&&(s=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-i)*100)/100,f=Math.round((Date.now()-s)*100)/100,c=f/16,g=(d,p)=>{for(d=String(d);d.length{let d=g;for(const m of s.split(".")){var p;d=(p=d)==null?void 0:p[m]}return d}:f=g=>g[a.accessorKey]),!u)throw new Error;let c={id:`${String(u)}`,accessorFn:f,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var g;return[c,...(g=c.columns)==null?void 0:g.flatMap(d=>d.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}}),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],g=>{var d;if((d=c.columns)!=null&&d.length){let p=c.columns.flatMap(m=>m.getLeafColumns());return g(p)}return[c]},{key:"column.getLeafColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}})};return c=e._features.reduce((g,d)=>Object.assign(g,d.createColumn==null?void 0:d.createColumn(c,e)),c),c}function xl(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],a=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(a),l.push(s)};return a(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{Object.assign(i,l.createHeader==null?void 0:l.createHeader(i,e))}),i}const sp={createTable:e=>({getHeaderGroups:Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,l;const a=(i=o==null?void 0:o.map(c=>n.find(g=>g.id===c)).filter(Boolean))!=null?i:[],s=(l=r==null?void 0:r.map(c=>n.find(g=>g.id===c)).filter(Boolean))!=null?l:[],u=n.filter(c=>!(o!=null&&o.includes(c.id))&&!(r!=null&&r.includes(c.id)));return Ln(t,[...a,...u,...s],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Ln(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Ln(t,i,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Ln(t,i,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:Q(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:Q(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:Q(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:Q(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:Q(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFlatHeaders:Q(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFlatHeaders:Q(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFlatHeaders:Q(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterLeafHeaders:Q(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:Q(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:Q(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,l,a,s,u;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(u=o[0])==null?void 0:u.headers)!=null?s:[]].map(f=>f.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function Ln(e,t,n,o){var r,i;let l=0;const a=function(g,d){d===void 0&&(d=1),l=Math.max(l,d),g.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&a(p.columns,d+1)},0)};a(e);let s=[];const u=(g,d)=>{const p={depth:d,id:[o,`${d}`].filter(Boolean).join("_"),headers:[]},m=[];g.forEach(_=>{const w=[...m].reverse()[0],b=_.column.depth===p.depth;let k,A=!1;if(b&&_.column.parent?k=_.column.parent:(k=_.column,A=!0),w&&(w==null?void 0:w.column)===k)w.subHeaders.push(_);else{const R=xl(n,k,{id:[o,d,k.id,_==null?void 0:_.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${m.filter(E=>E.column===k).length}`:void 0,depth:d,index:m.length});R.subHeaders.push(_),m.push(R)}p.headers.push(_),_.headerGroup=p}),s.push(p),d>0&&u(m,d-1)},f=t.map((g,d)=>xl(n,g,{depth:l,index:d}));u(f,l-1),s.reverse();const c=g=>g.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,_=0,w=[0];p.subHeaders&&p.subHeaders.length?(w=[],c(p.subHeaders).forEach(k=>{let{colSpan:A,rowSpan:R}=k;m+=A,w.push(R)})):m=1;const b=Math.min(...w);return _=_+b,p.colSpan=m,p.rowSpan=_,{colSpan:m,rowSpan:_}});return c((r=(i=s[0])==null?void 0:i.headers)!=null?r:[]),s}const Hn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},qo=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ap={getDefaultColumnDef:()=>Hn,getInitialState:e=>({columnSizing:{},columnSizingInfo:qo(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:Xe("columnSizing",e),onColumnSizingInfoChange:Xe("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Hn.minSize,(o=i??e.columnDef.size)!=null?o:Hn.size),(r=e.columnDef.maxSize)!=null?r:Hn.maxSize)},getStart:n=>{const o=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),r=o.findIndex(i=>i.id===e.id);if(r>0){const i=o[r-1];return i.getStart(n)+i.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},getCanResize:()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},getStart:()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},getResizeHandler:()=>{const n=t.getColumn(e.column.id),o=n==null?void 0:n.getCanResize();return r=>{if(!n||!o||(r.persist==null||r.persist(),Go(r)&&r.touches&&r.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=Go(r)?Math.round(r.touches[0].clientX):r.clientX,s={},u=(m,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(w=>{var b,k;const A=_-((b=w==null?void 0:w.startOffset)!=null?b:0),R=Math.max(A/((k=w==null?void 0:w.startSize)!=null?k:0),-.999999);return w.columnSizingStart.forEach(E=>{let[C,$]=E;s[C]=Math.round(Math.max($+$*R,0)*100)/100}),{...w,deltaOffset:A,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(w=>({...w,...s})))},f=m=>u("move",m),c=m=>{u("end",m),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g={moveHandler:m=>f(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",g.moveHandler),document.removeEventListener("mouseup",g.upHandler),c(m.clientX)}},d={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),f(m.touches[0].clientX),!1),upHandler:m=>{var _;document.removeEventListener("touchmove",d.moveHandler),document.removeEventListener("touchend",d.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),c((_=m.touches[0])==null?void 0:_.clientX)}},p=up()?{passive:!1}:!1;Go(r)?(document.addEventListener("touchmove",d.moveHandler,p),document.addEventListener("touchend",d.upHandler,p)):(document.addEventListener("mousemove",g.moveHandler,p),document.addEventListener("mouseup",g.upHandler,p)),t.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:n.id}))}}}),createTable:e=>({setColumnSizing:t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),setColumnSizingInfo:t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),resetColumnSizing:t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},resetHeaderSizeInfo:t=>{var n;e.setColumnSizingInfo(t?qo():(n=e.initialState.columnSizingInfo)!=null?n:qo())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}})};let qn=null;function up(){if(typeof qn=="boolean")return qn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return qn=e,qn}function Go(e){return e.type==="touchstart"}const fp={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),toggleAllRowsExpanded:o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},getCanSomeRowsExpand:()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),getToggleAllRowsExpandedHandler:()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},getIsAllRowsExpanded:()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},getExpandedDepth:()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},getPreExpandedRowModel:()=>e.getSortedRowModel(),getExpandedRowModel:()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())}},createRow:(e,t)=>({toggleExpanded:n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let l={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=o,n=(r=n)!=null?r:!i,!i&&n)return{...l,[e.id]:!0};if(i&&!n){const{[e.id]:a,...s}=l;return s}return o})},getIsExpanded:()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o!=null&&o[e.id])},getCanExpand:()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},Aa=(e,t,n)=>{var o,r,i;const l=n.toLowerCase();return!!(!((o=e.getValue(t))==null||(r=o.toString())==null||(i=r.toLowerCase())==null)&&i.includes(l))};Aa.autoRemove=e=>Je(e);const Ra=(e,t,n)=>{var o,r;return!!(!((o=e.getValue(t))==null||(r=o.toString())==null)&&r.includes(n))};Ra.autoRemove=e=>Je(e);const Ma=(e,t,n)=>{var o,r;return((o=e.getValue(t))==null||(r=o.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};Ma.autoRemove=e=>Je(e);const Ea=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};Ea.autoRemove=e=>Je(e)||!(e!=null&&e.length);const Fa=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Fa.autoRemove=e=>Je(e)||!(e!=null&&e.length);const Da=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Da.autoRemove=e=>Je(e)||!(e!=null&&e.length);const Ia=(e,t,n)=>e.getValue(t)===n;Ia.autoRemove=e=>Je(e);const Na=(e,t,n)=>e.getValue(t)==n;Na.autoRemove=e=>Je(e);const Pr=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};Pr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(r)?1/0:r;if(i>l){const a=i;i=l,l=a}return[i,l]};Pr.autoRemove=e=>Je(e)||Je(e[0])&&Je(e[1]);const st={includesString:Aa,includesStringSensitive:Ra,equalsString:Ma,arrIncludes:Ea,arrIncludesAll:Fa,arrIncludesSome:Da,equals:Ia,weakEquals:Na,inNumberRange:Pr};function Je(e){return e==null||e===""}const cp={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xe("columnFilters",e),onGlobalFilterChange:Xe("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,o;const r=(n=e.getCoreRowModel().flatRows[0])==null||(o=n._getAllCellsByColumnId()[t.id])==null?void 0:o.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(e.id);return typeof o=="string"?st.includesString:typeof o=="number"?st.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?st.equals:Array.isArray(o)?st.arrIncludes:st.weakEquals},getFilterFn:()=>{var n,o;return mo(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:st[e.columnDef.filterFn]},getCanFilter:()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,o;return(n=t.getState().columnFilters)==null||(o=n.find(r=>r.id===e.id))==null?void 0:o.value},getFilterIndex:()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o==null?void 0:o.find(f=>f.id===e.id),l=vt(n,i?i.value:void 0);if(Vl(r,l,e)){var a;return(a=o==null?void 0:o.filter(f=>f.id!==e.id))!=null?a:[]}const s={id:e.id,value:l};if(i){var u;return(u=o==null?void 0:o.map(f=>f.id===e.id?s:f))!=null?u:[]}return o!=null&&o.length?[...o,s]:[s]})},_getFacetedRowModel:t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),getFacetedRowModel:()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),_getFacetedUniqueValues:t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),getFacetedUniqueValues:()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,_getFacetedMinMaxValues:t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),getFacetedMinMaxValues:()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}),createRow:(e,t)=>({columnFilters:{},columnFiltersMeta:{}}),createTable:e=>({getGlobalAutoFilterFn:()=>st.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:o}=e.options;return mo(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:st[o]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=vt(t,r))==null?void 0:i.filter(l=>{const a=n.find(s=>s.id===l.id);if(a){const s=a.getFilterFn();if(Vl(s,l.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},getPreFilteredRowModel:()=>e.getCoreRowModel(),getFilteredRowModel:()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),_getGlobalFacetedRowModel:e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),getGlobalFacetedRowModel:()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),_getGlobalFacetedUniqueValues:e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),getGlobalFacetedUniqueValues:()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,_getGlobalFacetedMinMaxValues:e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),getGlobalFacetedMinMaxValues:()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}})};function Vl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const dp=(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),gp=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},hp=(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o=i)&&(o=i)}),o},pp=(e,t,n)=>{let o,r;return n.forEach(i=>{const l=i.getValue(e);l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},_p=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!rp(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,l)=>i-l);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},vp=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),bp=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,wp=(e,t)=>t.length,Bo={sum:dp,min:gp,max:hp,extent:pp,mean:mp,median:_p,unique:vp,uniqueCount:bp,count:wp},yp={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Xe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,o,r,i;return(n=(o=(r=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?r:t.options.enableGrouping)!=null?o:!0)!=null?n:!!e.accessorFn},getIsGrouped:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},getGroupedIndex:()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},getToggleGroupingHandler:()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},getAutoAggregationFn:()=>{const n=t.getCoreRowModel().flatRows[0],o=n==null?void 0:n.getValue(e.id);if(typeof o=="number")return Bo.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Bo.extent},getAggregationFn:()=>{var n,o;if(!e)throw new Error;return mo(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:Bo[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},getPreGroupedRowModel:()=>e.getFilteredRowModel(),getGroupedRowModel:()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())}),createRow:(e,t)=>({getIsGrouped:()=>!!e.groupingColumnId,getGroupingValue:n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},_groupingValuesCache:{}}),createCell:(e,t,n,o)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}})};function Sp(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(l=>l.id===i)).filter(Boolean),...o]}const Cp={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xe("columnOrder",e)}),createTable:e=>({setColumnOrder:t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),resetColumnOrder:t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},_getOrderColumnsFn:Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const l=[...t],a=[...r];for(;a.length&&l.length;){const s=l.shift(),u=a.findIndex(f=>f.id===s);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return Sp(i,n,o)},{key:!1})})},hr=0,pr=10,jo=()=>({pageIndex:hr,pageSize:pr}),kp={getInitialState:e=>({...e,pagination:{...jo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xe("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:o=>{const r=i=>vt(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},resetPagination:o=>{var r;e.setPagination(o?jo():(r=e.initialState.pagination)!=null?r:jo())},setPageIndex:o=>{e.setPagination(r=>{let i=vt(o,r.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...r,pageIndex:i}})},resetPageIndex:o=>{var r,i,l;e.setPageIndex(o?hr:(r=(i=e.initialState)==null||(l=i.pagination)==null?void 0:l.pageIndex)!=null?r:hr)},resetPageSize:o=>{var r,i,l;e.setPageSize(o?pr:(r=(i=e.initialState)==null||(l=i.pagination)==null?void 0:l.pageSize)!=null?r:pr)},setPageSize:o=>{e.setPagination(r=>{const i=Math.max(1,vt(o,r.pageSize)),l=r.pageSize*r.pageIndex,a=Math.floor(l/i);return{...r,pageIndex:a,pageSize:i}})},setPageCount:o=>e.setPagination(r=>{var i;let l=vt(o,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),getPageOptions:Q(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,l)=>l)),r},{key:!1,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:oe.setPageIndex(o=>o-1),nextPage:()=>e.setPageIndex(o=>o+1),getPrePaginationRowModel:()=>e.getExpandedRowModel(),getPaginationRowModel:()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),getPageCount:()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},Uo=()=>({left:[],right:[]}),$p={getInitialState:e=>({columnPinning:Uo(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xe("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,l;if(n==="right"){var a,s;return{left:((a=r==null?void 0:r.left)!=null?a:[]).filter(c=>!(o!=null&&o.includes(c))),right:[...((s=r==null?void 0:r.right)!=null?s:[]).filter(c=>!(o!=null&&o.includes(c))),...o]}}if(n==="left"){var u,f;return{left:[...((u=r==null?void 0:r.left)!=null?u:[]).filter(c=>!(o!=null&&o.includes(c))),...o],right:((f=r==null?void 0:r.right)!=null?f:[]).filter(c=>!(o!=null&&o.includes(c)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(c=>!(o!=null&&o.includes(c))),right:((l=r==null?void 0:r.right)!=null?l:[]).filter(c=>!(o!=null&&o.includes(c)))}})},getCanPin:()=>e.getLeafColumns().some(o=>{var r,i;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=t.options.enablePinning)!=null?i:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(a=>o==null?void 0:o.includes(a)),l=n.some(a=>r==null?void 0:r.includes(a));return i?"left":l?"right":!1},getPinnedIndex:()=>{var n,o,r;const i=e.getIsPinned();return i?(n=(o=t.getState().columnPinning)==null||(r=o[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(l=>!i.includes(l.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>({setColumnPinning:t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),resetColumnPinning:t=>{var n,o;return e.setColumnPinning(t?Uo():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Uo())},getIsSomeColumnsPinned:t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},getLeftLeafColumns:Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Ap={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>({setRowSelection:t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),resetRowSelection:t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},toggleAllRowsSelected:t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{mr(r,i.id,o,e)}),r}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Wo(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Wo(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Wo(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getIsAllRowsSelected:()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},getIsSomeRowsSelected:()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},getToggleAllRowsSelectedHandler:()=>t=>{e.toggleAllRowsSelected(t.target.checked)},getToggleAllPageRowsSelectedHandler:()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}}),createRow:(e,t)=>({toggleSelected:n=>{const o=e.getIsSelected();t.setRowSelection(r=>{if(n=typeof n<"u"?n:!o,o===n)return r;const i={...r};return mr(i,e.id,n,t),i})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Or(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return zl(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return zl(e,n)==="all"},getCanSelect:()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},getCanSelectSubRows:()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},getCanMultiSelect:()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},getToggleSelectedHandler:()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}})},mr=(e,t,n,o)=>{var r;const i=o.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],(r=i.subRows)!=null&&r.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>mr(e,l.id,n,o))};function Wo(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(l,a){return l.map(s=>{var u;const f=Or(s,n);if(f&&(o.push(s),r[s.id]=s),(u=s.subRows)!=null&&u.length&&(s={...s,subRows:i(s.subRows)}),f)return s}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function Or(e,t){var n;return(n=t[e.id])!=null?n:!1}function zl(e,t,n){if(e.subRows&&e.subRows.length){let o=!0,r=!1;return e.subRows.forEach(i=>{r&&!o||(Or(i,t)?r=!0:o=!1)}),o?"all":r?"some":!1}return!1}const _r=/([0-9]+)/gm,Rp=(e,t,n)=>Pa(wt(e.getValue(n)).toLowerCase(),wt(t.getValue(n)).toLowerCase()),Mp=(e,t,n)=>Pa(wt(e.getValue(n)),wt(t.getValue(n))),Ep=(e,t,n)=>Tr(wt(e.getValue(n)).toLowerCase(),wt(t.getValue(n)).toLowerCase()),Fp=(e,t,n)=>Tr(wt(e.getValue(n)),wt(t.getValue(n))),Dp=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:oTr(e.getValue(n),t.getValue(n));function Tr(e,t){return e===t?0:e>t?1:-1}function wt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Pa(e,t){const n=e.split(_r).filter(Boolean),o=t.split(_r).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),l=parseInt(r,10),a=parseInt(i,10),s=[l,a].sort();if(isNaN(s[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>a)return 1;if(a>l)return-1}return n.length-o.length}const nn={alphanumeric:Rp,alphanumericCaseSensitive:Mp,text:Ep,textCaseSensitive:Fp,datetime:Dp,basic:Ip},Np={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return nn.datetime;if(typeof i=="string"&&(o=!0,i.split(_r).length>1))return nn.alphanumeric}return o?nn.text:nn.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,o;if(!e)throw new Error;return mo(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:nn[e.columnDef.sortingFn]},toggleSorting:(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(l=>{const a=l==null?void 0:l.find(d=>d.id===e.id),s=l==null?void 0:l.findIndex(d=>d.id===e.id);let u=[],f,c=i?n:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&o?a?f="toggle":f="add":l!=null&&l.length&&s!==l.length-1?f="replace":a?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var g;u=[...l,{id:e.id,desc:c}],u.splice(0,u.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=l.map(d=>d.id===e.id?{...d,desc:c}:d):f==="remove"?u=l.filter(d=>d.id!==e.id):u=[{id:e.id,desc:c}];return u})},getFirstSortDir:()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var o,r;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:l==="desc"?"asc":"desc":i},getCanSort:()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},getSortIndex:()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},getPreSortedRowModel:()=>e.getGroupedRowModel(),getSortedRowModel:()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())})},Pp={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xe("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,o;return(n=(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},getCanHide:()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:Q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,o)=>Q(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugColumns}});return{getVisibleFlatColumns:t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),getVisibleLeafColumns:t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),getLeftVisibleLeafColumns:t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),getRightVisibleLeafColumns:t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),getCenterVisibleLeafColumns:t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),setColumnVisibility:n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),resetColumnVisibility:n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},toggleAllColumnsVisible:n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},getIsAllColumnsVisible:()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),getIsSomeColumnsVisible:()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),getToggleAllColumnsVisibilityHandler:()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}}},Ll=[sp,Pp,Cp,$p,cp,Np,yp,fp,kp,Ap,ap];function Op(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:Ll};const o=n._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(n)),{}),r=f=>n.options.mergeOptions?n.options.mergeOptions(o,f):{...o,...f};let l={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(f=>{var c;l=(c=f.getInitialState==null?void 0:f.getInitialState(l))!=null?c:l});const a=[];let s=!1;const u={_features:Ll,options:{...o,...e},initialState:l,_queue:f=>{a.push(f),s||(s=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();s=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{n.setState(n.initialState)},setOptions:f=>{const c=vt(f,n.options);n.options=r(c)},getState:()=>n.options.state,setState:f=>{n.options.onStateChange==null||n.options.onStateChange(f)},_getRowId:(f,c,g)=>{var d;return(d=n.options.getRowId==null?void 0:n.options.getRowId(f,c,g))!=null?d:`${g?[g.id,c].join("."):c}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:f=>{const c=n.getRowModel().rowsById[f];if(!c)throw new Error;return c},_getDefaultColumnDef:Q(()=>[n.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:g=>{const d=g.header.column.columnDef;return d.accessorKey?d.accessorKey:d.accessorFn?d.id:null},cell:g=>{var d,p;return(d=(p=g.renderValue())==null||p.toString==null?void 0:p.toString())!=null?d:null},...n._features.reduce((g,d)=>Object.assign(g,d.getDefaultColumnDef==null?void 0:d.getDefaultColumnDef()),{}),...f}},{debug:()=>{var f;return(f=n.options.debugAll)!=null?f:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:Q(()=>[n._getColumnDefs()],f=>{const c=function(g,d,p){return p===void 0&&(p=0),g.map(m=>{const _=lp(n,m,p,d),w=m;return _.columns=w.columns?c(w.columns,_,p+1):[],_})};return c(f)},{key:!1,debug:()=>{var f;return(f=n.options.debugAll)!=null?f:n.options.debugColumns}}),getAllFlatColumns:Q(()=>[n.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),{key:!1,debug:()=>{var f;return(f=n.options.debugAll)!=null?f:n.options.debugColumns}}),_getAllFlatColumnsById:Q(()=>[n.getAllFlatColumns()],f=>f.reduce((c,g)=>(c[g.id]=g,c),{}),{key:!1,debug:()=>{var f;return(f=n.options.debugAll)!=null?f:n.options.debugColumns}}),getAllLeafColumns:Q(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(f,c)=>{let g=f.flatMap(d=>d.getLeafColumns());return c(g)},{key:!1,debug:()=>{var f;return(f=n.options.debugAll)!=null?f:n.options.debugColumns}}),getColumn:f=>n._getAllFlatColumnsById()[f]};return Object.assign(n,u),n._features.forEach(f=>Object.assign(n,f.createTable==null?void 0:f.createTable(n))),n}function Tp(e,t,n,o){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:Q(()=>[e,n,t,i],(l,a,s,u)=>({table:l,column:a,row:s,cell:u,getValue:u.getValue,renderValue:u.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(l=>{Object.assign(i,l.createCell==null?void 0:l.createCell(i,n,t,e))},{}),i}const xr=(e,t,n,o,r,i,l)=>{let a={id:t,index:o,original:n,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(a._valuesCache.hasOwnProperty(s))return a._valuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return a._valuesCache[s]=u.accessorFn(a.original,o),a._valuesCache[s]},getUniqueValues:s=>{if(a._uniqueValuesCache.hasOwnProperty(s))return a._uniqueValuesCache[s];const u=e.getColumn(s);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[s]=u.columnDef.getUniqueValues(a.original,o),a._uniqueValuesCache[s]):(a._uniqueValuesCache[s]=[a.getValue(s)],a._uniqueValuesCache[s])},renderValue:s=>{var u;return(u=a.getValue(s))!=null?u:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>ip(a.subRows,s=>s.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId):void 0,getParentRows:()=>{let s=[],u=a;for(;;){const f=u.getParentRow();if(!f)break;s.push(f),u=f}return s.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],s=>s.map(u=>Tp(e,a,u,u.id)),{key:!1,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}}),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],s=>s.reduce((u,f)=>(u[f.column.id]=f,u),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}})};for(let s=0;stypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Hl(){return e=>Q(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,l){i===void 0&&(i=0);const a=[];for(let u=0;u{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Oa(e,t,n){return n.options.filterFromLeafRows?Vp(e,t,n):zp(e,t,n)}function Vp(e,t,n){var o;const r=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,a=function(s,u){u===void 0&&(u=0);const f=[];for(let g=0;gQ(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let g=0;g{var d;const p=e.getColumn(g.id);if(!p)return;const m=p.getFilterFn();m&&r.push({id:g.id,filterFn:m,resolvedValue:(d=m.resolveFilterValue==null?void 0:m.resolveFilterValue(g.value))!=null?d:g.value})});const l=n.map(g=>g.id),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());o&&a&&s.length&&(l.push("__global__"),s.forEach(g=>{var d;i.push({id:g.id,filterFn:a,resolvedValue:(d=a.resolveFilterValue==null?void 0:a.resolveFilterValue(o))!=null?d:o})}));let u,f;for(let g=0;g{d.columnFiltersMeta[m]=_})}if(i.length){for(let p=0;p{d.columnFiltersMeta[m]=_})){d.columnFilters.__global__=!0;break}}d.columnFilters.__global__!==!0&&(d.columnFilters.__global__=!1)}}const c=g=>{for(let d=0;d{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Gl(){return(e,t)=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,o,r)=>{if(!n.rows.length||!(o!=null&&o.length)&&!r)return n;const i=[...o.map(a=>a.id).filter(a=>a!==t),r?"__global__":void 0].filter(Boolean),l=a=>{for(let s=0;s{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{}})}function Bl(){return e=>Q(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(s=>{var u;return(u=e.getColumn(s.id))==null?void 0:u.getCanSort()}),l={};i.forEach(s=>{const u=e.getColumn(s.id);u&&(l[s.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=s=>{const u=[...s];return u.sort((f,c)=>{for(let d=0;d{var c;r.push(f),(c=f.subRows)!=null&&c.length&&(f.subRows=a(f.subRows))}),u};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Lp(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function jl(e){return t=>Q(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:l,flatRows:a,rowsById:s}=o;const u=r*i,f=u+r;l=l.slice(u,f);let c;t.options.paginateExpandedRows?c={rows:l,flatRows:a,rowsById:s}:c=Lp({rows:l,flatRows:a,rowsById:s}),c.flatRows=[];const g=d=>{c.flatRows.push(d),d.subRows.length&&d.subRows.forEach(g)};return c.rows.forEach(g),c},{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
- * svelte-table
- *
- * Copyright (c) TanStack
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Hp(e){let t;return{c(){t=z(e[0])},l(n){t=Za(n,e[0])},m(n,o){Wa(n,t,o)},p(n,[o]){o&1&&ie(t,n[0])},i:U,o:U,d(n){n&&N(t)}}}function qp(e,t,n){let{content:o}=t;return e.$$set=r=>{"content"in r&&n(0,o=r.content)},[o]}class Gp extends de{constructor(t){super(),pe(this,t,qp,Hp,ce,{content:0})}}const Bp=As((e,t,n,o)=>`${mu(t.content)}`);var jp=typeof document>"u"?Bp:Gp;function Up(e,t,n){let o,r;return o=new t({props:n,$$inline:!0}),{c(){ne(o.$$.fragment)},l(i){vu(o.$$.fragment,i)},m(i,l){Z(o,i,l),r=!0},p:U,i(i){r||(P(o.$$.fragment,i),r=!0)},o(i){T(o.$$.fragment,i),r=!1},d(i){ee(o,i)}}}function Wp(e,t){return class extends de{constructor(o){super(),pe(this,o,null,r=>Up(r,e,t),ce,{},void 0)}}}function Xp(e,t){return As((o,r,i,l)=>`${_u(e,"TableComponent").$$render(o,t,{},{})}`)}const vr=typeof window>"u"?Xp:Wp;function Yp(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Qp(e){var t,n;let o="__SVELTE_HMR"in window;return e.prototype instanceof de||o&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function Ul(e){return typeof document>"u"?Yp(e):Qp(e)}function Wl(e){return vr(jp,{content:e})}function _o(e,t){if(!e)return null;if(Ul(e))return vr(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:Ul(n)?vr(n,t):Wl(n)}return Wl(e)}function Xl(e){let t;"subscribe"in e?t=e:t=Ko(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...za(t)},o=Op(n),r=Fe(o.initialState),i=wu([r,t],a=>a);return Ko(o,function(s){const u=i.subscribe(f=>{let[c,g]=f;o.setOptions(d=>({...d,...g,state:{...c,...g.state},onStateChange:p=>{p instanceof Function?r.update(p):r.set(p),n.onStateChange==null||n.onStateChange(p)}})),s(o)});return function(){u()}})}/**
- * match-sorter-utils
- *
- * Copyright (c) TanStack
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */const Ta={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Kp=Object.keys(Ta).join("|"),Jp=new RegExp(Kp,"g");function Zp(e){return e.replace(Jp,t=>Ta[t])}/**
- * @name match-sorter
- * @license MIT license.
- * @copyright (c) 2099 Kent C. Dodds
- * @author Kent C. Dodds (https://kentcdodds.com)
- */const Ve={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function em(e,t,n){var o;if(n=n||{},n.threshold=(o=n.threshold)!=null?o:Ve.MATCHES,!n.accessors){const l=Yl(e,t,n);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:n.threshold,passed:l>=n.threshold}}const r=rm(e,n.accessors),i={rankedValue:e,rank:Ve.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let l=0;l=Ve.MATCHES?s=u:s>f&&(s=f),s=Math.min(s,f),s>=c&&s>i.rank&&(i.rank=s,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=c,i.rankedValue=a.itemValue)}return i}function Yl(e,t,n){return e=Ql(e,n),t=Ql(t,n),t.length>e.length?Ve.NO_MATCH:e===t?Ve.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Ve.EQUAL:e.startsWith(t)?Ve.STARTS_WITH:e.includes(` ${t}`)?Ve.WORD_STARTS_WITH:e.includes(t)?Ve.CONTAINS:t.length===1?Ve.NO_MATCH:tm(e).includes(t)?Ve.ACRONYM:nm(e,t))}function tm(e){let t="";return e.split(" ").forEach(o=>{o.split("-").forEach(i=>{t+=i.substr(0,1)})}),t}function nm(e,t){let n=0,o=0;function r(s,u,f){for(let c=f,g=u.length;c-1))return Ve.NO_MATCH}const a=o-l;return i(a)}function Ql(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Zp(e)),e}function om(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const o=n(e);return o==null?[]:Array.isArray(o)?o:[String(o)]}function rm(e,t){const n=[];for(let o=0,r=t.length;o{ee(p,1)}),ve()}f?(n=bt(f,c()),ne(n.$$.fragment),P(n.$$.fragment,1),Z(n,t,o)):n=null}},i(g){a||(n&&P(n.$$.fragment,g),a=!0)},o(g){n&&T(n.$$.fragment,g),a=!1},d(g){g&&N(t),n&&ee(n),s=!1,u()}}}function ns(e){let t,n,o=!e[26].isPlaceholder&&lm(e);return{c(){t=S("th"),o&&o.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(r,i){O(r,t,i),o&&o.m(t,null),n=!0},p(r,i){r[26].isPlaceholder||o.p(r,i)},i(r){n||(P(o),n=!0)},o(r){T(o),n=!1},d(r){r&&N(t),o&&o.d()}}}function os(e){let t,n,o,r=e[23].headers,i=[];for(let a=0;aT(i[a],1,1,()=>{i[a]=null});return{c(){t=S("tr");for(let a=0;a{ee(u,1)}),ve()}i?(o=bt(i,l()),ne(o.$$.fragment),P(o.$$.fragment,1),Z(o,n,null)):o=null}},i(a){r||(o&&P(o.$$.fragment,a),r=!0)},o(a){o&&T(o.$$.fragment,a),r=!1},d(a){a&&N(n),o&&ee(o)}}}function is(e){let t,n=[],o=new Map,r,i,l=e[17].getVisibleCells();const a=s=>s[20].id;for(let s=0;s",ge,L,B,H,G,Y=e[5],ue=[];for(let J=0;JT(ue[J],1,1,()=>{ue[J]=null});let yt=e[1].getRowModel().rows,Se=[];for(let J=0;JT(Se[J],1,1,()=>{Se[J]=null});return{c(){t=S("div"),n=S("input"),o=D(),r=S("div"),i=S("table"),l=S("thead");for(let J=0;J(i(),i=vo(w,R=>n(1,r=R)),w);ae(e,po,R=>n(8,o=R)),e.$$.on_destroy.push(()=>i());const a=(R,E,C,$)=>{if(console.log("yessir"),Array.isArray(C))return C.length===0?!0:C.includes(R.getValue(E));typeof C=="number"&&(C=String(C));const y=em(R.getValue(E),C);return $({itemRank:y}),y.passed},s=xp(),u=[s.accessor("file",{header:"File",cell:R=>R.getValue(),footer:R=>R.column.id}),s.accessor("size",{header:"Size",cell:R=>nr(R.getValue()),footer:R=>R.column.id}),s.accessor("type",{header:"Type",cell:R=>R.getValue(),footer:R=>R.column.id})];let f="",c=Fe({data:o,columns:u,getCoreRowModel:Hl(),getSortedRowModel:Bl(),getFilteredRowModel:ql(),globalFilterFn:a,getFacetedRowModel:Gl(),getPaginationRowModel:jl(),state:{globalFilter:f,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function g(R){n(6,f=R),c.update(E=>({...E,state:{...E.state,globalFilter:R}}))}function d(R){c.update(E=>{var C;return{...E,state:{...E.state,pagination:{...(C=E.state)==null?void 0:C.pagination,pageIndex:R}}}})}let p;function m(R){clearTimeout(p),p=setTimeout(()=>{const E=R.target;g(E.value)},100)}function _(R){const E=R.target;d(parseInt(E.value)-1)}let w=Xl(c);l();let b=r.getHeaderGroups();const k=()=>d(r.getState().pagination.pageIndex-1),A=()=>d(r.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,c={data:o,columns:u,getCoreRowModel:Hl(),getSortedRowModel:Bl(),getFilteredRowModel:ql(),globalFilterFn:a,getFacetedRowModel:Gl(),getPaginationRowModel:jl(),state:{globalFilter:f,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),l(n(0,w=Xl(Fe(c)))))},[w,r,d,m,_,b,f,c,o,k,A]}class fm extends de{constructor(t){super(),pe(this,t,um,sm,ce,{})}}function ls(e){let t,n;return{c(){t=S("p"),n=z(e[3])},m(o,r){O(o,t,r),v(t,n)},p(o,r){r&8&&ie(n,o[3])},d(o){o&&N(t)}}}function ss(e){let t;return{c(){t=S("p"),t.textContent="Data Successfully indexed!"},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function as(e){let t,n;return t=new fm({}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function cm(e){let t,n,o,r,i,l,a,s,u,f,c,g,d,p,m,_,w,b,k,A,R,E,C,$=e[2]&&!e[1]&&ls(e),y=e[1]&&ss();k=new op({});let M=e[0]&&as();return{c(){t=S("div"),n=S("div"),o=S("div"),r=S("div"),i=S("h4"),i.textContent="Upload Data",l=D(),a=S("br"),s=D(),u=S("form"),f=S("input"),c=D(),$&&$.c(),g=D(),y&&y.c(),d=D(),p=S("p"),p.textContent="These are the files your model will use as context.",m=D(),_=S("p"),_.innerHTML="Currently pdf , txt, and md are supported.",w=D(),b=S("div"),ne(k.$$.fragment),A=D(),M&&M.c(),h(f,"type","file"),f.multiple=!0,h(r,"class","upload-box svelte-1lu6hos"),h(o,"class","upload-container svelte-1lu6hos"),h(n,"class","file-container svelte-1lu6hos"),h(b,"class","charts-container svelte-1lu6hos"),h(t,"class","data-grid svelte-1lu6hos")},m(I,F){O(I,t,F),v(t,n),v(n,o),v(o,r),v(r,i),v(r,l),v(r,a),v(r,s),v(r,u),v(u,f),v(r,c),$&&$.m(r,null),v(r,g),y&&y.m(r,null),v(r,d),v(r,p),v(r,m),v(r,_),v(t,w),v(t,b),Z(k,b,null),v(b,A),M&&M.m(b,null),R=!0,E||(C=j(f,"change",e[4]),E=!0)},p(I,[F]){I[2]&&!I[1]?$?$.p(I,F):($=ls(I),$.c(),$.m(r,g)):$&&($.d(1),$=null),I[1]?y||(y=ss(),y.c(),y.m(r,d)):y&&(y.d(1),y=null),I[0]?M?F&1&&P(M,1):(M=as(),M.c(),P(M,1),M.m(b,null)):M&&(_e(),T(M,1,1,()=>{M=null}),ve())},i(I){R||(P(k.$$.fragment,I),P(M),R=!0)},o(I){T(k.$$.fragment,I),T(M),R=!1},d(I){I&&N(t),$&&$.d(),y&&y.d(),ee(k),M&&M.d(),E=!1,C()}}}function dm(e,t,n){let o,r,i;ae(e,Pl,p=>n(6,r=p)),ae(e,po,p=>n(7,i=p));let l=[],a=!1,s=!1;async function u(p){n(0,l=p.target.files);const m=new FormData;for(let _=0;_({file:w.name,size:w.size,type:w.type}));Oe(po,i=[..._],i)}async function c(){console.log("index!"),n(2,s=!0),await(await fetch("/retrieval/vector_db/index",{method:"POST"})).json(),n(1,a=!0),n(2,s=!1)}async function g(){console.log("getting embeddings...");const m=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",m),Oe(Pl,r=m,r)}dt(()=>{f()});let d=0;return setInterval(()=>{n(5,d=(d+1)%4)},200),e.$$.update=()=>{e.$$.dirty&32&&n(3,o="Indexing"+".".repeat(d))},[l,a,s,o,u,d]}class gm extends de{constructor(t){super(),pe(this,t,dm,cm,ce,{})}}function hm(e){let t,n,o,r,i,l,a,s,u,f,c,g,d,p,m,_,w,b,k,A,R,E,C,$,y,M,I;return i=new oa({}),s=new ra({}),c=new Js({}),p=new ea({props:{feedback:"Bad"}}),w=new na({}),A=new ta({}),M=new Zs({}),{c(){t=S("div"),n=S("div"),o=S("div"),r=S("div"),ne(i.$$.fragment),l=D(),a=S("div"),ne(s.$$.fragment),u=D(),f=S("div"),ne(c.$$.fragment),g=D(),d=S("div"),ne(p.$$.fragment),m=D(),_=S("div"),ne(w.$$.fragment),b=D(),k=S("div"),ne(A.$$.fragment),R=D(),E=S("div"),C=S("div"),C.innerHTML=`
-
`,$=D(),y=S("div"),ne(M.$$.fragment),h(r,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(o,"class","left-text svelte-14znspc"),h(f,"class","left-confidence svelte-14znspc"),h(d,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(k,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(C,"class","right-chart svelte-14znspc"),h(y,"class","right-table svelte-14znspc"),h(E,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(F,x){O(F,t,x),v(t,n),v(n,o),v(o,r),Z(i,r,null),v(o,l),v(o,a),Z(s,a,null),v(n,u),v(n,f),Z(c,f,null),v(n,g),v(n,d),Z(p,d,null),v(n,m),v(n,_),Z(w,_,null),v(n,b),v(n,k),Z(A,k,null),v(t,R),v(t,E),v(E,C),v(E,$),v(E,y),Z(M,y,null),I=!0},p:U,i(F){I||(P(i.$$.fragment,F),P(s.$$.fragment,F),P(c.$$.fragment,F),P(p.$$.fragment,F),P(w.$$.fragment,F),P(A.$$.fragment,F),P(M.$$.fragment,F),I=!0)},o(F){T(i.$$.fragment,F),T(s.$$.fragment,F),T(c.$$.fragment,F),T(p.$$.fragment,F),T(w.$$.fragment,F),T(A.$$.fragment,F),T(M.$$.fragment,F),I=!1},d(F){F&&N(t),ee(i),ee(s),ee(c),ee(p),ee(w),ee(A),ee(M)}}}function pm(e,t,n){let o;ae(e,wn,i=>n(0,o=i)),dt(()=>{console.log("FEEDBACK on mount"),r()});async function r(){const s=(await(await fetch("/chat/rag_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[4]}));Oe(wn,o=[...s],o)}return[]}class mm extends de{constructor(t){super(),pe(this,t,pm,hm,ce,{})}}function _m(e){let t,n;return t=new ia({}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function vm(e){let t,n;return t=new mm({}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function bm(e){let t,n;return t=new ia({}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function wm(e){let t,n,o,r;const i=[bm,vm,_m],l=[];function a(s,u){return s[0]==="vote"?0:s[0]==="rag"?1:2}return t=a(e),n=l[t]=i[t](e),{c(){n.c(),o=Ee()},m(s,u){l[t].m(s,u),O(s,o,u),r=!0},p(s,[u]){let f=t;t=a(s),t!==f&&(_e(),T(l[f],1,1,()=>{l[f]=null}),ve(),n=l[t],n||(n=l[t]=i[t](s),n.c()),P(n,1),n.m(o.parentNode,o))},i(s){r||(P(n),r=!0)},o(s){T(n),r=!1},d(s){l[t].d(s),s&&N(o)}}}function ym(e,t,n){let{feedback:o}=t;return e.$$set=r=>{"feedback"in r&&n(0,o=r.feedback)},[o]}class Sm extends de{constructor(t){super(),pe(this,t,ym,wm,ce,{feedback:0})}}function us(e,t,n){const o=e.slice();return o[7]=t[n],o}function fs(e){let t,n=e[0],o=[];for(let r=0;r{ee(f,1)}),ve()}i?(t=bt(i,l()),ne(t.$$.fragment),P(t.$$.fragment,1),Z(t,n.parentNode,n)):t=null}else i&&t.$set(u)},i(a){o||(t&&P(t.$$.fragment,a),o=!0)},o(a){t&&T(t.$$.fragment,a),o=!1},d(a){a&&N(n),t&&ee(t,a)}}}function Cm(e){let t,n,o,r=e[0].length>1&&fs(e),i=e[1]&&ds(e);return{c(){r&&r.c(),t=D(),i&&i.c(),n=Ee()},m(l,a){r&&r.m(l,a),O(l,t,a),i&&i.m(l,a),O(l,n,a),o=!0},p(l,[a]){l[0].length>1?r?r.p(l,a):(r=fs(l),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),l[1]?i?(i.p(l,a),a&2&&P(i,1)):(i=ds(l),i.c(),P(i,1),i.m(n.parentNode,n)):i&&(_e(),T(i,1,1,()=>{i=null}),ve())},i(l){o||(P(i),o=!0)},o(l){T(i),o=!1},d(l){r&&r.d(l),l&&N(t),i&&i.d(l),l&&N(n)}}}function km(e,t,n){let o,r;const i=Fe([]);ae(e,i,f=>n(0,o=f));const l=Fe(null);ae(e,l,f=>n(1,r=f));const a={Chatbot:od,Dropdown:ld,Feedback:Sm,Compare:wh,RetrievalQA:gm},s=f=>{l.set(f)};return fetch("/components").then(f=>{if(!f.ok)throw new Error(`HTTP error! status: ${f.status}`);return f.json()}).then(f=>{i.set(f),l.set(f[0])}).catch(f=>{console.log("Fetch request failed",f)}),[o,r,i,l,a,s,f=>s(f)]}class $m extends de{constructor(t){super(),pe(this,t,km,Cm,ce,{})}}new $m({target:document.getElementById("app")});
diff --git a/pykoi/frontend/dist/assets/index-c2d4a9bc.css b/pykoi/frontend/dist/assets/index-c2d4a9bc.css
deleted file mode 100644
index 8c9db51..0000000
--- a/pykoi/frontend/dist/assets/index-c2d4a9bc.css
+++ /dev/null
@@ -1 +0,0 @@
-@import"https://fonts.googleapis.com/css?family=Work+Sans:400|Lato:400|Inconsolata:400";:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:auto;width:100%}h1{font-size:3.2em;line-height:1.1}.card{padding:2em}#app{margin:0 auto;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Inconsolata", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px}header{color:var(--headerTextColor);position:fixed;left:0;top:0;width:100%;height:var(--headerHeight);background:var(--headerBackground);border-bottom:var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;position:absolute;bottom:0;width:100%}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:5px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--lightGrey);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 300px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}:root{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--yellow);--danger: var(--red);--background: var(--white);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--white);--footerBackground: var(--green);--footerTextColor: var(--black);--headerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--borderBottom: solid 2px var(--primary);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 0px;--height: height: calc(100vh - var(--headerHeight))}html{box-sizing:border-box;font-size:var(--baseFontSize)}*,*:before,*:after{box-sizing:inherit}body{font-family:var(--bodyFont);font-weight:400;line-height:1.75;background:var(--background);color:var(--textColor)}header{color:var(--headerTextColor);margin-top:1%;height:var(--headerHeight);background:var(--headerBackground);font-size:var(--h5);display:flex;justify-content:space-between;align-items:center;padding:0 var(--containerPadding)}header nav a{color:var(--white);text-decoration:none}header nav a+a{margin-left:10px}footer{color:var(--footerTextColor);background-color:var(--footerBackground);padding:calc(var(--headerHeight) * .75) var(--containerPadding);text-align:center;bottom:0;width:100%}footer a{color:var(--footerTextColor)}footer nav a+a{margin-left:10px}footer p{margin-bottom:0;max-width:none}p{margin-bottom:1rem}p a,blockquote a{color:var(--textColor);text-decoration:none;border-bottom:var(--borderBottom)}h1,h2,h3,h4,h5{margin:3rem 0 1.38rem;font-family:var(--headingFont);font-weight:400;line-height:1.15}h1{margin-top:0;font-size:var(--h1)}h2{font-size:var(--h2)}h3{font-size:var(--h3)}h4{font-size:var(--h4)}h5{font-size:var(--h5)}small,.text_small{font-size:var(--smallText)}blockquote{margin:10px;padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg)}label{display:block;font-size:var(--smallText)}input,textarea{padding:2px 5px;border:var(--line);border-radius:4px}textarea{width:100%;height:5rem}::placeholder{color:var(--grey)}::selection,.highlight{background:#ffb7b7;background:var(--red);color:var(--white)}select{border:var(--line)}hr{border-top:var(--line)}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--buttonTextColor);background-color:var(--white);border:var(--line);border-radius:var(--borderRadius);padding:10px 25px;box-shadow:var(--shadow-s);transition:.3s ease-in-out box-shadow}button:hover{cursor:pointer;box-shadow:var(--shadow-md)}button[disabled]{opacity:.4}button.cancel{--buttonColor: var(--danger);--buttonTextColor: var(--white)}button.small{font-size:var(--smallText)}.layout{padding-top:calc(0rem + var(--headerHeight))}.grid{--gridCols: 2;display:block;grid-template-columns:repeat(var(--gridCols),1fr)}.cols-3{--gridCols: 3}.cols-4{--gridCols: 4}.flex{--justifyContent: space-between;display:block;justify-content:var(--justifyContent)}.flex-around{--justifyContent: space-around}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius)}.grid-split{display:grid;grid-template-columns:33% 67%;gap:20px}@media only screen and (min-width: 600px){:root{--baseFontSize: 100%}.grid{display:grid}.flex{display:flex}}.logo{font-size:var(--baseFontSize);margin:0 0 0 8px}.dark{--background: var(--black);--textColor: var(--lightGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--yellow);--cardBg: var(--darkGrey);--buttonTextColor: var(--black)}.oled{--black: #000;--cardBg: var(--darkGrey);--headerBackground: var(--darkGrey);--footerBackground: var(--darkGrey)}.theme{--green: #00ebc7;--red: #FF5470;--yellow: #fde24f;--black: #1b2d45;--darkBlue: #00214d;--darkGrey: #222;--grey: #bfbfbf;--lightGrey: #f2f4f6;--white: white;--primary: var(--green);--danger: var(--red);--background: var(--lightGrey);--textColor: var(--black);--lineColor: var(--grey);--cardBg: var(--white);--headerBackground: var(--darkBlue);--footerBackground: var(--darkBlue);--footerTextColor: var(--black);--buttonColor: var(--primary);--buttonTextColor: var(--textColor);--line: solid 1px var(--lineColor);--headingFont: "Lato", monospace;--bodyFont: "Work Sans", sans-serif;--baseFontSize: 100%;--h1: 3.052em;--h2: 2.441em;--h3: 1.953em;--h4: 1.563em;--h5: 1.25em;--smallText: .8em;--shadow-s: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--containerPadding: 2.5%;--headerHeight: 3rem;--borderRadius: 10px}:root{--left: 25px}.grid-sidemenu{--gridCols: 2;display:grid;grid-template-columns:var(--left) 1fr}header{padding:0 15px 0 0}header nav a+a{margin-left:15px}.corner{margin-left:var(--left)}header nav a{color:var(--black);text-decoration:none}.page{padding:3em}.page-title{text-decoration:none;border-bottom:var(--borderBottom)}.card{padding:2em;background:var(--cardBg);box-shadow:var(--shadow-lg);border-radius:var(--borderRadius);font-size:var(--smallText)}.card:hover{box-shadow:var(--shadow-xl)}.card>*:first-child{margin-top:0}.card>*:last-child{margin-bottom:0}table{margin:auto}button{margin:5px}.small-button.svelte-19cad35.svelte-19cad35{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-19cad35.svelte-19cad35{text-align:center;margin:auto;width:20%}.small-button.svelte-19cad35.svelte-19cad35:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-19cad35.svelte-19cad35,.thumbs-up.svelte-19cad35.svelte-19cad35:hover,.thumbs-up.svelte-19cad35.svelte-19cad35::selection{background:var(--green)}.thumbs-down.svelte-19cad35.svelte-19cad35,.thumbs-down.svelte-19cad35.svelte-19cad35:hover,.thumbs-down.svelte-19cad35.svelte-19cad35::selection{background:var(--red)}.ranked-chat.svelte-19cad35.svelte-19cad35{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-19cad35.svelte-19cad35{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-19cad35.svelte-19cad35{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-19cad35.svelte-19cad35{display:flex;width:100%}.btnyousend.svelte-19cad35.svelte-19cad35{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-19cad35.svelte-19cad35{opacity:1}.green.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--green)}.red.svelte-19cad35.svelte-19cad35{border-bottom:2px solid var(--red)}.instructions.svelte-19cad35.svelte-19cad35{text-align:center;padding:5%}.instructions.svelte-19cad35 h5.svelte-19cad35{text-align:left}.instructions.svelte-19cad35 p.svelte-19cad35{font-size:var(--smallText);text-align:left}.ranked-feedback-container.svelte-19cad35.svelte-19cad35{display:grid;grid-template-columns:20% 80%}.underline.svelte-19cad35.svelte-19cad35{border-bottom:var(--line)}.bold.svelte-19cad35.svelte-19cad35{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-19cad35.svelte-19cad35{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-19cad35.svelte-19cad35{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-19cad35.svelte-19cad35{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-19cad35 .question.svelte-19cad35{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-19cad35 .answer.svelte-19cad35{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-19cad35 .answers.svelte-19cad35{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(50%);padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.ranked-chat.svelte-au920n.svelte-au920n{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-au920n.svelte-au920n{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-au920n.svelte-au920n{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-au920n.svelte-au920n{display:flex;width:100%}.btnyousend.svelte-au920n.svelte-au920n{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-au920n.svelte-au920n{opacity:1}.green.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--green)}.red.svelte-au920n.svelte-au920n{border-bottom:2px solid var(--red)}.instructions.svelte-au920n.svelte-au920n{text-align:center;padding:5%}.instructions.svelte-au920n h5.svelte-au920n{text-align:left}.instructions.svelte-au920n p.svelte-au920n{font-size:var(--smallText);text-align:left}.instructions.svelte-au920n button.svelte-au920n{font-size:var(--smallText)}.ranked-feedback-container.svelte-au920n.svelte-au920n{display:grid;grid-template-columns:20% 80%}.underline.svelte-au920n.svelte-au920n{border-bottom:var(--line)}.bold.svelte-au920n.svelte-au920n{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-au920n.svelte-au920n{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-au920n.svelte-au920n{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-au920n.svelte-au920n{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-au920n .question.svelte-au920n{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-au920n .answer.svelte-au920n{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-au920n .answers.svelte-au920n{display:grid;grid-template-columns:49% 49%;gap:2%;width:100%;margin:auto}.multiselect.svelte-8o2wf2.svelte-8o2wf2{position:relative;max-width:200px}.selectBox.svelte-8o2wf2.svelte-8o2wf2{position:relative}.selectBox.svelte-8o2wf2 select.svelte-8o2wf2{width:100%;font-weight:700}.overSelect.svelte-8o2wf2.svelte-8o2wf2{position:absolute;left:0;right:0;top:0;bottom:0}.dropdown-content.svelte-8o2wf2.svelte-8o2wf2{position:absolute;top:100%;left:0;width:100%;border:1px #dadada solid;background-color:#fff;z-index:1}.source.svelte-1pk2e1k{text-align:left;background-color:var(--lightGrey);border:1px solid var(--grey);border-top:none;padding:0 5px;margin:0;color:var(--darkGrey);box-sizing:border-box}.source_tab.svelte-1pk2e1k{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.source_content.svelte-1pk2e1k{border:1pt solid var(--grey);padding:5px;margin-bottom:5px;background-color:#fff;color:var(--darkGrey)}p.svelte-1pk2e1k{margin:0;padding:0}.source.svelte-1pk2e1k:nth-of-type(2){border-top:1px solid var(--grey)}.sources.svelte-1r759df{display:inline-block;text-align:left;padding:5px;border:1pt solid var(--grey)}.sources-header.svelte-1r759df{display:flex;justify-content:space-between;align-items:center;cursor:pointer}.box.svelte-iwm583.svelte-iwm583{margin-bottom:10px;padding:40px;border:1px solid #dee2e6;border-radius:0 0 .5rem .5rem;border-top:0}ul.svelte-iwm583.svelte-iwm583{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none;border-bottom:1px solid #dee2e6}li.svelte-iwm583.svelte-iwm583{margin-bottom:-1px}span.svelte-iwm583.svelte-iwm583{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem;display:block;padding:.5rem 1rem;cursor:pointer}span.svelte-iwm583.svelte-iwm583:hover{border-color:#e9ecef #e9ecef #dee2e6;color:#495057}li.svelte-iwm583>span.svelte-iwm583{color:var(--grey)}li.active.svelte-iwm583>span.svelte-iwm583{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.button-container.svelte-i9wciy{display:flex;justify-content:space-between}.note.svelte-i9wciy{font-size:var(--smallText);color:var(--gray)}.small-button.svelte-1u8cd0w{margin-left:10px;background:none;border:3px solid transparent;color:inherit;padding:6px 10px;cursor:pointer;box-shadow:none;font-size:var(--smallText)}.feedback-buttons.svelte-1u8cd0w{display:flex;text-align:center;margin:auto;width:20%}.small-button.svelte-1u8cd0w:hover{box-shadow:var(--shadow-md)}.thumbs-up.svelte-1u8cd0w,.thumbs-up.svelte-1u8cd0w:hover,.thumbs-up.svelte-1u8cd0w::selection{background:var(--green)}.thumbs-down.svelte-1u8cd0w,.thumbs-down.svelte-1u8cd0w:hover,.thumbs-down.svelte-1u8cd0w::selection{background:var(--red)}.chat-and-question.svelte-aj7hp0.svelte-aj7hp0{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-aj7hp0.svelte-aj7hp0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-aj7hp0.svelte-aj7hp0{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-aj7hp0.svelte-aj7hp0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-aj7hp0.svelte-aj7hp0{display:flex;width:100%}.btnyousend.svelte-aj7hp0.svelte-aj7hp0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-aj7hp0.svelte-aj7hp0{opacity:1}.green.svelte-aj7hp0.svelte-aj7hp0{border-bottom:2px solid var(--green)}.red.svelte-aj7hp0.svelte-aj7hp0{border-bottom:2px solid var(--red)}.instructions.svelte-aj7hp0.svelte-aj7hp0{text-align:center;padding:5%}.instructions.svelte-aj7hp0 h5.svelte-aj7hp0{text-align:left}.instructions.svelte-aj7hp0 p.svelte-aj7hp0{font-size:var(--smallText);text-align:left}.ranked-feedback-container.svelte-aj7hp0.svelte-aj7hp0{display:grid;grid-template-columns:20% 80%}.underline.svelte-aj7hp0.svelte-aj7hp0{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-aj7hp0.svelte-aj7hp0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-aj7hp0.svelte-aj7hp0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-aj7hp0.svelte-aj7hp0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-aj7hp0 .question.svelte-aj7hp0{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-aj7hp0 .answer.svelte-aj7hp0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-aj7hp0 .answers.svelte-aj7hp0{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-aj7hp0.svelte-aj7hp0{display:flex}.tooltip{white-space:nowrap;position:relative;padding-top:.35rem;cursor:zoom-in}#tooltip{position:absolute;bottom:100%;right:.78rem;transform:translate(calc(100% - 120px));padding:.2rem .35rem;background:hsl(0,0%,20%);color:#fafafa;font-size:.95em;border-radius:.25rem;filter:drop-shadow(0 1px 2px hsla(0,0%,0%,.2));width:max-content}.tooltip #tooltip:before{content:"";position:absolute;top:100%;left:10px;width:.6em;height:.25em;background:inherit;clip-path:polygon(0% 0%,100% 0%,50% 100%)}.series.svelte-tg5p7i:focus{outline:none}.horizontal-bar-rect.selected.svelte-tg5p7i{stroke:var(--black);stroke-width:3}#stackedrect-holder.svelte-tg5p7i{height:100%;width:100%}.line.svelte-tg5p7i{stroke-width:3;stroke:var(--black);fill:none}.horizontal-bar-rect.svelte-tg5p7i{transition:opacity .3s}.horizontal-bar-rect.svelte-tg5p7i:hover{stroke:var(--black);stroke-width:3}.horizontal-bar-text.svelte-tg5p7i{transition:opacity .3s;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none;font-size:var(--smallText)}.qa-card.svelte-szi0e{border:2px solid var(--black);display:flex;flex-direction:column;font-size:var(--smallText);padding:4px;margin:6px}.qa-card.svelte-szi0e:hover{border:3px solid var(--black)}.question.svelte-szi0e{background-color:var(--white);margin:0;padding:8px;border-bottom:1px solid var(--black)}.answer.svelte-szi0e{background-color:var(--lightGrey);margin:0;padding:8px}.feedback.svelte-szi0e{margin:0;padding:8px}.up.svelte-szi0e{background-color:var(--green)}.down.svelte-szi0e{background-color:var(--red)}.na.svelte-szi0e{background-color:var(--yellow)}.qa-container.svelte-1xv9cfi{border:2px solid var(--background);max-height:100%;overflow-y:auto}.chart-title.svelte-1oikip4{font-size:var(--smallText)}rect.svelte-1oikip4:hover{stroke:var(--black)}#stackedrect-holder.svelte-1oikip4{height:100%;width:100%}.axis-line.svelte-1oikip4{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-1oikip4{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-1oikip4{font-size:calc(var(--smallText) * .9)}.svelte-kz2qh6{transition:all .3s}.chart-title.svelte-kz2qh6{font-size:var(--smallText)}rect.svelte-kz2qh6:hover{stroke:var(--black)}.histogram-container.svelte-kz2qh6{height:100%;width:100%}.axis-line.svelte-kz2qh6{stroke-width:3;stroke:var(--black);fill:none}.axis-tick.svelte-kz2qh6{stroke-width:1;fill:none;opacity:0;font-size:9px}.axis-text.svelte-kz2qh6{font-size:calc(var(--smallText) * .9)}.svelte-1pknxov{font-family:Lato}.card-container.svelte-1pknxov{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-1pknxov{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-1pknxov{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-1pknxov{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-1pknxov{font-size:.6em}text.svelte-1pknxov{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.card-container.svelte-mchgj2{border:2px solid var(--black);width:100%;height:100%;display:grid;grid-template-columns:100%;grid-template-rows:35% 50% 10%;padding:5px;box-sizing:border-box}.card-text.svelte-mchgj2{text-align:left;margin:0;padding:0 0 0 2px;font-weight:700;font-size:.8em}#feedback-dropdown.svelte-mchgj2{width:98%;border:none;border-bottom:1px solid var(--black);border-top:1px solid var(--black);font-size:var(--smallText);margin-bottom:1px}svg.svelte-mchgj2{width:100%;height:100%;border-bottom:1px solid var(--black)}.small.svelte-mchgj2{font-size:.6em}text.svelte-mchgj2{font-size:3rem;transition:opacity .3s;stroke:#fff;stroke-width:6px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill;pointer-events:none}.ranked-chat.svelte-1nj8mt0.svelte-1nj8mt0{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.chat-input-holder.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;align-items:center;padding:24px;width:100%;max-width:640px;margin:auto}.chat-input-textarea.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--lightgrey);cursor:pointer;width:100%;border:var(--line);border-color:none;margin:12px;outline:none;padding:12px;color:var(--black);font-size:var(--baseFontSize);box-shadow:var(--shadow-md);flex:3;border-radius:0;border-right:0px}.chat-input-form.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;width:100%}.btnyousend.svelte-1nj8mt0.svelte-1nj8mt0{border-radius:0;margin-top:12px;margin-bottom:12px;margin-left:-15px;background:var(--primary);color:var(--black);opacity:.5;transition:all .3s}.active.svelte-1nj8mt0.svelte-1nj8mt0{opacity:1}.instructions.svelte-1nj8mt0.svelte-1nj8mt0{text-align:center;padding:5%;border-right:var(--line)}.instructions.svelte-1nj8mt0 h5.svelte-1nj8mt0{text-align:left}.instructions.svelte-1nj8mt0 p.svelte-1nj8mt0{font-size:var(--smallText);text-align:left;margin:0}.instructions.svelte-1nj8mt0 button.svelte-1nj8mt0{font-size:var(--smallText)}.ranked-feedback-container.svelte-1nj8mt0.svelte-1nj8mt0{display:grid;grid-template-columns:20% 80%}.underline.svelte-1nj8mt0.svelte-1nj8mt0{border-bottom:var(--line)}.bold.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-log.svelte-1nj8mt0.svelte-1nj8mt0{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-1nj8mt0.svelte-1nj8mt0{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-1nj8mt0.svelte-1nj8mt0{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-1nj8mt0 .question.svelte-1nj8mt0{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-1nj8mt0 .answer.svelte-1nj8mt0{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}option.svelte-1nj8mt0.svelte-1nj8mt0{font-weight:700;font-size:120%}p.svelte-1nj8mt0.svelte-1nj8mt0{margin:0}.svelte-1nna9rx{font-family:Lato}#chart-holder.svelte-1nna9rx{height:100%;width:100%}.axis-line.svelte-1nna9rx{stroke-width:3;stroke:#000;fill:none}.axis-tick.svelte-1nna9rx{stroke-width:2;stroke:#000;fill:none;opacity:.13}.axis-text.svelte-1nna9rx{font-family:Arial;font-size:12px}.bump-text.svelte-1nna9rx{font-size:12px;pointer-events:none}.model-path.svelte-1nna9rx{fill:none;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.model-path-outer.svelte-1nna9rx{fill:none;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}.chart-subtitle.svelte-1nna9rx{font-size:12px}#bar-chart-holder.svelte-1y9gffu{height:100%;width:100%}.axis-text.svelte-1y9gffu{font-size:9px}.axis-line.svelte-1y9gffu{stroke-width:3;stroke:#000;fill:none}.label-text.svelte-1y9gffu{font-size:9px}.cell.svelte-hnulv9{max-height:40px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cell.active.svelte-hnulv9{max-height:100%;overflow:visible;white-space:normal}.svelte-owgjbp.svelte-owgjbp{font-family:Lato,monospace}.table.svelte-owgjbp.svelte-owgjbp{margin:auto;width:90%}.pretty-pager.svelte-owgjbp.svelte-owgjbp{padding-top:1rem}.pretty-table.normal.svelte-owgjbp.svelte-owgjbp{font-size:15px}.pretty-table.normal.svelte-owgjbp th.svelte-owgjbp,.pretty-table.normal.svelte-owgjbp td.svelte-owgjbp{padding:3px 2px}.pretty-table.svelte-owgjbp th.svelte-owgjbp,.pretty-table.svelte-owgjbp td.svelte-owgjbp{vertical-align:top}.pretty-table.svelte-owgjbp thead th.svelte-owgjbp{text-transform:uppercase;font-weight:700;font-family:Work Sans,sans-serif;border-bottom:2px solid black}.pretty-table.svelte-owgjbp th.svelte-owgjbp{cursor:pointer}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{text-align:right}.pretty-table.svelte-owgjbp tbody td.cell-type-number.svelte-owgjbp,.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{font-family:menlo,consolas,monaco,monospace;font-size:90%}.pretty-table.svelte-owgjbp tbody td.cell-rank.svelte-owgjbp{padding-right:1em;color:#666}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse}table.pretty-table.svelte-owgjbp.svelte-owgjbp{border-collapse:collapse;table-layout:fixed}.pretty-table.svelte-owgjbp tr.svelte-owgjbp{border-bottom:1px solid #eee}td.active.svelte-owgjbp.svelte-owgjbp{max-height:100%;overflow:auto;color:red}td.svelte-owgjbp.svelte-owgjbp:not(.active){overflow:hidden;white-space:normal}tr.svelte-owgjbp.svelte-owgjbp:hover{background:#eee}.pretty-table.svelte-owgjbp.svelte-owgjbp{width:100%}#heatmap-holder.svelte-t6wv8i{height:100%;width:100%}.axis-text.svelte-t6wv8i,.chart-subtitle.svelte-t6wv8i{font-size:12px}.holder.svelte-7imt18.svelte-7imt18{height:100vh;width:100%;display:flex;justify-content:center;align-items:center}button.svelte-7imt18.svelte-7imt18{margin:0}.chart-captions.svelte-7imt18.svelte-7imt18{margin:auto;width:100%;text-align:left;height:100%}.chart-captions.svelte-7imt18 h4.svelte-7imt18{padding:0;margin:0}.main-container.svelte-7imt18.svelte-7imt18{margin:auto}.eval-container.svelte-7imt18.svelte-7imt18{display:grid;height:100vh;grid-template-rows:100%;grid-template-columns:65% 35%;padding:1rem}.left-charts.svelte-7imt18.svelte-7imt18{display:grid;grid-template-columns:100%;grid-template-rows:15% 60% 25%}.eval-table.svelte-7imt18.svelte-7imt18{margin:auto;width:100%}.right-charts.svelte-7imt18.svelte-7imt18{display:grid;grid-template-columns:100%;grid-template-rows:10% 33% 33%;gap:1%}.main-annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:90% 10%;height:100vh;width:100%;margin:auto}.buttons.svelte-3wjb3y.svelte-3wjb3y{display:flex;background:var(--grey)}.rating-button.svelte-3wjb3y.svelte-3wjb3y{padding:10px;border:none}.rating-button.svelte-3wjb3y+.rating-button.svelte-3wjb3y{margin-left:-1px}.ranked-chat.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:100%;grid-template-rows:100%;border:var(--line);margin:12px}.chat-input-holder.svelte-3wjb3y.svelte-3wjb3y{align-items:center;width:100%;margin:auto;border-top:var(--line)}.instructions.svelte-3wjb3y.svelte-3wjb3y{text-align:center;padding:5%}.instructions.svelte-3wjb3y h5.svelte-3wjb3y{text-align:left}.instructions.svelte-3wjb3y p.svelte-3wjb3y{font-size:var(--smallText);text-align:left}.instructions.svelte-3wjb3y button.svelte-3wjb3y{font-size:var(--smallText)}.annotation-container.svelte-3wjb3y.svelte-3wjb3y{display:grid;grid-template-columns:40% 60%}.underline.svelte-3wjb3y.svelte-3wjb3y{border-bottom:var(--line)}.bold.svelte-3wjb3y.svelte-3wjb3y{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;justify-content:space-between;height:calc(100vh - var(--headerHeight));background-color:var(--white);box-sizing:border-box;width:95%;margin:auto;height:100%}.chat-message-center.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;padding:12px;box-sizing:border-box}.message-content.svelte-3wjb3y.svelte-3wjb3y{display:flex;flex-direction:column;box-sizing:border-box;display:block}.message-content.svelte-3wjb3y .question.svelte-3wjb3y{text-align:left;border:1px solid var(--grey);padding:5px;margin-bottom:10px;background-color:var(--lightGrey)}.message-content.svelte-3wjb3y .answer.svelte-3wjb3y{display:block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-3wjb3y .answers.svelte-3wjb3y{display:grid;grid-template-columns:100%;gap:2%;width:100%;margin:auto}svg.svelte-h2ab3o{background:conic-gradient(from 90deg at 1px 1px,#0000 90deg,rgba(0,0,0,.04) 0) 0 0/20px 20px;border:var(--line)}.file-circle-g.svelte-h2ab3o:hover{opacity:1}.bubble-file-text.svelte-h2ab3o{font-size:calc(.99 * var(--smallText));pointer-events:none;stroke:var(--white);stroke-width:4px;fill:var(--black);stroke-linejoin:round;paint-order:stroke fill}circle.svelte-h2ab3o{transition:all .3s ease}circle.svelte-h2ab3o:hover{stroke:var(--black);stroke-width:3}.table-container.svelte-16fb3tv.svelte-16fb3tv{margin:auto;width:100%;overflow-y:scroll;max-height:100%;height:100%;overflow-y:auto}table.svelte-16fb3tv.svelte-16fb3tv{width:100%;border-collapse:collapse;font-size:var(--smallText)}thead.svelte-16fb3tv th.svelte-16fb3tv{text-align:center;padding:5px;border-bottom:4px solid var(--grey);background-color:var(--lightGrey)}thead.svelte-16fb3tv th.svelte-16fb3tv:nth-child(1){text-align:left}tbody.svelte-16fb3tv tr.svelte-16fb3tv{border-bottom:var(--line)}tbody.svelte-16fb3tv tr.svelte-16fb3tv:nth-child(2n){background-color:var(--white)}tbody.svelte-16fb3tv td.svelte-16fb3tv{padding:10px}.is-flex.svelte-16fb3tv.svelte-16fb3tv{display:flex;justify-content:space-between;align-items:center;padding:10px}.button.svelte-16fb3tv.svelte-16fb3tv{padding:5px 10px;border:none;cursor:pointer;transition:background-color .3s ease}.button.is-disabled.svelte-16fb3tv.svelte-16fb3tv{cursor:not-allowed;color:#ccc}.button.svelte-16fb3tv.svelte-16fb3tv:not(.is-disabled):hover{background-color:#f2f2f2}.button.is-white.svelte-16fb3tv.svelte-16fb3tv{color:#000}.mx-1.svelte-16fb3tv.svelte-16fb3tv{margin-left:1em;margin-right:1em}.file-container.svelte-1lu6hos{display:grid;height:calc(100% - var(--headerHeight));align-items:center;justify-content:center}.upload-container.svelte-1lu6hos{margin:auto;max-width:100%;text-align:center}.charts-container.svelte-1lu6hos{height:calc(100vh - var(--headerHeight));display:grid;gap:2%;grid-template-columns:100%;grid-template-rows:50% 40%}.data-grid.svelte-1lu6hos{display:grid;grid-template-columns:45% 50%;gap:0;margin:auto;max-width:1200px;padding-top:20px}.upload-box.svelte-1lu6hos{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;max-height:50vh;margin:auto;border:5px dashed var(--grey);padding:20px;box-sizing:border-box}.feedback-container.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:30% 70%;grid-template-rows:100%;width:90%;height:calc(100vh - var(--headerHeight))}.feedback-left.svelte-14znspc{border-bottom:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:25% 25% 25% 12.5% 12.5%}.left-text.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:100%;grid-template-columns:50% 50%}.left-confidence.svelte-14znspc{text-align:center;border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-rows:40% 55%}.left-question.svelte-14znspc,.left-filter.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.feedback-right.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:100%;grid-template-rows:30% 70%;grid-template-rows:0% 100%}.right-chart.svelte-14znspc{border-bottom:var(--line);border-right:var(--line);display:grid;grid-template-columns:50% 50%;grid-template-rows:100%}.right-chart-1.svelte-14znspc,.right-chart-2.svelte-14znspc{border-right:var(--line)}.right-table.svelte-14znspc{border-bottom:var(--line);border-right:var(--line)}.card-1.svelte-14znspc{border-right:var(--line)}
diff --git a/pykoi/frontend/dist/assets/index-dc2068fd.js b/pykoi/frontend/dist/assets/index-dc2068fd.js
new file mode 100644
index 0000000..fe84fb5
--- /dev/null
+++ b/pykoi/frontend/dist/assets/index-dc2068fd.js
@@ -0,0 +1,64 @@
+(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function U(){}const Ks=e=>e;function Sn(e,t){for(const n in t)e[n]=t[n];return e}function Js(e){return e()}function Jl(){return Object.create(null)}function be(e){e.forEach(Js)}function Ge(e){return typeof e=="function"}function fe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Eu(e){return Object.keys(e).length===0}function $l(e,...t){if(e==null)return U;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Fu(e){let t;return $l(e,n=>t=n)(),t}function ue(e,t,n){e.$$.on_destroy.push($l(t,n))}function Uo(e,t,n,l){if(e){const o=Zs(e,t,n,l);return e[0](o)}}function Zs(e,t,n,l){return e[1]&&l?Sn(n.ctx.slice(),e[1](l(t))):n.ctx}function Wo(e,t,n,l){if(e[2]&&l){const o=e[2](l(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const r=[],s=Math.max(t.dirty.length,o.length);for(let u=0;u32){const t=[],n=e.ctx.length/32;for(let l=0;lwindow.performance.now():()=>Date.now(),Mo=ea?e=>requestAnimationFrame(e):U;const Xt=new Set;function na(e){Xt.forEach(t=>{t.c(e)||(Xt.delete(t),t.f())}),Xt.size!==0&&Mo(na)}function la(e){let t;return Xt.size===0&&Mo(na),{promise:new Promise(n=>{Xt.add(t={c:e,f:n})}),abort(){Xt.delete(t)}}}let Al=!1;function Du(){Al=!0}function Iu(){Al=!1}function Nu(e,t,n,l){for(;e>1);n(o)<=l?e=o+1:t=o}return e}function Pu(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const a=[];for(let f=0;f0&&t[n[o]].claim_order<=f?o+1:Nu(1,o,g=>t[n[g]].claim_order,f))-1;l[a]=n[c]+1;const d=c+1;n[d]=a,o=Math.max(d,o)}const r=[],s=[];let u=t.length-1;for(let a=n[o]+1;a!=0;a=l[a-1]){for(r.push(t[a-1]);u>=a;u--)s.push(t[u]);u--}for(;u>=0;u--)s.push(t[u]);r.reverse(),s.sort((a,f)=>a.claim_order-f.claim_order);for(let a=0,f=0;a=r[f].claim_order;)f++;const c=fe.removeEventListener(t,n,l)}function Lu(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function qu(e){return function(t){t.target===this&&e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Hu(e){return Array.from(e.childNodes)}function Gu(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Bu(e,t,n,l,o=!1){Gu(e);const r=(()=>{for(let s=e.claim_info.last_index;s=0;s--){const u=e[s];if(t(u)){const a=n(u);return a===void 0?e.splice(s,1):e[s]=a,o?a===void 0&&e.claim_info.last_index--:e.claim_info.last_index=s,u}}return l()})();return r.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,r}function ju(e,t){return Bu(e,n=>n.nodeType===3,n=>{const l=""+t;if(n.data.startsWith(l)){if(n.data.length!==l.length)return n.splitText(l.length)}else n.data=l},()=>H(t),!0)}function K(e,t){t=""+t,e.data!==t&&(e.data=t)}function Ye(e,t){e.value=t??""}function Re(e,t,n,l){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function ll(e,t,n){for(let l=0;lonresize=function(){parent.postMessage(0,'*')}<\/script>",r=x(window,"message",s=>{s.source===l.contentWindow&&t()})):(l.src="about:blank",l.onload=()=>{r=x(l.contentWindow,"resize",t),t()}),b(e,l),()=>{(o||r&&l.contentWindow)&&r(),P(l)}}function Pt(e,t,n){e.classList[n?"add":"remove"](t)}function Uu(e,t,{bubbles:n=!1,cancelable:l=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(e,n,l,t),o}function At(e,t){return new e(t)}const ol=new Map;let il=0;function Wu(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Xu(e,t){const n={stylesheet:Tu(t),rules:{}};return ol.set(e,n),n}function Ko(e,t,n,l,o,r,s,u=0){const a=16.666/l;let f=`{
+`;for(let v=0;v<=1;v+=a){const w=t+(n-t)*r(v);f+=v*100+`%{${s(w,1-w)}}
+`}const c=f+`100% {${s(n,1-n)}}
+}`,d=`__svelte_${Wu(c)}_${u}`,g=oa(e),{stylesheet:p,rules:m}=ol.get(g)||Xu(g,e);m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${c}`,p.cssRules.length));const _=e.style.animation||"";return e.style.animation=`${_?`${_}, `:""}${d} ${l}ms linear ${o}ms 1 both`,il+=1,d}function Yu(e,t){const n=(e.style.animation||"").split(", "),l=n.filter(t?r=>r.indexOf(t)<0:r=>r.indexOf("__svelte")===-1),o=n.length-l.length;o&&(e.style.animation=l.join(", "),il-=o,il||Qu())}function Qu(){Mo(()=>{il||(ol.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&P(t)}),ol.clear())})}let Zt;function Ot(e){Zt=e}function Ku(){if(!Zt)throw new Error("Function called outside component initialization");return Zt}function ft(e){Ku().$$.on_mount.push(e)}function Ju(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(l=>l.call(this,t))}const xt=[],et=[];let Yt=[];const Zl=[],Zu=Promise.resolve();let eo=!1;function ef(){eo||(eo=!0,Zu.then(ra))}function Me(e){Yt.push(e)}function $n(e){Zl.push(e)}const El=new Set;let Ht=0;function ra(){if(Ht!==0)return;const e=Zt;do{try{for(;Hte.indexOf(l)===-1?t.push(l):n.push(l)),n.forEach(l=>l()),Yt=t}let sn;function lf(){return sn||(sn=Promise.resolve(),sn.then(()=>{sn=null})),sn}function Fl(e,t,n){e.dispatchEvent(Uu(`${t?"intro":"outro"}${n}`))}const Qn=new Set;let dt;function we(){dt={r:0,c:[],p:dt}}function ye(){dt.r||be(dt.c),dt=dt.p}function V(e,t){e&&e.i&&(Qn.delete(e),e.i(t))}function z(e,t,n,l){if(e&&e.o){if(Qn.has(e))return;Qn.add(e),dt.c.push(()=>{Qn.delete(e),l&&(n&&e.d(1),l())}),e.o(t)}else l&&l()}const of={duration:0};function lt(e,t,n,l){const o={direction:"both"};let r=t(e,n,o),s=l?0:1,u=null,a=null,f=null;function c(){f&&Yu(e,f)}function d(p,m){const _=p.b-s;return m*=Math.abs(_),{a:s,b:p.b,d:_,duration:m,start:p.start,end:p.start+m,group:p.group}}function g(p){const{delay:m=0,duration:_=300,easing:v=Ks,tick:w=U,css:y}=r||of,C={start:ta()+m,b:p};p||(C.group=dt,dt.r+=1),u||a?a=C:(y&&(c(),f=Ko(e,s,p,_,m,v,y)),p&&w(0,1),u=d(C,_),Me(()=>Fl(e,p,"start")),la(M=>{if(a&&M>a.start&&(u=d(a,_),a=null,Fl(e,u.b,"start"),y&&(c(),f=Ko(e,s,u.b,u.duration,0,v,r.css))),u){if(M>=u.end)w(s=u.b,1-s),Fl(e,u.b,"end"),a||(u.b?c():--u.group.r||be(u.group.c)),u=null;else if(M>=u.start){const $=M-u.start;s=u.a+u.d*v($/u.duration),w(s,1-s)}}return!!(u||a)}))}return{run(p){Ge(r)?lf().then(()=>{r=r(o),g(p)}):g(p)},end(){c(),u=a=null}}}function zt(e,t){e.d(1),t.delete(e.key)}function sa(e,t){z(e,1,1,()=>{t.delete(e.key)})}function gt(e,t,n,l,o,r,s,u,a,f,c,d){let g=e.length,p=r.length,m=g;const _={};for(;m--;)_[e[m].key]=m;const v=[],w=new Map,y=new Map,C=[];for(m=p;m--;){const S=d(o,r,m),A=n(S);let k=s.get(A);k?l&&C.push(()=>k.p(S,t)):(k=f(A,S),k.c()),w.set(A,v[m]=k),A in _&&y.set(A,Math.abs(m-_[A]))}const M=new Set,$=new Set;function F(S){V(S,1),S.m(u,c),s.set(S.key,S),c=S.first,p--}for(;g&&p;){const S=v[p-1],A=e[g-1],k=S.key,E=A.key;S===A?(c=S.first,g--,p--):w.has(E)?!s.has(k)||M.has(k)?F(S):$.has(E)?g--:y.get(k)>y.get(E)?($.add(k),F(S)):(M.add(E),g--):(a(A,s),g--)}for(;g--;){const S=e[g];w.has(S.key)||a(S,s)}for(;p;)F(v[p-1]);return be(C),v}function aa(e,t){const n={},l={},o={$$scope:1};let r=e.length;for(;r--;){const s=e[r],u=t[r];if(u){for(const a in s)a in u||(l[a]=1);for(const a in u)o[a]||(n[a]=u[a],o[a]=1);e[r]=u}else for(const a in s)o[a]=1}for(const s in l)s in n||(n[s]=void 0);return n}function ua(e){return typeof e=="object"&&e!==null?e:{}}const rf=/[&"]/g,sf=/[&<]/g;function af(e,t=!1){const n=String(e),l=t?rf:sf;l.lastIndex=0;let o="",r=0;for(;l.test(n);){const s=l.lastIndex-1,u=n[s];o+=n.substring(r,s)+(u==="&"?"&":u==='"'?""":"<"),r=s+1}return o+n.substring(r)}function uf(e,t){if(!e||!e.$$render)throw t==="svelte:component"&&(t+=" this={...}"),new Error(`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`);return e}let Dl;function fa(e){function t(n,l,o,r,s){const u=Zt,a={on_destroy:Dl,context:new Map(s||(u?u.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Jl()};Ot({$$:a});const f=e(n,l,o,r);return Ot(u),f}return{render:(n={},{$$slots:l={},context:o=new Map}={})=>{Dl=[];const r={title:"",head:"",css:new Set},s=t(r,n,{},l,o);return be(Dl),{html:s,css:{code:Array.from(r.css).map(u=>u.code).join(`
+`),map:null},head:r.title+r.head}},$$render:t}}function An(e,t,n){const l=e.$$.props[t];l!==void 0&&(e.$$.bound[l]=n,n(e.$$.ctx[l]))}function ne(e){e&&e.c()}function ff(e,t){e&&e.l(t)}function ee(e,t,n,l){const{fragment:o,after_update:r}=e.$$;o&&o.m(t,n),l||Me(()=>{const s=e.$$.on_mount.map(Js).filter(Ge);e.$$.on_destroy?e.$$.on_destroy.push(...s):be(s),e.$$.on_mount=[]}),r.forEach(Me)}function te(e,t){const n=e.$$;n.fragment!==null&&(nf(n.after_update),be(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function cf(e,t){e.$$.dirty[0]===-1&&(xt.push(e),ef(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const m=p.length?p[0]:g;return f.ctx&&o(f.ctx[d],f.ctx[d]=m)&&(!f.skip_bound&&f.bound[d]&&f.bound[d](m),c&&cf(e,d)),g}):[],f.update(),c=!0,be(f.before_update),f.fragment=l?l(f.ctx):!1,t.target){if(t.hydrate){Du();const d=Hu(t.target);f.fragment&&f.fragment.l(d),d.forEach(P)}else f.fragment&&f.fragment.c();t.intro&&V(e.$$.fragment),ee(e,t.target,t.anchor,t.customElement),Iu(),ra()}Ot(a)}class ce{$destroy(){te(this,1),this.$destroy=U}$on(t,n){if(!Ge(n))return U;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const o=l.indexOf(n);o!==-1&&l.splice(o,1)}}$set(t){this.$$set&&!Eu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Gt=[];function to(e,t){return{subscribe:De(e,t).subscribe}}function De(e,t=U){let n;const l=new Set;function o(u){if(fe(e,u)&&(e=u,n)){const a=!Gt.length;for(const f of l)f[1](),Gt.push(f,e);if(a){for(let f=0;f{l.delete(f),l.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:s}}function df(e,t,n){const l=!Array.isArray(e),o=l?[e]:e,r=t.length<2;return to(n,s=>{let u=!1;const a=[];let f=0,c=U;const d=()=>{if(f)return;c();const p=t(l?a[0]:a,s);r?s(p):c=Ge(p)?p:U},g=o.map((p,m)=>$l(p,_=>{a[m]=_,f&=~(1<{f|=1<e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const l=t.map((o,r)=>no(e[r],o));return o=>l.map(r=>r(o))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(Jo(e)&&Jo(t)){e=e.getTime(),t=t.getTime();const r=t-e;return s=>new Date(e+s*r)}const l=Object.keys(t),o={};return l.forEach(r=>{o[r]=no(e[r],t[r])}),r=>{const s={};return l.forEach(u=>{s[u]=o[u](r)}),s}}if(n==="number"){const l=t-e;return o=>e+o*l}throw new Error(`Cannot interpolate ${n} values`)}function Fo(e,t={}){const n=De(e);let l,o=e;function r(s,u){if(e==null)return n.set(e=s),Promise.resolve();o=s;let a=l,f=!1,{delay:c=0,duration:d=400,easing:g=Ks,interpolate:p=no}=Sn(Sn({},t),u);if(d===0)return a&&(a.abort(),a=null),n.set(e=o),Promise.resolve();const m=ta()+c;let _;return l=la(v=>{if(vd?(n.set(e=s),!1):(n.set(e=_(g(w/d))),!0)}),l.promise}return{set:r,update:(s,u)=>r(s(o,e),u),subscribe:n.subscribe}}const qe=De([]),Il=De([]),an=De([]),Rn=De([]),st=De("all"),Zo=De({"n/a":1,up:1,down:1}),hf=["who","what","how","why","where","does","can","n/a"],lo=Fo(hf.map(e=>({question:e,count:0}))),oo=De(new Set);var io="http://www.w3.org/1999/xhtml";const ei={svg:"http://www.w3.org/2000/svg",xhtml:io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ca(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ei.hasOwnProperty(t)?{space:ei[t],local:e}:e}function gf(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===io&&t.documentElement.namespaceURI===io?t.createElement(e):t.createElementNS(n,e)}}function pf(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function da(e){var t=ca(e);return(t.local?pf:gf)(t)}function mf(){}function ha(e){return e==null?mf:function(){return this.querySelector(e)}}function _f(e){typeof e!="function"&&(e=ha(e));for(var t=this._groups,n=t.length,l=new Array(n),o=0;o=C&&(C=y+1);!($=v[C])&&++C=0;)(s=l[o])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function Bf(e){e||(e=jf);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,l=n.length,o=new Array(l),r=0;rt?1:e>=t?0:NaN}function xf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uf(){return Array.from(this)}function Wf(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?oc:typeof t=="function"?rc:ic)(e,t,n??"")):ac(this.node(),e)}function ac(e,t){return e.style.getPropertyValue(t)||_a(e).getComputedStyle(e,null).getPropertyValue(t)}function uc(e){return function(){delete this[e]}}function fc(e,t){return function(){this[e]=t}}function cc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function dc(e,t){return arguments.length>1?this.each((t==null?uc:typeof t=="function"?cc:fc)(e,t)):this.node()[e]}function va(e){return e.trim().split(/^|\s+/)}function Do(e){return e.classList||new ba(e)}function ba(e){this._node=e,this._names=va(e.getAttribute("class")||"")}ba.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wa(e,t){for(var n=Do(e),l=-1,o=t.length;++l=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function qc(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,o=t.length,r;n({}),ti=e=>({});function Yc(e){let t,n,l,o,r,s,u,a,f;const c=e[4].header,d=Uo(c,e,e[3],ti),g=e[4].default,p=Uo(g,e,e[3],null);return{c(){t=R("dialog"),n=R("div"),l=R("div"),o=R("button"),o.textContent="X",r=N(),d&&d.c(),s=N(),p&&p.c(),h(o,"class","close-button svelte-g384pz"),h(l,"class","btn-container svelte-g384pz"),h(n,"class","svelte-g384pz"),h(t,"class","svelte-g384pz")},m(m,_){T(m,t,_),b(t,n),b(n,l),b(l,o),b(n,r),d&&d.m(n,null),b(n,s),p&&p.m(n,null),e[6](t),u=!0,a||(f=[x(o,"click",function(){Ge(e[1])&&e[1].apply(this,arguments)}),x(n,"click",Lu(e[5])),x(t,"close",function(){Ge(e[1])&&e[1].apply(this,arguments)}),x(t,"click",qu(function(){Ge(e[1])&&e[1].apply(this,arguments)}))],a=!0)},p(m,[_]){e=m,d&&d.p&&(!u||_&8)&&Xo(d,c,e,e[3],u?Wo(c,e[3],_,Xc):Yo(e[3]),ti),p&&p.p&&(!u||_&8)&&Xo(p,g,e,e[3],u?Wo(g,e[3],_,null):Yo(e[3]),null)},i(m){u||(V(d,m),V(p,m),u=!0)},o(m){z(d,m),z(p,m),u=!1},d(m){m&&P(t),d&&d.d(m),p&&p.d(m),e[6](null),a=!1,be(f)}}}function Qc(e,t,n){let{$$slots:l={},$$scope:o}=t,{showModal:r}=t,{dialog:s}=t,{handleClose:u}=t;function a(c){Ju.call(this,e,c)}function f(c){et[c?"unshift":"push"](()=>{s=c,n(0,s)})}return e.$$set=c=>{"showModal"in c&&n(2,r=c.showModal),"dialog"in c&&n(0,s=c.dialog),"handleClose"in c&&n(1,u=c.handleClose),"$$scope"in c&&n(3,o=c.$$scope)},e.$$.update=()=>{e.$$.dirty&5&&s&&r&&s.showModal()},[s,u,r,o,l,a,f]}class Kc extends ce{constructor(t){super(),de(this,t,Qc,Yc,fe,{showModal:2,dialog:0,handleClose:1})}}function ni(e){let t,n,l,o,r,s,u,a,f;return{c(){t=R("form"),n=R("div"),l=R("label"),l.textContent="Filename",o=N(),r=R("input"),s=N(),u=R("div"),u.innerHTML='Download ',h(l,"for","file_name"),h(l,"class","svelte-sy2m0x"),h(r,"type","text"),h(r,"placeholder","Please enter filename"),h(r,"name","file_name"),r.required=!0,h(n,"class","inputs svelte-sy2m0x"),h(u,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(n,o),b(n,r),Ye(r,e[2]),b(t,s),b(t,u),a||(f=[x(r,"input",e[8]),x(t,"submit",e[5])],a=!0)},p(c,d){d&4&&r.value!==c[2]&&Ye(r,c[2])},d(c){c&&P(t),a=!1,be(f)}}}function li(e){let t,n,l,o,r,s,u,a,f;return{c(){t=R("div"),n=H("✅ Data downloaded to ~/pykoi/"),l=H(e[2]),o=H(".csv"),r=N(),s=R("div"),u=R("button"),u.textContent="Close",h(s,"class","btn-container svelte-sy2m0x")},m(c,d){T(c,t,d),b(t,n),b(t,l),b(t,o),T(c,r,d),T(c,s,d),b(s,u),a||(f=x(u,"click",e[6]),a=!0)},p(c,d){d&4&&K(l,c[2])},d(c){c&&P(t),c&&P(r),c&&P(s),a=!1,f()}}}function oi(e){let t,n,l,o,r,s,u,a;return{c(){t=R("div"),t.textContent="⚠️ Download failed. Please try again.",n=N(),l=R("div"),o=R("button"),o.textContent="Retry",r=N(),s=R("button"),s.textContent="Close",h(l,"class","btn-container svelte-sy2m0x")},m(f,c){T(f,t,c),T(f,n,c),T(f,l,c),b(l,o),b(l,r),b(l,s),u||(a=[x(o,"click",e[9]),x(s,"click",e[6])],u=!0)},p:U,d(f){f&&P(t),f&&P(n),f&&P(l),u=!1,be(a)}}}function Jc(e){let t,n,l,o=e[3]===e[4].FILE_INPUT&&ni(e),r=e[3]===e[4].DOWNLOADED&&li(e),s=e[3]===e[4].FAILED_DOWNLOAD&&oi(e);return{c(){o&&o.c(),t=N(),r&&r.c(),n=N(),s&&s.c(),l=Se()},m(u,a){o&&o.m(u,a),T(u,t,a),r&&r.m(u,a),T(u,n,a),s&&s.m(u,a),T(u,l,a)},p(u,a){u[3]===u[4].FILE_INPUT?o?o.p(u,a):(o=ni(u),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null),u[3]===u[4].DOWNLOADED?r?r.p(u,a):(r=li(u),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null),u[3]===u[4].FAILED_DOWNLOAD?s?s.p(u,a):(s=oi(u),s.c(),s.m(l.parentNode,l)):s&&(s.d(1),s=null)},d(u){o&&o.d(u),u&&P(t),r&&r.d(u),u&&P(n),s&&s.d(u),u&&P(l)}}}function Zc(e){let t;return{c(){t=R("h4"),t.textContent="Download Data",h(t,"slot","header"),h(t,"class","svelte-sy2m0x")},m(n,l){T(n,t,l)},p:U,d(n){n&&P(t)}}}function ed(e){let t,n,l,o;function r(a){e[10](a)}function s(a){e[11](a)}let u={handleClose:e[6],$$slots:{header:[Zc],default:[Jc]},$$scope:{ctx:e}};return e[0]!==void 0&&(u.showModal=e[0]),e[1]!==void 0&&(u.dialog=e[1]),t=new Kc({props:u}),et.push(()=>An(t,"showModal",r)),et.push(()=>An(t,"dialog",s)),{c(){ne(t.$$.fragment)},m(a,f){ee(t,a,f),o=!0},p(a,[f]){const c={};f&4108&&(c.$$scope={dirty:f,ctx:a}),!n&&f&1&&(n=!0,c.showModal=a[0],$n(()=>n=!1)),!l&&f&2&&(l=!0,c.dialog=a[1],$n(()=>l=!1)),t.$set(c)},i(a){o||(V(t.$$.fragment,a),o=!0)},o(a){z(t.$$.fragment,a),o=!1},d(a){te(t,a)}}}function td(e,t,n){let{showModal:l,table:o}=t,r,s="";const u={FILE_INPUT:0,DOWNLOADED:1,FAILED_DOWNLOAD:2};let a=u.FILE_INPUT;const f=async _=>{_.preventDefault();const v={file_name:s},y=await(await fetch(`/chat/${o}/save_to_csv`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).json();console.log("Download Complete: ",y),y.status==="200"?(console.log("success"),n(3,a=u.DOWNLOADED)):(console.log("failed"),n(3,a=u.FAILED_DOWNLOAD))};function c(){n(0,l=!1),n(3,a=u.FILE_INPUT),r.close()}function d(){s=this.value,n(2,s)}const g=()=>n(3,a=u.FILE_INPUT);function p(_){l=_,n(0,l)}function m(_){r=_,n(1,r)}return e.$$set=_=>{"showModal"in _&&n(0,l=_.showModal),"table"in _&&n(7,o=_.table)},[l,r,s,a,u,f,c,o,d,g,p,m]}class Io extends ce{constructor(t){super(),de(this,t,td,ed,fe,{showModal:0,table:7})}}function ii(e,t,n){const l=e.slice();return l[19]=t[n],l[21]=n,l}function ri(e){let t,n,l,o,r,s;function u(...f){return e[12](e[21],...f)}function a(...f){return e[13](e[21],...f)}return{c(){t=R("div"),n=R("button"),n.textContent="👍",l=N(),o=R("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(o,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(f,c){T(f,t,c),b(t,n),b(t,l),b(t,o),r||(s=[x(n,"click",u),x(o,"click",a)],r=!0)},p(f,c){e=f},d(f){f&&P(t),r=!1,be(s)}}}function si(e,t){let n,l,o,r,s,u,a,f,c,d=t[19].question+"",g,p,m,_,v,w,y,C=t[19].answer+"",M,$,F,S,A,k,E=t[0]&&ri(t);return{key:e,first:null,c(){n=R("div"),l=R("div"),o=R("div"),r=N(),s=R("div"),u=R("div"),a=R("h5"),a.textContent="Question:",f=N(),c=R("p"),g=H(d),p=N(),m=R("div"),_=R("div"),v=R("h5"),v.textContent="Response:",w=N(),y=R("p"),M=H(C),$=N(),E&&E.c(),F=N(),h(o,"class","avatar"),h(a,"class","bold svelte-19cad35"),h(u,"class","question svelte-19cad35"),h(v,"class","bold svelte-19cad35"),h(_,"class","answer svelte-19cad35"),h(m,"class","answers svelte-19cad35"),h(s,"class","message-content svelte-19cad35"),h(l,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,D){T(I,n,D),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(s,p),b(s,m),b(m,_),b(_,v),b(_,w),b(_,y),b(y,M),b(_,$),E&&E.m(_,null),b(n,F),A||(k=Cn(S=ld.call(null,n,t[21]===t[5].length-1)),A=!0)},p(I,D){t=I,D&32&&d!==(d=t[19].question+"")&&K(g,d),D&32&&C!==(C=t[19].answer+"")&&K(M,C),t[0]?E?E.p(t,D):(E=ri(t),E.c(),E.m(_,null)):E&&(E.d(1),E=null),S&&Ge(S.update)&&D&32&&S.update.call(null,t[21]===t[5].length-1)},d(I){I&&P(n),E&&E.d(),A=!1,k()}}}function nd(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_=[],v=new Map,w,y,C,M,$,F,S=(e[3]?e[4]:"Send")+"",A,k,E,I,D,L,O;function B(W){e[11](W)}let j={table:"qa_table"};e[1]!==void 0&&(j.showModal=e[1]),t=new Io({props:j}),et.push(()=>An(t,"showModal",B));let ae=e[5];const pe=W=>W[21];for(let W=0;W👍
+ button. If the repsonse is not satisfactory, click on the
+ 👎 button.`,f=N(),c=R("button"),c.textContent="Download Data",d=N(),g=R("div"),p=R("section"),m=R("div");for(let W=0;W<_.length;W+=1)_[W].c();w=N(),y=R("div"),C=R("form"),M=R("input"),$=N(),F=R("button"),A=H(S),E=N(),I=R("p"),I.textContent="Note - may produce inaccurate information.",h(s,"class","underline bold svelte-19cad35"),h(a,"class","svelte-19cad35"),h(c,"class","svelte-19cad35"),h(r,"class","instructions svelte-19cad35"),h(m,"class","chat-log svelte-19cad35"),h(p,"class","chatbox svelte-19cad35"),h(M,"class","chat-input-textarea svelte-19cad35"),h(M,"placeholder","Type Question Here"),h(F,"class",k="btnyousend "+(e[2]===""?"":"active")+" svelte-19cad35"),h(F,"type","submit"),h(C,"class","chat-input-form svelte-19cad35"),h(I,"class","message svelte-19cad35"),h(y,"class","chat-input-holder svelte-19cad35"),h(g,"class","ranked-chat svelte-19cad35"),h(o,"class","ranked-feedback-container svelte-19cad35")},m(W,Q){ee(t,W,Q),T(W,l,Q),T(W,o,Q),b(o,r),b(r,s),b(r,u),b(r,a),b(r,f),b(r,c),b(o,d),b(o,g),b(g,p),b(p,m);for(let X=0;X<_.length;X+=1)_[X]&&_[X].m(m,null);b(g,w),b(g,y),b(y,C),b(C,M),Ye(M,e[2]),b(C,$),b(C,F),b(F,A),b(y,E),b(y,I),D=!0,L||(O=[x(c,"click",e[8]),x(M,"input",e[14]),x(C,"submit",e[6])],L=!0)},p(W,[Q]){const X={};!n&&Q&2&&(n=!0,X.showModal=W[1],$n(()=>n=!1)),t.$set(X),Q&161&&(ae=W[5],_=gt(_,Q,pe,1,W,ae,v,m,zt,si,null,ii)),Q&4&&M.value!==W[2]&&Ye(M,W[2]),(!D||Q&24)&&S!==(S=(W[3]?W[4]:"Send")+"")&&K(A,S),(!D||Q&4&&k!==(k="btnyousend "+(W[2]===""?"":"active")+" svelte-19cad35"))&&h(F,"class",k)},i(W){D||(V(t.$$.fragment,W),D=!0)},o(W){z(t.$$.fragment,W),D=!1},d(W){te(t,W),W&&P(l),W&&P(o);for(let Q=0;Q<_.length;Q+=1)_[Q].d();L=!1,be(O)}}}function ld(e){setTimeout(()=>{e.scrollIntoView({behavior:"smooth"})},0)}async function od(e){const t=await fetch("/chat/qa_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function id(e,t,n){let l,o;ue(e,qe,M=>n(5,o=M));let r=!1,{feedback:s=!1}=t,{is_retrieval:u=!1}=t,a="",f="",c=!1;ft(()=>{d()});async function d(){const S=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(A=>({id:A[0],question:A[1],answer:A[2],vote_status:A[3]}));Pe(qe,o=[...S],o)}const g=async M=>{M.preventDefault(),a=f,n(2,f=""),n(3,c=!0);let $={id:o.length+1,question:a,answer:"Loading...",vote_status:"na"};Pe(qe,o=[...o,$],o);const F=u?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})}):await fetch(`/chat/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(F.ok){const S=await F.json();console.log("response data",S),$.answer=S.answer,qe.update(A=>(A[A.length-1]=$,A))}else{const S=await F.text();alert(S)}n(3,c=!1)};let p=0;setInterval(()=>{n(10,p=(p+1)%4)},200);function m(M,$,F){const S=o[F];S.vote=$;const A={id:F+1,vote_status:$};od(A),pt(M.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),pt(M.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}function _(){n(1,r=!0)}[...Array(10).keys()].map(M=>String.fromCharCode(65+M));function v(M){r=M,n(1,r)}const w=(M,$)=>m($,"up",M),y=(M,$)=>m($,"down",M);function C(){f=this.value,n(2,f)}return e.$$set=M=>{"feedback"in M&&n(0,s=M.feedback),"is_retrieval"in M&&n(9,u=M.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(4,l=".".repeat(p).padEnd(3))},[s,r,f,c,l,o,g,m,_,u,p,v,w,y,C]}class No extends ce{constructor(t){super(),de(this,t,id,nd,fe,{feedback:0,is_retrieval:9})}}function ai(e,t,n){const l=e.slice();return l[14]=t[n],l[16]=n,l}function ui(e,t){let n,l,o,r,s,u,a,f,c,d=t[14].question+"",g,p,m,_,v,w,y,C=t[14].up_ranking_answer+"",M,$,F,S,A,k,E=t[14].low_ranking_answer+"",I,D,L,O,B;function j(...Q){return t[7](t[14],t[16],...Q)}function ae(...Q){return t[8](t[14],t[16],...Q)}function pe(...Q){return t[9](t[14],t[16],...Q)}function W(...Q){return t[10](t[14],t[16],...Q)}return{key:e,first:null,c(){n=R("div"),l=R("div"),o=R("div"),r=N(),s=R("div"),u=R("div"),a=R("h5"),a.textContent="Question:",f=N(),c=R("p"),g=H(d),p=N(),m=R("div"),_=R("div"),v=R("h5"),v.textContent="Response 1:",w=N(),y=R("p"),M=H(C),$=N(),F=R("div"),S=R("h5"),S.textContent="Response 2:",A=N(),k=R("p"),I=H(E),D=N(),h(o,"class","avatar"),h(a,"class","bold svelte-au920n"),h(u,"class","question svelte-au920n"),h(v,"class","bold underline svelte-au920n"),h(_,"class","answer svelte-au920n"),h(S,"class","bold underline svelte-au920n"),h(F,"class","answer svelte-au920n"),h(m,"class","answers svelte-au920n"),h(s,"class","message-content svelte-au920n"),h(l,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(Q,X){T(Q,n,X),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(s,p),b(s,m),b(m,_),b(_,v),b(_,w),b(_,y),b(y,M),b(m,$),b(m,F),b(F,S),b(F,A),b(F,k),b(k,I),b(n,D),O||(B=[x(_,"click",j),x(_,"keydown",ae),x(F,"click",pe),x(F,"keydown",W),Cn(L=sd.call(null,n,t[16]===t[3].length-1))],O=!0)},p(Q,X){t=Q,X&8&&d!==(d=t[14].question+"")&&K(g,d),X&8&&C!==(C=t[14].up_ranking_answer+"")&&K(M,C),X&8&&E!==(E=t[14].low_ranking_answer+"")&&K(I,E),L&&Ge(L.update)&&X&8&&L.update.call(null,t[16]===t[3].length-1)},d(Q){Q&&P(n),O=!1,be(B)}}}function rd(e){let t,n,l,o,r,s,u=[],a=new Map,f,c,d,g,p,m,_=(e[1]?e[2]:"Send")+"",v,w,y,C,M,$,F=e[3];const S=A=>A[16];for(let A=0;ARanked Feedback Instructions
+ Ask a question and click on the better of the two responses. The better
+ response will be outlined in green , the worse
+ response outlined in red . This data will be
+ automatically fed to RLHF.
+ Download Data `,l=N(),o=R("div"),r=R("section"),s=R("div");for(let A=0;A{e.scrollIntoView({behavior:"smooth"})},0)}async function ad(e){const t=await fetch("/chat/ranking_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function ud(e,t,n){let l,o;ue(e,Il,v=>n(3,o=v));let r="",s="",u=!1;ft(()=>{});const a=async v=>{v.preventDefault(),r=s,n(0,s=""),n(1,u=!0);let w={question:r,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Pe(Il,o=[...o,w],o);const y=await fetch(`/chat/multi_responses/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:r})});if(y.ok){const C=await y.json();w.up_ranking_answer=C.answer[0],w.low_ranking_answer=C.answer[1],Il.update(M=>(M[M.length-1]=w,M))}else{const C=await y.text();alert(C)}n(1,u=!1)};let f=0;setInterval(()=>{n(6,f=(f+1)%4)},200);function c(v,w,y,C){const M=o[y],$={1:"up_ranking_answer",2:"low_ranking_answer"},F={question:M.question,up_ranking_answer:M[$[C]],low_ranking_answer:M[$[C%2+1]]};ad(F),pt(v.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),pt(v.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const d=(v,w,y)=>c(y,v,w,1),g=(v,w,y)=>c(y,v,w,1),p=(v,w,y)=>c(y,v,w,2),m=(v,w,y)=>c(y,v,w,2);function _(){s=this.value,n(0,s)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,l=".".repeat(f).padEnd(3))},[s,u,l,o,a,c,f,d,g,p,m,_]}class fd extends ce{constructor(t){super(),de(this,t,ud,rd,fe,{})}}function fi(e,t,n){const l=e.slice();return l[8]=t[n],l[10]=n,l}function ci(e){let t,n,l,o,r=e[8].name+"",s,u,a,f,c;function d(...g){return e[6](e[8],...g)}return{c(){t=R("label"),n=R("input"),s=H(r),u=N(),h(n,"type","checkbox"),h(n,"id",l=e[8].id),n.checked=o=e[1].has(e[8].name),h(t,"for",a=e[8].id)},m(g,p){T(g,t,p),b(t,n),b(t,s),b(t,u),f||(c=x(n,"change",d),f=!0)},p(g,p){e=g,p&1&&l!==(l=e[8].id)&&h(n,"id",l),p&3&&o!==(o=e[1].has(e[8].name))&&(n.checked=o),p&1&&r!==(r=e[8].name+"")&&K(s,r),p&1&&a!==(a=e[8].id)&&h(t,"for",a)},d(g){g&&P(t),f=!1,c()}}}function cd(e){let t,n,l,o,r,s,u,a,f,c,d,g=e[0],p=[];for(let m=0;mn(1,l=d));let{documents:o=[]}=t,r=!1,s;function u(){n(2,r=!r)}function a(d,g){g.target.checked?l.add(d):l.delete(d),oo.set(new Set(l))}const f=(d,g)=>a(d.name,g);function c(d){et[d?"unshift":"push"](()=>{s=d,n(3,s)})}return e.$$set=d=>{"documents"in d&&n(0,o=d.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(l)},[o,l,r,s,u,a,f,c]}let hd=class extends ce{constructor(t){super(),de(this,t,dd,cd,fe,{documents:0})}};function ro(e,t=2){if(e===0)return"0 Bytes";const n=1024,l=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,r)).toFixed(l))+" "+o[r]}function gd(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let l=0;l({question:l,count:t[l]}))}function Ca(e){return e.map(t=>{const n=t.question.split(" ").length,l=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+l,vote:t.vote}})}function pd(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const o=document.createElement("span");o.textContent=t,o.setAttribute("id","tooltip"),e.appendChild(o),e.addEventListener("mouseleave",l),e.addEventListener("blur",l),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function l(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",l),e.removeEventListener("blur",l),e.addEventListener("mouseenter",n),e.addEventListener("focus",n)}return e.addEventListener("mouseenter",n),e.addEventListener("focus",n),{onDestroy(){e.classList.remove("tooltip"),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}}}function Mn(e,{delay:t=0,duration:n=400,easing:l=Eo,axis:o="y"}={}){const r=getComputedStyle(e),s=+r.opacity,u=o==="y"?"height":"width",a=parseFloat(r[u]),f=o==="y"?["top","bottom"]:["left","right"],c=f.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),d=parseFloat(r[`padding${c[0]}`]),g=parseFloat(r[`padding${c[1]}`]),p=parseFloat(r[`margin${c[0]}`]),m=parseFloat(r[`margin${c[1]}`]),_=parseFloat(r[`border${c[0]}Width`]),v=parseFloat(r[`border${c[1]}Width`]);return{delay:t,duration:n,easing:l,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*s};${u}: ${w*a}px;padding-${f[0]}: ${w*d}px;padding-${f[1]}: ${w*g}px;margin-${f[0]}: ${w*p}px;margin-${f[1]}: ${w*m}px;border-${f[0]}-width: ${w*_}px;border-${f[1]}-width: ${w*v}px;`}}function Ln(e,{delay:t=0,duration:n=400,easing:l=Eo,start:o=0,opacity:r=0}={}){const s=getComputedStyle(e),u=+s.opacity,a=s.transform==="none"?"":s.transform,f=1-o,c=u*(1-r);return{delay:t,duration:n,easing:l,css:(d,g)=>`
+ transform: ${a} scale(${1-f*g});
+ opacity: ${u-c*g}
+ `}}function md(e){let t;return{c(){t=R("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function _d(e){let t;return{c(){t=R("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function di(e){let t,n,l,o,r;return{c(){t=R("div"),n=R("p"),l=H(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(s,u){T(s,t,u),b(t,n),b(n,l),r=!0},p(s,u){(!r||u&2)&&K(l,s[1])},i(s){r||(Me(()=>{r&&(o||(o=lt(t,Mn,{},!0)),o.run(1))}),r=!0)},o(s){o||(o=lt(t,Mn,{},!1)),o.run(0),r=!1},d(s){s&&P(t),s&&o&&o.end()}}}function vd(e){let t,n,l,o=e[2]+1+"",r,s,u,a,f,c,d,g,p;function m(y,C){return y[3]?_d:md}let _=m(e),v=_(e),w=e[3]&&di(e);return{c(){t=R("div"),n=R("div"),l=R("p"),r=H(o),s=H(": "),u=H(e[0]),a=N(),v.c(),c=N(),w&&w.c(),h(l,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(y,C){T(y,t,C),b(t,n),b(n,l),b(l,r),b(l,s),b(l,u),b(n,a),v.m(n,null),b(t,c),w&&w.m(t,null),d=!0,g||(p=x(n,"click",e[4]),g=!0)},p(y,[C]){(!d||C&4)&&o!==(o=y[2]+1+"")&&K(r,o),(!d||C&1)&&K(u,y[0]),_!==(_=m(y))&&(v.d(1),v=_(y),v&&(v.c(),v.m(n,null))),y[3]?w?(w.p(y,C),C&8&&V(w,1)):(w=di(y),w.c(),V(w,1),w.m(t,null)):w&&(we(),z(w,1,1,()=>{w=null}),ye())},i(y){d||(Me(()=>{d&&(f||(f=lt(n,Mn,{},!0)),f.run(1))}),V(w),d=!0)},o(y){f||(f=lt(n,Mn,{},!1)),f.run(0),z(w),d=!1},d(y){y&&P(t),v.d(),y&&f&&f.end(),w&&w.d(),g=!1,p()}}}function bd(e,t,n){let{source:l=""}=t,{source_content:o=""}=t,{i:r=0}=t,s=r===0;const u=()=>n(3,s=!s);return e.$$set=a=>{"source"in a&&n(0,l=a.source),"source_content"in a&&n(1,o=a.source_content),"i"in a&&n(2,r=a.i)},[l,o,r,s,u]}class wd extends ce{constructor(t){super(),de(this,t,bd,vd,fe,{source:0,source_content:1,i:2})}}function hi(e,t,n){const l=e.slice();return l[4]=t[n],l[6]=n,l}function gi(e){let t,n,l,o;const r=[Cd,Sd,kd,yd],s=[];function u(a,f){return a[0][0]==="N/A"?0:a[0][0]==="Loading..."?1:a[0][0]==="Not loaded"?2:3}return t=u(e),n=s[t]=r[t](e),{c(){n.c(),l=Se()},m(a,f){s[t].m(a,f),T(a,l,f),o=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),n=s[t],n?n.p(a,f):(n=s[t]=r[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){o||(V(n),o=!0)},o(a){z(n),o=!1},d(a){s[t].d(a),a&&P(l)}}}function yd(e){let t,n,l,o=e[0].length+"",r,s,u,a,f,c,d,g;function p(w,y){return w[2]?Ad:$d}let m=p(e),_=m(e),v=e[2]&&pi(e);return{c(){t=R("div"),n=R("h5"),l=H("📖 Response Sources ("),r=H(o),s=H(")"),u=N(),_.c(),a=N(),v&&v.c(),f=Se(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(w,y){T(w,t,y),b(t,n),b(n,l),b(n,r),b(n,s),b(t,u),_.m(t,null),T(w,a,y),v&&v.m(w,y),T(w,f,y),c=!0,d||(g=x(t,"click",e[3]),d=!0)},p(w,y){(!c||y&1)&&o!==(o=w[0].length+"")&&K(r,o),m!==(m=p(w))&&(_.d(1),_=m(w),_&&(_.c(),_.m(t,null))),w[2]?v?(v.p(w,y),y&4&&V(v,1)):(v=pi(w),v.c(),V(v,1),v.m(f.parentNode,f)):v&&(we(),z(v,1,1,()=>{v=null}),ye())},i(w){c||(V(v),c=!0)},o(w){z(v),c=!1},d(w){w&&P(t),_.d(),w&&P(a),v&&v.d(w),w&&P(f),d=!1,g()}}}function kd(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function Sd(e){let t;return{c(){t=R("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function Cd(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function $d(e){let t;return{c(){t=R("span"),t.textContent="⌄"},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function Ad(e){let t;return{c(){t=R("span"),t.textContent="⌃"},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function pi(e){let t,n,l=e[0],o=[];for(let s=0;sz(o[s],1,1,()=>{o[s]=null});return{c(){for(let s=0;s{l=null}),ye())},i(o){n||(V(l),n=!0)},o(o){z(l),n=!1},d(o){o&&P(t),l&&l.d()}}}function Md(e,t,n){let{sources:l=[]}=t,{source_content:o=[]}=t,r=!1;const s=()=>n(2,r=!r);return e.$$set=u=>{"sources"in u&&n(0,l=u.sources),"source_content"in u&&n(1,o=u.source_content)},[l,o,r,s]}class Ed extends ce{constructor(t){super(),de(this,t,Md,Rd,fe,{sources:0,source_content:1})}}function _i(e,t,n){const l=e.slice();return l[4]=t[n],l}function vi(e,t,n){const l=e.slice();return l[4]=t[n],l}function bi(e){let t,n,l,o=e[4].label+"",r,s,u,a,f;return{c(){t=R("li"),n=R("span"),l=R("h5"),r=H(o),s=N(),h(l,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",u=Qo(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(l,r),b(t,s),a||(f=x(n,"click",function(){Ge(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),a=!0)},p(c,d){e=c,d&2&&o!==(o=e[4].label+"")&&K(r,o),d&3&&u!==(u=Qo(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",u)},d(c){c&&P(t),a=!1,f()}}}function wi(e){let t,n,l,o;const r=[e[2]];var s=e[4].component;function u(a){let f={};for(let c=0;c{te(d,1)}),ye()}s?(n=At(s,u()),ne(n.$$.fragment),V(n.$$.fragment,1),ee(n,t,l)):n=null}else s&&n.$set(c)},i(a){o||(n&&V(n.$$.fragment,a),o=!0)},o(a){n&&z(n.$$.fragment,a),o=!1},d(a){a&&P(t),n&&te(n)}}}function yi(e){let t,n,l=e[0]==e[4].value&&wi(e);return{c(){l&&l.c(),t=Se()},m(o,r){l&&l.m(o,r),T(o,t,r),n=!0},p(o,r){o[0]==o[4].value?l?(l.p(o,r),r&3&&V(l,1)):(l=wi(o),l.c(),V(l,1),l.m(t.parentNode,t)):l&&(we(),z(l,1,1,()=>{l=null}),ye())},i(o){n||(V(l),n=!0)},o(o){z(l),n=!1},d(o){l&&l.d(o),o&&P(t)}}}function Fd(e){let t,n,l,o,r=e[1],s=[];for(let c=0;cz(a[c],1,1,()=>{a[c]=null});return{c(){t=R("ul");for(let c=0;c()=>n(0,o=u);return e.$$set=u=>{"items"in u&&n(1,l=u.items),"activeTabValue"in u&&n(0,o=u.activeTabValue),"tabProps"in u&&n(2,r=u.tabProps)},[o,l,r,s]}class Id extends ce{constructor(t){super(),de(this,t,Dd,Fd,fe,{items:1,activeTabValue:0,tabProps:2})}}function ki(e){let t;return{c(){t=H("Press ENTER to autofill with the RAG answer.")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function Nd(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m=e[0].edited_answer===sl&&ki();return{c(){t=R("form"),n=R("textarea"),o=N(),r=R("div"),s=R("div"),m&&m.c(),u=N(),a=R("div"),f=R("button"),f.textContent="Update",c=N(),d=R("button"),d.textContent="Reset",h(n,"placeholder",l=e[0].answer),h(s,"class","note svelte-i9wciy"),h(r,"class","button-container svelte-i9wciy")},m(_,v){T(_,t,v),b(t,n),Ye(n,e[0].edited_answer),e[6](n),b(t,o),b(t,r),b(r,s),m&&m.m(s,null),b(r,u),b(r,a),b(a,f),b(a,c),b(a,d),g||(p=[x(n,"input",e[5]),x(n,"keydown",e[4]),x(f,"click",e[2]),x(d,"click",e[3])],g=!0)},p(_,[v]){v&1&&l!==(l=_[0].answer)&&h(n,"placeholder",l),v&1&&Ye(n,_[0].edited_answer),_[0].edited_answer===sl?m||(m=ki(),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},i:U,o:U,d(_){_&&P(t),e[6](null),m&&m.d(),g=!1,be(p)}}}const sl="";function Pd(e,t,n){let{message:l={}}=t,o;const r=async d=>{const g={id:l.id,new_answer:d},p=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(p.ok)console.log("Answer updated successfully",p),n(0,l.edited_answer=d,l);else{const m=await p.text();alert(m)}},s=d=>{d.preventDefault(),r(l.edited_answer)},u=d=>{d.preventDefault(),r(sl)},a=d=>{d.key=="Enter"&&l.edited_answer===sl&&(d.preventDefault(),console.log("ENTER"),n(0,l.edited_answer=l.answer,l))};ft(function(){o.focus()});function f(){l.edited_answer=this.value,n(0,l)}function c(d){et[d?"unshift":"push"](()=>{o=d,n(1,o)})}return e.$$set=d=>{"message"in d&&n(0,l=d.message)},[l,o,s,u,a,f,c]}class Td extends ce{constructor(t){super(),de(this,t,Pd,Nd,fe,{message:0})}}function Si(e){let t,n,l,o,r,s;return{c(){t=R("div"),n=R("button"),n.textContent="👍",l=N(),o=R("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(o,"class","small-button thumbs-down svelte-1u8cd0w"),h(t,"class","feedback-buttons svelte-1u8cd0w")},m(u,a){T(u,t,a),b(t,n),b(t,l),b(t,o),r||(s=[x(n,"click",e[4]),x(o,"click",e[5])],r=!0)},p:U,d(u){u&&P(t),r=!1,be(s)}}}function Od(e){let t,n=e[0].answer+"",l,o,r,s=e[1]&&Si(e);return{c(){t=R("div"),l=H(n),o=N(),s&&s.c(),r=Se()},m(u,a){T(u,t,a),b(t,l),T(u,o,a),s&&s.m(u,a),T(u,r,a)},p(u,[a]){a&1&&n!==(n=u[0].answer+"")&&K(l,n),u[1]?s?s.p(u,a):(s=Si(u),s.c(),s.m(r.parentNode,r)):s&&(s.d(1),s=null)},i:U,o:U,d(u){u&&P(t),u&&P(o),s&&s.d(u),u&&P(r)}}}async function Vd(e){const t=await fetch("/chat/rag_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function zd(e,t,n){let l;ue(e,qe,c=>n(6,l=c));let{message:o={}}=t,{feedback:r=!1}=t,{index:s=0}=t;function u(c,d,g){const p=l[g];p.vote=d;const m={id:g+1,vote_status:d};Vd(m),pt(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),pt(c.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const a=c=>u(c,"up",s),f=c=>u(c,"down",s);return e.$$set=c=>{"message"in c&&n(0,o=c.message),"feedback"in c&&n(1,r=c.feedback),"index"in c&&n(2,s=c.index)},[o,r,s,u,a,f]}class Ld extends ce{constructor(t){super(),de(this,t,zd,Od,fe,{message:0,feedback:1,index:2})}}function Ci(e,t,n){const l=e.slice();return l[19]=t[n],l[21]=n,l}function $i(e,t){let n,l,o,r,s,u,a,f,c,d=t[19].question+"",g,p,m,_,v,w,y,C,M,$,F,S,A,k,E,I;return M=new Id({props:{items:t[8],tabProps:{message:t[19],feedback:t[0],index:t[21]}}}),F=new Ed({props:{sources:t[19].source,source_content:t[19].source_content}}),{key:e,first:null,c(){n=R("div"),l=R("div"),o=R("div"),r=N(),s=R("div"),u=R("div"),a=R("h5"),a.textContent="Question:",f=N(),c=R("p"),g=H(d),p=N(),m=R("div"),_=R("p"),_.textContent="ℹ️ Retrieval Sources",w=N(),y=R("div"),C=R("div"),ne(M.$$.fragment),$=N(),ne(F.$$.fragment),S=N(),h(o,"class","avatar"),h(a,"class","bold"),h(_,"class","bold"),h(m,"class","rag-sources svelte-vgv4ev"),h(u,"class","question svelte-vgv4ev"),h(C,"class","answer svelte-vgv4ev"),h(y,"class","answers svelte-vgv4ev"),h(s,"class","message-content svelte-vgv4ev"),h(l,"class","chat-message-center svelte-vgv4ev"),h(n,"class","chat-message svelte-vgv4ev"),this.first=n},m(D,L){T(D,n,L),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(u,p),b(u,m),b(m,_),b(s,w),b(s,y),b(y,C),ee(M,C,null),b(s,$),ee(F,s,null),b(n,S),k=!0,E||(I=[Cn(v=pd.call(null,_,Ai(t[19]))),Cn(A=Hd.call(null,n,t[21]===t[5].length-1))],E=!0)},p(D,L){t=D,(!k||L&32)&&d!==(d=t[19].question+"")&&K(g,d),v&&Ge(v.update)&&L&32&&v.update.call(null,Ai(t[19]));const O={};L&33&&(O.tabProps={message:t[19],feedback:t[0],index:t[21]}),M.$set(O);const B={};L&32&&(B.sources=t[19].source),L&32&&(B.source_content=t[19].source_content),F.$set(B),A&&Ge(A.update)&&L&32&&A.update.call(null,t[21]===t[5].length-1)},i(D){k||(V(M.$$.fragment,D),V(F.$$.fragment,D),k=!0)},o(D){z(M.$$.fragment,D),z(F.$$.fragment,D),k=!1},d(D){D&&P(n),te(M),te(F),E=!1,be(I)}}}function qd(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_=[],v=new Map,w,y,C,M,$,F,S,A,k,E=(e[2]?e[4]:"Send")+"",I,D,L,O,B,j,ae;function pe(Y){e[13](Y)}let W={table:"rag_table"};e[3]!==void 0&&(W.showModal=e[3]),t=new Io({props:W}),et.push(()=>An(t,"showModal",pe));let Q=e[5];const X=Y=>Y[21];for(let Y=0;Y👍
+ button. If the response is not satisfactory, click on the
+ 👎 button.`,f=N(),c=R("button"),c.textContent="Download Data",d=N(),g=R("div"),p=R("section"),m=R("div");for(let Y=0;Y<_.length;Y+=1)_[Y].c();w=N(),y=R("div"),C=R("div"),ne(M.$$.fragment),$=N(),F=R("form"),S=R("input"),A=N(),k=R("button"),I=H(E),L=N(),O=R("p"),O.textContent="Note - may produce inaccurate information.",h(s,"class","underline bold svelte-vgv4ev"),h(a,"class","svelte-vgv4ev"),h(c,"class","svelte-vgv4ev"),h(r,"class","instructions svelte-vgv4ev"),h(m,"class","chat-log svelte-vgv4ev"),h(p,"class","chatbox svelte-vgv4ev"),h(S,"class","chat-input-textarea svelte-vgv4ev"),h(S,"placeholder","Type Question Here"),h(k,"class",D="btnyousend "+(e[1]===""?"":"active")+" svelte-vgv4ev"),h(k,"type","submit"),h(F,"class","chat-input-form svelte-vgv4ev"),h(C,"class","chat-and-question svelte-vgv4ev"),h(O,"class","message svelte-vgv4ev"),h(y,"class","chat-input-holder svelte-vgv4ev"),h(g,"class","ranked-chat svelte-vgv4ev"),h(o,"class","ranked-feedback-container svelte-vgv4ev")},m(Y,le){ee(t,Y,le),T(Y,l,le),T(Y,o,le),b(o,r),b(r,s),b(r,u),b(r,a),b(r,f),b(r,c),b(o,d),b(o,g),b(g,p),b(p,m);for(let he=0;he<_.length;he+=1)_[he]&&_[he].m(m,null);b(g,w),b(g,y),b(y,C),ee(M,C,null),b(C,$),b(C,F),b(F,S),Ye(S,e[1]),b(F,A),b(F,k),b(k,I),b(y,L),b(y,O),B=!0,j||(ae=[x(c,"click",e[10]),x(S,"input",e[14]),x(F,"submit",e[9])],j=!0)},p(Y,[le]){const he={};!n&&le&8&&(n=!0,he.showModal=Y[3],$n(()=>n=!1)),t.$set(he),le&289&&(Q=Y[5],we(),_=gt(_,le,X,1,Y,Q,v,m,sa,$i,null,Ci),ye());const Vn={};le&64&&(Vn.documents=Y[6]),M.$set(Vn),le&2&&S.value!==Y[1]&&Ye(S,Y[1]),(!B||le&20)&&E!==(E=(Y[2]?Y[4]:"Send")+"")&&K(I,E),(!B||le&2&&D!==(D="btnyousend "+(Y[1]===""?"":"active")+" svelte-vgv4ev"))&&h(k,"class",D)},i(Y){if(!B){V(t.$$.fragment,Y);for(let le=0;le{e.scrollIntoView({behavior:"smooth"})},0)}function Ai(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Gd(e,t,n){let l,o,r,s;ue(e,qe,F=>n(5,o=F)),ue(e,oo,F=>n(16,r=F));let{feedback:u=!1}=t,{is_retrieval:a=!1}=t;const f=De([]);ue(e,f,F=>n(6,s=F));let c="",d="",g=!1,p=!1,m=[{label:"Answer",value:1,component:Ld},{label:"Modified Answer",value:2,component:Td}];ft(()=>{v(),_()});async function _(){const S=await(await fetch("/retrieval/file/get")).json();console.log("data",S.files);const k=S.files.map((E,I)=>({id:String(I),name:E.name}));console.log("files",k),Pe(f,s=[...k],s)}async function v(){const A=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",A);const k=A.map(E=>({id:E[0],question:E[1],answer:E[2],edited_answer:E[3],vote_status:E[4],rag_sources:E[5],source:E[6],source_content:E[7]}));Pe(qe,o=[...k],o)}const w=async F=>{F.preventDefault(),c=d,n(1,d=""),n(2,g=!0);const S=[...r];let A={id:o.length+1,question:c,answer:"Loading...",rag_sources:S,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Pe(qe,o=[...o,A],o);const k=a?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:S})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(k.ok){const E=await k.json();console.log("response data",E),A.answer=E.answer,A.source=E.source,A.source_content=E.source_content,qe.update(I=>(I[I.length-1]=A,I))}else{const E=await k.text();alert(E)}n(2,g=!1)};let y=0;setInterval(()=>{n(12,y=(y+1)%4)},200);function C(){n(3,p=!0)}function M(F){p=F,n(3,p)}function $(){d=this.value,n(1,d)}return e.$$set=F=>{"feedback"in F&&n(0,u=F.feedback),"is_retrieval"in F&&n(11,a=F.is_retrieval)},e.$$.update=()=>{e.$$.dirty&4096&&n(4,l=".".repeat(y).padEnd(3))},[u,d,g,p,l,o,s,f,m,w,C,a,y,M,$]}class Bd extends ce{constructor(t){super(),de(this,t,Gd,qd,fe,{feedback:0,is_retrieval:11})}}function Ri(e){let t,n;return t=new No({props:{is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Mi(e){let t,n;return t=new No({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Ei(e){let t,n;return t=new Bd({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Fi(e){let t,n,l,o;const r=[xd,jd],s=[];function u(a,f){return a[1]?0:1}return t=u(e),n=s[t]=r[t](e),{c(){n.c(),l=Se()},m(a,f){s[t].m(a,f),T(a,l,f),o=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),n=s[t],n?n.p(a,f):(n=s[t]=r[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){o||(V(n),o=!0)},o(a){z(n),o=!1},d(a){s[t].d(a),a&&P(l)}}}function jd(e){let t,n;return t=new fd({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p:U,i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function xd(e){let t,n;return t=new No({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Ud(e){let t,n,l,o,r,s=!e[0]&&Ri(e),u=e[0]==="vote"&&Mi(e),a=e[0]==="rag"&&Ei(e),f=e[0]==="rank"&&Fi(e);return{c(){s&&s.c(),t=N(),u&&u.c(),n=N(),a&&a.c(),l=N(),f&&f.c(),o=Se()},m(c,d){s&&s.m(c,d),T(c,t,d),u&&u.m(c,d),T(c,n,d),a&&a.m(c,d),T(c,l,d),f&&f.m(c,d),T(c,o,d),r=!0},p(c,[d]){c[0]?s&&(we(),z(s,1,1,()=>{s=null}),ye()):s?(s.p(c,d),d&1&&V(s,1)):(s=Ri(c),s.c(),V(s,1),s.m(t.parentNode,t)),c[0]==="vote"?u?(u.p(c,d),d&1&&V(u,1)):(u=Mi(c),u.c(),V(u,1),u.m(n.parentNode,n)):u&&(we(),z(u,1,1,()=>{u=null}),ye()),c[0]==="rag"?a?(a.p(c,d),d&1&&V(a,1)):(a=Ei(c),a.c(),V(a,1),a.m(l.parentNode,l)):a&&(we(),z(a,1,1,()=>{a=null}),ye()),c[0]==="rank"?f?(f.p(c,d),d&1&&V(f,1)):(f=Fi(c),f.c(),V(f,1),f.m(o.parentNode,o)):f&&(we(),z(f,1,1,()=>{f=null}),ye())},i(c){r||(V(s),V(u),V(a),V(f),r=!0)},o(c){z(s),z(u),z(a),z(f),r=!1},d(c){s&&s.d(c),c&&P(t),u&&u.d(c),c&&P(n),a&&a.d(c),c&&P(l),f&&f.d(c),c&&P(o)}}}function Wd(e,t,n){let{feedback:l}=t,{is_retrieval:o}=t;return e.$$set=r=>{"feedback"in r&&n(0,l=r.feedback),"is_retrieval"in r&&n(1,o=r.is_retrieval)},[l,o]}class Xd extends ce{constructor(t){super(),de(this,t,Wd,Ud,fe,{feedback:0,is_retrieval:1})}}function Di(e,t,n){const l=e.slice();return l[2]=t[n],l}function Ii(e){let t,n=e[2]+"",l,o;return{c(){t=R("option"),l=H(n),t.__value=o=e[2],t.value=t.__value},m(r,s){T(r,t,s),b(t,l)},p(r,s){s&1&&n!==(n=r[2]+"")&&K(l,n),s&1&&o!==(o=r[2])&&(t.__value=o,t.value=t.__value)},d(r){r&&P(t)}}}function Yd(e){let t,n=e[0],l=[];for(let o=0;o{const r=await fetch(`/data/${l}`);n(0,o=await r.json())}),e.$$set=r=>{"data_endpoint"in r&&n(1,l=r.data_endpoint)},[o,l]}class Kd extends ce{constructor(t){super(),de(this,t,Qd,Yd,fe,{data_endpoint:1})}}function Qt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Jd(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function $a(e){let t,n,l;e.length!==2?(t=Qt,n=(u,a)=>Qt(e(u),a),l=(u,a)=>e(u)-a):(t=e===Qt||e===Jd?e:Zd,n=e,l=e);function o(u,a,f=0,c=u.length){if(f>>1;n(u[d],a)<0?f=d+1:c=d}while(f>>1;n(u[d],a)<=0?f=d+1:c=d}while(ff&&l(u[d-1],a)>-l(u[d],a)?d-1:d}return{left:o,center:s,right:r}}function Zd(){return 0}function eh(e){return e===null?NaN:+e}function*th(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let l of e)(l=t(l,++n,e))!=null&&(l=+l)>=l&&(yield l)}}const nh=$a(Qt),lh=nh.right;$a(eh).center;const Aa=lh;function oh(e,t){let n=0;if(t===void 0)for(let l of e)l!=null&&(l=+l)>=l&&++n;else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(o=+o)>=o&&++n}return n}function ih(e,t){let n=0,l,o=0,r=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(l=s-o,o+=l/++n,r+=l*(s-o));else{let s=-1;for(let u of e)(u=t(u,++s,e))!=null&&(u=+u)>=u&&(l=u-o,o+=l/++n,r+=l*(u-o))}if(n>1)return r/(n-1)}function rh(e,t){const n=ih(e,t);return n&&Math.sqrt(n)}function _n(e,t){let n,l;if(t===void 0)for(const o of e)o!=null&&(n===void 0?o>=o&&(n=l=o):(n>o&&(n=o),l=r&&(n=l=r):(n>r&&(n=r),l{const l=e(t,n);return l||l===0?l:(e(n,n)===0)-(e(t,t)===0)}}function Ra(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var dh=Array.prototype,hh=dh.slice;function Pl(e){return()=>e}const gh=Math.sqrt(50),ph=Math.sqrt(10),mh=Math.sqrt(2);function al(e,t,n){const l=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(l)),r=l/Math.pow(10,o),s=r>=gh?10:r>=ph?5:r>=mh?2:1;let u,a,f;return o<0?(f=Math.pow(10,-o)/s,u=Math.round(e*f),a=Math.round(t*f),u/ft&&--a,f=-f):(f=Math.pow(10,o)*s,u=Math.round(e/f),a=Math.round(t/f),u*ft&&--a),a0))return[];if(e===t)return[e];const l=t=o))return[];const u=r-o+1,a=new Array(u);if(l)if(s<0)for(let f=0;f0?(e=Math.floor(e/o)*o,t=Math.ceil(t/o)*o):o<0&&(e=Math.ceil(e*o)/o,t=Math.floor(t*o)/o),l=o}}function bh(e){return Math.max(1,Math.ceil(Math.log(oh(e))/Math.LN2)+1)}function Ea(){var e=fh,t=_n,n=bh;function l(o){Array.isArray(o)||(o=Array.from(o));var r,s=o.length,u,a,f=new Array(s);for(r=0;r=g)if(C>=g&&t===_n){const $=en(d,g,M);isFinite($)&&($>0?g=(Math.floor(g/$)+1)*$:$<0&&(g=(Math.ceil(g*-$)+1)/-$))}else p.pop()}for(var m=p.length,_=0,v=m;p[_]<=d;)++_;for(;p[v-1]>g;)--v;(_||v0?p[r-1]:d,y.x1=r0)for(r=0;r=l)&&(n=l);else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n=o)&&(n=o)}return n}function so(e,t){let n;if(t===void 0)for(const l of e)l!=null&&(n>l||n===void 0&&l>=l)&&(n=l);else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Fa(e,t,n=0,l=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),l=Math.floor(Math.min(e.length-1,l)),!(n<=t&&t<=l))return e;for(o=o===void 0?Ra:ch(o);l>n;){if(l-n>600){const a=l-n+1,f=t-n+1,c=Math.log(a),d=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*d*(a-d)/a)*(f-a/2<0?-1:1),p=Math.max(n,Math.floor(t-f*d/a+g)),m=Math.min(l,Math.floor(t+(a-f)*d/a+g));Fa(e,t,p,m,o)}const r=e[t];let s=n,u=l;for(un(e,n,t),o(e[l],r)>0&&un(e,n,l);s0;)--u}o(e[n],r)===0?un(e,n,u):(++u,un(e,u,l)),u<=t&&(n=u+1),t<=u&&(l=u-1)}return e}function un(e,t,n){const l=e[t];e[t]=e[n],e[n]=l}function wh(e,t,n){if(e=Float64Array.from(th(e,n)),!(!(l=e.length)||isNaN(t=+t))){if(t<=0||l<2)return so(e);if(t>=1)return mt(e);var l,o=(l-1)*t,r=Math.floor(o),s=mt(Fa(e,r).subarray(0,r+1)),u=so(e.subarray(r+1));return s+(u-s)*(o-r)}}function yh(e,t){let n=0,l=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(++n,l+=o);else{let o=-1;for(let r of e)(r=t(r,++o,e))!=null&&(r=+r)>=r&&(++n,l+=r)}if(n)return l/n}function kh(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var l=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,r=new Array(o);++l