From 1e4ad964e781c81153a7718d21b6a333f8ffd2f3 Mon Sep 17 00:00:00 2001 From: Jared Wilber Date: Thu, 28 Sep 2023 15:27:24 -0700 Subject: [PATCH] rebuild --- pykoi/frontend/dist/assets/index-42540648.js | 70 +++++++++++++++++++ ...{index-6e8a727f.css => index-c2d4a9bc.css} | 2 +- pykoi/frontend/dist/assets/index-e352a05f.js | 70 ------------------- pykoi/frontend/dist/index.html | 4 +- 4 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 pykoi/frontend/dist/assets/index-42540648.js rename pykoi/frontend/dist/assets/{index-6e8a727f.css => index-c2d4a9bc.css} (82%) delete mode 100644 pykoi/frontend/dist/assets/index-e352a05f.js diff --git a/pykoi/frontend/dist/assets/index-42540648.js b/pykoi/frontend/dist/assets/index-42540648.js new file mode 100644 index 0000000..10ee4e8 --- /dev/null +++ b/pykoi/frontend/dist/assets/index-42540648.js @@ -0,0 +1,70 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function x(){}const Hs=e=>e;function Jn(e,t){for(const n in t)e[n]=t[n];return e}function qs(e){return e()}function Yl(){return Object.create(null)}function ge(e){e.forEach(qs)}function Qe(e){return typeof e=="function"}function re(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function _u(e){return Object.keys(e).length===0}function yl(e,...t){if(e==null)return x;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function vu(e){let t;return yl(e,n=>t=n)(),t}function le(e,t,n){e.$$.on_destroy.push(yl(t,n))}function qr(e){return e??""}function Ne(e,t,n){return e.set(n),t}function wn(e){return e&&Qe(e.destroy)?e.destroy:x}const Ls=typeof window<"u";let js=Ls?()=>window.performance.now():()=>Date.now(),Sr=Ls?e=>requestAnimationFrame(e):x;const Ut=new Set;function xs(e){Ut.forEach(t=>{t.c(e)||(Ut.delete(t),t.f())}),Ut.size!==0&&Sr(xs)}function Gs(e){let t;return Ut.size===0&&Sr(xs),{promise:new Promise(n=>{Ut.add(t={c:e,f:n})}),abort(){Ut.delete(t)}}}let kl=!1;function bu(){kl=!0}function wu(){kl=!1}function yu(e,t,n,l){for(;e>1);n(r)<=l?e=r+1:t=r}return e}function ku(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[r]].claim_order<=f?r+1:yu(1,r,g=>t[n[g]].claim_order,f))-1;l[a]=n[c]+1;const d=c+1;n[d]=a,r=Math.max(d,r)}const o=[],s=[];let u=t.length-1;for(let a=n[r]+1;a!=0;a=l[a-1]){for(o.push(t[a-1]);u>=a;u--)s.push(t[u]);u--}for(;u>=0;u--)s.push(t[u]);o.reverse(),s.sort((a,f)=>a.claim_order-f.claim_order);for(let a=0,f=0;a=o[f].claim_order;)f++;const c=fe.removeEventListener(t,n,l)}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Au(e){return Array.from(e.childNodes)}function Mu(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Eu(e,t,n,l,r=!1){Mu(e);const o=(()=>{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,r?a===void 0&&e.claim_info.last_index--:e.claim_info.last_index=s,u}}return l()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function Fu(e,t){return Eu(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},()=>L(t),!0)}function W(e,t){t=""+t,e.data!==t&&(e.data=t)}function lt(e,t){e.value=t??""}function ye(e,t,n,l){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,l?"important":"")}function Zn(e,t,n){for(let l=0;l{s.source===l.contentWindow&&t()})):(l.src="about:blank",l.onload=()=>{o=B(l.contentWindow,"resize",t),t()}),b(e,l),()=>{(r||o&&l.contentWindow)&&o(),N(l)}}function It(e,t,n){e.classList[n?"add":"remove"](t)}function Iu(e,t,{bubbles:n=!1,cancelable:l=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n,l,t),r}function St(e,t){return new e(t)}const el=new Map;let tl=0;function Nu(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Pu(e,t){const n={stylesheet:Su(t),rules:{}};return el.set(e,n),n}function Lr(e,t,n,l,r,o,s,u=0){const a=16.666/l;let f=`{ +`;for(let _=0;_<=1;_+=a){const w=t+(n-t)*o(_);f+=_*100+`%{${s(w,1-w)}} +`}const c=f+`100% {${s(n,1-n)}} +}`,d=`__svelte_${Nu(c)}_${u}`,g=Bs(e),{stylesheet:p,rules:m}=el.get(g)||Pu(g,e);m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${c}`,p.cssRules.length));const v=e.style.animation||"";return e.style.animation=`${v?`${v}, `:""}${d} ${l}ms linear ${r}ms 1 both`,tl+=1,d}function Tu(e,t){const n=(e.style.animation||"").split(", "),l=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),r=n.length-l.length;r&&(e.style.animation=l.join(", "),tl-=r,tl||Ou())}function Ou(){Sr(()=>{tl||(el.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&N(t)}),el.clear())})}let Kt;function Pt(e){Kt=e}function Vu(){if(!Kt)throw new Error("Function called outside component initialization");return Kt}function st(e){Vu().$$.on_mount.push(e)}const xt=[],yn=[];let Wt=[];const jr=[],zu=Promise.resolve();let Ql=!1;function Hu(){Ql||(Ql=!0,zu.then(Ws))}function ke(e){Wt.push(e)}const $l=new Set;let Ht=0;function Ws(){if(Ht!==0)return;const e=Kt;do{try{for(;Hte.indexOf(l)===-1?t.push(l):n.push(l)),n.forEach(l=>l()),Wt=t}let rn;function ju(){return rn||(rn=Promise.resolve(),rn.then(()=>{rn=null})),rn}function Rl(e,t,n){e.dispatchEvent(Iu(`${t?"intro":"outro"}${n}`))}const Bn=new Set;let ut;function ce(){ut={r:0,c:[],p:ut}}function de(){ut.r||ge(ut.c),ut=ut.p}function V(e,t){e&&e.i&&(Bn.delete(e),e.i(t))}function H(e,t,n,l){if(e&&e.o){if(Bn.has(e))return;Bn.add(e),ut.c.push(()=>{Bn.delete(e),l&&(n&&e.d(1),l())}),e.o(t)}else l&&l()}const xu={duration:0};function Ze(e,t,n,l){const r={direction:"both"};let o=t(e,n,r),s=l?0:1,u=null,a=null,f=null;function c(){f&&Tu(e,f)}function d(p,m){const v=p.b-s;return m*=Math.abs(v),{a:s,b:p.b,d:v,duration:m,start:p.start,end:p.start+m,group:p.group}}function g(p){const{delay:m=0,duration:v=300,easing:_=Hs,tick:w=x,css:y}=o||xu,$={start:js()+m,b:p};p||($.group=ut,ut.r+=1),u||a?a=$:(y&&(c(),f=Lr(e,s,p,v,m,_,y)),p&&w(0,1),u=d($,v),ke(()=>Rl(e,p,"start")),Gs(M=>{if(a&&M>a.start&&(u=d(a,v),a=null,Rl(e,u.b,"start"),y&&(c(),f=Lr(e,s,u.b,u.duration,0,_,o.css))),u){if(M>=u.end)w(s=u.b,1-s),Rl(e,u.b,"end"),a||(u.b?c():--u.group.r||ge(u.group.c)),u=null;else if(M>=u.start){const k=M-u.start;s=u.a+u.d*_(k/u.duration),w(s,1-s)}}return!!(u||a)}))}return{run(p){Qe(o)?ju().then(()=>{o=o(r),g(p)}):g(p)},end(){c(),u=a=null}}}function Ot(e,t){e.d(1),t.delete(e.key)}function Xs(e,t){H(e,1,1,()=>{t.delete(e.key)})}function ct(e,t,n,l,r,o,s,u,a,f,c,d){let g=e.length,p=o.length,m=g;const v={};for(;m--;)v[e[m].key]=m;const _=[],w=new Map,y=new Map,$=[];for(m=p;m--;){const S=d(r,o,m),R=n(S);let C=s.get(R);C?l&&$.push(()=>C.p(S,t)):(C=f(R,S),C.c()),w.set(R,_[m]=C),R in v&&y.set(R,Math.abs(m-v[R]))}const M=new Set,k=new Set;function E(S){V(S,1),S.m(u,c),s.set(S.key,S),c=S.first,p--}for(;g&&p;){const S=_[p-1],R=e[g-1],C=S.key,F=R.key;S===R?(c=S.first,g--,p--):w.has(F)?!s.has(C)||M.has(C)?E(S):k.has(F)?g--:y.get(C)>y.get(F)?(k.add(C),E(S)):(M.add(F),g--):(a(R,s),g--)}for(;g--;){const S=e[g];w.has(S.key)||a(S,s)}for(;p;)E(_[p-1]);return ge($),_}function Ys(e,t){const n={},l={},r={$$scope:1};let o=e.length;for(;o--;){const s=e[o],u=t[o];if(u){for(const a in s)a in u||(l[a]=1);for(const a in u)r[a]||(n[a]=u[a],r[a]=1);e[o]=u}else for(const a in s)r[a]=1}for(const s in l)s in n||(n[s]=void 0);return n}function Qs(e){return typeof e=="object"&&e!==null?e:{}}const Gu=/[&"]/g,Bu=/[&<]/g;function Uu(e,t=!1){const n=String(e),l=t?Gu:Bu;l.lastIndex=0;let r="",o=0;for(;l.test(n);){const s=l.lastIndex-1,u=n[s];r+=n.substring(o,s)+(u==="&"?"&":u==='"'?""":"<"),o=s+1}return r+n.substring(o)}function Wu(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 Al;function Ks(e){function t(n,l,r,o,s){const u=Kt,a={on_destroy:Al,context:new Map(s||(u?u.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Yl()};Pt({$$:a});const f=e(n,l,r,o);return Pt(u),f}return{render:(n={},{$$slots:l={},context:r=new Map}={})=>{Al=[];const o={title:"",head:"",css:new Set},s=t(o,n,{},l,r);return ge(Al),{html:s,css:{code:Array.from(o.css).map(u=>u.code).join(` +`),map:null},head:o.title+o.head}},$$render:t}}function te(e){e&&e.c()}function Xu(e,t){e&&e.l(t)}function J(e,t,n,l){const{fragment:r,after_update:o}=e.$$;r&&r.m(t,n),l||ke(()=>{const s=e.$$.on_mount.map(qs).filter(Qe);e.$$.on_destroy?e.$$.on_destroy.push(...s):ge(s),e.$$.on_mount=[]}),o.forEach(ke)}function Z(e,t){const n=e.$$;n.fragment!==null&&(Lu(n.after_update),ge(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Yu(e,t){e.$$.dirty[0]===-1&&(xt.push(e),Hu(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const m=p.length?p[0]:g;return f.ctx&&r(f.ctx[d],f.ctx[d]=m)&&(!f.skip_bound&&f.bound[d]&&f.bound[d](m),c&&Yu(e,d)),g}):[],f.update(),c=!0,ge(f.before_update),f.fragment=l?l(f.ctx):!1,t.target){if(t.hydrate){bu();const d=Au(t.target);f.fragment&&f.fragment.l(d),d.forEach(N)}else f.fragment&&f.fragment.c();t.intro&&V(e.$$.fragment),J(e,t.target,t.anchor,t.customElement),wu(),Ws()}Pt(a)}class ie{$destroy(){Z(this,1),this.$destroy=x}$on(t,n){if(!Qe(n))return x;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const r=l.indexOf(n);r!==-1&&l.splice(r,1)}}$set(t){this.$$set&&!_u(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const qt=[];function Kl(e,t){return{subscribe:Ae(e,t).subscribe}}function Ae(e,t=x){let n;const l=new Set;function r(u){if(re(e,u)&&(e=u,n)){const a=!qt.length;for(const f of l)f[1](),qt.push(f,e);if(a){for(let f=0;f{l.delete(f),l.size===0&&n&&(n(),n=null)}}return{set:r,update:o,subscribe:s}}function Qu(e,t,n){const l=!Array.isArray(e),r=l?[e]:e,o=t.length<2;return Kl(n,s=>{let u=!1;const a=[];let f=0,c=x;const d=()=>{if(f)return;c();const p=t(l?a[0]:a,s);o?s(p):c=Qe(p)?p:x},g=r.map((p,m)=>yl(p,v=>{a[m]=v,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((r,o)=>Jl(e[o],r));return r=>l.map(o=>o(r))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(xr(e)&&xr(t)){e=e.getTime(),t=t.getTime();const o=t-e;return s=>new Date(e+s*o)}const l=Object.keys(t),r={};return l.forEach(o=>{r[o]=Jl(e[o],t[o])}),o=>{const s={};return l.forEach(u=>{s[u]=r[u](o)}),s}}if(n==="number"){const l=t-e;return r=>e+r*l}throw new Error(`Cannot interpolate ${n} values`)}function $r(e,t={}){const n=Ae(e);let l,r=e;function o(s,u){if(e==null)return n.set(e=s),Promise.resolve();r=s;let a=l,f=!1,{delay:c=0,duration:d=400,easing:g=Hs,interpolate:p=Jl}=Jn(Jn({},t),u);if(d===0)return a&&(a.abort(),a=null),n.set(e=r),Promise.resolve();const m=js()+c;let v;return l=Gs(_=>{if(_d?(n.set(e=s),!1):(n.set(e=v(g(w/d))),!0)}),l.promise}return{set:o,update:(s,u)=>o(s(r,e),u),subscribe:n.subscribe}}const Ve=Ae([]),Ml=Ae([]),El=Ae([]),kn=Ae([]),rt=Ae("all"),Gr=Ae({"n/a":1,up:1,down:1}),Ku=["who","what","how","why","where","does","can","n/a"],Zl=$r(Ku.map(e=>({question:e,count:0}))),er=Ae(new Set);var tr="http://www.w3.org/1999/xhtml";const Br={svg:"http://www.w3.org/2000/svg",xhtml:tr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Js(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Br.hasOwnProperty(t)?{space:Br[t],local:e}:e}function Ju(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===tr&&t.documentElement.namespaceURI===tr?t.createElement(e):t.createElementNS(n,e)}}function Zu(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Zs(e){var t=Js(e);return(t.local?Zu:Ju)(t)}function ef(){}function ea(e){return e==null?ef:function(){return this.querySelector(e)}}function tf(e){typeof e!="function"&&(e=ea(e));for(var t=this._groups,n=t.length,l=new Array(n),r=0;r=$&&($=y+1);!(k=_[$])&&++$=0;)(s=l[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Mf(e){e||(e=Ef);function t(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var n=this._groups,l=n.length,r=new Array(l),o=0;ot?1:e>=t?0:NaN}function Ff(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Df(){return Array.from(this)}function If(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?xf:typeof t=="function"?Bf:Gf)(e,t,n??"")):Wf(this.node(),e)}function Wf(e,t){return e.style.getPropertyValue(t)||ra(e).getComputedStyle(e,null).getPropertyValue(t)}function Xf(e){return function(){delete this[e]}}function Yf(e,t){return function(){this[e]=t}}function Qf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kf(e,t){return arguments.length>1?this.each((t==null?Xf:typeof t=="function"?Qf:Yf)(e,t)):this.node()[e]}function ia(e){return e.trim().split(/^|\s+/)}function Rr(e){return e.classList||new oa(e)}function oa(e){this._node=e,this._names=ia(e.getAttribute("class")||"")}oa.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 sa(e,t){for(var n=Rr(e),l=-1,r=t.length;++l=0&&(n=t.slice(l+1),t=t.slice(0,l)),{type:t,name:n}})}function $c(e){return function(){var t=this.__on;if(t){for(var n=0,l=-1,r=t.length,o;n`${w[0].toUpperCase()}${w.slice(1)}`),d=parseFloat(o[`padding${c[0]}`]),g=parseFloat(o[`padding${c[1]}`]),p=parseFloat(o[`margin${c[0]}`]),m=parseFloat(o[`margin${c[1]}`]),v=parseFloat(o[`border${c[0]}Width`]),_=parseFloat(o[`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*v}px;border-${f[1]}-width: ${w*_}px;`}}function Pn(e,{delay:t=0,duration:n=400,easing:l=Cr,start:r=0,opacity:o=0}={}){const s=getComputedStyle(e),u=+s.opacity,a=s.transform==="none"?"":s.transform,f=1-r,c=u*(1-o);return{delay:t,duration:n,easing:l,css:(d,g)=>` + transform: ${a} scale(${1-f*g}); + opacity: ${u-c*g} + `}}function nr(e,t=2){if(e===0)return"0 Bytes";const n=1024,l=t<0?0:t,r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(l))+" "+r[o]}function Nc(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 Pc(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const r=document.createElement("span");r.textContent=t,r.setAttribute("id","tooltip"),e.appendChild(r),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 Ur(e,t,n){const l=e.slice();return l[16]=t[n],l[18]=n,l}function Wr(e){let t,n,l,r,o,s;function u(...f){return e[9](e[18],...f)}function a(...f){return e[10](e[18],...f)}return{c(){t=A("div"),n=A("button"),n.textContent="👍",l=P(),r=A("button"),r.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(r,"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,r),o||(s=[B(n,"click",u),B(r,"click",a)],o=!0)},p(f,c){e=f},d(f){f&&N(t),o=!1,ge(s)}}}function Xr(e,t){let n,l,r,o,s,u,a,f,c,d=t[16].question+"",g,p,m,v,_,w,y,$=t[16].answer+"",M,k,E,S,R,C,F=t[0]&&Wr(t);return{key:e,first:null,c(){n=A("div"),l=A("div"),r=A("div"),o=P(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=P(),c=A("p"),g=L(d),p=P(),m=A("div"),v=A("div"),_=A("h5"),_.textContent="Response:",w=P(),y=A("p"),M=L($),k=P(),F&&F.c(),E=P(),h(r,"class","avatar"),h(a,"class","bold svelte-19cad35"),h(u,"class","question svelte-19cad35"),h(_,"class","bold svelte-19cad35"),h(v,"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,r),b(l,o),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,v),b(v,_),b(v,w),b(v,y),b(y,M),b(v,k),F&&F.m(v,null),b(n,E),R||(C=wn(S=Oc.call(null,n,t[18]===t[4].length-1)),R=!0)},p(I,D){t=I,D&16&&d!==(d=t[16].question+"")&&W(g,d),D&16&&$!==($=t[16].answer+"")&&W(M,$),t[0]?F?F.p(t,D):(F=Wr(t),F.c(),F.m(v,null)):F&&(F.d(1),F=null),S&&Qe(S.update)&&D&16&&S.update.call(null,t[18]===t[4].length-1)},d(I){I&&N(n),F&&F.d(),R=!1,C()}}}function Tc(e){let t,n,l,r,o,s,u=[],a=new Map,f,c,d,g,p,m,v=(e[2]?e[3]:"Send")+"",_,w,y,$,M,k,E=e[4];const S=R=>R[18];for(let R=0;RVote Feedback Instructions +

Ask a question to receive an answer from the chatbot. If the response is + satisfactory, click on the 👍 + button. If the repsonse is not satisfactory, click on the + 👎 button.

`,l=P(),r=A("div"),o=A("section"),s=A("div");for(let R=0;R{e.scrollIntoView({behavior:"smooth"})},0)}async function Vc(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 zc(e,t,n){let l,r;le(e,Ve,w=>n(4,r=w));let{feedback:o=!1}=t,{is_retrieval:s=!1}=t,u="",a="",f=!1;st(()=>{c()});async function c(){const M=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(k=>({id:k[0],question:k[1],answer:k[2],vote_status:k[3]}));Ne(Ve,r=[...M],r)}const d=async w=>{w.preventDefault(),u=a,n(1,a=""),n(2,f=!0);let y={id:r.length+1,question:u,answer:"Loading...",vote_status:"na"};Ne(Ve,r=[...r,y],r);const $=s?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:u})}):await fetch(`/chat/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:u})});if($.ok){const M=await $.json();console.log("response data",M),y.answer=M.answer,Ve.update(k=>(k[k.length-1]=y,k))}else{const M=await $.text();alert(M)}n(2,f=!1)};let g=0;setInterval(()=>{n(8,g=(g+1)%4)},200);function p(w,y,$){const M=r[$];M.vote=y;const k={id:$+1,vote_status:y};Vc(k),dt(w.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),dt(w.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}[...Array(10).keys()].map(w=>String.fromCharCode(65+w));const m=(w,y)=>p(y,"up",w),v=(w,y)=>p(y,"down",w);function _(){a=this.value,n(1,a)}return e.$$set=w=>{"feedback"in w&&n(0,o=w.feedback),"is_retrieval"in w&&n(7,s=w.is_retrieval)},e.$$.update=()=>{e.$$.dirty&256&&n(3,l=".".repeat(g).padEnd(3))},[o,a,f,l,r,d,p,s,g,m,v,_]}class Ar extends ie{constructor(t){super(),oe(this,t,zc,Tc,re,{feedback:0,is_retrieval:7})}}function Yr(e,t,n){const l=e.slice();return l[14]=t[n],l[16]=n,l}function Qr(e,t){let n,l,r,o,s,u,a,f,c,d=t[14].question+"",g,p,m,v,_,w,y,$=t[14].up_ranking_answer+"",M,k,E,S,R,C,F=t[14].low_ranking_answer+"",I,D,z,O,U;function G(...he){return t[7](t[14],t[16],...he)}function $e(...he){return t[8](t[14],t[16],...he)}function Fe(...he){return t[9](t[14],t[16],...he)}function Re(...he){return t[10](t[14],t[16],...he)}return{key:e,first:null,c(){n=A("div"),l=A("div"),r=A("div"),o=P(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=P(),c=A("p"),g=L(d),p=P(),m=A("div"),v=A("div"),_=A("h5"),_.textContent="Response 1:",w=P(),y=A("p"),M=L($),k=P(),E=A("div"),S=A("h5"),S.textContent="Response 2:",R=P(),C=A("p"),I=L(F),D=P(),h(r,"class","avatar"),h(a,"class","bold svelte-au920n"),h(u,"class","question svelte-au920n"),h(_,"class","bold underline svelte-au920n"),h(v,"class","answer svelte-au920n"),h(S,"class","bold underline svelte-au920n"),h(E,"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(he,qe){T(he,n,qe),b(n,l),b(l,r),b(l,o),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,v),b(v,_),b(v,w),b(v,y),b(y,M),b(m,k),b(m,E),b(E,S),b(E,R),b(E,C),b(C,I),b(n,D),O||(U=[B(v,"click",G),B(v,"keydown",$e),B(E,"click",Fe),B(E,"keydown",Re),wn(z=qc.call(null,n,t[16]===t[3].length-1))],O=!0)},p(he,qe){t=he,qe&8&&d!==(d=t[14].question+"")&&W(g,d),qe&8&&$!==($=t[14].up_ranking_answer+"")&&W(M,$),qe&8&&F!==(F=t[14].low_ranking_answer+"")&&W(I,F),z&&Qe(z.update)&&qe&8&&z.update.call(null,t[16]===t[3].length-1)},d(he){he&&N(n),O=!1,ge(U)}}}function Hc(e){let t,n,l,r,o,s,u=[],a=new Map,f,c,d,g,p,m,v=(e[1]?e[2]:"Send")+"",_,w,y,$,M,k,E=e[3];const S=R=>R[16];for(let R=0;RRanked 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.

+ `,l=P(),r=A("div"),o=A("section"),s=A("div");for(let R=0;R{e.scrollIntoView({behavior:"smooth"})},0)}async function Lc(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 jc(e,t,n){let l,r;le(e,Ml,_=>n(3,r=_));let o="",s="",u=!1;st(()=>{});const a=async _=>{_.preventDefault(),o=s,n(0,s=""),n(1,u=!0);let w={question:o,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Ne(Ml,r=[...r,w],r);const y=await fetch(`/chat/multi_responses/${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:o})});if(y.ok){const $=await y.json();w.up_ranking_answer=$.answer[0],w.low_ranking_answer=$.answer[1],Ml.update(M=>(M[M.length-1]=w,M))}else{const $=await y.text();alert($)}n(1,u=!1)};let f=0;setInterval(()=>{n(6,f=(f+1)%4)},200);function c(_,w,y,$){const M=r[y],k={1:"up_ranking_answer",2:"low_ranking_answer"},E={question:M.question,up_ranking_answer:M[k[$]],low_ranking_answer:M[k[$%2+1]]};Lc(E),dt(_.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),dt(_.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const d=(_,w,y)=>c(y,_,w,1),g=(_,w,y)=>c(y,_,w,1),p=(_,w,y)=>c(y,_,w,2),m=(_,w,y)=>c(y,_,w,2);function v(){s=this.value,n(0,s)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,l=".".repeat(f).padEnd(3))},[s,u,l,r,a,c,f,d,g,p,m,v]}class xc extends ie{constructor(t){super(),oe(this,t,jc,Hc,re,{})}}function Kr(e,t,n){const l=e.slice();return l[8]=t[n],l[10]=n,l}function Jr(e){let t,n,l,r,o=e[8].name+"",s,u,a,f,c;function d(...g){return e[6](e[8],...g)}return{c(){t=A("label"),n=A("input"),s=L(o),u=P(),h(n,"type","checkbox"),h(n,"id",l=e[8].id),n.checked=r=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=B(n,"change",d),f=!0)},p(g,p){e=g,p&1&&l!==(l=e[8].id)&&h(n,"id",l),p&3&&r!==(r=e[1].has(e[8].name))&&(n.checked=r),p&1&&o!==(o=e[8].name+"")&&W(s,o),p&1&&a!==(a=e[8].id)&&h(t,"for",a)},d(g){g&&N(t),f=!1,c()}}}function Gc(e){let t,n,l,r,o,s,u,a,f,c,d,g=e[0],p=[];for(let m=0;mn(1,l=d));let{documents:r=[]}=t,o=!1,s;function u(){n(2,o=!o)}function a(d,g){g.target.checked?l.add(d):l.delete(d),er.set(new Set(l))}const f=(d,g)=>a(d.name,g);function c(d){yn[d?"unshift":"push"](()=>{s=d,n(3,s)})}return e.$$set=d=>{"documents"in d&&n(0,r=d.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(l)},[r,l,o,s,u,a,f,c]}let Uc=class extends ie{constructor(t){super(),oe(this,t,Bc,Gc,re,{documents:0})}};function Wc(e){let t;return{c(){t=A("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function Xc(e){let t;return{c(){t=A("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function Zr(e){let t,n,l,r,o;return{c(){t=A("div"),n=A("p"),l=L(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),o=!0},p(s,u){(!o||u&2)&&W(l,s[1])},i(s){o||(ke(()=>{o&&(r||(r=Ze(t,Sn,{},!0)),r.run(1))}),o=!0)},o(s){r||(r=Ze(t,Sn,{},!1)),r.run(0),o=!1},d(s){s&&N(t),s&&r&&r.end()}}}function Yc(e){let t,n,l,r=e[2]+1+"",o,s,u,a,f,c,d,g,p;function m(y,$){return y[3]?Xc:Wc}let v=m(e),_=v(e),w=e[3]&&Zr(e);return{c(){t=A("div"),n=A("div"),l=A("p"),o=L(r),s=L(": "),u=L(e[0]),a=P(),_.c(),c=P(),w&&w.c(),h(l,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(y,$){T(y,t,$),b(t,n),b(n,l),b(l,o),b(l,s),b(l,u),b(n,a),_.m(n,null),b(t,c),w&&w.m(t,null),d=!0,g||(p=B(n,"click",e[4]),g=!0)},p(y,[$]){(!d||$&4)&&r!==(r=y[2]+1+"")&&W(o,r),(!d||$&1)&&W(u,y[0]),v!==(v=m(y))&&(_.d(1),_=v(y),_&&(_.c(),_.m(n,null))),y[3]?w?(w.p(y,$),$&8&&V(w,1)):(w=Zr(y),w.c(),V(w,1),w.m(t,null)):w&&(ce(),H(w,1,1,()=>{w=null}),de())},i(y){d||(ke(()=>{d&&(f||(f=Ze(n,Sn,{},!0)),f.run(1))}),V(w),d=!0)},o(y){f||(f=Ze(n,Sn,{},!1)),f.run(0),H(w),d=!1},d(y){y&&N(t),_.d(),y&&f&&f.end(),w&&w.d(),g=!1,p()}}}function Qc(e,t,n){let{source:l=""}=t,{source_content:r=""}=t,{i:o=0}=t,s=o===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,r=a.source_content),"i"in a&&n(2,o=a.i)},[l,r,o,s,u]}class Kc extends ie{constructor(t){super(),oe(this,t,Qc,Yc,re,{source:0,source_content:1,i:2})}}function ei(e,t,n){const l=e.slice();return l[4]=t[n],l[6]=n,l}function ti(e){let t,n,l,r;const o=[td,ed,Zc,Jc],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]=o[t](e),{c(){n.c(),l=_e()},m(a,f){s[t].m(a,f),T(a,l,f),r=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(ce(),H(s[c],1,1,()=>{s[c]=null}),de(),n=s[t],n?n.p(a,f):(n=s[t]=o[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){r||(V(n),r=!0)},o(a){H(n),r=!1},d(a){s[t].d(a),a&&N(l)}}}function Jc(e){let t,n,l,r=e[0].length+"",o,s,u,a,f,c,d,g;function p(w,y){return w[2]?ld:nd}let m=p(e),v=m(e),_=e[2]&&ni(e);return{c(){t=A("div"),n=A("h5"),l=L("📖 Response Sources ("),o=L(r),s=L(")"),u=P(),v.c(),a=P(),_&&_.c(),f=_e(),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,o),b(n,s),b(t,u),v.m(t,null),T(w,a,y),_&&_.m(w,y),T(w,f,y),c=!0,d||(g=B(t,"click",e[3]),d=!0)},p(w,y){(!c||y&1)&&r!==(r=w[0].length+"")&&W(o,r),m!==(m=p(w))&&(v.d(1),v=m(w),v&&(v.c(),v.m(t,null))),w[2]?_?(_.p(w,y),y&4&&V(_,1)):(_=ni(w),_.c(),V(_,1),_.m(f.parentNode,f)):_&&(ce(),H(_,1,1,()=>{_=null}),de())},i(w){c||(V(_),c=!0)},o(w){H(_),c=!1},d(w){w&&N(t),v.d(),w&&N(a),_&&_.d(w),w&&N(f),d=!1,g()}}}function Zc(e){let t;return{c(){t=A("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,l){T(n,t,l)},p:x,i:x,o:x,d(n){n&&N(t)}}}function ed(e){let t;return{c(){t=A("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,l){T(n,t,l)},p:x,i:x,o:x,d(n){n&&N(t)}}}function td(e){let t;return{c(){t=A("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,l){T(n,t,l)},p:x,i:x,o:x,d(n){n&&N(t)}}}function nd(e){let t;return{c(){t=A("span"),t.textContent="⌄"},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function ld(e){let t;return{c(){t=A("span"),t.textContent="⌃"},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function ni(e){let t,n,l=e[0],r=[];for(let s=0;sH(r[s],1,1,()=>{r[s]=null});return{c(){for(let s=0;s{l=null}),de())},i(r){n||(V(l),n=!0)},o(r){H(l),n=!1},d(r){r&&N(t),l&&l.d()}}}function id(e,t,n){let{sources:l=[]}=t,{source_content:r=[]}=t,o=!1;const s=()=>n(2,o=!o);return e.$$set=u=>{"sources"in u&&n(0,l=u.sources),"source_content"in u&&n(1,r=u.source_content)},[l,r,o,s]}class od extends ie{constructor(t){super(),oe(this,t,id,rd,re,{sources:0,source_content:1})}}function ri(e,t,n){const l=e.slice();return l[4]=t[n],l}function ii(e,t,n){const l=e.slice();return l[4]=t[n],l}function oi(e){let t,n,l,r=e[4].label+"",o,s,u,a,f;return{c(){t=A("li"),n=A("span"),l=A("h5"),o=L(r),s=P(),h(l,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",u=qr(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(l,o),b(t,s),a||(f=B(n,"click",function(){Qe(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),a=!0)},p(c,d){e=c,d&2&&r!==(r=e[4].label+"")&&W(o,r),d&3&&u!==(u=qr(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",u)},d(c){c&&N(t),a=!1,f()}}}function si(e){let t,n,l,r;const o=[e[2]];var s=e[4].component;function u(a){let f={};for(let c=0;c{Z(d,1)}),de()}s?(n=St(s,u()),te(n.$$.fragment),V(n.$$.fragment,1),J(n,t,l)):n=null}else s&&n.$set(c)},i(a){r||(n&&V(n.$$.fragment,a),r=!0)},o(a){n&&H(n.$$.fragment,a),r=!1},d(a){a&&N(t),n&&Z(n)}}}function ai(e){let t,n,l=e[0]==e[4].value&&si(e);return{c(){l&&l.c(),t=_e()},m(r,o){l&&l.m(r,o),T(r,t,o),n=!0},p(r,o){r[0]==r[4].value?l?(l.p(r,o),o&3&&V(l,1)):(l=si(r),l.c(),V(l,1),l.m(t.parentNode,t)):l&&(ce(),H(l,1,1,()=>{l=null}),de())},i(r){n||(V(l),n=!0)},o(r){H(l),n=!1},d(r){l&&l.d(r),r&&N(t)}}}function sd(e){let t,n,l,r,o=e[1],s=[];for(let c=0;cH(a[c],1,1,()=>{a[c]=null});return{c(){t=A("ul");for(let c=0;c()=>n(0,r=u);return e.$$set=u=>{"items"in u&&n(1,l=u.items),"activeTabValue"in u&&n(0,r=u.activeTabValue),"tabProps"in u&&n(2,o=u.tabProps)},[r,l,o,s]}class ud extends ie{constructor(t){super(),oe(this,t,ad,sd,re,{items:1,activeTabValue:0,tabProps:2})}}function ui(e){let t;return{c(){t=L("Press ENTER to autofill with the RAG answer.")},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function fd(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m=e[0].edited_answer===ll&&ui();return{c(){t=A("form"),n=A("textarea"),r=P(),o=A("div"),s=A("div"),m&&m.c(),u=P(),a=A("div"),f=A("button"),f.textContent="Update",c=P(),d=A("button"),d.textContent="Reset",h(n,"placeholder",l=e[0].answer),h(s,"class","note svelte-i9wciy"),h(o,"class","button-container svelte-i9wciy")},m(v,_){T(v,t,_),b(t,n),lt(n,e[0].edited_answer),e[6](n),b(t,r),b(t,o),b(o,s),m&&m.m(s,null),b(o,u),b(o,a),b(a,f),b(a,c),b(a,d),g||(p=[B(n,"input",e[5]),B(n,"keydown",e[4]),B(f,"click",e[2]),B(d,"click",e[3])],g=!0)},p(v,[_]){_&1&&l!==(l=v[0].answer)&&h(n,"placeholder",l),_&1&<(n,v[0].edited_answer),v[0].edited_answer===ll?m||(m=ui(),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},i:x,o:x,d(v){v&&N(t),e[6](null),m&&m.d(),g=!1,ge(p)}}}const ll="";function cd(e,t,n){let{message:l={}}=t,r;const o=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(),o(l.edited_answer)},u=d=>{d.preventDefault(),o(ll)},a=d=>{d.key=="Enter"&&l.edited_answer===ll&&(d.preventDefault(),console.log("ENTER"),n(0,l.edited_answer=l.answer,l))};st(function(){r.focus()});function f(){l.edited_answer=this.value,n(0,l)}function c(d){yn[d?"unshift":"push"](()=>{r=d,n(1,r)})}return e.$$set=d=>{"message"in d&&n(0,l=d.message)},[l,r,s,u,a,f,c]}class dd extends ie{constructor(t){super(),oe(this,t,cd,fd,re,{message:0})}}function fi(e){let t,n,l,r,o,s;return{c(){t=A("div"),n=A("button"),n.textContent="👍",l=P(),r=A("button"),r.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(r,"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,r),o||(s=[B(n,"click",e[4]),B(r,"click",e[5])],o=!0)},p:x,d(u){u&&N(t),o=!1,ge(s)}}}function hd(e){let t,n=e[0].answer+"",l,r,o,s=e[1]&&fi(e);return{c(){t=A("div"),l=L(n),r=P(),s&&s.c(),o=_e()},m(u,a){T(u,t,a),b(t,l),T(u,r,a),s&&s.m(u,a),T(u,o,a)},p(u,[a]){a&1&&n!==(n=u[0].answer+"")&&W(l,n),u[1]?s?s.p(u,a):(s=fi(u),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null)},i:x,o:x,d(u){u&&N(t),u&&N(r),s&&s.d(u),u&&N(o)}}}async function gd(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 pd(e,t,n){let l;le(e,Ve,c=>n(6,l=c));let{message:r={}}=t,{feedback:o=!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};gd(m),dt(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),dt(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,r=c.message),"feedback"in c&&n(1,o=c.feedback),"index"in c&&n(2,s=c.index)},[r,o,s,u,a,f]}class md extends ie{constructor(t){super(),oe(this,t,pd,hd,re,{message:0,feedback:1,index:2})}}function ci(e,t,n){const l=e.slice();return l[16]=t[n],l[18]=n,l}function di(e,t){let n,l,r,o,s,u,a,f,c,d=t[16].question+"",g,p,m,v,_,w,y,$,M,k,E,S,R,C,F,I;return M=new ud({props:{items:t[7],tabProps:{message:t[16],feedback:t[0],index:t[18]}}}),E=new od({props:{sources:t[16].source,source_content:t[16].source_content}}),{key:e,first:null,c(){n=A("div"),l=A("div"),r=A("div"),o=P(),s=A("div"),u=A("div"),a=A("h5"),a.textContent="Question:",f=P(),c=A("p"),g=L(d),p=P(),m=A("div"),v=A("p"),v.textContent="ℹ️ Retrieval Sources",w=P(),y=A("div"),$=A("div"),te(M.$$.fragment),k=P(),te(E.$$.fragment),S=P(),h(r,"class","avatar"),h(a,"class","bold"),h(v,"class","bold"),h(m,"class","rag-sources svelte-aj7hp0"),h(u,"class","question svelte-aj7hp0"),h($,"class","answer svelte-aj7hp0"),h(y,"class","answers svelte-aj7hp0"),h(s,"class","message-content svelte-aj7hp0"),h(l,"class","chat-message-center svelte-aj7hp0"),h(n,"class","chat-message svelte-aj7hp0"),this.first=n},m(D,z){T(D,n,z),b(n,l),b(l,r),b(l,o),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,v),b(s,w),b(s,y),b(y,$),J(M,$,null),b(s,k),J(E,s,null),b(n,S),C=!0,F||(I=[wn(_=Pc.call(null,v,hi(t[16]))),wn(R=vd.call(null,n,t[18]===t[4].length-1))],F=!0)},p(D,z){t=D,(!C||z&16)&&d!==(d=t[16].question+"")&&W(g,d),_&&Qe(_.update)&&z&16&&_.update.call(null,hi(t[16]));const O={};z&17&&(O.tabProps={message:t[16],feedback:t[0],index:t[18]}),M.$set(O);const U={};z&16&&(U.sources=t[16].source),z&16&&(U.source_content=t[16].source_content),E.$set(U),R&&Qe(R.update)&&z&16&&R.update.call(null,t[18]===t[4].length-1)},i(D){C||(V(M.$$.fragment,D),V(E.$$.fragment,D),C=!0)},o(D){H(M.$$.fragment,D),H(E.$$.fragment,D),C=!1},d(D){D&&N(n),Z(M),Z(E),F=!1,ge(I)}}}function _d(e){let t,n,l,r,o,s,u=[],a=new Map,f,c,d,g,p,m,v,_,w,y=(e[2]?e[3]:"Send")+"",$,M,k,E,S,R,C,F=e[4];const I=D=>D[18];for(let D=0;DVote Feedback Instructions +

Ask a question to receive an answer from the chatbot. If the response is + satisfactory, click on the 👍 + button. If the response is not satisfactory, click on the + 👎 button.

`,l=P(),r=A("div"),o=A("section"),s=A("div");for(let D=0;D{e.scrollIntoView({behavior:"smooth"})},0)}function hi(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function bd(e,t,n){let l,r,o,s;le(e,Ve,$=>n(4,r=$)),le(e,er,$=>n(13,o=$));let{feedback:u=!1}=t,{is_retrieval:a=!1}=t;const f=Ae([]);le(e,f,$=>n(5,s=$));let c="",d="",g=!1,p=[{label:"Answer",value:1,component:md},{label:"Modified Answer",value:2,component:dd}];st(()=>{v(),m()});async function m(){const M=await(await fetch("/retrieval/file/get")).json();console.log("data",M.files);const E=M.files.map((S,R)=>({id:String(R),name:S.name}));console.log("files",E),Ne(f,s=[...E],s)}async function v(){const k=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",k);const E=k.map(S=>({id:S[0],question:S[1],answer:S[2],edited_answer:S[3],vote_status:S[4],rag_sources:S[5],source:S[6],source_content:S[7]}));Ne(Ve,r=[...E],r)}const _=async $=>{$.preventDefault(),c=d,n(1,d=""),n(2,g=!0);const M=[...o];let k={id:r.length+1,question:c,answer:"Loading...",rag_sources:M,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Ne(Ve,r=[...r,k],r);const E=a?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:M})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(E.ok){const S=await E.json();console.log("response data",S),k.answer=S.answer,k.source=S.source,k.source_content=S.source_content,Ve.update(R=>(R[R.length-1]=k,R))}else{const S=await E.text();alert(S)}n(2,g=!1)};let w=0;setInterval(()=>{n(10,w=(w+1)%4)},200);function y(){d=this.value,n(1,d)}return e.$$set=$=>{"feedback"in $&&n(0,u=$.feedback),"is_retrieval"in $&&n(9,a=$.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(3,l=".".repeat(w).padEnd(3))},[u,d,g,l,r,s,f,p,_,a,w,y]}class wd extends ie{constructor(t){super(),oe(this,t,bd,_d,re,{feedback:0,is_retrieval:9})}}function gi(e){let t,n;return t=new Ar({props:{is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},p(l,r){const o={};r&2&&(o.is_retrieval=l[1]),t.$set(o)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function pi(e){let t,n;return t=new Ar({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},p(l,r){const o={};r&2&&(o.is_retrieval=l[1]),t.$set(o)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function mi(e){let t,n;return t=new wd({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},p(l,r){const o={};r&2&&(o.is_retrieval=l[1]),t.$set(o)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function _i(e){let t,n,l,r;const o=[kd,yd],s=[];function u(a,f){return a[1]?0:1}return t=u(e),n=s[t]=o[t](e),{c(){n.c(),l=_e()},m(a,f){s[t].m(a,f),T(a,l,f),r=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(ce(),H(s[c],1,1,()=>{s[c]=null}),de(),n=s[t],n?n.p(a,f):(n=s[t]=o[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){r||(V(n),r=!0)},o(a){H(n),r=!1},d(a){s[t].d(a),a&&N(l)}}}function yd(e){let t,n;return t=new xc({}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},p:x,i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function kd(e){let t,n;return t=new Ar({props:{feedback:!0,is_retrieval:e[1]}}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},p(l,r){const o={};r&2&&(o.is_retrieval=l[1]),t.$set(o)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function Sd(e){let t,n,l,r,o,s=!e[0]&&gi(e),u=e[0]==="vote"&&pi(e),a=e[0]==="rag"&&mi(e),f=e[0]==="rank"&&_i(e);return{c(){s&&s.c(),t=P(),u&&u.c(),n=P(),a&&a.c(),l=P(),f&&f.c(),r=_e()},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,r,d),o=!0},p(c,[d]){c[0]?s&&(ce(),H(s,1,1,()=>{s=null}),de()):s?(s.p(c,d),d&1&&V(s,1)):(s=gi(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=pi(c),u.c(),V(u,1),u.m(n.parentNode,n)):u&&(ce(),H(u,1,1,()=>{u=null}),de()),c[0]==="rag"?a?(a.p(c,d),d&1&&V(a,1)):(a=mi(c),a.c(),V(a,1),a.m(l.parentNode,l)):a&&(ce(),H(a,1,1,()=>{a=null}),de()),c[0]==="rank"?f?(f.p(c,d),d&1&&V(f,1)):(f=_i(c),f.c(),V(f,1),f.m(r.parentNode,r)):f&&(ce(),H(f,1,1,()=>{f=null}),de())},i(c){o||(V(s),V(u),V(a),V(f),o=!0)},o(c){H(s),H(u),H(a),H(f),o=!1},d(c){s&&s.d(c),c&&N(t),u&&u.d(c),c&&N(n),a&&a.d(c),c&&N(l),f&&f.d(c),c&&N(r)}}}function Cd(e,t,n){let{feedback:l}=t,{is_retrieval:r}=t;return e.$$set=o=>{"feedback"in o&&n(0,l=o.feedback),"is_retrieval"in o&&n(1,r=o.is_retrieval)},[l,r]}class $d extends ie{constructor(t){super(),oe(this,t,Cd,Sd,re,{feedback:0,is_retrieval:1})}}function vi(e,t,n){const l=e.slice();return l[2]=t[n],l}function bi(e){let t,n=e[2]+"",l,r;return{c(){t=A("option"),l=L(n),t.__value=r=e[2],t.value=t.__value},m(o,s){T(o,t,s),b(t,l)},p(o,s){s&1&&n!==(n=o[2]+"")&&W(l,n),s&1&&r!==(r=o[2])&&(t.__value=r,t.value=t.__value)},d(o){o&&N(t)}}}function Rd(e){let t,n=e[0],l=[];for(let r=0;r{const o=await fetch(`/data/${l}`);n(0,r=await o.json())}),e.$$set=o=>{"data_endpoint"in o&&n(1,l=o.data_endpoint)},[r,l]}class Md extends ie{constructor(t){super(),oe(this,t,Ad,Rd,re,{data_endpoint:1})}}function Xt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Ed(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function da(e){let t,n,l;e.length!==2?(t=Xt,n=(u,a)=>Xt(e(u),a),l=(u,a)=>e(u)-a):(t=e===Xt||e===Ed?e:Fd,n=e,l=e);function r(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:r,center:s,right:o}}function Fd(){return 0}function Dd(e){return e===null?NaN:+e}function*Id(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 Nd=da(Xt),Pd=Nd.right;da(Dd).center;const ha=Pd;function Td(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 r of e)(r=t(r,++l,e))!=null&&(r=+r)>=r&&++n}return n}function Od(e,t){let n=0,l,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(l=s-r,r+=l/++n,o+=l*(s-r));else{let s=-1;for(let u of e)(u=t(u,++s,e))!=null&&(u=+u)>=u&&(l=u-r,r+=l/++n,o+=l*(u-r))}if(n>1)return o/(n-1)}function Vd(e,t){const n=Od(e,t);return n&&Math.sqrt(n)}function gn(e,t){let n,l;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=l=r):(n>r&&(n=r),l=o&&(n=l=o):(n>o&&(n=o),l{const l=e(t,n);return l||l===0?l:(e(n,n)===0)-(e(t,t)===0)}}function ga(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var xd=Array.prototype,Gd=xd.slice;function Dl(e){return()=>e}const Bd=Math.sqrt(50),Ud=Math.sqrt(10),Wd=Math.sqrt(2);function rl(e,t,n){const l=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(l)),o=l/Math.pow(10,r),s=o>=Bd?10:o>=Ud?5:o>=Wd?2:1;let u,a,f;return r<0?(f=Math.pow(10,-r)/s,u=Math.round(e*f),a=Math.round(t*f),u/ft&&--a,f=-f):(f=Math.pow(10,r)*s,u=Math.round(e/f),a=Math.round(t/f),u*ft&&--a),a0))return[];if(e===t)return[e];const l=t=r))return[];const u=o-r+1,a=new Array(u);if(l)if(s<0)for(let f=0;f0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),l=r}}function Qd(e){return Math.max(1,Math.ceil(Math.log(Td(e))/Math.LN2)+1)}function ma(){var e=Ld,t=gn,n=Qd;function l(r){Array.isArray(r)||(r=Array.from(r));var o,s=r.length,u,a,f=new Array(s);for(o=0;o=g)if($>=g&&t===gn){const k=Jt(d,g,M);isFinite(k)&&(k>0?g=(Math.floor(g/k)+1)*k:k<0&&(g=(Math.ceil(g*-k)+1)/-k))}else p.pop()}for(var m=p.length,v=0,_=m;p[v]<=d;)++v;for(;p[_-1]>g;)--_;(v||_0?p[o-1]:d,y.x1=o0)for(o=0;o=l)&&(n=l);else{let l=-1;for(let r of e)(r=t(r,++l,e))!=null&&(n=r)&&(n=r)}return n}function lr(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 r of e)(r=t(r,++l,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function _a(e,t,n=0,l=1/0,r){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(r=r===void 0?ga:jd(r);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));_a(e,t,p,m,r)}const o=e[t];let s=n,u=l;for(on(e,n,t),r(e[l],o)>0&&on(e,n,l);s0;)--u}r(e[n],o)===0?on(e,n,u):(++u,on(e,u,l)),u<=t&&(n=u+1),t<=u&&(l=u-1)}return e}function on(e,t,n){const l=e[t];e[t]=e[n],e[n]=l}function Kd(e,t,n){if(e=Float64Array.from(Id(e,n)),!(!(l=e.length)||isNaN(t=+t))){if(t<=0||l<2)return lr(e);if(t>=1)return ht(e);var l,r=(l-1)*t,o=Math.floor(r),s=ht(_a(e,o).subarray(0,o+1)),u=lr(e.subarray(o+1));return s+(u-s)*(r-o)}}function Jd(e,t){let n=0,l=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,l+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,l+=o)}if(n)return l/n}function Zd(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var l=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++l=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function il(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,l=e.slice(0,n);return[l.length>1?l[0]+l.slice(2):l,+e.slice(n+1)]}function Zt(e){return e=il(Math.abs(e)),e?e[1]:NaN}function th(e,t){return function(n,l){for(var r=n.length,o=[],s=0,u=e[0],a=0;r>0&&u>0&&(a+u+1>l&&(u=Math.max(1,l-a)),o.push(n.substring(r-=u,r+u)),!((a+=u+1)>l));)u=e[s=(s+1)%e.length];return o.reverse().join(t)}}function nh(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var lh=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ol(e){if(!(t=lh.exec(e)))throw new Error("invalid format: "+e);var t;return new Mr({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ol.prototype=Mr.prototype;function Mr(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Mr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function rh(e){e:for(var t=e.length,n=1,l=-1,r;n0&&(l=0);break}return l>0?e.slice(0,l)+e.slice(r+1):e}var va;function ih(e,t){var n=il(e,t);if(!n)return e+"";var l=n[0],r=n[1],o=r-(va=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=l.length;return o===s?l:o>s?l+new Array(o-s+1).join("0"):o>0?l.slice(0,o)+"."+l.slice(o):"0."+new Array(1-o).join("0")+il(e,Math.max(0,t+o-1))[0]}function ki(e,t){var n=il(e,t);if(!n)return e+"";var l=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+l:l.length>r+1?l.slice(0,r+1)+"."+l.slice(r+1):l+new Array(r-l.length+2).join("0")}const Si={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:eh,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ki(e*100,t),r:ki,s:ih,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ci(e){return e}var $i=Array.prototype.map,Ri=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oh(e){var t=e.grouping===void 0||e.thousands===void 0?Ci:th($i.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",l=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Ci:nh($i.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",a=e.nan===void 0?"NaN":e.nan+"";function f(d){d=ol(d);var g=d.fill,p=d.align,m=d.sign,v=d.symbol,_=d.zero,w=d.width,y=d.comma,$=d.precision,M=d.trim,k=d.type;k==="n"?(y=!0,k="g"):Si[k]||($===void 0&&($=12),M=!0,k="g"),(_||g==="0"&&p==="=")&&(_=!0,g="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",S=v==="$"?l:/[%p]/.test(k)?s:"",R=Si[k],C=/[defgprs%]/.test(k);$=$===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,$)):Math.max(0,Math.min(20,$));function F(I){var D=E,z=S,O,U,G;if(k==="c")z=R(I)+z,I="";else{I=+I;var $e=I<0||1/I<0;if(I=isNaN(I)?a:R(Math.abs(I),$),M&&(I=rh(I)),$e&&+I==0&&m!=="+"&&($e=!1),D=($e?m==="("?m:u:m==="-"||m==="("?"":m)+D,z=(k==="s"?Ri[8+va/3]:"")+z+($e&&m==="("?")":""),C){for(O=-1,U=I.length;++OG||G>57){z=(G===46?r+I.slice(O+1):I.slice(O))+z,I=I.slice(0,O);break}}}y&&!_&&(I=t(I,1/0));var Fe=D.length+I.length+z.length,Re=Fe>1)+D+I+z+Re.slice(Fe);break;default:I=Re+D+I+z;break}return o(I)}return F.toString=function(){return d+""},F}function c(d,g){var p=f((d=ol(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(Zt(g)/3)))*3,v=Math.pow(10,-m),_=Ri[8+m/3];return function(w){return p(v*w)+_}}return{format:f,formatPrefix:c}}var Tn,pt,ba;sh({thousands:",",grouping:[3],currency:["$",""]});function sh(e){return Tn=oh(e),pt=Tn.format,ba=Tn.formatPrefix,Tn}function ah(e){return Math.max(0,-Zt(Math.abs(e)))}function uh(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zt(t)/3)))*3-Zt(Math.abs(e)))}function fh(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zt(t)-Zt(e))+1}function Er(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ch(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Ai=Symbol("implicit");function $t(){var e=new wi,t=[],n=[],l=Ai;function r(o){let s=e.get(o);if(s===void 0){if(l!==Ai)return l;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new wi;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(l=o,r):l},r.copy=function(){return $t(t,n).unknown(l)},Er.apply(r,arguments),r}function Vt(){var e=$t().unknown(void 0),t=e.domain,n=e.range,l=0,r=1,o,s,u=!1,a=0,f=0,c=.5;delete e.unknown;function d(){var g=t().length,p=r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?On(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hh.exec(e))?new ze(t[1],t[2],t[3],1):(t=gh.exec(e))?new ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ph.exec(e))?On(t[1],t[2],t[3],t[4]):(t=mh.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_h.exec(e))?Ti(t[1],t[2]/100,t[3]/100,1):(t=vh.exec(e))?Ti(t[1],t[2]/100,t[3]/100,t[4]):Ei.hasOwnProperty(e)?Ii(Ei[e]):e==="transparent"?new ze(NaN,NaN,NaN,0):null}function Ii(e){return new ze(e>>16&255,e>>8&255,e&255,1)}function On(e,t,n,l){return l<=0&&(e=t=n=NaN),new ze(e,t,n,l)}function yh(e){return e instanceof Mn||(e=Rn(e)),e?(e=e.rgb(),new ze(e.r,e.g,e.b,e.opacity)):new ze}function rr(e,t,n,l){return arguments.length===1?yh(e):new ze(e,t,n,l??1)}function ze(e,t,n,l){this.r=+e,this.g=+t,this.b=+n,this.opacity=+l}Fr(ze,rr,ya(Mn,{brighter(e){return e=e==null?sl:Math.pow(sl,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ze(Tt(this.r),Tt(this.g),Tt(this.b),al(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ni,formatHex:Ni,formatHex8:kh,formatRgb:Pi,toString:Pi}));function Ni(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}`}function kh(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}${Nt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pi(){const e=al(this.opacity);return`${e===1?"rgb(":"rgba("}${Tt(this.r)}, ${Tt(this.g)}, ${Tt(this.b)}${e===1?")":`, ${e})`}`}function al(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nt(e){return e=Tt(e),(e<16?"0":"")+e.toString(16)}function Ti(e,t,n,l){return l<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xe(e,t,n,l)}function ka(e){if(e instanceof Xe)return new Xe(e.h,e.s,e.l,e.opacity);if(e instanceof Mn||(e=Rn(e)),!e)return new Xe;if(e instanceof Xe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,l=e.b/255,r=Math.min(t,n,l),o=Math.max(t,n,l),s=NaN,u=o-r,a=(o+r)/2;return u?(t===o?s=(n-l)/u+(n0&&a<1?0:s,new Xe(s,u,a,e.opacity)}function Sh(e,t,n,l){return arguments.length===1?ka(e):new Xe(e,t,n,l??1)}function Xe(e,t,n,l){this.h=+e,this.s=+t,this.l=+n,this.opacity=+l}Fr(Xe,Sh,ya(Mn,{brighter(e){return e=e==null?sl:Math.pow(sl,e),new Xe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cn:Math.pow(Cn,e),new Xe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,l=n+(n<.5?n:1-n)*t,r=2*n-l;return new ze(Il(e>=240?e-240:e+120,r,l),Il(e,r,l),Il(e<120?e+240:e-120,r,l),this.opacity)},clamp(){return new Xe(Oi(this.h),Vn(this.s),Vn(this.l),al(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=al(this.opacity);return`${e===1?"hsl(":"hsla("}${Oi(this.h)}, ${Vn(this.s)*100}%, ${Vn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Oi(e){return e=(e||0)%360,e<0?e+360:e}function Vn(e){return Math.max(0,Math.min(1,e||0))}function Il(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Dr=e=>()=>e;function Ch(e,t){return function(n){return e+n*t}}function $h(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(l){return Math.pow(e+l*t,n)}}function Rh(e){return(e=+e)==1?Sa:function(t,n){return n-t?$h(t,n,e):Dr(isNaN(t)?n:t)}}function Sa(e,t){var n=t-e;return n?Ch(e,n):Dr(isNaN(e)?t:e)}const ir=function e(t){var n=Rh(t);function l(r,o){var s=n((r=rr(r)).r,(o=rr(o)).r),u=n(r.g,o.g),a=n(r.b,o.b),f=Sa(r.opacity,o.opacity);return function(c){return r.r=s(c),r.g=u(c),r.b=a(c),r.opacity=f(c),r+""}}return l.gamma=e,l}(1);function Ah(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,l=t.slice(),r;return function(o){for(r=0;rn&&(o=t.slice(n,o),u[s]?u[s]+=o:u[++s]=o),(l=l[0])===(r=r[0])?u[s]?u[s]+=r:u[++s]=r:(u[++s]=null,a.push({i:s,x:ul(l,r)})),n=Nl.lastIndex;return nt&&(n=e,e=t,t=n),function(l){return Math.max(e,Math.min(t,l))}}function zh(e,t,n){var l=e[0],r=e[1],o=t[0],s=t[1];return r2?Hh:zh,a=f=null,d}function d(g){return g==null||isNaN(g=+g)?o:(a||(a=u(e.map(l),t,n)))(l(s(g)))}return d.invert=function(g){return s(r((f||(f=u(t,e.map(l),ul)))(g)))},d.domain=function(g){return arguments.length?(e=Array.from(g,Oh),c()):e.slice()},d.range=function(g){return arguments.length?(t=Array.from(g),c()):t.slice()},d.rangeRound=function(g){return t=Array.from(g),n=Ca,c()},d.clamp=function(g){return arguments.length?(s=g?!0:bt,c()):s!==bt},d.interpolate=function(g){return arguments.length?(n=g,c()):n},d.unknown=function(g){return arguments.length?(o=g,d):o},function(g,p){return l=g,r=p,c()}}function jh(){return Lh()(bt,bt)}function xh(e,t,n,l){var r=Xd(e,t,n),o;switch(l=ol(l??",f"),l.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return l.precision==null&&!isNaN(o=uh(r,s))&&(l.precision=o),ba(l,s)}case"":case"e":case"g":case"p":case"r":{l.precision==null&&!isNaN(o=fh(r,Math.max(Math.abs(e),Math.abs(t))))&&(l.precision=o-(l.type==="e"));break}case"f":case"%":{l.precision==null&&!isNaN(o=ah(r))&&(l.precision=o-(l.type==="%")*2);break}}return pt(l)}function $a(e){var t=e.domain;return e.ticks=function(n){var l=t();return pa(l[0],l[l.length-1],n??10)},e.tickFormat=function(n,l){var r=t();return xh(r[0],r[r.length-1],n??10,l)},e.nice=function(n){n==null&&(n=10);var l=t(),r=0,o=l.length-1,s=l[r],u=l[o],a,f,c=10;for(u0;){if(f=Jt(s,u,n),f===a)return l[r]=s,l[o]=u,t(l);if(f>0)s=Math.floor(s/f)*f,u=Math.ceil(u/f)*f;else if(f<0)s=Math.ceil(s*f)/f,u=Math.floor(u*f)/f;else break;a=f}return e},e}function Ge(){var e=jh();return e.copy=function(){return qh(e,Ge())},Er.apply(e,arguments),$a(e)}function Gh(){var e=0,t=1,n,l,r,o,s=bt,u=!1,a;function f(d){return d==null||isNaN(d=+d)?a:s(r===0?.5:(d=(o(d)-n)*r,u?Math.max(0,Math.min(1,d)):d))}f.domain=function(d){return arguments.length?([e,t]=d,n=o(e=+e),l=o(t=+t),r=n===l?0:1/(l-n),f):[e,t]},f.clamp=function(d){return arguments.length?(u=!!d,f):u},f.interpolator=function(d){return arguments.length?(s=d,f):s};function c(d){return function(g){var p,m;return arguments.length?([p,m]=g,s=d(p,m),f):[s(0),s(1)]}}return f.range=c(En),f.rangeRound=c(Ca),f.unknown=function(d){return arguments.length?(a=d,f):a},function(d){return o=d,n=d(e),l=d(t),r=n===l?0:1/(l-n),f}}function Bh(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ra(){var e=$a(Gh()(bt));return e.copy=function(){return Bh(e,Ra())},ch.apply(e,arguments)}function Je(e){return function(){return e}}const ar=Math.PI,ur=2*ar,Ft=1e-6,Uh=ur-Ft;function Aa(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Aa;const n=10**t;return function(l){this._+=l[0];for(let r=1,o=l.length;rFt)if(!(Math.abs(d*a-f*c)>Ft)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=l-s,m=r-u,v=a*a+f*f,_=p*p+m*m,w=Math.sqrt(v),y=Math.sqrt(g),$=o*Math.tan((ar-Math.acos((v+g-_)/(2*w*y)))/2),M=$/y,k=$/w;Math.abs(M-1)>Ft&&this._append`L${t+M*c},${n+M*d}`,this._append`A${o},${o},0,0,${+(d*p>c*m)},${this._x1=t+k*a},${this._y1=n+k*f}`}}arc(t,n,l,r,o,s){if(t=+t,n=+n,l=+l,s=!!s,l<0)throw new Error(`negative radius: ${l}`);let u=l*Math.cos(r),a=l*Math.sin(r),f=t+u,c=n+a,d=1^s,g=s?r-o:o-r;this._x1===null?this._append`M${f},${c}`:(Math.abs(this._x1-f)>Ft||Math.abs(this._y1-c)>Ft)&&this._append`L${f},${c}`,l&&(g<0&&(g=g%ur+ur),g>Uh?this._append`A${l},${l},0,1,${d},${t-u},${n-a}A${l},${l},0,1,${d},${this._x1=f},${this._y1=c}`:g>Ft&&this._append`A${l},${l},0,${+(g>=ar)},${d},${this._x1=t+l*Math.cos(o)},${this._y1=n+l*Math.sin(o)}`)}rect(t,n,l,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${l=+l}v${+r}h${-l}Z`}toString(){return this._}}function Yh(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const l=Math.floor(n);if(!(l>=0))throw new RangeError(`invalid digits: ${n}`);t=l}return e},()=>new Xh(t)}function Ma(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ea(e){this._context=e}Ea.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Qh(e){return new Ea(e)}function Kh(e){return e[0]}function Jh(e){return e[1]}function Zh(e,t){var n=Je(!0),l=null,r=Qh,o=null,s=Yh(u);e=typeof e=="function"?e:e===void 0?Kh:Je(e),t=typeof t=="function"?t:t===void 0?Jh:Je(t);function u(a){var f,c=(a=Ma(a)).length,d,g=!1,p;for(l==null&&(o=r(p=s())),f=0;f<=c;++f)!(f1)for(var n=1,l,r,o=e[t[0]],s,u=o.length;n=0;)n[t]=t;return n}function eg(e,t){return e[t]}function tg(e){const t=[];return t.key=e,t}function ng(){var e=Je([]),t=cr,n=fr,l=eg;function r(o){var s=Array.from(e.apply(this,arguments),tg),u,a=s.length,f=-1,c;for(const d of o)for(u=0,++f;uFeedback Distribution

",n=P(),l=A("div"),r=j("svg");for(let a=0;ae[19].call(l))},m(a,f){T(a,t,f),T(a,n,f),T(a,l,f),b(l,r);for(let c=0;cn(15,d=R)),le(e,Gr,R=>n(4,g=R)),le(e,Ve,R=>n(16,p=R));let m=300,v=300;const _={up:2,down:1,"n/a":0,all:"all"},w={top:10,bottom:10,left:25,right:5},y=$t().range(["var(--yellow)","var(--red)","var(--green)"]),$=pt(".0%");function M(R,C){l===R?n(5,l="all"):n(5,l=R),Ne(rt,d=l==="all"?"all":C,d)}const k=(R,C)=>M(R,C.key),E=(R,C)=>M(R,C.key);function S(){v=this.offsetWidth,m=this.offsetHeight,n(1,v),n(0,m)}return e.$$.update=()=>{e.$$.dirty&32768&&n(5,l=_[d]),e.$$.dirty&2&&n(3,r=v-w.left-w.right),e.$$.dirty&1&&n(14,o=m-w.top-w.bottom),e.$$.dirty&65552&&p.forEach(R=>{Ne(Gr,g[R.vote_status]++,g)}),e.$$.dirty&16&&n(2,s=g.up+g.down+g["n/a"]),e.$$.dirty&16384&&n(8,u=Vt().rangeRound([w.top,o-w.bottom]).padding(0).domain(["a"])),e.$$.dirty&12&&n(7,a=Ge().rangeRound([w.left,r-w.right]).domain([0,s])),e.$$.dirty&8208&&n(6,c=f([g]))},n(13,f=ng().keys(["n/a","down","up"]).order(cr).offset(fr)),[m,v,s,r,g,l,c,a,u,w,y,$,M,f,o,d,p,k,E,S]}class Fa extends ie{constructor(t){super(),oe(this,t,rg,lg,re,{})}}function ig(e){let t,n,l,r,o,s,u,a,f,c,d,g=e[3][e[2]]+"",p,m;return{c(){t=A("div"),n=A("div"),l=L("Q: "),r=L(e[0]),o=P(),s=A("div"),u=L("A: "),a=L(e[1]),f=P(),c=A("div"),d=L("Rating: "),p=L(g),h(n,"class","question svelte-szi0e"),h(s,"class","answer svelte-szi0e"),h(c,"class",m="feedback "+e[2]+" svelte-szi0e"),h(t,"class","qa-card svelte-szi0e")},m(v,_){T(v,t,_),b(t,n),b(n,l),b(n,r),b(t,o),b(t,s),b(s,u),b(s,a),b(t,f),b(t,c),b(c,d),b(c,p)},p(v,[_]){_&1&&W(r,v[0]),_&2&&W(a,v[1]),_&4&&g!==(g=v[3][v[2]]+"")&&W(p,g),_&4&&m!==(m="feedback "+v[2]+" svelte-szi0e")&&h(c,"class",m)},i:x,o:x,d(v){v&&N(t)}}}function og(e,t,n){let{question:l="What is gradient descent?"}=t,{answer:r="Gradient descent is an algorithm used to minimize a loss function by taking small steps in the direction of steepest descent."}=t,{feedback:o="Good: 👍"}=t;const s={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"};return e.$$set=u=>{"question"in u&&n(0,l=u.question),"answer"in u&&n(1,r=u.answer),"feedback"in u&&n(2,o=u.feedback)},[l,r,o,s]}class sg extends ie{constructor(t){super(),oe(this,t,og,ig,re,{question:0,answer:1,feedback:2})}}function ji(e,t,n){const l=e.slice();return l[5]=t[n].question,l[6]=t[n].answer,l[7]=t[n].vote_status,l}function xi(e){let t,n,l,r,o;return n=new sg({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=A("div"),te(n.$$.fragment),l=P()},m(s,u){T(s,t,u),J(n,t,null),b(t,l),o=!0},p(s,u){const a={};u&1&&(a.question=s[5]),u&1&&(a.answer=s[6]),u&1&&(a.feedback=s[7]),n.$set(a)},i(s){o||(V(n.$$.fragment,s),s&&ke(()=>{o&&(r||(r=Ze(t,e[1],{duration:300},!0)),r.run(1))}),o=!0)},o(s){H(n.$$.fragment,s),s&&(r||(r=Ze(t,e[1],{duration:300},!1)),r.run(0)),o=!1},d(s){s&&N(t),Z(n),s&&r&&r.end()}}}function ag(e){let t,n,l=e[0],r=[];for(let s=0;sH(r[s],1,1,()=>{r[s]=null});return{c(){t=A("div");for(let s=0;sn(4,r=a)),le(e,rt,a=>n(2,o=a)),le(e,kn,a=>n(3,s=a));const u=(a,{delay:f=0,duration:c=1e3,easing:d=Cr})=>Sn(a,{delay:f,duration:c,easing:d});return e.$$.update=()=>{e.$$.dirty&12&&n(0,l=o==="all"?s:s.filter(a=>a.vote_status===o)),e.$$.dirty&1&&Ne(Zl,r=Nc(l),r)},[l,u,o,s]}class Da extends ie{constructor(t){super(),oe(this,t,ug,ag,re,{})}}function Gi(e,t,n){const l=e.slice();return l[13]=t[n],l}function Bi(e,t,n){const l=e.slice();return l[16]=t[n],l}function Ui(e,t,n){const l=e.slice();return l[16]=t[n],l}function Wi(e){let t,n,l,r,o=e[16]+"",s,u;return{c(){t=j("g"),n=j("line"),r=j("text"),s=L(o),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",l=-e[2]+e[10].bottom+e[10].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(r,"class","axis-text svelte-1oikip4"),h(r,"y","15"),h(r,"text-anchor","middle"),h(t,"transform",u=`translate(${e[6](e[16])+e[6].bandwidth()/2} ${e[2]-e[10].bottom})`)},m(a,f){T(a,t,f),b(t,n),b(t,r),b(r,s)},p(a,f){f&4&&l!==(l=-a[2]+a[10].bottom+a[10].top)&&h(n,"y2",l),f&16&&o!==(o=a[16]+"")&&W(s,o),f&84&&u!==(u=`translate(${a[6](a[16])+a[6].bandwidth()/2} ${a[2]-a[10].bottom})`)&&h(t,"transform",u)},d(a){a&&N(t)}}}function Xi(e){let t,n,l,r;return{c(){t=j("g"),n=j("line"),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1",0),h(n,"x2",l=e[3]-e[10].right-e[10].left),h(n,"y1","0"),h(n,"y2","0"),h(n,"stroke","black"),h(t,"transform",r=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(o,s){T(o,t,s),b(t,n)},p(o,s){s&8&&l!==(l=o[3]-o[10].right-o[10].left)&&h(n,"x2",l),s&32&&r!==(r=`translate(${o[10].left} ${o[5](o[16])+0})`)&&h(t,"transform",r)},d(o){o&&N(t)}}}function Yi(e){let t,n,l,r,o,s,u,a,f=Math.round(e[11](e[13].count))+"",c,d,g;return{c(){t=j("g"),n=j("rect"),a=j("text"),c=L(f),h(n,"x",l=e[6](e[13].question)),h(n,"y",r=e[5](e[13].count)),h(n,"height",o=e[2]-e[5](e[13].count)-e[10].bottom),h(n,"fill",s=e[9][e[7]]),h(n,"fill-opacity","0.95"),h(n,"width",u=e[6].bandwidth()),h(n,"class","svelte-1oikip4"),h(a,"class","axis-text svelte-1oikip4"),h(a,"x",d=e[6](e[13].question)+e[6].bandwidth()/2),h(a,"y",g=e[5](e[13].count)-5),h(a,"text-anchor","middle"),h(t,"class","series")},m(p,m){T(p,t,m),b(t,n),b(t,a),b(a,c)},p(p,m){m&80&&l!==(l=p[6](p[13].question))&&h(n,"x",l),m&48&&r!==(r=p[5](p[13].count))&&h(n,"y",r),m&52&&o!==(o=p[2]-p[5](p[13].count)-p[10].bottom)&&h(n,"height",o),m&128&&s!==(s=p[9][p[7]])&&h(n,"fill",s),m&64&&u!==(u=p[6].bandwidth())&&h(n,"width",u),m&16&&f!==(f=Math.round(p[11](p[13].count))+"")&&W(c,f),m&80&&d!==(d=p[6](p[13].question)+p[6].bandwidth()/2)&&h(a,"x",d),m&48&&g!==(g=p[5](p[13].count)-5)&&h(a,"y",g)},d(p){p&&N(t)}}}function fg(e){let t,n,l,r,o,s,u=e[8][e[7]]+"",a,f,c,d,g,p,m,v,_,w=e[4].map(Qi),y=[];for(let S=0;Se[12].call(t))},m(S,R){T(S,t,R),b(t,n);for(let C=0;Ce.question;function cg(e,t,n){let l,r,o,s,u,a;le(e,Zl,_=>n(4,u=_)),le(e,rt,_=>n(7,a=_));const f={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"},c={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let d=300,g=300,p={top:35,bottom:10,left:25,right:5};const m=pt(".1f");function v(){g=this.offsetWidth,d=this.offsetHeight,n(1,g),n(0,d)}return e.$$.update=()=>{e.$$.dirty&2&&n(3,l=g-p.left-p.right),e.$$.dirty&1&&n(2,r=d-p.top-p.bottom),e.$$.dirty&24&&n(6,o=Vt().rangeRound([p.left,l-p.right]).padding(.05).domain(u.map(_=>_.question))),e.$$.dirty&20&&n(5,s=Ge().rangeRound([r-p.bottom,p.top]).domain([0,ht(u,_=>_.count)])),e.$$.dirty&16&&console.log(u)},[d,g,r,l,u,s,o,a,f,c,p,m,v]}class Ia extends ie{constructor(t){super(),oe(this,t,cg,fg,re,{})}}function Ki(e,t,n){const l=e.slice();l[19]=t[n];const r=l[7](l[19].x1)-l[7](l[19].x0);return l[20]=r,l}function Ji(e,t,n){const l=e.slice();return l[23]=t[n],l}function Zi(e){let t,n,l,r,o=e[23]+"",s,u;return{c(){t=j("g"),n=j("line"),r=j("text"),s=L(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",l=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(r,"class","axis-text svelte-kz2qh6"),h(r,"y","15"),h(r,"text-anchor","middle"),h(t,"transform",u=`translate(${e[7](e[23])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(a,f){T(a,t,f),b(t,n),b(t,r),b(r,s)},p(a,f){f&4&&l!==(l=-a[2]+a[9].bottom+a[9].top)&&h(n,"y2",l),f&128&&o!==(o=a[23]+"")&&W(s,o),f&132&&u!==(u=`translate(${a[7](a[23])+(a[7](1)-a[7](0))/2} ${a[2]-a[9].bottom})`)&&h(t,"transform",u)},d(a){a&&N(t)}}}function eo(e){let t,n,l,r,o,s,u;return{c(){t=j("g"),n=j("rect"),h(n,"x",l=e[7](e[19].x0)+1),h(n,"width",r=e[20]),h(n,"y",o=e[6](e[19].length)),h(n,"height",s=e[6](0)-e[6](e[19].length)),h(n,"fill",u=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(a,f){T(a,t,f),b(t,n)},p(a,f){f&136&&l!==(l=a[7](a[19].x0)+1)&&h(n,"x",l),f&136&&r!==(r=a[20])&&h(n,"width",r),f&72&&o!==(o=a[6](a[19].length))&&h(n,"y",o),f&72&&s!==(s=a[6](0)-a[6](a[19].length))&&h(n,"height",s),f&32&&u!==(u=a[8][a[5]])&&h(n,"fill",u)},d(a){a&&N(t)}}}function dg(e){let t,n,l,r,o,s,u,a,f,c,d,g=e[7].ticks(),p=[];for(let _=0;_e[14].call(t))},m(_,w){T(_,t,w),b(t,n);for(let y=0;yn(5,d=$)),le(e,Ve,$=>n(13,g=$));const p={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let m=300,v=300,_={top:15,bottom:10,left:25,right:5};pt(".1f");let w=Array.from({length:to},($,M)=>M);function y(){v=this.offsetWidth,m=this.offsetHeight,n(1,v),n(0,m)}return e.$$.update=()=>{e.$$.dirty&8224&&n(12,l=d==="all"?g:g.filter($=>$.vote_status===d)),e.$$.dirty&4096&&n(11,r=ca(l)),e.$$.dirty&2&&n(4,o=v-_.left-_.right),e.$$.dirty&1&&n(2,s=m-_.top-_.bottom),e.$$.dirty&2048&&n(3,u=ma().thresholds(w).value($=>$.answer)(r)),e.$$.dirty&16&&n(7,a=Ge().domain([3,to]).range([_.left,o-_.right])),e.$$.dirty&12&&n(6,f=Ge().domain([0,ht(u,$=>$.length)]).range([s-_.bottom,_.top])),e.$$.dirty&2048&&n(10,c=ht(r,$=>$.length)),e.$$.dirty&1056&&Ge().domain([0,c]).range(["white",p[d]]).interpolate(En)},[m,v,s,u,o,d,f,a,p,_,c,r,l,g,y]}class Na extends ie{constructor(t){super(),oe(this,t,hg,dg,re,{})}}function no(e,t,n){const l=e.slice();l[18]=t[n];const r=l[7](l[18].x1)-l[7](l[18].x0);return l[19]=r,l}function lo(e,t,n){const l=e.slice();return l[22]=t[n],l}function ro(e){let t,n,l,r,o=e[22]+"",s,u;return{c(){t=j("g"),n=j("line"),r=j("text"),s=L(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",l=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(r,"class","axis-text svelte-kz2qh6"),h(r,"y","15"),h(r,"text-anchor","middle"),h(t,"transform",u=`translate(${e[7](e[22])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(a,f){T(a,t,f),b(t,n),b(t,r),b(r,s)},p(a,f){f&4&&l!==(l=-a[2]+a[9].bottom+a[9].top)&&h(n,"y2",l),f&128&&o!==(o=a[22]+"")&&W(s,o),f&132&&u!==(u=`translate(${a[7](a[22])+(a[7](1)-a[7](0))/2} ${a[2]-a[9].bottom})`)&&h(t,"transform",u)},d(a){a&&N(t)}}}function io(e){let t,n,l,r,o,s,u;return{c(){t=j("g"),n=j("rect"),h(n,"x",l=e[7](e[18].x0)+1),h(n,"width",r=e[19]),h(n,"y",o=e[6](e[18].length)),h(n,"height",s=e[6](0)-e[6](e[18].length)),h(n,"fill",u=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(a,f){T(a,t,f),b(t,n)},p(a,f){f&136&&l!==(l=a[7](a[18].x0)+1)&&h(n,"x",l),f&136&&r!==(r=a[19])&&h(n,"width",r),f&72&&o!==(o=a[6](a[18].length))&&h(n,"y",o),f&72&&s!==(s=a[6](0)-a[6](a[18].length))&&h(n,"height",s),f&32&&u!==(u=a[8][a[5]])&&h(n,"fill",u)},d(a){a&&N(t)}}}function gg(e){let t,n,l,r,o,s,u,a,f,c,d,g=e[7].ticks(),p=[];for(let _=0;_e[13].call(t))},m(_,w){T(_,t,w),b(t,n);for(let y=0;yn(5,c=y)),le(e,Ve,y=>n(12,d=y));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,m=300,v={top:15,bottom:10,left:25,right:5},_=Array.from({length:oo},(y,$)=>$);$t().range(["var(--yellow)","var(--red)","var(--green)"]);function w(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&4128&&n(11,l=c==="all"?d:d.filter(y=>y.vote_status===c)),e.$$.dirty&2048&&n(10,r=ca(l)),e.$$.dirty&2&&n(4,o=m-v.left-v.right),e.$$.dirty&1&&n(2,s=p-v.top-v.bottom),e.$$.dirty&1024&&n(3,u=ma().thresholds(_).value(y=>y.question)(r)),e.$$.dirty&16&&n(7,a=Ge().domain([3,oo]).range([v.left,o-v.right])),e.$$.dirty&12&&n(6,f=Ge().domain([0,ht(u,y=>y.length)]).range([s-v.bottom,v.top])),e.$$.dirty&1024&&ht(r,y=>y.length)},[p,m,s,u,o,c,f,a,g,v,r,l,d,w]}class Pa extends ie{constructor(t){super(),oe(this,t,pg,gg,re,{})}}function mg(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m=Math.round(e[5](e[3]))+"",v,_,w,y,$,M,k,E;return{c(){t=A("div"),n=A("div"),l=A("p"),l.textContent="Questions",r=P(),o=A("select"),s=A("option"),s.textContent="All",u=A("option"),u.textContent="Good",a=A("option"),a.textContent="Bad",f=A("option"),f.textContent="N/A",c=P(),d=A("div"),g=j("svg"),p=j("text"),v=L(m),$=P(),M=A("p"),M.textContent="number of responses",h(l,"class","card-text svelte-1pknxov"),s.__value="all",s.value=s.__value,h(s,"class","svelte-1pknxov"),u.__value="up",u.value=u.__value,h(u,"class","svelte-1pknxov"),a.__value="down",a.value=a.__value,h(a,"class","svelte-1pknxov"),f.__value="n/a",f.value=f.__value,h(f,"class","svelte-1pknxov"),h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),ye(o,"background",e[6][e[0]]),h(o,"class","svelte-1pknxov"),e[0]===void 0&&ke(()=>e[9].call(o)),h(n,"class","svelte-1pknxov"),h(p,"dominant-baseline","middle"),h(p,"x",_=e[2]/2),h(p,"y",w=e[1]/2),h(p,"text-anchor","middle"),h(p,"class","svelte-1pknxov"),h(g,"width",e[2]),h(g,"height",e[1]),h(g,"class","svelte-1pknxov"),h(d,"class","svelte-1pknxov"),ke(()=>e[10].call(d)),h(M,"class","small svelte-1pknxov"),h(t,"class","card-container svelte-1pknxov"),ye(t,"background",e[6][e[0]])},m(S,R){T(S,t,R),b(t,n),b(n,l),b(n,r),b(n,o),b(o,s),b(o,u),b(o,a),b(o,f),Zn(o,e[0],!0),b(t,c),b(t,d),b(d,g),b(g,p),b(p,v),y=ot(d,e[10].bind(d)),b(t,$),b(t,M),k||(E=B(o,"change",e[9]),k=!0)},p(S,[R]){R&1&&ye(o,"background",S[6][S[0]]),R&1&&Zn(o,S[0]),R&8&&m!==(m=Math.round(S[5](S[3]))+"")&&W(v,m),R&4&&_!==(_=S[2]/2)&&h(p,"x",_),R&2&&w!==(w=S[1]/2)&&h(p,"y",w),R&4&&h(g,"width",S[2]),R&2&&h(g,"height",S[1]),R&1&&ye(t,"background",S[6][S[0]])},i:x,o:x,d(S){S&&N(t),y(),k=!1,E()}}}function _g(e,t){return t==="all"?e.length:e.filter(l=>l.vote_status===t).length}function vg(e,t,n){let l,r,o,s;le(e,rt,m=>n(0,r=m)),le(e,Ve,m=>n(8,o=m));let u,a,f=$r(0);le(e,f,m=>n(3,s=m));const c=pt(".1f"),d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){r=Us(this),rt.set(r)}function p(){a=this.clientWidth,u=this.clientHeight,n(2,a),n(1,u)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,l=_g(o,r)),e.$$.dirty&128&&console.log("fbc",l),e.$$.dirty&128&&f.set(l)},[r,u,a,s,f,c,d,l,o,g,p]}class Ta extends ie{constructor(t){super(),oe(this,t,vg,mg,re,{})}}function bg(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m=e[5](e[3])+"",v,_,w,y,$,M,k,E;return{c(){t=A("div"),n=A("div"),l=A("p"),l.textContent="Questions",r=P(),o=A("select"),s=A("option"),s.textContent="All",u=A("option"),u.textContent="Good",a=A("option"),a.textContent="Bad",f=A("option"),f.textContent="N/A",c=P(),d=A("div"),g=j("svg"),p=j("text"),v=L(m),$=P(),M=A("p"),M.textContent="percentage of responses",h(l,"class","card-text svelte-mchgj2"),s.__value="all",s.value=s.__value,u.__value="up",u.value=u.__value,a.__value="down",a.value=a.__value,f.__value="n/a",f.value=f.__value,h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),ye(o,"background",e[6][e[0]]),h(o,"class","svelte-mchgj2"),e[0]===void 0&&ke(()=>e[9].call(o)),h(p,"dominant-baseline","middle"),h(p,"x",_=e[2]/2),h(p,"y",w=e[1]/2),h(p,"text-anchor","middle"),h(p,"class","svelte-mchgj2"),h(g,"width",e[2]),h(g,"height",e[1]),h(g,"class","svelte-mchgj2"),ke(()=>e[10].call(d)),h(M,"class","small svelte-mchgj2"),h(t,"class","card-container svelte-mchgj2"),ye(t,"background",e[6][e[0]])},m(S,R){T(S,t,R),b(t,n),b(n,l),b(n,r),b(n,o),b(o,s),b(o,u),b(o,a),b(o,f),Zn(o,e[0],!0),b(t,c),b(t,d),b(d,g),b(g,p),b(p,v),y=ot(d,e[10].bind(d)),b(t,$),b(t,M),k||(E=B(o,"change",e[9]),k=!0)},p(S,[R]){R&1&&ye(o,"background",S[6][S[0]]),R&1&&Zn(o,S[0]),R&8&&m!==(m=S[5](S[3])+"")&&W(v,m),R&4&&_!==(_=S[2]/2)&&h(p,"x",_),R&2&&w!==(w=S[1]/2)&&h(p,"y",w),R&4&&h(g,"width",S[2]),R&2&&h(g,"height",S[1]),R&1&&ye(t,"background",S[6][S[0]])},i:x,o:x,d(S){S&&N(t),y(),k=!1,E()}}}function wg(e,t){const n=e.length;return t==="all"?1:e.filter(r=>r.vote_status===t).length/n}function yg(e,t,n){let l,r,o,s;le(e,rt,m=>n(0,r=m)),le(e,Ve,m=>n(8,o=m));let u,a,f=$r(0);le(e,f,m=>n(3,s=m));const c=pt(".1%"),d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){r=Us(this),rt.set(r)}function p(){a=this.clientWidth,u=this.clientHeight,n(2,a),n(1,u)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,l=wg(o,r)),e.$$.dirty&128&&f.set(l)},[r,u,a,s,f,c,d,l,o,g,p]}class Oa extends ie{constructor(t){super(),oe(this,t,yg,bg,re,{})}}function kg(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m,v,_,w,y,$,M,k,E,S,R,C,F,I;return o=new Ta({}),a=new Oa({}),d=new Fa({}),m=new Ia({props:{feedback:"Bad"}}),w=new Pa({}),M=new Na({}),F=new Da({}),{c(){t=A("div"),n=A("div"),l=A("div"),r=A("div"),te(o.$$.fragment),s=P(),u=A("div"),te(a.$$.fragment),f=P(),c=A("div"),te(d.$$.fragment),g=P(),p=A("div"),te(m.$$.fragment),v=P(),_=A("div"),te(w.$$.fragment),y=P(),$=A("div"),te(M.$$.fragment),k=P(),E=A("div"),S=A("div"),S.innerHTML=`
+
`,R=P(),C=A("div"),te(F.$$.fragment),h(r,"class","card-1 svelte-14znspc"),h(u,"class","card-2"),h(l,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(p,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h($,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(C,"class","right-table svelte-14znspc"),h(E,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(D,z){T(D,t,z),b(t,n),b(n,l),b(l,r),J(o,r,null),b(l,s),b(l,u),J(a,u,null),b(n,f),b(n,c),J(d,c,null),b(n,g),b(n,p),J(m,p,null),b(n,v),b(n,_),J(w,_,null),b(n,y),b(n,$),J(M,$,null),b(t,k),b(t,E),b(E,S),b(E,R),b(E,C),J(F,C,null),I=!0},p:x,i(D){I||(V(o.$$.fragment,D),V(a.$$.fragment,D),V(d.$$.fragment,D),V(m.$$.fragment,D),V(w.$$.fragment,D),V(M.$$.fragment,D),V(F.$$.fragment,D),I=!0)},o(D){H(o.$$.fragment,D),H(a.$$.fragment,D),H(d.$$.fragment,D),H(m.$$.fragment,D),H(w.$$.fragment,D),H(M.$$.fragment,D),H(F.$$.fragment,D),I=!1},d(D){D&&N(t),Z(o),Z(a),Z(d),Z(m),Z(w),Z(M),Z(F)}}}function Sg(e,t,n){let l;le(e,kn,o=>n(0,l=o)),st(()=>{r()});async function r(){const a=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(f=>({id:f[0],question:f[1],answer:f[2],vote_status:f[3]}));Ne(kn,l=[...a],l)}return[]}class Va extends ie{constructor(t){super(),oe(this,t,Sg,kg,re,{})}}/**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function so(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,l)}return n}function it(e){for(var t=1;t=0)&&(n[r]=e[r]);return n}function Rg(e,t){if(e==null)return{};var n=$g(e,t),l,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Ag="1.15.0";function ft(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var mt=ft(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Fn=ft(/Edge/i),ao=ft(/firefox/i),pn=ft(/safari/i)&&!ft(/chrome/i)&&!ft(/android/i),za=ft(/iP(ad|od|hone)/i),Ha=ft(/chrome/i)&&ft(/android/i),qa={capture:!1,passive:!1};function ae(e,t,n){e.addEventListener(t,n,!mt&&qa)}function se(e,t,n){e.removeEventListener(t,n,!mt&&qa)}function fl(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Mg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ke(e,t,n,l){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&fl(e,t):fl(e,t))||l&&e===n)return e;if(e===n)break}while(e=Mg(e))}return null}var uo=/\s+/g;function Le(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var l=(" "+e.className+" ").replace(uo," ").replace(" "+t+" "," ");e.className=(l+(n?" "+t:"")).replace(uo," ")}}function Y(e,t,n){var l=e&&e.style;if(l){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in l)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),l[t]=n+(typeof n=="string"?"":"px")}}function Qt(e,t){var n="";if(typeof e=="string")n=e;else do{var l=Y(e,"transform");l&&l!=="none"&&(n=l+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function La(e,t,n){if(e){var l=e.getElementsByTagName(t),r=0,o=l.length;if(n)for(;r=o:s=r<=o,!s)return l;if(l===nt())break;l=yt(l,!1)}return!1}function en(e,t,n,l){for(var r=0,o=0,s=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},r=l.evt,o=Rg(l,Og);Dn.pluginEvent.bind(X)(t,n,it({dragEl:q,parentEl:we,ghostEl:ee,rootEl:pe,nextEl:Dt,lastDownEl:Wn,cloneEl:me,cloneHidden:vt,dragStarted:un,putSortable:Me,activeSortable:X.active,originalEvent:r,oldIndex:Bt,oldDraggableIndex:_n,newIndex:je,newDraggableIndex:_t,hideGhostForTarget:Xa,unhideGhostForTarget:Ya,cloneNowHidden:function(){vt=!0},cloneNowShown:function(){vt=!1},dispatchSortableEvent:function(u){De({sortable:n,name:u,originalEvent:r})}},o))};function De(e){Tg(it({putSortable:Me,cloneEl:me,targetEl:q,rootEl:pe,oldIndex:Bt,oldDraggableIndex:_n,newIndex:je,newDraggableIndex:_t},e))}var q,we,ee,pe,Dt,Wn,me,vt,Bt,je,_n,_t,zn,Me,Gt=!1,cl=!1,dl=[],Mt,We,Ol,Vl,ho,go,un,jt,vn,bn=!1,Hn=!1,Xn,Ee,zl=[],dr=!1,hl=[],Sl=typeof document<"u",qn=za,po=Fn||mt?"cssFloat":"float",Vg=Sl&&!Ha&&!za&&"draggable"in document.createElement("div"),Ba=function(){if(Sl){if(mt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Ua=function(t,n){var l=Y(t),r=parseInt(l.width)-parseInt(l.paddingLeft)-parseInt(l.paddingRight)-parseInt(l.borderLeftWidth)-parseInt(l.borderRightWidth),o=en(t,0,n),s=en(t,1,n),u=o&&Y(o),a=s&&Y(s),f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Ce(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ce(s).width;if(l.display==="flex")return l.flexDirection==="column"||l.flexDirection==="column-reverse"?"vertical":"horizontal";if(l.display==="grid")return l.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&u.float&&u.float!=="none"){var d=u.float==="left"?"left":"right";return s&&(a.clear==="both"||a.clear===d)?"vertical":"horizontal"}return o&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||f>=r&&l[po]==="none"||s&&l[po]==="none"&&f+c>r)?"vertical":"horizontal"},zg=function(t,n,l){var r=l?t.left:t.top,o=l?t.right:t.bottom,s=l?t.width:t.height,u=l?n.left:n.top,a=l?n.right:n.bottom,f=l?n.width:n.height;return r===u||o===a||r+s/2===u+f/2},Hg=function(t,n){var l;return dl.some(function(r){var o=r[xe].options.emptyInsertThreshold;if(!(!o||Ir(r))){var s=Ce(r),u=t>=s.left-o&&t<=s.right+o,a=n>=s.top-o&&n<=s.bottom+o;if(u&&a)return l=r}}),l},Wa=function(t){function n(o,s){return function(u,a,f,c){var d=u.options.group.name&&a.options.group.name&&u.options.group.name===a.options.group.name;if(o==null&&(s||d))return!0;if(o==null||o===!1)return!1;if(s&&o==="clone")return o;if(typeof o=="function")return n(o(u,a,f,c),s)(u,a,f,c);var g=(s?u:a).options.group.name;return o===!0||typeof o=="string"&&o===g||o.join&&o.indexOf(g)>-1}}var l={},r=t.group;(!r||Un(r)!="object")&&(r={name:r}),l.name=r.name,l.checkPull=n(r.pull,!0),l.checkPut=n(r.put),l.revertClone=r.revertClone,t.group=l},Xa=function(){!Ba&&ee&&Y(ee,"display","none")},Ya=function(){!Ba&&ee&&Y(ee,"display","")};Sl&&!Ha&&document.addEventListener("click",function(e){if(cl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),cl=!1,!1},!0);var Et=function(t){if(q){t=t.touches?t.touches[0]:t;var n=Hg(t.clientX,t.clientY);if(n){var l={};for(var r in t)t.hasOwnProperty(r)&&(l[r]=t[r]);l.target=l.rootEl=n,l.preventDefault=void 0,l.stopPropagation=void 0,n[xe]._onDragOver(l)}}},qg=function(t){q&&q.parentNode[xe]._isOutsideThisEl(t.target)};function X(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=gt({},t),e[xe]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ua(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,u){s.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:X.supportPointer!==!1&&"PointerEvent"in window&&!pn,emptyInsertThreshold:5};Dn.initializePlugins(this,e,n);for(var l in n)!(l in t)&&(t[l]=n[l]);Wa(t);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=t.forceFallback?!1:Vg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ae(e,"pointerdown",this._onTapStart):(ae(e,"mousedown",this._onTapStart),ae(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ae(e,"dragover",this),ae(e,"dragenter",this)),dl.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),gt(this,Ig())}X.prototype={constructor:X,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(jt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,q):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,l=this.el,r=this.options,o=r.preventOnFilter,s=t.type,u=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(u||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=r.filter;if(Xg(l),!q&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||r.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&pn&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=Ke(a,r.draggable,l,!1),!(a&&a.animated)&&Wn!==a)){if(Bt=Be(a),_n=Be(a,r.draggable),typeof c=="function"){if(c.call(this,t,a,this)){De({sortable:n,rootEl:f,name:"filter",targetEl:a,toEl:l,fromEl:l}),Te("filter",n,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=Ke(f,d.trim(),l,!1),d)return De({sortable:n,rootEl:d,name:"filter",targetEl:a,fromEl:l,toEl:l}),Te("filter",n,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}r.handle&&!Ke(f,r.handle,l,!1)||this._prepareDragStart(t,u,a)}}},_prepareDragStart:function(t,n,l){var r=this,o=r.el,s=r.options,u=o.ownerDocument,a;if(l&&!q&&l.parentNode===o){var f=Ce(l);if(pe=o,q=l,we=q.parentNode,Dt=q.nextSibling,Wn=l,zn=s.group,X.dragged=q,Mt={target:q,clientX:(n||t).clientX,clientY:(n||t).clientY},ho=Mt.clientX-f.left,go=Mt.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,q.style["will-change"]="all",a=function(){if(Te("delayEnded",r,{evt:t}),X.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!ao&&r.nativeDraggable&&(q.draggable=!0),r._triggerDragStart(t,n),De({sortable:r,name:"choose",originalEvent:t}),Le(q,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){La(q,c.trim(),Hl)}),ae(u,"dragover",Et),ae(u,"mousemove",Et),ae(u,"touchmove",Et),ae(u,"mouseup",r._onDrop),ae(u,"touchend",r._onDrop),ae(u,"touchcancel",r._onDrop),ao&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),Te("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Fn||mt))){if(X.eventCanceled){this._onDrop();return}ae(u,"mouseup",r._disableDelayedDrag),ae(u,"touchend",r._disableDelayedDrag),ae(u,"touchcancel",r._disableDelayedDrag),ae(u,"mousemove",r._delayedDragTouchMoveHandler),ae(u,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&ae(u,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(a,s.delay)}else a()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){q&&Hl(q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;se(t,"mouseup",this._disableDelayedDrag),se(t,"touchend",this._disableDelayedDrag),se(t,"touchcancel",this._disableDelayedDrag),se(t,"mousemove",this._delayedDragTouchMoveHandler),se(t,"touchmove",this._delayedDragTouchMoveHandler),se(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ae(document,"pointermove",this._onTouchMove):n?ae(document,"touchmove",this._onTouchMove):ae(document,"mousemove",this._onTouchMove):(ae(q,"dragend",this),ae(pe,"dragstart",this._onDragStart));try{document.selection?Yn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Gt=!1,pe&&q){Te("dragStarted",this,{evt:n}),this.nativeDraggable&&ae(document,"dragover",qg);var l=this.options;!t&&Le(q,l.dragClass,!1),Le(q,l.ghostClass,!0),X.active=this,t&&this._appendGhost(),De({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(We){this._lastX=We.clientX,this._lastY=We.clientY,Xa();for(var t=document.elementFromPoint(We.clientX,We.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(We.clientX,We.clientY),t!==n);)n=t;if(q.parentNode[xe]._isOutsideThisEl(t),n)do{if(n[xe]){var l=void 0;if(l=n[xe]._onDragOver({clientX:We.clientX,clientY:We.clientY,target:t,rootEl:n}),l&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);Ya()}},_onTouchMove:function(t){if(Mt){var n=this.options,l=n.fallbackTolerance,r=n.fallbackOffset,o=t.touches?t.touches[0]:t,s=ee&&Qt(ee,!0),u=ee&&s&&s.a,a=ee&&s&&s.d,f=qn&&Ee&&co(Ee),c=(o.clientX-Mt.clientX+r.x)/(u||1)+(f?f[0]-zl[0]:0)/(u||1),d=(o.clientY-Mt.clientY+r.y)/(a||1)+(f?f[1]-zl[1]:0)/(a||1);if(!X.active&&!Gt){if(l&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(De({rootEl:we,name:"add",toEl:we,fromEl:pe,originalEvent:t}),De({sortable:this,name:"remove",toEl:we,originalEvent:t}),De({rootEl:we,name:"sort",toEl:we,fromEl:pe,originalEvent:t}),De({sortable:this,name:"sort",toEl:we,originalEvent:t})),Me&&Me.save()):je!==Bt&&je>=0&&(De({sortable:this,name:"update",toEl:we,originalEvent:t}),De({sortable:this,name:"sort",toEl:we,originalEvent:t})),X.active&&((je==null||je===-1)&&(je=Bt,_t=_n),De({sortable:this,name:"end",toEl:we,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Te("nulling",this),pe=q=we=ee=Dt=me=Wn=vt=Mt=We=un=je=_t=Bt=_n=jt=vn=Me=zn=X.dragged=X.ghost=X.clone=X.active=null,hl.forEach(function(t){t.checked=!0}),hl.length=Ol=Vl=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":q&&(this._onDragOver(t),Lg(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,l=this.el.children,r=0,o=l.length,s=this.options;rl.right+r||e.clientX<=l.right&&e.clientY>l.bottom&&e.clientX>=l.left:e.clientX>l.right&&e.clientY>l.top||e.clientX<=l.right&&e.clientY>l.bottom+r}function Bg(e,t,n,l,r,o,s,u){var a=l?e.clientY:e.clientX,f=l?n.height:n.width,c=l?n.top:n.left,d=l?n.bottom:n.right,g=!1;if(!s){if(u&&Xnc+f*o/2:ad-Xn)return-vn}else if(a>c+f*(1-r)/2&&ad-f*o/2)?a>c+f/2?1:-1:0}function Ug(e){return Be(q)R[24];for(let R=0;RE[21];for(let E=0;EQ & A Comparison Instructions +
+

Ask a question and rank the answers across the models. Drag each answer to + rank it, in ascending order, from left-to-right. Optionally, select the + rank for each via the corresponding dropdown.

+
+ `,l=P(),r=A("div"),o=A("section"),s=A("div");for(let E=0;E{e.scrollIntoView({behavior:"smooth"})},0)}async function So(e){console.log("run update",e);const n=await fetch("/chat/comparator/db/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e})});if(n.ok)console.log("ok",n);else{const l=await n.text();alert(l)}}function Jg(e,t,n){let l,r,o;le(e,El,k=>n(7,o=k));let{numModels:s=1}=t,{models:u=[0]}=t,a="",f="",c=!1;st(async()=>{if(await new Promise(k=>setTimeout(k,200)),p){const k=new X(p,{animation:150,onUpdate(E){k.toArray()}});k.toArray()}});const d=async k=>{k.preventDefault(),a=f,n(3,f=""),n(4,c=!0);let E={question:a};for(let R of u)E[R]="Loading...";Ne(El,o=[...o,E],o);const S=await fetch(`/chat/comparator/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(S.ok){const R=await S.json();n(1,u=Object.keys(R.answer)),n(0,s=u.length);for(let C of u)E[C]=R.answer[C];E.qid=R.qid,El.update(C=>(C[C.length-1]=E,C))}else{const R=await S.text();alert(R)}n(4,c=!1)};let g=0;setInterval(()=>{n(11,g=(g+1)%4)},200);let p,m;function v(k,E){const S=E,C=dt(k.currentTarget.parentNode).selectAll("div.answer").nodes().map(z=>z.id);C.forEach((z,O)=>{dt(`#${z}`).select(".answer-rank").property("value",O+1)});let F=[];for(let[z,O]of C.entries()){const U=parseInt(O.split("-")[1]),G=u[U],$e={rank:z,model:G};F.push($e)}let I=o.filter(z=>z.qid===S),D=[];for(let z of F){const O={model:z.model,qid:parseInt(S),rank:parseInt(z.rank)+1,answer:I[0][z.model]};D.push(O)}So(D)}function _(k,E,S){const R=E,C=parseInt(k.target.value),F=u[S],I={qid:R,rank:parseInt(C),model:F};let D=[],O=o.filter(G=>G.qid===I.qid)[0][I.model];const U={model:I.model,qid:parseInt(I.qid),rank:parseInt(I.rank),answer:O};D.push(U),So(D)}const w=(k,E,S)=>_(S,k.qid,E),y=(k,E)=>v(E,k.qid);function $(k){yn[k?"unshift":"push"](()=>{p=k,n(2,p)})}function M(){f=this.value,n(3,f)}return e.$$set=k=>{"numModels"in k&&n(0,s=k.numModels),"models"in k&&n(1,u=k.models)},e.$$.update=()=>{e.$$.dirty&1&&n(6,l="1fr ".repeat(s).trim()),e.$$.dirty&2048&&n(5,r=".".repeat(g).padEnd(3)),e.$$.dirty&4100&&p&&(n(12,m=new X(p,{animation:150,dataIdAttr:"id",onUpdate(k){m.toArray()}})),m.toArray())},[s,u,p,f,c,r,l,o,d,v,_,g,m,w,y,$,M]}class Zg extends ie{constructor(t){super(),oe(this,t,Jg,Qg,re,{numModels:0,models:1})}}const tn=Ae([{model:"llama",qid:1,rank:1,answer:"Llama's first unique answer."},{model:"gpt3.5",qid:1,rank:2,answer:"GPT-3.5's first unique answer."},{model:"gpt4",qid:1,rank:3,answer:"GPT-4's first unique answer."},{model:"claude",qid:1,rank:4,answer:"Claude's first unique answer."},{model:"llama",qid:2,rank:4,answer:"Llama's second unique answer."},{model:"gpt3.5",qid:2,rank:2,answer:"GPT-3.5's second unique answer."},{model:"gpt4",qid:2,rank:4,answer:"GPT-4's second unique answer."},{model:"claude",qid:2,rank:3,answer:"'s second unique answer."}]);function Co(e,t,n){const l=e.slice();return l[20]=t[n],l}function $o(e,t,n){const l=e.slice();return l[20]=t[n],l[24]=n,l}function Ro(e,t,n){const l=e.slice();return l[25]=t[n],l}function Ao(e){let t,n,l,r,o=`Q.${e[25]}`,s,u;return{c(){t=j("g"),n=j("line"),r=j("text"),s=L(o),h(n,"class","axis-tick svelte-1nna9rx"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",l=-e[5]+e[12].bottom+e[12].top),h(n,"stroke","black"),h(n,"stroke-dasharray","4"),h(r,"class","axis-text svelte-1nna9rx"),h(r,"y","15"),h(r,"text-anchor","middle"),h(t,"transform",u=`translate(${e[3](e[25])+0} ${e[5]-e[12].bottom})`),h(t,"class","svelte-1nna9rx")},m(a,f){T(a,t,f),b(t,n),b(t,r),b(r,s)},p(a,f){f&32&&l!==(l=-a[5]+a[12].bottom+a[12].top)&&h(n,"y2",l),f&256&&o!==(o=`Q.${a[25]}`)&&W(s,o),f&296&&u!==(u=`translate(${a[3](a[25])+0} ${a[5]-a[12].bottom})`)&&h(t,"transform",u)},d(a){a&&N(t)}}}function Mo(e){let t=Number.isInteger(e[25]),n,l=t&&Ao(e);return{c(){l&&l.c(),n=_e()},m(r,o){l&&l.m(r,o),T(r,n,o)},p(r,o){o&256&&(t=Number.isInteger(r[25])),t?l?l.p(r,o):(l=Ao(r),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(r){l&&l.d(r),r&&N(n)}}}function Eo(e,t){let n,l,r,o,s,u,a,f,c;function d(){return t[15](t[24])}function g(){return t[16](t[24])}return{key:e,first:null,c(){n=j("path"),o=j("path"),h(n,"class","model-path-outer svelte-1nna9rx"),h(n,"d",l=t[10](t[20])),h(n,"stroke","white"),h(n,"data-model",r=t[2][t[24]]),h(o,"class","model-path svelte-1nna9rx"),h(o,"d",s=t[10](t[20])),h(o,"role","img"),h(o,"stroke",u=t[11](t[2][t[24]])),h(o,"data-model",a=t[2][t[24]]),this.first=n},m(p,m){T(p,n,m),T(p,o,m),f||(c=[B(o,"mouseover",d),B(o,"focus",g),B(o,"mouseout",pl),B(o,"blur",pl)],f=!0)},p(p,m){t=p,m&1536&&l!==(l=t[10](t[20]))&&h(n,"d",l),m&516&&r!==(r=t[2][t[24]])&&h(n,"data-model",r),m&1536&&s!==(s=t[10](t[20]))&&h(o,"d",s),m&2564&&u!==(u=t[11](t[2][t[24]]))&&h(o,"stroke",u),m&516&&a!==(a=t[2][t[24]])&&h(o,"data-model",a)},d(p){p&&N(n),p&&N(o),f=!1,ge(c)}}}function Fo(e,t){let n,l,r,o,s,u,a=t[20].rank+"",f,c,d,g;return{key:e,first:null,c(){n=j("g"),l=j("circle"),u=j("text"),f=L(a),h(l,"r",r=t[20].answer.length/2*0+12),h(l,"fill",o=t[11](t[20].model)),h(l,"stroke","white"),h(l,"class","model-circle svelte-1nna9rx"),h(l,"role","img"),h(l,"data-model",s=t[20].model),h(u,"class","bump-text svelte-1nna9rx"),h(u,"text-anchor","middle"),h(u,"alignment-baseline","middle"),h(u,"color","white"),h(u,"fill","white"),h(n,"transform",c=`translate(${t[3](t[20].qid)}, ${t[4](t[20].rank)})`),h(n,"class","svelte-1nna9rx"),this.first=n},m(p,m){T(p,n,m),b(n,l),b(n,u),b(u,f),d||(g=[B(l,"mouseover",t[17]),B(l,"focus",t[18]),B(l,"mouseout",pl),B(l,"blur",pl)],d=!0)},p(p,m){t=p,m&128&&r!==(r=t[20].answer.length/2*0+12)&&h(l,"r",r),m&2176&&o!==(o=t[11](t[20].model))&&h(l,"fill",o),m&128&&s!==(s=t[20].model)&&h(l,"data-model",s),m&128&&a!==(a=t[20].rank+"")&&W(f,a),m&152&&c!==(c=`translate(${t[3](t[20].qid)}, ${t[4](t[20].rank)})`)&&h(n,"transform",c)},d(p){p&&N(n),d=!1,ge(g)}}}function ep(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m=[],v=new Map,_,w=[],y=new Map,$,M,k,E,S,R=e[8],C=[];for(let O=0;OO[24];for(let O=0;OO[20].model+O[20].qid;for(let O=0;Oe[19].call(t))},m(O,U){T(O,t,U),b(t,n),b(n,l);for(let G=0;G{e.style.opacity=1})}function tp(e,t,n){let l,r,o,s,u,a,f,c,d,g,p;le(e,tn,S=>n(7,p=S));let m,v,_={top:35,bottom:15,left:10,right:0};function w(S){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(R=>{R.style.opacity=.12}),document.querySelectorAll(`.model-path[data-model="${l[S]}"], .model-circle[data-model="${l[S]}"]`).forEach(R=>{R.style.opacity=1})}const y=S=>w(S),$=S=>w(S),M=()=>w(i),k=()=>w(i);function E(){v=this.offsetWidth,m=this.offsetHeight,n(1,v),n(0,m)}return e.$$.update=()=>{e.$$.dirty&128&&n(2,l=Array.from(new Set(p.map(S=>S.model)))),e.$$.dirty&2&&n(6,r=v-_.left-_.right),e.$$.dirty&1&&n(5,o=m-_.top-_.bottom),e.$$.dirty&192&&n(3,s=Mi().domain(p.map(S=>S.qid)).padding(.3).range([_.left,r-_.right])),e.$$.dirty&128&&n(14,u=p.map(S=>S.rank).sort((S,R)=>S-R)),e.$$.dirty&16416&&n(4,a=Mi().domain(u).padding(1).range([_.top,o-_.bottom])),e.$$.dirty&128&&n(11,f=$t().domain(p.map(S=>S.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"])),e.$$.dirty&24&&n(10,c=Zh().x(S=>s(S.qid)).y(S=>a(S.rank))),e.$$.dirty&132&&n(9,d=l.map(S=>p.filter(R=>R.model===S))),e.$$.dirty&8&&n(8,g=s.domain().length>10?s.domain().filter((S,R)=>R%2===0):s.domain())},[m,v,l,s,a,o,r,p,g,d,c,f,_,w,u,y,$,M,k,E]}class np extends ie{constructor(t){super(),oe(this,t,tp,ep,re,{})}}function Do(e,t,n){const l=e.slice();return l[13]=t[n],l[15]=n,l}function Io(e,t,n){const l=e.slice();return l[16]=t[n],l}function No(e,t,n){const l=e.slice();return l[16]=t[n],l}function Po(e){let t,n,l=e[16]+"",r,o;return{c(){t=j("g"),n=j("text"),r=L(l),h(n,"class","axis-text svelte-1y9gffu"),h(n,"x","-5"),h(n,"y","0"),h(n,"text-anchor","end"),h(t,"transform",o=`translate(${e[9].left} ${e[8](e[16])+e[8].bandwidth()/2})`)},m(s,u){T(s,t,u),b(t,n),b(n,r)},p(s,u){u&4&&l!==(l=s[16]+"")&&W(r,l),u&260&&o!==(o=`translate(${s[9].left} ${s[8](s[16])+s[8].bandwidth()/2})`)&&h(t,"transform",o)},d(s){s&&N(t)}}}function To(e){let t,n,l=e[16]+"",r,o;return{c(){t=j("g"),n=j("text"),r=L(l),h(n,"class","axis-text svelte-1y9gffu"),h(n,"y","15"),h(n,"text-anchor","middle"),h(t,"transform",o=`translate(${e[7](e[16])}, ${e[4]-e[9].bottom})`)},m(s,u){T(s,t,u),b(t,n),b(n,r)},p(s,u){u&128&&l!==(l=s[16]+"")&&W(r,l),u&144&&o!==(o=`translate(${s[7](s[16])}, ${s[4]-s[9].bottom})`)&&h(t,"transform",o)},d(s){s&&N(t)}}}function Oo(e){let t,n=e[16]%2==0&&To(e);return{c(){n&&n.c(),t=_e()},m(l,r){n&&n.m(l,r),T(l,t,r)},p(l,r){l[16]%2==0?n?n.p(l,r):(n=To(l),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(l){n&&n.d(l),l&&N(t)}}}function Vo(e){let t,n,l,r,o,s,u,a=e[13].avgRank.toFixed(2)+"",f,c,d;return{c(){t=j("rect"),u=j("text"),f=L(a),h(t,"y",n=e[8](e[13].model)),h(t,"x",e[9].left),h(t,"width",l=e[7](e[13].avgRank)-e[9].left),h(t,"height",r=e[8].bandwidth()),h(t,"fill",o=e[6](e[13].model)),h(t,"class","model-path"),h(t,"data-model",s=e[5][e[15]]),h(u,"class","label-text svelte-1y9gffu"),h(u,"y",c=e[8](e[13].model)+e[8].bandwidth()/2),h(u,"x",d=e[7](e[13].avgRank)+5),h(u,"text-anchor","start"),h(u,"dominant-baseline","middle")},m(g,p){T(g,t,p),T(g,u,p),b(u,f)},p(g,p){p&260&&n!==(n=g[8](g[13].model))&&h(t,"y",n),p&132&&l!==(l=g[7](g[13].avgRank)-g[9].left)&&h(t,"width",l),p&256&&r!==(r=g[8].bandwidth())&&h(t,"height",r),p&68&&o!==(o=g[6](g[13].model))&&h(t,"fill",o),p&32&&s!==(s=g[5][g[15]])&&h(t,"data-model",s),p&4&&a!==(a=g[13].avgRank.toFixed(2)+"")&&W(f,a),p&260&&c!==(c=g[8](g[13].model)+g[8].bandwidth()/2)&&h(u,"y",c),p&132&&d!==(d=g[7](g[13].avgRank)+5)&&h(u,"x",d)},d(g){g&&N(t),g&&N(u)}}}function lp(e){let t,n,l,r,o,s,u,a,f,c,d,g,p=e[2].map(zo),m=[];for(let $=0;$e[12].call(t))},m($,M){T($,t,M),b(t,n);for(let k=0;ke.model;function rp(e,t,n){let l,r,o,s,u,a,f,c,d;le(e,tn,_=>n(11,d=_));let g=300,p=500,m={top:50,bottom:0,left:100,right:0};function v(){p=this.offsetWidth,g=this.offsetHeight,n(1,p),n(0,g)}return e.$$.update=()=>{e.$$.dirty&2048&&n(10,l=d.reduce((_,w)=>(_[w.model]?(_[w.model].sum+=w.rank,_[w.model].count++):_[w.model]={sum:w.rank,count:1},_),{})),e.$$.dirty&1024&&n(2,r=Object.keys(l).map(_=>({model:_,avgRank:l[_].sum/l[_].count}))),e.$$.dirty&2&&n(3,o=p-m.left-m.right),e.$$.dirty&1&&n(4,s=g-m.top-m.bottom),e.$$.dirty&20&&n(8,u=Vt().rangeRound([m.top,s-m.bottom]).padding(.05).domain(r.map(_=>_.model))),e.$$.dirty&12&&n(7,a=Ge().rangeRound([m.left,o-m.right]).domain([0,ht(r,_=>_.avgRank)])),e.$$.dirty&4&&n(6,f=$t().domain(r.map(_=>_.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$$.dirty&2048&&n(5,c=Array.from(new Set(d.map(_=>_.model))))},[g,p,r,o,s,c,f,a,u,m,l,d,v]}class ip extends ie{constructor(t){super(),oe(this,t,rp,lp,re,{})}}function Ho(e,t,n){const l=e.slice();return l[20]=t[n],l[22]=n,l}function qo(e,t,n){const l=e.slice();return l[23]=t[n],l[25]=n,l}function Lo(e,t,n){const l=e.slice();return l[23]=t[n],l}function jo(e){let t,n=e[23].key+"",l,r,o;function s(){return e[10](e[23])}return{c(){t=A("th"),l=L(n),h(t,"class","svelte-owgjbp")},m(u,a){T(u,t,a),b(t,l),r||(o=B(t,"click",s),r=!0)},p(u,a){e=u,a&64&&n!==(n=e[23].key+"")&&W(l,n)},d(u){u&&N(t),r=!1,o()}}}function xo(e,t){let n,l=(t[20][t[23].key].length>Bo&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"",r,o,s,u;function a(){return t[11](t[22],t[25])}return{key:e,first:null,c(){n=A("td"),r=L(l),h(n,"class",o="cell-type-"+t[23].type+" svelte-owgjbp"),ye(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),It(n,"active",t[4]===`${t[22]}-${t[25]}`),this.first=n},m(f,c){T(f,n,c),b(n,r),s||(u=B(n,"click",a),s=!0)},p(f,c){t=f,c&112&&l!==(l=(t[20][t[23].key].length>Bo&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"")&&W(r,l),c&64&&o!==(o="cell-type-"+t[23].type+" svelte-owgjbp")&&h(n,"class",o),c&96&&ye(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),c&80&&It(n,"active",t[4]===`${t[22]}-${t[25]}`)},d(f){f&&N(n),s=!1,u()}}}function Go(e){let t,n=[],l=new Map,r,o=e[6];const s=u=>u[23].key;for(let u=0;un(9,s=M));let u={};const a=pt(".2f");function f(M){let k=M.reduce((S,R)=>(S[R.model]||(S[R.model]=[]),S[R.model].push(R.rank),S),{});return Object.entries(k).map(([S,R])=>{let C=R.reduce((I,D)=>(I[D]=(I[D]||0)+1,I),{}),F=Object.entries(C).reduce((I,D)=>D[1]>I[1]?D:I)[0];return{model:S,overall_rank:Number(F),average_rank:a(Jd(R)),standard_deviation_rank:a(Vd(R))}})}u={...{columns:{},style:"normal",paged:25},...u};const d=Ge().domain([-1,0,1]).range(["#FF5470","#f8f8f8","#00ebc7"]);let{sortable:g,index:p,paged:m}=u,v,_=!0;if(g&&p)throw new Error("A table can either be ranked or sortable, but not both");p=1,g=1;let w=null;const y=M=>{g&&(v===M.key&&n(2,_=!_),n(1,v=M.key))},$=(M,k)=>{n(4,w=w===`${M}-${k}`?null:`${M}-${k}`)};return e.$$.update=()=>{if(e.$$.dirty&512,e.$$.dirty&512&&n(8,l=f(s)),e.$$.dirty&774){v&&n(8,l=l.slice().sort((k,E)=>{let S=k[v],R=E[v];if(S==R)return JSON.stringify(k).localeCompare(JSON.stringify(E));let C=S>R?1:S{const k=u.columns[M]||{};return{key:M,type:k.type||typeof l[0][M],options:k}}))},n(5,o=[]),[u,v,_,g,w,o,r,d,l,s,y,$]}let up=class extends ie{constructor(t){super(),oe(this,t,ap,op,re,{})}};function Uo(e,t,n){const l=e.slice();return l[19]=t[n],l}function Wo(e,t,n){const l=e.slice();return l[22]=t[n],l}function Xo(e,t,n){const l=e.slice();return l[25]=t[n],l[27]=n,l}function Yo(e){let t,n=e[25]+"",l,r,o,s=e[25]+"",u,a;return{c(){t=j("text"),l=L(n),o=j("text"),u=L(s),h(t,"class","axis-text svelte-t6wv8i"),h(t,"x",r=e[7].left+e[5](e[25])+e[5].bandwidth()/2),h(t,"y",e[7].top-10),h(t,"text-anchor","middle"),h(o,"class","axis-text svelte-t6wv8i"),h(o,"x",e[7].left-10),h(o,"y",a=e[7].top+e[4](e[25])+e[4].bandwidth()/2),h(o,"text-anchor","end"),h(o,"dominant-baseline","middle")},m(f,c){T(f,t,c),b(t,l),T(f,o,c),b(o,u)},p(f,c){c&8&&n!==(n=f[25]+"")&&W(l,n),c&40&&r!==(r=f[7].left+f[5](f[25])+f[5].bandwidth()/2)&&h(t,"x",r),c&8&&s!==(s=f[25]+"")&&W(u,s),c&24&&a!==(a=f[7].top+f[4](f[25])+f[4].bandwidth()/2)&&h(o,"y",a)},d(f){f&&N(t),f&&N(o)}}}function Qo(e){let t,n,l,r,o,s,u,a,f=e[6](e[2][e[19]][e[22]])+"",c,d,g,p;return{c(){t=j("rect"),a=j("text"),c=L(f),h(t,"x",n=e[7].left+e[5](e[22])),h(t,"y",l=e[7].top+e[4](e[19])),h(t,"width",r=e[5].bandwidth()),h(t,"height",o=e[4].bandwidth()),h(t,"fill",s=e[8](e[19],e[22])),h(t,"rx","4"),h(t,"ry","4"),h(t,"class","model-path"),h(t,"data-model",u=e[19]),h(a,"x",d=e[7].left+e[5](e[22])+e[5].bandwidth()/2),h(a,"y",g=e[7].top+e[4](e[19])+e[4].bandwidth()/2),h(a,"text-anchor","middle"),h(a,"dominant-baseline","middle"),h(a,"class","model-path"),h(a,"data-model",p=e[19])},m(m,v){T(m,t,v),T(m,a,v),b(a,c)},p(m,v){v&40&&n!==(n=m[7].left+m[5](m[22]))&&h(t,"x",n),v&24&&l!==(l=m[7].top+m[4](m[19]))&&h(t,"y",l),v&32&&r!==(r=m[5].bandwidth())&&h(t,"width",r),v&16&&o!==(o=m[4].bandwidth())&&h(t,"height",o),v&8&&s!==(s=m[8](m[19],m[22]))&&h(t,"fill",s),v&8&&u!==(u=m[19])&&h(t,"data-model",u),v&12&&f!==(f=m[6](m[2][m[19]][m[22]])+"")&&W(c,f),v&40&&d!==(d=m[7].left+m[5](m[22])+m[5].bandwidth()/2)&&h(a,"x",d),v&24&&g!==(g=m[7].top+m[4](m[19])+m[4].bandwidth()/2)&&h(a,"y",g),v&8&&p!==(p=m[19])&&h(a,"data-model",p)},d(m){m&&N(t),m&&N(a)}}}function Ko(e){let t,n=e[3],l=[];for(let r=0;re[16].call(t))},m(g,p){T(g,t,p),b(t,n);for(let m=0;mn(15,p=k));const m=pt(".1f");function v(k){let E=k.reduce((C,F)=>(C[F.qid]||(C[F.qid]=[]),C[F.qid].push(F),C),{}),S=Array.from(new Set(k.map(C=>C.model))),R=S.reduce((C,F)=>(C[F]=S.reduce((I,D)=>(I[D]={sum:0,count:0},I),{}),C),{});for(let C in E){let F=E[C];for(let I of S)for(let D of S){let z=F.find(U=>U.model===I),O=F.find(U=>U.model===D);z&&O&&(R[I][D].sum+=O.rank-z.rank,R[I][D].count++)}}for(let C in R)for(let F in R[C])R[C][F].count>0?R[C][F]=R[C][F].sum/R[C][F].count:R[C][F]=0;return R}let _=500,w=500,y={top:50,bottom:0,left:65,right:25};function $(k,E){let S=l[k][E];return S===0?"white":S>=0?g(k):g(E)}function M(){w=this.offsetWidth,_=this.offsetHeight,n(1,w),n(0,_)}return e.$$.update=()=>{e.$$.dirty&32768&&n(2,l=v(p)),e.$$.dirty&32768&&n(3,r=Array.from(new Set(p.map(k=>k.model)))),e.$$.dirty&2&&n(14,o=w-y.left-y.right),e.$$.dirty&1&&n(13,s=_-y.top-y.bottom),e.$$.dirty&16392&&n(5,u=Vt().range([0,o]).domain(r).padding(.05)),e.$$.dirty&8200&&n(4,a=Vt().range([0,s]).domain(r).padding(.05)),e.$$.dirty&4&&n(12,f=Object.values(l).flatMap(k=>Object.values(k))),e.$$.dirty&4096&&n(11,c=lr(f)),e.$$.dirty&4096&&n(10,d=ht(f)),e.$$.dirty&8&&n(9,g=$t().domain(r).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$$.dirty&3592&&r.reduce((k,E)=>(k[E]=Ra().domain([c,d]).interpolator(ir("white",g(E))),k),{})},[_,w,l,r,a,u,m,y,$,g,d,c,f,s,o,p,M]}class dp extends ie{constructor(t){super(),oe(this,t,cp,fp,re,{})}}function Jo(e,t,n){const l=e.slice();return l[7]=t[n],l[9]=n,l}function hp(e){let t;return{c(){t=A("div"),t.innerHTML="
To view the comparison dashboard, you must first rank some comparisons!
",h(t,"class","holder svelte-7imt18")},m(n,l){T(n,t,l)},p:x,i:x,o:x,d(n){n&&N(t)}}}function gp(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m,v,_,w,y,$,M,k,E=e[1],S=[];for(let R=0;R0?0:1}return n=u(e),l=s[n]=o[n](e),{c(){t=A("div"),l.c(),h(t,"class","main-container svelte-7imt18")},m(a,f){T(a,t,f),s[n].m(t,null),r=!0},p(a,[f]){let c=n;n=u(a),n===c?s[n].p(a,f):(ce(),H(s[c],1,1,()=>{s[c]=null}),de(),l=s[n],l?l.p(a,f):(l=s[n]=o[n](a),l.c()),V(l,1),l.m(t,null))},i(a){r||(V(l),r=!0)},o(a){H(l),r=!1},d(a){a&&N(t),s[n].d()}}}function es(){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(e=>{e.style.opacity=1})}function mp(e,t,n){let l,r,o;le(e,tn,c=>n(0,o=c));async function s(){const d=await(await fetch("/chat/comparator/db/retrieve")).json();console.log("uploooo",d);const p=d.data.map(m=>({model:m.model,answer:m.answer,qid:parseInt(m.qid),rank:parseInt(m.rank)}));Ne(tn,o=[...p],o)}st(()=>{s()});function u(c){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(d=>{d.style.opacity=.12}),document.querySelectorAll(`.model-path[data-model="${l[c]}"], .model-circle[data-model="${l[c]}"]`).forEach(d=>{d.style.opacity=1})}const a=c=>u(c),f=c=>u(c);return e.$$.update=()=>{e.$$.dirty&1&&n(1,l=Array.from(new Set(o.map(c=>c.model)))),e.$$.dirty&1&&n(2,r=$t().domain(o.map(c=>c.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"]))},[o,l,r,u,a,f]}class _p extends ie{constructor(t){super(),oe(this,t,mp,pp,re,{})}}function vp(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Ka(this.cover(t,n),t,n,e)}function Ka(e,t,n,l){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:l},u=e._x0,a=e._y0,f=e._x1,c=e._y1,d,g,p,m,v,_,w,y;if(!o)return e._root=s,e;for(;o.length;)if((v=t>=(d=(u+f)/2))?u=d:f=d,(_=n>=(g=(a+c)/2))?a=g:c=g,r=o,!(o=o[w=_<<1|v]))return r[w]=s,e;if(p=+e._x.call(null,o.data),m=+e._y.call(null,o.data),t===p&&n===m)return s.next=o,r?r[w]=s:e._root=s,e;do r=r?r[w]=new Array(4):e._root=new Array(4),(v=t>=(d=(u+f)/2))?u=d:f=d,(_=n>=(g=(a+c)/2))?a=g:c=g;while((w=_<<1|v)===(y=(m>=g)<<1|p>=d));return r[y]=o,r[w]=s,e}function bp(e){var t,n,l=e.length,r,o,s=new Array(l),u=new Array(l),a=1/0,f=1/0,c=-1/0,d=-1/0;for(n=0;nc&&(c=r),od&&(d=o));if(a>c||f>d)return this;for(this.cover(a,f).cover(c,d),n=0;ne||e>=r||l>t||t>=o;)switch(f=(tc||(u=m.y0)>d||(a=m.x1)=w)<<1|e>=_)&&(m=g[g.length-1],g[g.length-1]=g[g.length-1-v],g[g.length-1-v]=m)}else{var y=e-+this._x.call(null,p.data),$=t-+this._y.call(null,p.data),M=y*y+$*$;if(M=(g=(s+a)/2))?s=g:a=g,(v=d>=(p=(u+f)/2))?u=p:f=p,t=n,!(n=n[_=v<<1|m]))return this;if(!n.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(l=t,w=_)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[_]=o:delete t[_],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(l?l[w]=n:this._root=n),this):(this._root=o,this)}function $p(e){for(var t=0,n=e.length;tg.index){var I=p-R.x-R.vx,D=m-R.y-R.vy,z=I*I+D*D;zp+F||Em+F||Sf.r&&(f.r=f[c].r)}function a(){if(t){var f,c=t.length,d;for(n=new Array(c),f=0;f{}};function Za(){for(var e=0,t=arguments.length,n={},l;e=0&&(l=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:l}})}Kn.prototype=Za.prototype={constructor:Kn,on:function(e,t){var n=this._,l=zp(e+"",n),r,o=-1,s=l.length;if(arguments.length<2){for(;++o0)for(var n=new Array(r),l=0,r,o;l=0&&e._call.call(void 0,t),e=e._next;--nn}function rs(){zt=(_l=An.now())+Cl,nn=dn=0;try{Lp()}finally{nn=0,xp(),zt=0}}function jp(){var e=An.now(),t=e-_l;t>eu&&(Cl-=t,_l=e)}function xp(){for(var e,t=ml,n,l=1/0;t;)t._call?(l>t._time&&(l=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ml=n);hn=e,_r(l)}function _r(e){if(!nn){dn&&(dn=clearTimeout(dn));var t=e-zt;t>24?(e<1/0&&(dn=setTimeout(rs,e-An.now()-Cl)),sn&&(sn=clearInterval(sn))):(sn||(_l=An.now(),sn=setInterval(jp,eu)),nn=1,tu(rs))}}const Gp=1664525,Bp=1013904223,is=4294967296;function Up(){let e=1;return()=>(e=(Gp*e+Bp)%is)/is}var Wp=10,Xp=Math.PI*(3-Math.sqrt(5));function Yp(e){var t,n=1,l=.001,r=1-Math.pow(l,1/300),o=0,s=.6,u=new Map,a=lu(d),f=Za("tick","end"),c=Up();e==null&&(e=[]);function d(){g(),f.call("tick",t),n1?(_==null?u.delete(v):u.set(v,m(_)),t):u.get(v)},find:function(v,_,w){var y=0,$=e.length,M,k,E,S,R;for(w==null?w=1/0:w*=w,y=0;y<$;++y)S=e[y],M=v-S.x,k=_-S.y,E=M*M+k*k,E1?(f.on(v,_),t):f.on(v)}}}function Qp(e){var t=et(.1),n,l,r;typeof e!="function"&&(e=et(e==null?0:+e));function o(u){for(var a=0,f=n.length,c;ae[4]?1:0),h(t,"class",p="file-circle-g "+(e[20].size>e[4]?"large":"")+" svelte-h2ab3o"),h(t,"style",m=e[5](e[20].x,e[20].y)),h(t,"role","img")},m(y,$){T(y,t,$),b(t,n),b(t,o),b(o,u),b(o,a),b(a,c),v=!0,_||(w=[B(t,"mouseover",e[6]),B(t,"mouseout",e[7]),B(t,"focus",e[6]),B(t,"blur",e[7])],_=!0)},p(y,$){(!v||$&12&&l!==(l=y[3](y[20].size)))&&h(n,"r",l),(!v||$&4)&&s!==(s=y[20].file+"")&&W(u,s),(!v||$&4)&&f!==(f=nr(y[20].size)+"")&&W(c,f),(!v||$&20&&d!==(d=y[20].size>y[4]?1:0))&&h(o,"opacity",d),(!v||$&20&&p!==(p="file-circle-g "+(y[20].size>y[4]?"large":"")+" svelte-h2ab3o"))&&h(t,"class",p),(!v||$&4&&m!==(m=y[5](y[20].x,y[20].y)))&&h(t,"style",m)},i(y){v||(y&&ke(()=>{v&&(r||(r=Ze(n,Pn,{duration:1e3},!0)),r.run(1))}),y&&ke(()=>{v&&(g||(g=Ze(o,Pn,{duration:1e3},!0)),g.run(1))}),v=!0)},o(y){y&&(r||(r=Ze(n,Pn,{duration:1e3},!1)),r.run(0)),y&&(g||(g=Ze(o,Pn,{duration:1e3},!1)),g.run(0)),v=!1},d(y){y&&N(t),y&&r&&r.end(),y&&g&&g.end(),_=!1,ge(w)}}}function Jp(e){let t,n,l,r,o=e[2],s=[];for(let a=0;aH(s[a],1,1,()=>{s[a]=null});return{c(){t=A("div"),n=j("svg");for(let a=0;ae[15].call(t))},m(a,f){T(a,t,f),b(t,n);for(let c=0;cn(14,c=k));let d=600,g=350,p=!0,m=!1;const v=(k,E)=>`transform: translate(${k}px, ${E}px)`,_=[-4,4],w=[-1,1];function y(){n(8,p=!0),n(9,m=!0);const k=dt(this);Fl(".file-circle-g").select("text").style("opacity",0),k.raise(),k.select("circle").attr("fill","var(--red)"),k.select("text").style("opacity",1)}const $=()=>{const k=Fl(".file-circle-g");k.select("circle").attr("fill","var(--yellow)"),k.select("text").style("opacity",0),n(9,m=!1),setTimeout(()=>{n(8,p=!1)},1e3)};function M(){d=this.offsetWidth,g=this.offsetHeight,n(0,d),n(1,g)}return e.$$.update=()=>{e.$$.dirty&16387&&n(2,l=c.map(k=>({...k,x:d/2,y:g/2,tickCount:0}))),e.$$.dirty&16384&&console.log(c.map(k=>k.size).sort((k,E)=>k-E)),e.$$.dirty&1&&n(13,r=Qp().x(d/2)),e.$$.dirty&2&&n(12,o=Kp().y(g/2)),e.$$.dirty&16384&&n(3,a=Ge().domain(gn(c,k=>k.size)).range([12,60])),e.$$.dirty&8&&n(10,s=Op().radius(k=>a(k.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,u=Kd(c.map(k=>k.size).sort((k,E)=>k-E),.85)),e.$$.dirty&1&&Ge().domain(_).range([5,d]),e.$$.dirty&2&&Ge().domain(w).range([g,5]),e.$$.dirty&4&&n(11,f=Yp().nodes(l).on("tick",()=>{n(2,l=[...l])})),e.$$.dirty&15360&&(f.force("x",r),f.force("y",o),f.force("collide",s),f.alpha(.02),f.restart()),e.$$.dirty&19468&&(a.domain(gn(c,k=>k.size)),l.forEach(k=>k.radius=a(k.size)),f.nodes(l),s.radius(k=>k.radius+.5)),e.$$.dirty&768&&p===!1&&(m||Fl(".large").select("text").style("opacity",1))},[d,g,l,a,u,v,y,$,p,m,s,f,o,r,c,M]}class em extends ie{constructor(t){super(),oe(this,t,Zp,Jp,re,{})}}/** + * 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 kt(e,t){return typeof e=="function"?e(t):e}function Ue(e,t){return n=>{t.setState(l=>({...l,[e]:kt(n,l[e])}))}}function bl(e){return e instanceof Function}function tm(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function nm(e,t){const n=[],l=r=>{r.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&l(s)})};return l(e),n}function Q(e,t,n){let l=[],r;return()=>{let o;n.key&&n.debug&&(o=Date.now());const s=e();if(!(s.length!==l.length||s.some((f,c)=>l[c]!==f)))return r;l=s;let a;if(n.key&&n.debug&&(a=Date.now()),r=t(...s),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-o)*100)/100,c=Math.round((Date.now()-a)*100)/100,d=c/16,g=(p,m)=>{for(p=String(p);p.length{let p=g;for(const v of a.split(".")){var m;p=(m=p)==null?void 0:m[v]}return p}:c=g=>g[u.accessorKey]),!f)throw new Error;let d={id:`${String(f)}`,accessorFn:c,parent:l,depth:n,columnDef:u,columns:[],getFlatColumns:Q(()=>[!0],()=>{var g;return[d,...(g=d.columns)==null?void 0:g.flatMap(p=>p.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}}),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],g=>{var p;if((p=d.columns)!=null&&p.length){let m=d.columns.flatMap(v=>v.getLeafColumns());return g(m)}return[d]},{key:"column.getLeafColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}})};return d=e._features.reduce((g,p)=>Object.assign(g,p.createColumn==null?void 0:p.createColumn(d,e)),d),d}function us(e,t,n){var l;let o={id:(l=n.id)!=null?l: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 s=[],u=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(u),s.push(a)};return u(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{Object.assign(o,s.createHeader==null?void 0:s.createHeader(o,e))}),o}const rm={createTable:e=>({getHeaderGroups:Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,l,r)=>{var o,s;const u=(o=l==null?void 0:l.map(d=>n.find(g=>g.id===d)).filter(Boolean))!=null?o:[],a=(s=r==null?void 0:r.map(d=>n.find(g=>g.id===d)).filter(Boolean))!=null?s:[],f=n.filter(d=>!(l!=null&&l.includes(d.id))&&!(r!=null&&r.includes(d.id)));return jn(t,[...u,...f,...a],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,l,r)=>(n=n.filter(o=>!(l!=null&&l.includes(o.id))&&!(r!=null&&r.includes(o.id))),jn(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,l)=>{var r;const o=(r=l==null?void 0:l.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?r:[];return jn(t,o,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,l)=>{var r;const o=(r=l==null?void 0:l.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?r:[];return jn(t,o,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 l;return!((l=n.subHeaders)!=null&&l.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 l;return!((l=n.subHeaders)!=null&&l.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 l;return!((l=n.subHeaders)!=null&&l.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,l)=>{var r,o,s,u,a,f;return[...(r=(o=t[0])==null?void 0:o.headers)!=null?r:[],...(s=(u=n[0])==null?void 0:u.headers)!=null?s:[],...(a=(f=l[0])==null?void 0:f.headers)!=null?a:[]].map(c=>c.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function jn(e,t,n,l){var r,o;let s=0;const u=function(g,p){p===void 0&&(p=1),s=Math.max(s,p),g.filter(m=>m.getIsVisible()).forEach(m=>{var v;(v=m.columns)!=null&&v.length&&u(m.columns,p+1)},0)};u(e);let a=[];const f=(g,p)=>{const m={depth:p,id:[l,`${p}`].filter(Boolean).join("_"),headers:[]},v=[];g.forEach(_=>{const w=[...v].reverse()[0],y=_.column.depth===m.depth;let $,M=!1;if(y&&_.column.parent?$=_.column.parent:($=_.column,M=!0),w&&(w==null?void 0:w.column)===$)w.subHeaders.push(_);else{const k=us(n,$,{id:[l,p,$.id,_==null?void 0:_.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${v.filter(E=>E.column===$).length}`:void 0,depth:p,index:v.length});k.subHeaders.push(_),v.push(k)}m.headers.push(_),_.headerGroup=m}),a.push(m),p>0&&f(v,p-1)},c=t.map((g,p)=>us(n,g,{depth:s,index:p}));f(c,s-1),a.reverse();const d=g=>g.filter(m=>m.column.getIsVisible()).map(m=>{let v=0,_=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],d(m.subHeaders).forEach($=>{let{colSpan:M,rowSpan:k}=$;v+=M,w.push(k)})):v=1;const y=Math.min(...w);return _=_+y,m.colSpan=v,m.rowSpan=_,{colSpan:v,rowSpan:_}});return d((r=(o=a[0])==null?void 0:o.headers)!=null?r:[]),a}const xn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},xl=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),im={getDefaultColumnDef:()=>xn,getInitialState:e=>({columnSizing:{},columnSizingInfo:xl(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:Ue("columnSizing",e),onColumnSizingInfoChange:Ue("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,l,r;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:xn.minSize,(l=o??e.columnDef.size)!=null?l:xn.size),(r=e.columnDef.maxSize)!=null?r:xn.maxSize)},getStart:n=>{const l=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),r=l.findIndex(o=>o.id===e.id);if(r>0){const o=l[r-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:l,...r}=n;return r})},getCanResize:()=>{var n,l;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((l=t.options.enableColumnResizing)!=null?l:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const l=r=>{if(r.subHeaders.length)r.subHeaders.forEach(l);else{var o;n+=(o=r.column.getSize())!=null?o:0}};return l(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),l=n==null?void 0:n.getCanResize();return r=>{if(!n||!l||(r.persist==null||r.persist(),Gl(r)&&r.touches&&r.touches.length>1))return;const o=e.getSize(),s=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[n.id,n.getSize()]],u=Gl(r)?Math.round(r.touches[0].clientX):r.clientX,a={},f=(v,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(w=>{var y,$;const M=_-((y=w==null?void 0:w.startOffset)!=null?y:0),k=Math.max(M/(($=w==null?void 0:w.startSize)!=null?$:0),-.999999);return w.columnSizingStart.forEach(E=>{let[S,R]=E;a[S]=Math.round(Math.max(R+R*k,0)*100)/100}),{...w,deltaOffset:M,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(w=>({...w,...a})))},c=v=>f("move",v),d=v=>{f("end",v),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g={moveHandler:v=>c(v.clientX),upHandler:v=>{document.removeEventListener("mousemove",g.moveHandler),document.removeEventListener("mouseup",g.upHandler),d(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),c(v.touches[0].clientX),!1),upHandler:v=>{var _;document.removeEventListener("touchmove",p.moveHandler),document.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),d((_=v.touches[0])==null?void 0:_.clientX)}},m=om()?{passive:!1}:!1;Gl(r)?(document.addEventListener("touchmove",p.moveHandler,m),document.addEventListener("touchend",p.upHandler,m)):(document.addEventListener("mousemove",g.moveHandler,m),document.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(v=>({...v,startOffset:u,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,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?xl():(n=e.initialState.columnSizingInfo)!=null?n:xl())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((l,r)=>l+r.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((l,r)=>l+r.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((l,r)=>l+r.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((l,r)=>l+r.getSize(),0))!=null?t:0}})};let Gn=null;function om(){if(typeof Gn=="boolean")return Gn;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 Gn=e,Gn}function Gl(e){return e.type==="touchstart"}const sm={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ue("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var l,r;if(!t){e._queue(()=>{t=!0});return}if((l=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:l=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(l),toggleAllRowsExpanded:l=>{l??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:l=>{var r,o;e.setExpanded(l?{}:(r=(o=e.initialState)==null?void 0:o.expanded)!=null?r:{})},getCanSomeRowsExpand:()=>e.getPrePaginationRowModel().flatRows.some(l=>l.getCanExpand()),getToggleAllRowsExpandedHandler:()=>l=>{l.persist==null||l.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const l=e.getState().expanded;return l===!0||Object.values(l).some(Boolean)},getIsAllRowsExpanded:()=>{const l=e.getState().expanded;return typeof l=="boolean"?l===!0:!(!Object.keys(l).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},getExpandedDepth:()=>{let l=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");l=Math.max(l,s.length)}),l},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(l=>{var r;const o=l===!0?!0:!!(l!=null&&l[e.id]);let s={};if(l===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{s[u]=!0}):s=l,n=(r=n)!=null?r:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:u,...a}=s;return a}return l})},getIsExpanded:()=>{var n;const l=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:l===!0||l!=null&&l[e.id])},getCanExpand:()=>{var n,l,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((l=t.options.enableExpanding)!=null?l:!0)&&!!((r=e.subRows)!=null&&r.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},ru=(e,t,n)=>{var l,r,o;const s=n.toLowerCase();return!!(!((l=e.getValue(t))==null||(r=l.toString())==null||(o=r.toLowerCase())==null)&&o.includes(s))};ru.autoRemove=e=>Ye(e);const iu=(e,t,n)=>{var l,r;return!!(!((l=e.getValue(t))==null||(r=l.toString())==null)&&r.includes(n))};iu.autoRemove=e=>Ye(e);const ou=(e,t,n)=>{var l,r;return((l=e.getValue(t))==null||(r=l.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};ou.autoRemove=e=>Ye(e);const su=(e,t,n)=>{var l;return(l=e.getValue(t))==null?void 0:l.includes(n)};su.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const au=(e,t,n)=>!n.some(l=>{var r;return!((r=e.getValue(t))!=null&&r.includes(l))});au.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const uu=(e,t,n)=>n.some(l=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(l)});uu.autoRemove=e=>Ye(e)||!(e!=null&&e.length);const fu=(e,t,n)=>e.getValue(t)===n;fu.autoRemove=e=>Ye(e);const cu=(e,t,n)=>e.getValue(t)==n;cu.autoRemove=e=>Ye(e);const Or=(e,t,n)=>{let[l,r]=n;const o=e.getValue(t);return o>=l&&o<=r};Or.resolveFilterValue=e=>{let[t,n]=e,l=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(l)?-1/0:l,s=n===null||Number.isNaN(r)?1/0:r;if(o>s){const u=o;o=s,s=u}return[o,s]};Or.autoRemove=e=>Ye(e)||Ye(e[0])&&Ye(e[1]);const at={includesString:ru,includesStringSensitive:iu,equalsString:ou,arrIncludes:su,arrIncludesAll:au,arrIncludesSome:uu,equals:fu,weakEquals:cu,inNumberRange:Or};function Ye(e){return e==null||e===""}const am={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ue("columnFilters",e),onGlobalFilterChange:Ue("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,l;const r=(n=e.getCoreRowModel().flatRows[0])==null||(l=n._getAllCellsByColumnId()[t.id])==null?void 0:l.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],l=n==null?void 0:n.getValue(e.id);return typeof l=="string"?at.includesString:typeof l=="number"?at.inNumberRange:typeof l=="boolean"||l!==null&&typeof l=="object"?at.equals:Array.isArray(l)?at.arrIncludes:at.weakEquals},getFilterFn:()=>{var n,l;return bl(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(l=t.options.filterFns)==null?void 0:l[e.columnDef.filterFn])!=null?n:at[e.columnDef.filterFn]},getCanFilter:()=>{var n,l,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((l=t.options.enableColumnFilters)!=null?l:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,l,r,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((l=t.options.enableGlobalFilter)!=null?l:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,l;return(n=t.getState().columnFilters)==null||(l=n.find(r=>r.id===e.id))==null?void 0:l.value},getFilterIndex:()=>{var n,l;return(n=(l=t.getState().columnFilters)==null?void 0:l.findIndex(r=>r.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(l=>{const r=e.getFilterFn(),o=l==null?void 0:l.find(c=>c.id===e.id),s=kt(n,o?o.value:void 0);if(fs(r,s,e)){var u;return(u=l==null?void 0:l.filter(c=>c.id!==e.id))!=null?u:[]}const a={id:e.id,value:s};if(o){var f;return(f=l==null?void 0:l.map(c=>c.id===e.id?a:c))!=null?f:[]}return l!=null&&l.length?[...l,a]:[a]})},_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:()=>at.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:l}=e.options;return bl(l)?l:l==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[l])!=null?t:at[l]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),l=r=>{var o;return(o=kt(t,r))==null?void 0:o.filter(s=>{const u=n.find(a=>a.id===s.id);if(u){const a=u.getFilterFn();if(fs(a,s.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(l)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,l;e.setColumnFilters(t?[]:(n=(l=e.initialState)==null?void 0:l.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 fs(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const um=(e,t,n)=>n.reduce((l,r)=>{const o=r.getValue(e);return l+(typeof o=="number"?o:0)},0),fm=(e,t,n)=>{let l;return n.forEach(r=>{const o=r.getValue(e);o!=null&&(l>o||l===void 0&&o>=o)&&(l=o)}),l},cm=(e,t,n)=>{let l;return n.forEach(r=>{const o=r.getValue(e);o!=null&&(l=o)&&(l=o)}),l},dm=(e,t,n)=>{let l,r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(l===void 0?s>=s&&(l=r=s):(l>s&&(l=s),r{let n=0,l=0;if(t.forEach(r=>{let o=r.getValue(e);o!=null&&(o=+o)>=o&&(++n,l+=o)}),n)return l/n},gm=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!tm(n))return;if(n.length===1)return n[0];const l=Math.floor(n.length/2),r=n.sort((o,s)=>o-s);return n.length%2!==0?r[l]:(r[l-1]+r[l])/2},pm=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),mm=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,_m=(e,t)=>t.length,Bl={sum:um,min:fm,max:cm,extent:dm,mean:hm,median:gm,unique:pm,uniqueCount:mm,count:_m},vm={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:Ue("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(l=>l!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,l,r,o;return(n=(l=(r=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?r:t.options.enableGrouping)!=null?l:!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],l=n==null?void 0:n.getValue(e.id);if(typeof l=="number")return Bl.sum;if(Object.prototype.toString.call(l)==="[object Date]")return Bl.extent},getAggregationFn:()=>{var n,l;if(!e)throw new Error;return bl(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(l=t.options.aggregationFns)==null?void 0:l[e.columnDef.aggregationFn])!=null?n:Bl[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,l;e.setGrouping(t?[]:(n=(l=e.initialState)==null?void 0:l.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 l=t.getColumn(n);return l!=null&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},_groupingValuesCache:{}}),createCell:(e,t,n,l)=>({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 bm(e,t,n){if(!(t!=null&&t.length)||!n)return e;const l=e.filter(o=>!t.includes(o.id));return n==="remove"?l:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...l]}const wm={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ue("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,l)=>r=>{let o=[];if(!(t!=null&&t.length))o=r;else{const s=[...t],u=[...r];for(;u.length&&s.length;){const a=s.shift(),f=u.findIndex(c=>c.id===a);f>-1&&o.push(u.splice(f,1)[0])}o=[...o,...u]}return bm(o,n,l)},{key:!1})})},vr=0,br=10,Ul=()=>({pageIndex:vr,pageSize:br}),ym={getInitialState:e=>({...e,pagination:{...Ul(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ue("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var l,r;if(!t){e._queue(()=>{t=!0});return}if((l=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?l:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:l=>{const r=o=>kt(l,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},resetPagination:l=>{var r;e.setPagination(l?Ul():(r=e.initialState.pagination)!=null?r:Ul())},setPageIndex:l=>{e.setPagination(r=>{let o=kt(l,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...r,pageIndex:o}})},resetPageIndex:l=>{var r,o,s;e.setPageIndex(l?vr:(r=(o=e.initialState)==null||(s=o.pagination)==null?void 0:s.pageIndex)!=null?r:vr)},resetPageSize:l=>{var r,o,s;e.setPageSize(l?br:(r=(o=e.initialState)==null||(s=o.pagination)==null?void 0:s.pageSize)!=null?r:br)},setPageSize:l=>{e.setPagination(r=>{const o=Math.max(1,kt(l,r.pageSize)),s=r.pageSize*r.pageIndex,u=Math.floor(s/o);return{...r,pageIndex:u,pageSize:o}})},setPageCount:l=>e.setPagination(r=>{var o;let s=kt(l,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),getPageOptions:Q(()=>[e.getPageCount()],l=>{let r=[];return l&&l>0&&(r=[...new Array(l)].fill(null).map((o,s)=>s)),r},{key:!1,debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:l}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:le.setPageIndex(l=>l-1),nextPage:()=>e.setPageIndex(l=>l+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 l;return(l=e.options.pageCount)!=null?l:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},Wl=()=>({left:[],right:[]}),km={getInitialState:e=>({columnPinning:Wl(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ue("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const l=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var o,s;if(n==="right"){var u,a;return{left:((u=r==null?void 0:r.left)!=null?u:[]).filter(d=>!(l!=null&&l.includes(d))),right:[...((a=r==null?void 0:r.right)!=null?a:[]).filter(d=>!(l!=null&&l.includes(d))),...l]}}if(n==="left"){var f,c;return{left:[...((f=r==null?void 0:r.left)!=null?f:[]).filter(d=>!(l!=null&&l.includes(d))),...l],right:((c=r==null?void 0:r.right)!=null?c:[]).filter(d=>!(l!=null&&l.includes(d)))}}return{left:((o=r==null?void 0:r.left)!=null?o:[]).filter(d=>!(l!=null&&l.includes(d))),right:((s=r==null?void 0:r.right)!=null?s:[]).filter(d=>!(l!=null&&l.includes(d)))}})},getCanPin:()=>e.getLeafColumns().some(l=>{var r,o;return((r=l.columnDef.enablePinning)!=null?r:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(u=>u.id),{left:l,right:r}=t.getState().columnPinning,o=n.some(u=>l==null?void 0:l.includes(u)),s=n.some(u=>r==null?void 0:r.includes(u));return o?"left":s?"right":!1},getPinnedIndex:()=>{var n,l,r;const o=e.getIsPinned();return o?(n=(l=t.getState().columnPinning)==null||(r=l[o])==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,l,r)=>{const o=[...l??[],...r??[]];return n.filter(s=>!o.includes(s.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,l)=>(l??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,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,l)=>(l??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,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,l;return e.setColumnPinning(t?Wl():(n=(l=e.initialState)==null?void 0:l.columnPinning)!=null?n:Wl())},getIsSomeColumnsPinned:t=>{var n;const l=e.getState().columnPinning;if(!t){var r,o;return!!((r=l.left)!=null&&r.length||(o=l.right)!=null&&o.length)}return!!((n=l[t])!=null&&n.length)},getLeftLeafColumns:Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(l=>t.find(r=>r.id===l)).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(l=>t.find(r=>r.id===l)).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,l)=>{const r=[...n??[],...l??[]];return t.filter(o=>!r.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Sm={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ue("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 l={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(o=>{o.getCanSelect()&&(l[o.id]=!0)}):r.forEach(o=>{delete l[o.id]}),l})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const l=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(o=>{wr(r,o.id,l,e)}),r}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Xl(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?Xl(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?Xl(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 l=!!(t.length&&Object.keys(n).length);return l&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(l=!1),l},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some(r=>!n[r.id])&&(l=!1),l},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 l=e.getIsSelected();t.setRowSelection(r=>{if(n=typeof n<"u"?n:!l,l===n)return r;const o={...r};return wr(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Vr(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return cs(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return cs(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 l=>{var r;n&&e.toggleSelected((r=l.target)==null?void 0:r.checked)}}})},wr=(e,t,n,l)=>{var r;const o=l.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(r=o.subRows)!=null&&r.length&&o.getCanSelectSubRows()&&o.subRows.forEach(s=>wr(e,s.id,n,l))};function Xl(e,t){const n=e.getState().rowSelection,l=[],r={},o=function(s,u){return s.map(a=>{var f;const c=Vr(a,n);if(c&&(l.push(a),r[a.id]=a),(f=a.subRows)!=null&&f.length&&(a={...a,subRows:o(a.subRows)}),c)return a}).filter(Boolean)};return{rows:o(t.rows),flatRows:l,rowsById:r}}function Vr(e,t){var n;return(n=t[e.id])!=null?n:!1}function cs(e,t,n){if(e.subRows&&e.subRows.length){let l=!0,r=!1;return e.subRows.forEach(o=>{r&&!l||(Vr(o,t)?r=!0:l=!1)}),l?"all":r?"some":!1}return!1}const yr=/([0-9]+)/gm,Cm=(e,t,n)=>du(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),$m=(e,t,n)=>du(Ct(e.getValue(n)),Ct(t.getValue(n))),Rm=(e,t,n)=>zr(Ct(e.getValue(n)).toLowerCase(),Ct(t.getValue(n)).toLowerCase()),Am=(e,t,n)=>zr(Ct(e.getValue(n)),Ct(t.getValue(n))),Mm=(e,t,n)=>{const l=e.getValue(n),r=t.getValue(n);return l>r?1:lzr(e.getValue(n),t.getValue(n));function zr(e,t){return e===t?0:e>t?1:-1}function Ct(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function du(e,t){const n=e.split(yr).filter(Boolean),l=t.split(yr).filter(Boolean);for(;n.length&&l.length;){const r=n.shift(),o=l.shift(),s=parseInt(r,10),u=parseInt(o,10),a=[s,u].sort();if(isNaN(a[0])){if(r>o)return 1;if(o>r)return-1;continue}if(isNaN(a[1]))return isNaN(s)?-1:1;if(s>u)return 1;if(u>s)return-1}return n.length-l.length}const an={alphanumeric:Cm,alphanumericCaseSensitive:$m,text:Rm,textCaseSensitive:Am,datetime:Mm,basic:Em},Fm={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto"}),getDefaultOptions:e=>({onSortingChange:Ue("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!1;for(const r of n){const o=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return an.datetime;if(typeof o=="string"&&(l=!0,o.split(yr).length>1))return an.alphanumeric}return l?an.text:an.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,l;if(!e)throw new Error;return bl(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(l=t.options.sortingFns)==null?void 0:l[e.columnDef.sortingFn])!=null?n:an[e.columnDef.sortingFn]},toggleSorting:(n,l)=>{const r=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const u=s==null?void 0:s.find(p=>p.id===e.id),a=s==null?void 0:s.findIndex(p=>p.id===e.id);let f=[],c,d=o?n:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&l?u?c="toggle":c="add":s!=null&&s.length&&a!==s.length-1?c="replace":u?c="toggle":c="replace",c==="toggle"&&(o||r||(c="remove")),c==="add"){var g;f=[...s,{id:e.id,desc:d}],f.splice(0,f.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else c==="toggle"?f=s.map(p=>p.id===e.id?{...p,desc:d}:p):c==="remove"?f=s.filter(p=>p.id!==e.id):f=[{id:e.id,desc:d}];return f})},getFirstSortDir:()=>{var n,l;return((n=(l=e.columnDef.sortDescFirst)!=null?l:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var l,r;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((l=t.options.enableSortingRemoval)==null||l)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":o},getCanSort:()=>{var n,l;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((l=t.options.enableSorting)!=null?l:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,l;return(n=(l=e.columnDef.enableMultiSort)!=null?l:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const l=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return l?l.desc?"desc":"asc":!1},getSortIndex:()=>{var n,l;return(n=(l=t.getState().sorting)==null?void 0:l.findIndex(r=>r.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(l=>l.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return l=>{n&&(l.persist==null||l.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(l):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,l;e.setSorting(t?[]:(n=(l=e.initialState)==null?void 0:l.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())})},Dm={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ue("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(l=>({...l,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,l;return(n=(l=t.getState().columnVisibility)==null?void 0:l[e.id])!=null?n:!0},getCanHide:()=>{var n,l;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((l=t.options.enableHiding)!=null?l:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:Q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(l=>l.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,l,r)=>[...n,...l,...r],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,l)=>Q(()=>[l(),l().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(o=>o.getIsVisible==null?void 0:o.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 l;e.setColumnVisibility(n?{}:(l=e.initialState.columnVisibility)!=null?l:{})},toggleAllColumnsVisible:n=>{var l;n=(l=n)!=null?l:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,o)=>({...r,[o.id]:n||!(o.getCanHide!=null&&o.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 l;e.toggleAllColumnsVisible((l=n.target)==null?void 0:l.checked)}}}},ds=[rm,Dm,wm,km,am,Fm,vm,sm,ym,Sm,im];function Im(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:ds};const l=n._features.reduce((c,d)=>Object.assign(c,d.getDefaultOptions==null?void 0:d.getDefaultOptions(n)),{}),r=c=>n.options.mergeOptions?n.options.mergeOptions(l,c):{...l,...c};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(c=>{var d;s=(d=c.getInitialState==null?void 0:c.getInitialState(s))!=null?d:s});const u=[];let a=!1;const f={_features:ds,options:{...l,...e},initialState:s,_queue:c=>{u.push(c),a||(a=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();a=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{n.setState(n.initialState)},setOptions:c=>{const d=kt(c,n.options);n.options=r(d)},getState:()=>n.options.state,setState:c=>{n.options.onStateChange==null||n.options.onStateChange(c)},_getRowId:(c,d,g)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(c,d,g))!=null?p:`${g?[g.id,d].join("."):d}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:c=>{const d=n.getRowModel().rowsById[c];if(!d)throw new Error;return d},_getDefaultColumnDef:Q(()=>[n.options.defaultColumn],c=>{var d;return c=(d=c)!=null?d:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...n._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...c}},{debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:Q(()=>[n._getColumnDefs()],c=>{const d=function(g,p,m){return m===void 0&&(m=0),g.map(v=>{const _=lm(n,v,m,p),w=v;return _.columns=w.columns?d(w.columns,_,m+1):[],_})};return d(c)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllFlatColumns:Q(()=>[n.getAllColumns()],c=>c.flatMap(d=>d.getFlatColumns()),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),_getAllFlatColumnsById:Q(()=>[n.getAllFlatColumns()],c=>c.reduce((d,g)=>(d[g.id]=g,d),{}),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllLeafColumns:Q(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(c,d)=>{let g=c.flatMap(p=>p.getLeafColumns());return d(g)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getColumn:c=>n._getAllFlatColumnsById()[c]};return Object.assign(n,f),n._features.forEach(c=>Object.assign(n,c.createTable==null?void 0:c.createTable(n))),n}function Nm(e,t,n,l){const r=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:r,getContext:Q(()=>[e,n,t,o],(s,u,a,f)=>({table:s,column:u,row:a,cell:f,getValue:f.getValue,renderValue:f.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(s=>{Object.assign(o,s.createCell==null?void 0:s.createCell(o,n,t,e))},{}),o}const Hr=(e,t,n,l,r,o,s)=>{let u={id:t,index:l,original:n,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(u._valuesCache.hasOwnProperty(a))return u._valuesCache[a];const f=e.getColumn(a);if(f!=null&&f.accessorFn)return u._valuesCache[a]=f.accessorFn(u.original,l),u._valuesCache[a]},getUniqueValues:a=>{if(u._uniqueValuesCache.hasOwnProperty(a))return u._uniqueValuesCache[a];const f=e.getColumn(a);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(u._uniqueValuesCache[a]=f.columnDef.getUniqueValues(u.original,l),u._uniqueValuesCache[a]):(u._uniqueValuesCache[a]=[u.getValue(a)],u._uniqueValuesCache[a])},renderValue:a=>{var f;return(f=u.getValue(a))!=null?f:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>nm(u.subRows,a=>a.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId):void 0,getParentRows:()=>{let a=[],f=u;for(;;){const c=f.getParentRow();if(!c)break;a.push(c),f=c}return a.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],a=>a.map(f=>Nm(e,u,f,f.id)),{key:!1,debug:()=>{var a;return(a=e.options.debugAll)!=null?a:e.options.debugRows}}),_getAllCellsByColumnId:Q(()=>[u.getAllCells()],a=>a.reduce((f,c)=>(f[c.column.id]=c,f),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var a;return(a=e.options.debugAll)!=null?a:e.options.debugRows}})};for(let a=0;atypeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function hs(){return e=>Q(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(r,o,s){o===void 0&&(o=0);const u=[];for(let f=0;f{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function hu(e,t,n){return n.options.filterFromLeafRows?Tm(e,t,n):Om(e,t,n)}function Tm(e,t,n){var l;const r=[],o={},s=(l=n.options.maxLeafRowFilterDepth)!=null?l:100,u=function(a,f){f===void 0&&(f=0);const c=[];for(let g=0;gQ(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,l)=>{if(!t.rows.length||!(n!=null&&n.length)&&!l){for(let g=0;g{var p;const m=e.getColumn(g.id);if(!m)return;const v=m.getFilterFn();v&&r.push({id:g.id,filterFn:v,resolvedValue:(p=v.resolveFilterValue==null?void 0:v.resolveFilterValue(g.value))!=null?p:g.value})});const s=n.map(g=>g.id),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());l&&u&&a.length&&(s.push("__global__"),a.forEach(g=>{var p;o.push({id:g.id,filterFn:u,resolvedValue:(p=u.resolveFilterValue==null?void 0:u.resolveFilterValue(l))!=null?p:l})}));let f,c;for(let g=0;g{p.columnFiltersMeta[v]=_})}if(o.length){for(let m=0;m{p.columnFiltersMeta[v]=_})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const d=g=>{for(let p=0;p{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function ps(){return(e,t)=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,l,r)=>{if(!n.rows.length||!(l!=null&&l.length)&&!r)return n;const o=[...l.map(u=>u.id).filter(u=>u!==t),r?"__global__":void 0].filter(Boolean),s=u=>{for(let a=0;a{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{}})}function ms(){return e=>Q(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const l=e.getState().sorting,r=[],o=l.filter(a=>{var f;return(f=e.getColumn(a.id))==null?void 0:f.getCanSort()}),s={};o.forEach(a=>{const f=e.getColumn(a.id);f&&(s[a.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const u=a=>{const f=[...a];return f.sort((c,d)=>{for(let p=0;p"u",k=typeof $>"u";if(M||k){let E=M&&k?0:M?v.sortUndefined:-v.sortUndefined;return _&&E!==0&&(E*=-1),E}}let w=v.sortingFn(c,d,m.id);if(w!==0)return _&&(w*=-1),v.invertSorting&&(w*=-1),w}return c.index-d.index}),f.forEach(c=>{var d;r.push(c),(d=c.subRows)!=null&&d.length&&(c.subRows=u(c.subRows))}),f};return{rows:u(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 Vm(e){const t=[],n=l=>{var r;t.push(l),(r=l.subRows)!=null&&r.length&&l.getIsExpanded()&&l.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function _s(e){return t=>Q(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,l)=>{if(!l.rows.length)return l;const{pageSize:r,pageIndex:o}=n;let{rows:s,flatRows:u,rowsById:a}=l;const f=r*o,c=f+r;s=s.slice(f,c);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:u,rowsById:a}:d=Vm({rows:s,flatRows:u,rowsById:a}),d.flatRows=[];const g=p=>{d.flatRows.push(p),p.subRows.length&&p.subRows.forEach(g)};return d.rows.forEach(g),d},{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 zm(e){let t;return{c(){t=L(e[0])},l(n){t=Fu(n,e[0])},m(n,l){Ru(n,t,l)},p(n,[l]){l&1&&W(t,n[0])},i:x,o:x,d(n){n&&N(t)}}}function Hm(e,t,n){let{content:l}=t;return e.$$set=r=>{"content"in r&&n(0,l=r.content)},[l]}class qm extends ie{constructor(t){super(),oe(this,t,Hm,zm,re,{content:0})}}const Lm=Ks((e,t,n,l)=>`${Uu(t.content)}`);var jm=typeof document>"u"?Lm:qm;function xm(e,t,n){let l,r;return l=new t({props:n,$$inline:!0}),{c(){te(l.$$.fragment)},l(o){Xu(l.$$.fragment,o)},m(o,s){J(l,o,s),r=!0},p:x,i(o){r||(V(l.$$.fragment,o),r=!0)},o(o){H(l.$$.fragment,o),r=!1},d(o){Z(l,o)}}}function Gm(e,t){return class extends ie{constructor(l){super(),oe(this,l,null,r=>xm(r,e,t),re,{},void 0)}}}function Bm(e,t){return Ks((l,r,o,s)=>`${Wu(e,"TableComponent").$$render(l,t,{},{})}`)}const kr=typeof window>"u"?Bm:Gm;function Um(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Wm(e){var t,n;let l="__SVELTE_HMR"in window;return e.prototype instanceof ie||l&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function vs(e){return typeof document>"u"?Um(e):Wm(e)}function bs(e){return kr(jm,{content:e})}function wl(e,t){if(!e)return null;if(vs(e))return kr(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:vs(n)?kr(n,t):bs(n)}return bs(e)}function ws(e){let t;"subscribe"in e?t=e:t=Kl(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...vu(t)},l=Im(n),r=Ae(l.initialState),o=Qu([r,t],u=>u);return Kl(l,function(a){const f=o.subscribe(c=>{let[d,g]=c;l.setOptions(p=>({...p,...g,state:{...d,...g.state},onStateChange:m=>{m instanceof Function?r.update(m):r.set(m),n.onStateChange==null||n.onStateChange(m)}})),a(l)});return function(){f()}})}/** + * 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 gu={À:"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"},Xm=Object.keys(gu).join("|"),Ym=new RegExp(Xm,"g");function Qm(e){return e.replace(Ym,t=>gu[t])}/** + * @name match-sorter + * @license MIT license. + * @copyright (c) 2099 Kent C. Dodds + * @author Kent C. Dodds (https://kentcdodds.com) + */const Oe={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Km(e,t,n){var l;if(n=n||{},n.threshold=(l=n.threshold)!=null?l:Oe.MATCHES,!n.accessors){const s=ys(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const r=t_(e,n.accessors),o={rankedValue:e,rank:Oe.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s=Oe.MATCHES?a=f:a>c&&(a=c),a=Math.min(a,c),a>=d&&a>o.rank&&(o.rank=a,o.passed=!0,o.accessorIndex=s,o.accessorThreshold=d,o.rankedValue=u.itemValue)}return o}function ys(e,t,n){return e=ks(e,n),t=ks(t,n),t.length>e.length?Oe.NO_MATCH:e===t?Oe.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Oe.EQUAL:e.startsWith(t)?Oe.STARTS_WITH:e.includes(` ${t}`)?Oe.WORD_STARTS_WITH:e.includes(t)?Oe.CONTAINS:t.length===1?Oe.NO_MATCH:Jm(e).includes(t)?Oe.ACRONYM:Zm(e,t))}function Jm(e){let t="";return e.split(" ").forEach(l=>{l.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function Zm(e,t){let n=0,l=0;function r(a,f,c){for(let d=c,g=f.length;d-1))return Oe.NO_MATCH}const u=l-s;return o(u)}function ks(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Qm(e)),e}function e_(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const l=n(e);return l==null?[]:Array.isArray(l)?l:[String(l)]}function t_(e,t){const n=[];for(let l=0,r=t.length;l{Z(m,1)}),de()}c?(n=St(c,d()),te(n.$$.fragment),V(n.$$.fragment,1),J(n,t,l)):n=null}},i(g){u||(n&&V(n.$$.fragment,g),u=!0)},o(g){n&&H(n.$$.fragment,g),u=!1},d(g){g&&N(t),n&&Z(n),a=!1,f()}}}function Ms(e){let t,n,l=!e[26].isPlaceholder&&l_(e);return{c(){t=A("th"),l&&l.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(r,o){T(r,t,o),l&&l.m(t,null),n=!0},p(r,o){r[26].isPlaceholder||l.p(r,o)},i(r){n||(V(l),n=!0)},o(r){H(l),n=!1},d(r){r&&N(t),l&&l.d()}}}function Es(e){let t,n,l,r=e[23].headers,o=[];for(let u=0;uH(o[u],1,1,()=>{o[u]=null});return{c(){t=A("tr");for(let u=0;u{Z(f,1)}),de()}o?(l=St(o,s()),te(l.$$.fragment),V(l.$$.fragment,1),J(l,n,null)):l=null}},i(u){r||(l&&V(l.$$.fragment,u),r=!0)},o(u){l&&H(l.$$.fragment,u),r=!1},d(u){u&&N(n),l&&Z(l)}}}function Ds(e){let t,n=[],l=new Map,r,o,s=e[17].getVisibleCells();const u=a=>a[20].id;for(let a=0;a",Fe,Re,he,qe,In,Rt=e[5],ve=[];for(let K=0;KH(ve[K],1,1,()=>{ve[K]=null});let At=e[1].getRowModel().rows,be=[];for(let K=0;KH(be[K],1,1,()=>{be[K]=null});return{c(){t=A("div"),n=A("input"),l=P(),r=A("div"),o=A("table"),s=A("thead");for(let K=0;K(o(),o=yl(w,k=>n(1,r=k)),w);le(e,vl,k=>n(8,l=k)),e.$$.on_destroy.push(()=>o());const u=(k,E,S,R)=>{if(console.log("yessir"),Array.isArray(S))return S.length===0?!0:S.includes(k.getValue(E));typeof S=="number"&&(S=String(S));const C=Km(k.getValue(E),S);return R({itemRank:C}),C.passed},a=Pm(),f=[a.accessor("file",{header:"File",cell:k=>k.getValue(),footer:k=>k.column.id}),a.accessor("size",{header:"Size",cell:k=>nr(k.getValue()),footer:k=>k.column.id}),a.accessor("type",{header:"Type",cell:k=>k.getValue(),footer:k=>k.column.id})];let c="",d=Ae({data:l,columns:f,getCoreRowModel:hs(),getSortedRowModel:ms(),getFilteredRowModel:gs(),globalFilterFn:u,getFacetedRowModel:ps(),getPaginationRowModel:_s(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function g(k){n(6,c=k),d.update(E=>({...E,state:{...E.state,globalFilter:k}}))}function p(k){d.update(E=>{var S;return{...E,state:{...E.state,pagination:{...(S=E.state)==null?void 0:S.pagination,pageIndex:k}}}})}let m;function v(k){clearTimeout(m),m=setTimeout(()=>{const E=k.target;g(E.value)},100)}function _(k){const E=k.target;p(parseInt(E.value)-1)}let w=ws(d);s();let y=r.getHeaderGroups();const $=()=>p(r.getState().pagination.pageIndex-1),M=()=>p(r.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,d={data:l,columns:f,getCoreRowModel:hs(),getSortedRowModel:ms(),getFilteredRowModel:gs(),globalFilterFn:u,getFacetedRowModel:ps(),getPaginationRowModel:_s(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),s(n(0,w=ws(Ae(d)))))},[w,r,p,v,_,y,c,d,l,$,M]}class s_ extends ie{constructor(t){super(),oe(this,t,o_,r_,re,{})}}function Is(e){let t,n;return{c(){t=A("p"),n=L(e[3])},m(l,r){T(l,t,r),b(t,n)},p(l,r){r&8&&W(n,l[3])},d(l){l&&N(t)}}}function Ns(e){let t;return{c(){t=A("p"),t.textContent="Data Successfully indexed!"},m(n,l){T(n,t,l)},d(n){n&&N(t)}}}function Ps(e){let t,n;return t=new s_({}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function a_(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m,v,_,w,y,$,M,k,E,S,R=e[2]&&!e[1]&&Is(e),C=e[1]&&Ns();$=new em({});let F=e[0]&&Ps();return{c(){t=A("div"),n=A("div"),l=A("div"),r=A("div"),o=A("h4"),o.textContent="Upload Data",s=P(),u=A("br"),a=P(),f=A("form"),c=A("input"),d=P(),R&&R.c(),g=P(),C&&C.c(),p=P(),m=A("p"),m.textContent="These are the files your model will use as context.",v=P(),_=A("p"),_.innerHTML="Currently pdf, txt, and md are supported.",w=P(),y=A("div"),te($.$$.fragment),M=P(),F&&F.c(),h(c,"type","file"),c.multiple=!0,h(r,"class","upload-box svelte-1lu6hos"),h(l,"class","upload-container svelte-1lu6hos"),h(n,"class","file-container svelte-1lu6hos"),h(y,"class","charts-container svelte-1lu6hos"),h(t,"class","data-grid svelte-1lu6hos")},m(I,D){T(I,t,D),b(t,n),b(n,l),b(l,r),b(r,o),b(r,s),b(r,u),b(r,a),b(r,f),b(f,c),b(r,d),R&&R.m(r,null),b(r,g),C&&C.m(r,null),b(r,p),b(r,m),b(r,v),b(r,_),b(t,w),b(t,y),J($,y,null),b(y,M),F&&F.m(y,null),k=!0,E||(S=B(c,"change",e[4]),E=!0)},p(I,[D]){I[2]&&!I[1]?R?R.p(I,D):(R=Is(I),R.c(),R.m(r,g)):R&&(R.d(1),R=null),I[1]?C||(C=Ns(),C.c(),C.m(r,p)):C&&(C.d(1),C=null),I[0]?F?D&1&&V(F,1):(F=Ps(),F.c(),V(F,1),F.m(y,null)):F&&(ce(),H(F,1,1,()=>{F=null}),de())},i(I){k||(V($.$$.fragment,I),V(F),k=!0)},o(I){H($.$$.fragment,I),H(F),k=!1},d(I){I&&N(t),R&&R.d(),C&&C.d(),Z($),F&&F.d(),E=!1,S()}}}function u_(e,t,n){let l,r,o;le(e,os,m=>n(6,r=m)),le(e,vl,m=>n(7,o=m));let s=[],u=!1,a=!1;async function f(m){n(0,s=m.target.files);const v=new FormData;for(let _=0;_({file:w.name,size:w.size,type:w.type}));Ne(vl,o=[..._],o)}async function d(){console.log("index!"),n(2,a=!0),await(await fetch("/retrieval/vector_db/index",{method:"POST"})).json(),n(1,u=!0),n(2,a=!1)}async function g(){console.log("getting embeddings...");const v=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",v),Ne(os,r=v,r)}st(()=>{c()});let p=0;return setInterval(()=>{n(5,p=(p+1)%4)},200),e.$$.update=()=>{e.$$.dirty&32&&n(3,l="Indexing"+".".repeat(p))},[s,u,a,l,f,p]}class f_ extends ie{constructor(t){super(),oe(this,t,u_,a_,re,{})}}function c_(e){let t,n,l,r,o,s,u,a,f,c,d,g,p,m,v,_,w,y,$,M,k,E,S,R,C,F,I;return o=new Ta({}),a=new Oa({}),d=new Fa({}),m=new Ia({props:{feedback:"Bad"}}),w=new Pa({}),M=new Na({}),F=new Da({}),{c(){t=A("div"),n=A("div"),l=A("div"),r=A("div"),te(o.$$.fragment),s=P(),u=A("div"),te(a.$$.fragment),f=P(),c=A("div"),te(d.$$.fragment),g=P(),p=A("div"),te(m.$$.fragment),v=P(),_=A("div"),te(w.$$.fragment),y=P(),$=A("div"),te(M.$$.fragment),k=P(),E=A("div"),S=A("div"),S.innerHTML=`
+
`,R=P(),C=A("div"),te(F.$$.fragment),h(r,"class","card-1 svelte-14znspc"),h(u,"class","card-2"),h(l,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(p,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h($,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"class","right-chart svelte-14znspc"),h(C,"class","right-table svelte-14znspc"),h(E,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(D,z){T(D,t,z),b(t,n),b(n,l),b(l,r),J(o,r,null),b(l,s),b(l,u),J(a,u,null),b(n,f),b(n,c),J(d,c,null),b(n,g),b(n,p),J(m,p,null),b(n,v),b(n,_),J(w,_,null),b(n,y),b(n,$),J(M,$,null),b(t,k),b(t,E),b(E,S),b(E,R),b(E,C),J(F,C,null),I=!0},p:x,i(D){I||(V(o.$$.fragment,D),V(a.$$.fragment,D),V(d.$$.fragment,D),V(m.$$.fragment,D),V(w.$$.fragment,D),V(M.$$.fragment,D),V(F.$$.fragment,D),I=!0)},o(D){H(o.$$.fragment,D),H(a.$$.fragment,D),H(d.$$.fragment,D),H(m.$$.fragment,D),H(w.$$.fragment,D),H(M.$$.fragment,D),H(F.$$.fragment,D),I=!1},d(D){D&&N(t),Z(o),Z(a),Z(d),Z(m),Z(w),Z(M),Z(F)}}}function d_(e,t,n){let l;le(e,kn,o=>n(0,l=o)),st(()=>{console.log("FEEDBACK on mount"),r()});async function r(){const a=(await(await fetch("/chat/rag_table/retrieve")).json()).rows.map(f=>({id:f[0],question:f[1],answer:f[2],vote_status:f[4]}));Ne(kn,l=[...a],l)}return[]}class h_ extends ie{constructor(t){super(),oe(this,t,d_,c_,re,{})}}function g_(e){let t,n;return t=new Va({}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function p_(e){let t,n;return t=new h_({}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function m_(e){let t,n;return t=new Va({}),{c(){te(t.$$.fragment)},m(l,r){J(t,l,r),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){H(t.$$.fragment,l),n=!1},d(l){Z(t,l)}}}function __(e){let t,n,l,r;const o=[m_,p_,g_],s=[];function u(a,f){return a[0]==="vote"?0:a[0]==="rag"?1:2}return t=u(e),n=s[t]=o[t](e),{c(){n.c(),l=_e()},m(a,f){s[t].m(a,f),T(a,l,f),r=!0},p(a,[f]){let c=t;t=u(a),t!==c&&(ce(),H(s[c],1,1,()=>{s[c]=null}),de(),n=s[t],n||(n=s[t]=o[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){r||(V(n),r=!0)},o(a){H(n),r=!1},d(a){s[t].d(a),a&&N(l)}}}function v_(e,t,n){let{feedback:l}=t;return e.$$set=r=>{"feedback"in r&&n(0,l=r.feedback)},[l]}class b_ extends ie{constructor(t){super(),oe(this,t,v_,__,re,{feedback:0})}}function Ts(e,t,n){const l=e.slice();return l[7]=t[n],l}function Os(e){let t,n=e[0],l=[];for(let r=0;r{Z(c,1)}),de()}o?(t=St(o,s()),te(t.$$.fragment),V(t.$$.fragment,1),J(t,n.parentNode,n)):t=null}else o&&t.$set(f)},i(u){l||(t&&V(t.$$.fragment,u),l=!0)},o(u){t&&H(t.$$.fragment,u),l=!1},d(u){u&&N(n),t&&Z(t,u)}}}function w_(e){let t,n,l,r=e[0].length>1&&Os(e),o=e[1]&&zs(e);return{c(){r&&r.c(),t=P(),o&&o.c(),n=_e()},m(s,u){r&&r.m(s,u),T(s,t,u),o&&o.m(s,u),T(s,n,u),l=!0},p(s,[u]){s[0].length>1?r?r.p(s,u):(r=Os(s),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),s[1]?o?(o.p(s,u),u&2&&V(o,1)):(o=zs(s),o.c(),V(o,1),o.m(n.parentNode,n)):o&&(ce(),H(o,1,1,()=>{o=null}),de())},i(s){l||(V(o),l=!0)},o(s){H(o),l=!1},d(s){r&&r.d(s),s&&N(t),o&&o.d(s),s&&N(n)}}}function y_(e,t,n){let l,r;const o=Ae([]);le(e,o,c=>n(0,l=c));const s=Ae(null);le(e,s,c=>n(1,r=c));const u={Chatbot:$d,Dropdown:Md,Feedback:b_,Compare:Zg,CompareDashboard:_p,RetrievalQA:f_},a=c=>{s.set(c)};return fetch("/components").then(c=>{if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}).then(c=>{o.set(c),s.set(c[0])}).catch(c=>{console.log("Fetch request failed",c)}),[l,r,o,s,u,a,c=>a(c)]}class k_ extends ie{constructor(t){super(),oe(this,t,y_,w_,re,{})}}new k_({target:document.getElementById("app")}); diff --git a/pykoi/frontend/dist/assets/index-6e8a727f.css b/pykoi/frontend/dist/assets/index-c2d4a9bc.css similarity index 82% rename from pykoi/frontend/dist/assets/index-6e8a727f.css rename to pykoi/frontend/dist/assets/index-c2d4a9bc.css index 9767a75..8c9db51 100644 --- a/pykoi/frontend/dist/assets/index-6e8a727f.css +++ b/pykoi/frontend/dist/assets/index-c2d4a9bc.css @@ -1 +1 @@ -@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-1gze3r0.svelte-1gze3r0{height:100vh;width:100%;display:flex;justify-content:center;align-items:center}button.svelte-1gze3r0.svelte-1gze3r0{margin:0}.chart-captions.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%;text-align:left;height:100%}.chart-captions.svelte-1gze3r0 h4.svelte-1gze3r0{padding:0;margin:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{text-align:left;padding-left:0}.instructions.svelte-1gze3r0 p.svelte-1gze3r0{font-size:var(--smallText);text-align:left}.instructions.svelte-1gze3r0 button.svelte-1gze3r0{font-size:var(--smallText)}.underline.svelte-1gze3r0.svelte-1gze3r0{border-bottom:var(--line)}.bold.svelte-1gze3r0.svelte-1gze3r0{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.instructions.svelte-1gze3r0.svelte-1gze3r0{border-right:1px solid #eee}.main-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:20% 80%}.eval-container.svelte-1gze3r0.svelte-1gze3r0{display:grid;height:100vh;grid-template-rows:100%;grid-template-columns:65% 35%;padding:1rem}.left-charts.svelte-1gze3r0.svelte-1gze3r0{display:grid;grid-template-columns:100%;grid-template-rows:15% 60% 25%}.eval-table.svelte-1gze3r0.svelte-1gze3r0{margin:auto;width:100%}.right-charts.svelte-1gze3r0.svelte-1gze3r0{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)} +@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-e352a05f.js b/pykoi/frontend/dist/assets/index-e352a05f.js deleted file mode 100644 index de2f783..0000000 --- a/pykoi/frontend/dist/assets/index-e352a05f.js +++ /dev/null @@ -1,70 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function H(){}const ts=e=>e;function Bn(e,t){for(const n in t)e[n]=t[n];return e}function ns(e){return e()}function jr(){return Object.create(null)}function _e(e){e.forEach(ns)}function Ye(e){return typeof e=="function"}function re(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Ra(e){return Object.keys(e).length===0}function gr(e,...t){if(e==null)return H;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Aa(e){let t;return gr(e,n=>t=n)(),t}function ee(e,t,n){e.$$.on_destroy.push(gr(t,n))}function Ii(e){return e??""}function Oe(e,t,n){return e.set(n),t}function gn(e){return e&&Ye(e.destroy)?e.destroy:H}const rs=typeof window<"u";let is=rs?()=>window.performance.now():()=>Date.now(),hi=rs?e=>requestAnimationFrame(e):H;const Vt=new Set;function os(e){Vt.forEach(t=>{t.c(e)||(Vt.delete(t),t.f())}),Vt.size!==0&&hi(os)}function ls(e){let t;return Vt.size===0&&hi(os),{promise:new Promise(n=>{Vt.add(t={c:e,f:n})}),abort(){Vt.delete(t)}}}let hr=!1;function Ea(){hr=!0}function Ma(){hr=!1}function Fa(e,t,n,r){for(;e>1);n(i)<=r?e=i+1:t=i}return e}function Da(e){if(e.hydrate_init)return;e.hydrate_init=!0;let t=e.childNodes;if(e.nodeName==="HEAD"){const s=[];for(let u=0;u0&&t[n[i]].claim_order<=u?i+1:Fa(1,i,d=>t[n[d]].claim_order,u))-1;r[s]=n[c]+1;const f=c+1;n[f]=s,i=Math.max(f,i)}const o=[],l=[];let a=t.length-1;for(let s=n[i]+1;s!=0;s=r[s-1]){for(o.push(t[s-1]);a>=s;a--)l.push(t[a]);a--}for(;a>=0;a--)l.push(t[a]);o.reverse(),l.sort((s,u)=>s.claim_order-u.claim_order);for(let s=0,u=0;s=o[u].claim_order;)u++;const c=ue.removeEventListener(t,n,r)}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ta(e){return Array.from(e.childNodes)}function Oa(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Va(e,t,n,r,i=!1){Oa(e);const o=(()=>{for(let l=e.claim_info.last_index;l=0;l--){const a=e[l];if(t(a)){const s=n(a);return s===void 0?e.splice(l,1):e[l]=s,i?s===void 0&&e.claim_info.last_index--:e.claim_info.last_index=l,a}}return r()})();return o.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,o}function za(e,t){return Va(e,n=>n.nodeType===3,n=>{const r=""+t;if(n.data.startsWith(r)){if(n.data.length!==r.length)return n.splitText(r.length)}else n.data=r},()=>z(t),!0)}function Q(e,t){t=""+t,e.data!==t&&(e.data=t)}function tt(e,t){e.value=t??""}function Re(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Un(e,t,n){for(let r=0;r{l.source===r.contentWindow&&t()})):(r.src="about:blank",r.onload=()=>{o=j(r.contentWindow,"resize",t),t()}),v(e,r),()=>{(i||o&&r.contentWindow)&&o(),x(r)}}function en(e,t,n){e.classList[n?"add":"remove"](t)}function La(e,t,{bubbles:n=!1,cancelable:r=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n,r,t),i}function mt(e,t){return new e(t)}const Wn=new Map;let Xn=0;function qa(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function Ga(e,t){const n={stylesheet:Ia(t),rules:{}};return Wn.set(e,n),n}function Ni(e,t,n,r,i,o,l,a=0){const s=16.666/r;let u=`{ -`;for(let _=0;_<=1;_+=s){const b=t+(n-t)*o(_);u+=_*100+`%{${l(b,1-b)}} -`}const c=u+`100% {${l(n,1-n)}} -}`,f=`__svelte_${qa(c)}_${a}`,d=ss(e),{stylesheet:g,rules:p}=Wn.get(d)||Ga(d,e);p[f]||(p[f]=!0,g.insertRule(`@keyframes ${f} ${c}`,g.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${f} ${r}ms linear ${i}ms 1 both`,Xn+=1,f}function ja(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),Xn-=i,Xn||Ba())}function Ba(){hi(()=>{Xn||(Wn.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&x(t)}),Wn.clear())})}let Gt;function kt(e){Gt=e}function Ua(){if(!Gt)throw new Error("Function called outside component initialization");return Gt}function ut(e){Ua().$$.on_mount.push(e)}const Pt=[],hn=[];let zt=[];const Pi=[],Wa=Promise.resolve();let Br=!1;function Xa(){Br||(Br=!0,Wa.then(us))}function Se(e){zt.push(e)}const wr=new Set;let Ft=0;function us(){if(Ft!==0)return;const e=Gt;do{try{for(;Fte.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),zt=t}let Qt;function Ka(){return Qt||(Qt=Promise.resolve(),Qt.then(()=>{Qt=null})),Qt}function yr(e,t,n){e.dispatchEvent(La(`${t?"intro":"outro"}${n}`))}const Vn=new Set;let ot;function ue(){ot={r:0,c:[],p:ot}}function ce(){ot.r||_e(ot.c),ot=ot.p}function N(e,t){e&&e.i&&(Vn.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(Vn.has(e))return;Vn.add(e),ot.c.push(()=>{Vn.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const Ja={duration:0};function Ke(e,t,n,r){const i={direction:"both"};let o=t(e,n,i),l=r?0:1,a=null,s=null,u=null;function c(){u&&ja(e,u)}function f(g,p){const m=g.b-l;return p*=Math.abs(m),{a:l,b:g.b,d:m,duration:p,start:g.start,end:g.start+p,group:g.group}}function d(g){const{delay:p=0,duration:m=300,easing:_=ts,tick:b=H,css:w}=o||Ja,C={start:is()+p,b:g};g||(C.group=ot,ot.r+=1),a||s?s=C:(w&&(c(),u=Ni(e,l,g,m,p,_,w)),g&&b(0,1),a=f(C,m),Se(()=>yr(e,g,"start")),ls(A=>{if(s&&A>s.start&&(a=f(s,m),s=null,yr(e,a.b,"start"),w&&(c(),u=Ni(e,l,a.b,a.duration,0,_,o.css))),a){if(A>=a.end)b(l=a.b,1-l),yr(e,a.b,"end"),s||(a.b?c():--a.group.r||_e(a.group.c)),a=null;else if(A>=a.start){const $=A-a.start;l=a.a+a.d*_($/a.duration),b(l,1-l)}}return!!(a||s)}))}return{run(g){Ye(o)?Ka().then(()=>{o=o(i),d(g)}):d(g)},end(){c(),a=s=null}}}function pr(e,t){e.d(1),t.delete(e.key)}function cs(e,t){V(e,1,1,()=>{t.delete(e.key)})}function Xt(e,t,n,r,i,o,l,a,s,u,c,f){let d=e.length,g=o.length,p=d;const m={};for(;p--;)m[e[p].key]=p;const _=[],b=new Map,w=new Map,C=[];for(p=g;p--;){const S=f(i,o,p),k=n(S);let y=l.get(k);y?r&&C.push(()=>y.p(S,t)):(y=u(k,S),y.c()),b.set(k,_[p]=y),k in m&&w.set(k,Math.abs(p-m[k]))}const A=new Set,$=new Set;function E(S){N(S,1),S.m(a,c),l.set(S.key,S),c=S.first,g--}for(;d&&g;){const S=_[g-1],k=e[d-1],y=S.key,M=k.key;S===k?(c=S.first,d--,g--):b.has(M)?!l.has(y)||A.has(y)?E(S):$.has(M)?d--:w.get(y)>w.get(M)?($.add(y),E(S)):(A.add(M),d--):(s(k,l),d--)}for(;d--;){const S=e[d];b.has(S.key)||s(S,l)}for(;g;)E(_[g-1]);return _e(C),_}function fs(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const l=e[o],a=t[o];if(a){for(const s in l)s in a||(r[s]=1);for(const s in a)i[s]||(n[s]=a[s],i[s]=1);e[o]=a}else for(const s in l)i[s]=1}for(const l in r)l in n||(n[l]=void 0);return n}function ds(e){return typeof e=="object"&&e!==null?e:{}}const Za=/[&"]/g,eu=/[&<]/g;function tu(e,t=!1){const n=String(e),r=t?Za:eu;r.lastIndex=0;let i="",o=0;for(;r.test(n);){const l=r.lastIndex-1,a=n[l];i+=n.substring(o,l)+(a==="&"?"&":a==='"'?""":"<"),o=l+1}return i+n.substring(o)}function nu(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 Sr;function gs(e){function t(n,r,i,o,l){const a=Gt,s={on_destroy:Sr,context:new Map(l||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:jr()};kt({$$:s});const u=e(n,r,i,o);return kt(a),u}return{render:(n={},{$$slots:r={},context:i=new Map}={})=>{Sr=[];const o={title:"",head:"",css:new Set},l=t(o,n,{},r,i);return _e(Sr),{html:l,css:{code:Array.from(o.css).map(a=>a.code).join(` -`),map:null},head:o.title+o.head}},$$render:t}}function Z(e){e&&e.c()}function ru(e,t){e&&e.l(t)}function K(e,t,n,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),r||Se(()=>{const l=e.$$.on_mount.map(ns).filter(Ye);e.$$.on_destroy?e.$$.on_destroy.push(...l):_e(l),e.$$.on_mount=[]}),o.forEach(Se)}function J(e,t){const n=e.$$;n.fragment!==null&&(Qa(n.after_update),_e(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function iu(e,t){e.$$.dirty[0]===-1&&(Pt.push(e),Xa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=g.length?g[0]:d;return u.ctx&&i(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&iu(e,f)),d}):[],u.update(),c=!0,_e(u.before_update),u.fragment=r?r(u.ctx):!1,t.target){if(t.hydrate){Ea();const f=Ta(t.target);u.fragment&&u.fragment.l(f),f.forEach(x)}else u.fragment&&u.fragment.c();t.intro&&N(e.$$.fragment),K(e,t.target,t.anchor,t.customElement),Ma(),us()}kt(s)}class ie{$destroy(){J(this,1),this.$destroy=H}$on(t,n){if(!Ye(n))return H;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Ra(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Dt=[];function Ur(e,t){return{subscribe:ke(e,t).subscribe}}function ke(e,t=H){let n;const r=new Set;function i(a){if(re(e,a)&&(e=a,n)){const s=!Dt.length;for(const u of r)u[1](),Dt.push(u,e);if(s){for(let u=0;u{r.delete(u),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:l}}function ou(e,t,n){const r=!Array.isArray(e),i=r?[e]:e,o=t.length<2;return Ur(n,l=>{let a=!1;const s=[];let u=0,c=H;const f=()=>{if(u)return;c();const g=t(r?s[0]:s,l);o?l(g):c=Ye(g)?g:H},d=i.map((g,p)=>gr(g,m=>{s[p]=m,u&=~(1<{u|=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 r=t.map((i,o)=>Wr(e[o],i));return i=>r.map(o=>o(i))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(xi(e)&&xi(t)){e=e.getTime(),t=t.getTime();const o=t-e;return l=>new Date(e+l*o)}const r=Object.keys(t),i={};return r.forEach(o=>{i[o]=Wr(e[o],t[o])}),o=>{const l={};return r.forEach(a=>{l[a]=i[a](o)}),l}}if(n==="number"){const r=t-e;return i=>e+i*r}throw new Error(`Cannot interpolate ${n} values`)}function mi(e,t={}){const n=ke(e);let r,i=e;function o(l,a){if(e==null)return n.set(e=l),Promise.resolve();i=l;let s=r,u=!1,{delay:c=0,duration:f=400,easing:d=ts,interpolate:g=Wr}=Bn(Bn({},t),a);if(f===0)return s&&(s.abort(),s=null),n.set(e=i),Promise.resolve();const p=is()+c;let m;return r=ls(_=>{if(_f?(n.set(e=l),!1):(n.set(e=m(d(b/f))),!0)}),r.promise}return{set:o,update:(l,a)=>o(l(i,e),a),subscribe:n.subscribe}}const xe=ke([]),Cr=ke([]),kr=ke([]),pn=ke([]),nt=ke("all"),Ti=ke({"n/a":1,up:1,down:1}),lu=["who","what","how","why","where","does","can","n/a"],Xr=mi(lu.map(e=>({question:e,count:0}))),Yr=ke(new Set);var Qr="http://www.w3.org/1999/xhtml";const Oi={svg:"http://www.w3.org/2000/svg",xhtml:Qr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Oi.hasOwnProperty(t)?{space:Oi[t],local:e}:e}function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Qr&&t.documentElement.namespaceURI===Qr?t.createElement(e):t.createElementNS(n,e)}}function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ps(e){var t=hs(e);return(t.local?au:su)(t)}function uu(){}function ms(e){return e==null?uu:function(){return this.querySelector(e)}}function cu(e){typeof e!="function"&&(e=ms(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=C&&(C=w+1);!($=_[C])&&++C=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function Tu(e){e||(e=Ou);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function Vu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zu(){return Array.from(this)}function Hu(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Ku:typeof t=="function"?Zu:Ju)(e,t,n??"")):tc(this.node(),e)}function tc(e,t){return e.style.getPropertyValue(t)||ws(e).getComputedStyle(e,null).getPropertyValue(t)}function nc(e){return function(){delete this[e]}}function rc(e,t){return function(){this[e]=t}}function ic(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function oc(e,t){return arguments.length>1?this.each((t==null?nc:typeof t=="function"?ic:rc)(e,t)):this.node()[e]}function ys(e){return e.trim().split(/^|\s+/)}function _i(e){return e.classList||new Ss(e)}function Ss(e){this._node=e,this._names=ys(e.getAttribute("class")||"")}Ss.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 Cs(e,t){for(var n=_i(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Nc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n`${b[0].toUpperCase()}${b.slice(1)}`),f=parseFloat(o[`padding${c[0]}`]),d=parseFloat(o[`padding${c[1]}`]),g=parseFloat(o[`margin${c[0]}`]),p=parseFloat(o[`margin${c[1]}`]),m=parseFloat(o[`border${c[0]}Width`]),_=parseFloat(o[`border${c[1]}Width`]);return{delay:t,duration:n,easing:r,css:b=>`overflow: hidden;opacity: ${Math.min(b*20,1)*l};${a}: ${b*s}px;padding-${u[0]}: ${b*f}px;padding-${u[1]}: ${b*d}px;margin-${u[0]}: ${b*g}px;margin-${u[1]}: ${b*p}px;border-${u[0]}-width: ${b*m}px;border-${u[1]}-width: ${b*_}px;`}}function Rn(e,{delay:t=0,duration:n=400,easing:r=pi,start:i=0,opacity:o=0}={}){const l=getComputedStyle(e),a=+l.opacity,s=l.transform==="none"?"":l.transform,u=1-i,c=a*(1-o);return{delay:t,duration:n,easing:r,css:(f,d)=>` - transform: ${s} scale(${1-u*d}); - opacity: ${a-c*d} - `}}function Kr(e,t=2){if(e===0)return"0 Bytes";const n=1024,r=t<0?0:t,i=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,o)).toFixed(r))+" "+i[o]}function Lc(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let r=0;r({question:r,count:t[r]}))}function As(e){return e.map(t=>{const n=t.question.split(" ").length,r=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+r,vote:t.vote}})}function qc(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const i=document.createElement("span");i.textContent=t,i.setAttribute("id","tooltip"),e.appendChild(i),e.addEventListener("mouseleave",r),e.addEventListener("blur",r),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function r(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",r),e.removeEventListener("blur",r),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 Vi(e,t,n){const r=e.slice();return r[16]=t[n],r[18]=n,r}function zi(e){let t,n,r,i,o,l;function a(...u){return e[9](e[18],...u)}function s(...u){return e[10](e[18],...u)}return{c(){t=R("div"),n=R("button"),n.textContent="👍",r=D(),i=R("button"),i.textContent="👎",h(n,"class","small-button thumbs-up svelte-19cad35"),h(i,"class","small-button thumbs-down svelte-19cad35"),h(t,"class","feedback-buttons svelte-19cad35")},m(u,c){T(u,t,c),v(t,n),v(t,r),v(t,i),o||(l=[j(n,"click",a),j(i,"click",s)],o=!0)},p(u,c){e=u},d(u){u&&x(t),o=!1,_e(l)}}}function Hi(e,t){let n,r,i,o,l,a,s,u,c,f=t[16].question+"",d,g,p,m,_,b,w,C=t[16].answer+"",A,$,E,S,k,y,M=t[0]&&zi(t);return{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("div"),_=R("h5"),_.textContent="Response:",b=D(),w=R("p"),A=z(C),$=D(),M&&M.c(),E=D(),h(i,"class","avatar"),h(s,"class","bold svelte-19cad35"),h(a,"class","question svelte-19cad35"),h(_,"class","bold svelte-19cad35"),h(m,"class","answer svelte-19cad35"),h(p,"class","answers svelte-19cad35"),h(l,"class","message-content svelte-19cad35"),h(r,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,F){T(I,n,F),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,b),v(m,w),v(w,A),v(m,$),M&&M.m(m,null),v(n,E),k||(y=gn(S=jc.call(null,n,t[18]===t[4].length-1)),k=!0)},p(I,F){t=I,F&16&&f!==(f=t[16].question+"")&&Q(d,f),F&16&&C!==(C=t[16].answer+"")&&Q(A,C),t[0]?M?M.p(t,F):(M=zi(t),M.c(),M.m(m,null)):M&&(M.d(1),M=null),S&&Ye(S.update)&&F&16&&S.update.call(null,t[18]===t[4].length-1)},d(I){I&&x(n),M&&M.d(),k=!1,y()}}}function Gc(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m=(e[2]?e[3]:"Send")+"",_,b,w,C,A,$,E=e[4];const S=k=>k[18];for(let k=0;kVote Feedback Instructions -

Ask a question to receive an answer from the chatbot. If the response is - satisfactory, click on the 👍 - button. If the repsonse is not satisfactory, click on the - 👎 button.

`,r=D(),i=R("div"),o=R("section"),l=R("div");for(let k=0;k{e.scrollIntoView({behavior:"smooth"})},0)}async function Bc(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 Uc(e,t,n){let r,i;ee(e,xe,b=>n(4,i=b));let{feedback:o=!1}=t,{is_retrieval:l=!1}=t,a="",s="",u=!1;ut(()=>{c()});async function c(){const A=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map($=>({id:$[0],question:$[1],answer:$[2],vote_status:$[3]}));Oe(xe,i=[...A],i)}const f=async b=>{b.preventDefault(),a=s,n(1,s=""),n(2,u=!0);let w={id:i.length+1,question:a,answer:"Loading...",vote_status:"na"};Oe(xe,i=[...i,w],i);const C=l?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(C.ok){const A=await C.json();console.log("response data",A),w.answer=A.answer,xe.update($=>($[$.length-1]=w,$))}else{const A=await C.text();alert(A)}n(2,u=!1)};let d=0;setInterval(()=>{n(8,d=(d+1)%4)},200);function g(b,w,C){const A=i[C];A.vote=w;const $={id:C+1,vote_status:w};Bc($),st(b.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),st(b.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}[...Array(10).keys()].map(b=>String.fromCharCode(65+b));const p=(b,w)=>g(w,"up",b),m=(b,w)=>g(w,"down",b);function _(){s=this.value,n(1,s)}return e.$$set=b=>{"feedback"in b&&n(0,o=b.feedback),"is_retrieval"in b&&n(7,l=b.is_retrieval)},e.$$.update=()=>{e.$$.dirty&256&&n(3,r=".".repeat(d).padEnd(3))},[o,s,u,r,i,f,g,l,d,p,m,_]}class vi extends ie{constructor(t){super(),se(this,t,Uc,Gc,re,{feedback:0,is_retrieval:7})}}function Li(e,t,n){const r=e.slice();return r[14]=t[n],r[16]=n,r}function qi(e,t){let n,r,i,o,l,a,s,u,c,f=t[14].question+"",d,g,p,m,_,b,w,C=t[14].up_ranking_answer+"",A,$,E,S,k,y,M=t[14].low_ranking_answer+"",I,F,P,B,ge;function oe(...ae){return t[7](t[14],t[16],...ae)}function Ee(...ae){return t[8](t[14],t[16],...ae)}function Me(...ae){return t[9](t[14],t[16],...ae)}function ye(...ae){return t[10](t[14],t[16],...ae)}return{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("div"),_=R("h5"),_.textContent="Response 1:",b=D(),w=R("p"),A=z(C),$=D(),E=R("div"),S=R("h5"),S.textContent="Response 2:",k=D(),y=R("p"),I=z(M),F=D(),h(i,"class","avatar"),h(s,"class","bold svelte-au920n"),h(a,"class","question svelte-au920n"),h(_,"class","bold underline svelte-au920n"),h(m,"class","answer svelte-au920n"),h(S,"class","bold underline svelte-au920n"),h(E,"class","answer svelte-au920n"),h(p,"class","answers svelte-au920n"),h(l,"class","message-content svelte-au920n"),h(r,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(ae,ze){T(ae,n,ze),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(l,g),v(l,p),v(p,m),v(m,_),v(m,b),v(m,w),v(w,A),v(p,$),v(p,E),v(E,S),v(E,k),v(E,y),v(y,I),v(n,F),B||(ge=[j(m,"click",oe),j(m,"keydown",Ee),j(E,"click",Me),j(E,"keydown",ye),gn(P=Xc.call(null,n,t[16]===t[3].length-1))],B=!0)},p(ae,ze){t=ae,ze&8&&f!==(f=t[14].question+"")&&Q(d,f),ze&8&&C!==(C=t[14].up_ranking_answer+"")&&Q(A,C),ze&8&&M!==(M=t[14].low_ranking_answer+"")&&Q(I,M),P&&Ye(P.update)&&ze&8&&P.update.call(null,t[16]===t[3].length-1)},d(ae){ae&&x(n),B=!1,_e(ge)}}}function Wc(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m=(e[1]?e[2]:"Send")+"",_,b,w,C,A,$,E=e[3];const S=k=>k[16];for(let k=0;kRanked 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.

- `,r=D(),i=R("div"),o=R("section"),l=R("div");for(let k=0;k{e.scrollIntoView({behavior:"smooth"})},0)}async function Yc(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 Qc(e,t,n){let r,i;ee(e,Cr,_=>n(3,i=_));let o="",l="",a=!1;ut(()=>{});const s=async _=>{_.preventDefault(),o=l,n(0,l=""),n(1,a=!0);let b={question:o,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Oe(Cr,i=[...i,b],i);const w=await fetch(`/chat/multi_responses/${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:o})});if(w.ok){const C=await w.json();b.up_ranking_answer=C.answer[0],b.low_ranking_answer=C.answer[1],Cr.update(A=>(A[A.length-1]=b,A))}else{const C=await w.text();alert(C)}n(1,a=!1)};let u=0;setInterval(()=>{n(6,u=(u+1)%4)},200);function c(_,b,w,C){const A=i[w],$={1:"up_ranking_answer",2:"low_ranking_answer"},E={question:A.question,up_ranking_answer:A[$[C]],low_ranking_answer:A[$[C%2+1]]};Yc(E),st(_.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),st(_.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const f=(_,b,w)=>c(w,_,b,1),d=(_,b,w)=>c(w,_,b,1),g=(_,b,w)=>c(w,_,b,2),p=(_,b,w)=>c(w,_,b,2);function m(){l=this.value,n(0,l)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,r=".".repeat(u).padEnd(3))},[l,a,r,i,s,c,u,f,d,g,p,m]}class Kc extends ie{constructor(t){super(),se(this,t,Qc,Wc,re,{})}}function Gi(e,t,n){const r=e.slice();return r[8]=t[n],r[10]=n,r}function ji(e){let t,n,r,i,o=e[8].name+"",l,a,s,u,c;function f(...d){return e[6](e[8],...d)}return{c(){t=R("label"),n=R("input"),l=z(o),a=D(),h(n,"type","checkbox"),h(n,"id",r=e[8].id),n.checked=i=e[1].has(e[8].name),h(t,"for",s=e[8].id)},m(d,g){T(d,t,g),v(t,n),v(t,l),v(t,a),u||(c=j(n,"change",f),u=!0)},p(d,g){e=d,g&1&&r!==(r=e[8].id)&&h(n,"id",r),g&3&&i!==(i=e[1].has(e[8].name))&&(n.checked=i),g&1&&o!==(o=e[8].name+"")&&Q(l,o),g&1&&s!==(s=e[8].id)&&h(t,"for",s)},d(d){d&&x(t),u=!1,c()}}}function Jc(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[0],g=[];for(let p=0;pn(1,r=f));let{documents:i=[]}=t,o=!1,l;function a(){n(2,o=!o)}function s(f,d){d.target.checked?r.add(f):r.delete(f),Yr.set(new Set(r))}const u=(f,d)=>s(f.name,d);function c(f){hn[f?"unshift":"push"](()=>{l=f,n(3,l)})}return e.$$set=f=>{"documents"in f&&n(0,i=f.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(r)},[i,r,o,l,a,s,u,c]}let ef=class extends ie{constructor(t){super(),se(this,t,Zc,Jc,re,{documents:0})}};function tf(e){let t;return{c(){t=R("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function nf(e){let t;return{c(){t=R("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Bi(e){let t,n,r,i,o;return{c(){t=R("div"),n=R("p"),r=z(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(l,a){T(l,t,a),v(t,n),v(n,r),o=!0},p(l,a){(!o||a&2)&&Q(r,l[1])},i(l){o||(Se(()=>{o&&(i||(i=Ke(t,mn,{},!0)),i.run(1))}),o=!0)},o(l){i||(i=Ke(t,mn,{},!1)),i.run(0),o=!1},d(l){l&&x(t),l&&i&&i.end()}}}function rf(e){let t,n,r,i=e[2]+1+"",o,l,a,s,u,c,f,d,g;function p(w,C){return w[3]?nf:tf}let m=p(e),_=m(e),b=e[3]&&Bi(e);return{c(){t=R("div"),n=R("div"),r=R("p"),o=z(i),l=z(": "),a=z(e[0]),s=D(),_.c(),c=D(),b&&b.c(),h(r,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(w,C){T(w,t,C),v(t,n),v(n,r),v(r,o),v(r,l),v(r,a),v(n,s),_.m(n,null),v(t,c),b&&b.m(t,null),f=!0,d||(g=j(n,"click",e[4]),d=!0)},p(w,[C]){(!f||C&4)&&i!==(i=w[2]+1+"")&&Q(o,i),(!f||C&1)&&Q(a,w[0]),m!==(m=p(w))&&(_.d(1),_=m(w),_&&(_.c(),_.m(n,null))),w[3]?b?(b.p(w,C),C&8&&N(b,1)):(b=Bi(w),b.c(),N(b,1),b.m(t,null)):b&&(ue(),V(b,1,1,()=>{b=null}),ce())},i(w){f||(Se(()=>{f&&(u||(u=Ke(n,mn,{},!0)),u.run(1))}),N(b),f=!0)},o(w){u||(u=Ke(n,mn,{},!1)),u.run(0),V(b),f=!1},d(w){w&&x(t),_.d(),w&&u&&u.end(),b&&b.d(),d=!1,g()}}}function of(e,t,n){let{source:r=""}=t,{source_content:i=""}=t,{i:o=0}=t,l=o===0;const a=()=>n(3,l=!l);return e.$$set=s=>{"source"in s&&n(0,r=s.source),"source_content"in s&&n(1,i=s.source_content),"i"in s&&n(2,o=s.i)},[r,i,o,l,a]}class lf extends ie{constructor(t){super(),se(this,t,of,rf,re,{source:0,source_content:1,i:2})}}function Ui(e,t,n){const r=e.slice();return r[4]=t[n],r[6]=n,r}function Wi(e){let t,n,r,i;const o=[cf,uf,af,sf],l=[];function a(s,u){return s[0][0]==="N/A"?0:s[0][0]==="Loading..."?1:s[0][0]==="Not loaded"?2:3}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n?n.p(s,u):(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function sf(e){let t,n,r,i=e[0].length+"",o,l,a,s,u,c,f,d;function g(b,w){return b[2]?df:ff}let p=g(e),m=p(e),_=e[2]&&Xi(e);return{c(){t=R("div"),n=R("h5"),r=z("📖 Response Sources ("),o=z(i),l=z(")"),a=D(),m.c(),s=D(),_&&_.c(),u=Ae(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(b,w){T(b,t,w),v(t,n),v(n,r),v(n,o),v(n,l),v(t,a),m.m(t,null),T(b,s,w),_&&_.m(b,w),T(b,u,w),c=!0,f||(d=j(t,"click",e[3]),f=!0)},p(b,w){(!c||w&1)&&i!==(i=b[0].length+"")&&Q(o,i),p!==(p=g(b))&&(m.d(1),m=p(b),m&&(m.c(),m.m(t,null))),b[2]?_?(_.p(b,w),w&4&&N(_,1)):(_=Xi(b),_.c(),N(_,1),_.m(u.parentNode,u)):_&&(ue(),V(_,1,1,()=>{_=null}),ce())},i(b){c||(N(_),c=!0)},o(b){V(_),c=!1},d(b){b&&x(t),m.d(),b&&x(s),_&&_.d(b),b&&x(u),f=!1,d()}}}function af(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function uf(e){let t;return{c(){t=R("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function cf(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,r){T(n,t,r)},p:H,i:H,o:H,d(n){n&&x(t)}}}function ff(e){let t;return{c(){t=R("span"),t.textContent="⌄"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function df(e){let t;return{c(){t=R("span"),t.textContent="⌃"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Xi(e){let t,n,r=e[0],i=[];for(let l=0;lV(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l{r=null}),ce())},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){i&&x(t),r&&r.d()}}}function hf(e,t,n){let{sources:r=[]}=t,{source_content:i=[]}=t,o=!1;const l=()=>n(2,o=!o);return e.$$set=a=>{"sources"in a&&n(0,r=a.sources),"source_content"in a&&n(1,i=a.source_content)},[r,i,o,l]}class pf extends ie{constructor(t){super(),se(this,t,hf,gf,re,{sources:0,source_content:1})}}function Qi(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ki(e,t,n){const r=e.slice();return r[4]=t[n],r}function Ji(e){let t,n,r,i=e[4].label+"",o,l,a,s,u;return{c(){t=R("li"),n=R("span"),r=R("h5"),o=z(i),l=D(),h(r,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",a=Ii(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,f){T(c,t,f),v(t,n),v(n,r),v(r,o),v(t,l),s||(u=j(n,"click",function(){Ye(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),s=!0)},p(c,f){e=c,f&2&&i!==(i=e[4].label+"")&&Q(o,i),f&3&&a!==(a=Ii(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",a)},d(c){c&&x(t),s=!1,u()}}}function Zi(e){let t,n,r,i;const o=[e[2]];var l=e[4].component;function a(s){let u={};for(let c=0;c{J(f,1)}),ce()}l?(n=mt(l,a()),Z(n.$$.fragment),N(n.$$.fragment,1),K(n,t,r)):n=null}else l&&n.$set(c)},i(s){i||(n&&N(n.$$.fragment,s),i=!0)},o(s){n&&V(n.$$.fragment,s),i=!1},d(s){s&&x(t),n&&J(n)}}}function eo(e){let t,n,r=e[0]==e[4].value&&Zi(e);return{c(){r&&r.c(),t=Ae()},m(i,o){r&&r.m(i,o),T(i,t,o),n=!0},p(i,o){i[0]==i[4].value?r?(r.p(i,o),o&3&&N(r,1)):(r=Zi(i),r.c(),N(r,1),r.m(t.parentNode,t)):r&&(ue(),V(r,1,1,()=>{r=null}),ce())},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){r&&r.d(i),i&&x(t)}}}function mf(e){let t,n,r,i,o=e[1],l=[];for(let c=0;cV(s[c],1,1,()=>{s[c]=null});return{c(){t=R("ul");for(let c=0;c()=>n(0,i=a);return e.$$set=a=>{"items"in a&&n(1,r=a.items),"activeTabValue"in a&&n(0,i=a.activeTabValue),"tabProps"in a&&n(2,o=a.tabProps)},[i,r,o,l]}class vf extends ie{constructor(t){super(),se(this,t,_f,mf,re,{items:1,activeTabValue:0,tabProps:2})}}function to(e){let t;return{c(){t=z("Press ENTER to autofill with the RAG answer.")},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function bf(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=e[0].edited_answer===Qn&&to();return{c(){t=R("form"),n=R("textarea"),i=D(),o=R("div"),l=R("div"),p&&p.c(),a=D(),s=R("div"),u=R("button"),u.textContent="Update",c=D(),f=R("button"),f.textContent="Reset",h(n,"placeholder",r=e[0].answer),h(l,"class","note svelte-i9wciy"),h(o,"class","button-container svelte-i9wciy")},m(m,_){T(m,t,_),v(t,n),tt(n,e[0].edited_answer),e[6](n),v(t,i),v(t,o),v(o,l),p&&p.m(l,null),v(o,a),v(o,s),v(s,u),v(s,c),v(s,f),d||(g=[j(n,"input",e[5]),j(n,"keydown",e[4]),j(u,"click",e[2]),j(f,"click",e[3])],d=!0)},p(m,[_]){_&1&&r!==(r=m[0].answer)&&h(n,"placeholder",r),_&1&&tt(n,m[0].edited_answer),m[0].edited_answer===Qn?p||(p=to(),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},i:H,o:H,d(m){m&&x(t),e[6](null),p&&p.d(),d=!1,_e(g)}}}const Qn="";function wf(e,t,n){let{message:r={}}=t,i;const o=async f=>{const d={id:r.id,new_answer:f},g=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(g.ok)console.log("Answer updated successfully",g),n(0,r.edited_answer=f,r);else{const p=await g.text();alert(p)}},l=f=>{f.preventDefault(),o(r.edited_answer)},a=f=>{f.preventDefault(),o(Qn)},s=f=>{f.key=="Enter"&&r.edited_answer===Qn&&(f.preventDefault(),console.log("ENTER"),n(0,r.edited_answer=r.answer,r))};ut(function(){i.focus()});function u(){r.edited_answer=this.value,n(0,r)}function c(f){hn[f?"unshift":"push"](()=>{i=f,n(1,i)})}return e.$$set=f=>{"message"in f&&n(0,r=f.message)},[r,i,l,a,s,u,c]}class yf extends ie{constructor(t){super(),se(this,t,wf,bf,re,{message:0})}}function no(e){let t,n,r,i,o,l;return{c(){t=R("div"),n=R("button"),n.textContent="👍",r=D(),i=R("button"),i.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(i,"class","small-button thumbs-down svelte-1u8cd0w"),h(t,"class","feedback-buttons svelte-1u8cd0w")},m(a,s){T(a,t,s),v(t,n),v(t,r),v(t,i),o||(l=[j(n,"click",e[4]),j(i,"click",e[5])],o=!0)},p:H,d(a){a&&x(t),o=!1,_e(l)}}}function Sf(e){let t,n=e[0].answer+"",r,i,o,l=e[1]&&no(e);return{c(){t=R("div"),r=z(n),i=D(),l&&l.c(),o=Ae()},m(a,s){T(a,t,s),v(t,r),T(a,i,s),l&&l.m(a,s),T(a,o,s)},p(a,[s]){s&1&&n!==(n=a[0].answer+"")&&Q(r,n),a[1]?l?l.p(a,s):(l=no(a),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null)},i:H,o:H,d(a){a&&x(t),a&&x(i),l&&l.d(a),a&&x(o)}}}async function Cf(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 kf(e,t,n){let r;ee(e,xe,c=>n(6,r=c));let{message:i={}}=t,{feedback:o=!1}=t,{index:l=0}=t;function a(c,f,d){const g=r[d];g.vote=f;const p={id:d+1,vote_status:f};Cf(p),st(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),st(c.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const s=c=>a(c,"up",l),u=c=>a(c,"down",l);return e.$$set=c=>{"message"in c&&n(0,i=c.message),"feedback"in c&&n(1,o=c.feedback),"index"in c&&n(2,l=c.index)},[i,o,l,a,s,u]}class $f extends ie{constructor(t){super(),se(this,t,kf,Sf,re,{message:0,feedback:1,index:2})}}function ro(e,t,n){const r=e.slice();return r[16]=t[n],r[18]=n,r}function io(e,t){let n,r,i,o,l,a,s,u,c,f=t[16].question+"",d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return A=new vf({props:{items:t[7],tabProps:{message:t[16],feedback:t[0],index:t[18]}}}),E=new pf({props:{sources:t[16].source,source_content:t[16].source_content}}),{key:e,first:null,c(){n=R("div"),r=R("div"),i=R("div"),o=D(),l=R("div"),a=R("div"),s=R("h5"),s.textContent="Question:",u=D(),c=R("p"),d=z(f),g=D(),p=R("div"),m=R("p"),m.textContent="ℹ️ Retrieval Sources",b=D(),w=R("div"),C=R("div"),Z(A.$$.fragment),$=D(),Z(E.$$.fragment),S=D(),h(i,"class","avatar"),h(s,"class","bold"),h(m,"class","bold"),h(p,"class","rag-sources svelte-aj7hp0"),h(a,"class","question svelte-aj7hp0"),h(C,"class","answer svelte-aj7hp0"),h(w,"class","answers svelte-aj7hp0"),h(l,"class","message-content svelte-aj7hp0"),h(r,"class","chat-message-center svelte-aj7hp0"),h(n,"class","chat-message svelte-aj7hp0"),this.first=n},m(F,P){T(F,n,P),v(n,r),v(r,i),v(r,o),v(r,l),v(l,a),v(a,s),v(a,u),v(a,c),v(c,d),v(a,g),v(a,p),v(p,m),v(l,b),v(l,w),v(w,C),K(A,C,null),v(l,$),K(E,l,null),v(n,S),y=!0,M||(I=[gn(_=qc.call(null,m,oo(t[16]))),gn(k=Af.call(null,n,t[18]===t[4].length-1))],M=!0)},p(F,P){t=F,(!y||P&16)&&f!==(f=t[16].question+"")&&Q(d,f),_&&Ye(_.update)&&P&16&&_.update.call(null,oo(t[16]));const B={};P&17&&(B.tabProps={message:t[16],feedback:t[0],index:t[18]}),A.$set(B);const ge={};P&16&&(ge.sources=t[16].source),P&16&&(ge.source_content=t[16].source_content),E.$set(ge),k&&Ye(k.update)&&P&16&&k.update.call(null,t[18]===t[4].length-1)},i(F){y||(N(A.$$.fragment,F),N(E.$$.fragment,F),y=!0)},o(F){V(A.$$.fragment,F),V(E.$$.fragment,F),y=!1},d(F){F&&x(n),J(A),J(E),M=!1,_e(I)}}}function Rf(e){let t,n,r,i,o,l,a=[],s=new Map,u,c,f,d,g,p,m,_,b,w=(e[2]?e[3]:"Send")+"",C,A,$,E,S,k,y,M=e[4];const I=F=>F[18];for(let F=0;FVote Feedback Instructions -

Ask a question to receive an answer from the chatbot. If the response is - satisfactory, click on the 👍 - button. If the response is not satisfactory, click on the - 👎 button.

`,r=D(),i=R("div"),o=R("section"),l=R("div");for(let F=0;F{e.scrollIntoView({behavior:"smooth"})},0)}function oo(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Ef(e,t,n){let r,i,o,l;ee(e,xe,C=>n(4,i=C)),ee(e,Yr,C=>n(13,o=C));let{feedback:a=!1}=t,{is_retrieval:s=!1}=t;const u=ke([]);ee(e,u,C=>n(5,l=C));let c="",f="",d=!1,g=[{label:"Answer",value:1,component:$f},{label:"Modified Answer",value:2,component:yf}];ut(()=>{m(),p()});async function p(){const A=await(await fetch("/retrieval/file/get")).json();console.log("data",A.files);const E=A.files.map((S,k)=>({id:String(k),name:S.name}));console.log("files",E),Oe(u,l=[...E],l)}async function m(){const $=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",$);const E=$.map(S=>({id:S[0],question:S[1],answer:S[2],edited_answer:S[3],vote_status:S[4],rag_sources:S[5],source:S[6],source_content:S[7]}));Oe(xe,i=[...E],i)}const _=async C=>{C.preventDefault(),c=f,n(1,f=""),n(2,d=!0);const A=[...o];let $={id:i.length+1,question:c,answer:"Loading...",rag_sources:A,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Oe(xe,i=[...i,$],i);const E=s?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:A})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(E.ok){const S=await E.json();console.log("response data",S),$.answer=S.answer,$.source=S.source,$.source_content=S.source_content,xe.update(k=>(k[k.length-1]=$,k))}else{const S=await E.text();alert(S)}n(2,d=!1)};let b=0;setInterval(()=>{n(10,b=(b+1)%4)},200);function w(){f=this.value,n(1,f)}return e.$$set=C=>{"feedback"in C&&n(0,a=C.feedback),"is_retrieval"in C&&n(9,s=C.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(3,r=".".repeat(b).padEnd(3))},[a,f,d,r,i,l,u,g,_,s,b,w]}class Mf extends ie{constructor(t){super(),se(this,t,Ef,Rf,re,{feedback:0,is_retrieval:9})}}function lo(e){let t,n;return t=new vi({props:{is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function so(e){let t,n;return t=new vi({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function ao(e){let t,n;return t=new Mf({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function uo(e){let t,n,r,i;const o=[Df,Ff],l=[];function a(s,u){return s[1]?0:1}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,u){let c=t;t=a(s),t===c?l[t].p(s,u):(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n?n.p(s,u):(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function Ff(e){let t,n;return t=new Kc({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:H,i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Df(e){let t,n;return t=new vi({props:{feedback:!0,is_retrieval:e[1]}}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.is_retrieval=r[1]),t.$set(o)},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function If(e){let t,n,r,i,o,l=!e[0]&&lo(e),a=e[0]==="vote"&&so(e),s=e[0]==="rag"&&ao(e),u=e[0]==="rank"&&uo(e);return{c(){l&&l.c(),t=D(),a&&a.c(),n=D(),s&&s.c(),r=D(),u&&u.c(),i=Ae()},m(c,f){l&&l.m(c,f),T(c,t,f),a&&a.m(c,f),T(c,n,f),s&&s.m(c,f),T(c,r,f),u&&u.m(c,f),T(c,i,f),o=!0},p(c,[f]){c[0]?l&&(ue(),V(l,1,1,()=>{l=null}),ce()):l?(l.p(c,f),f&1&&N(l,1)):(l=lo(c),l.c(),N(l,1),l.m(t.parentNode,t)),c[0]==="vote"?a?(a.p(c,f),f&1&&N(a,1)):(a=so(c),a.c(),N(a,1),a.m(n.parentNode,n)):a&&(ue(),V(a,1,1,()=>{a=null}),ce()),c[0]==="rag"?s?(s.p(c,f),f&1&&N(s,1)):(s=ao(c),s.c(),N(s,1),s.m(r.parentNode,r)):s&&(ue(),V(s,1,1,()=>{s=null}),ce()),c[0]==="rank"?u?(u.p(c,f),f&1&&N(u,1)):(u=uo(c),u.c(),N(u,1),u.m(i.parentNode,i)):u&&(ue(),V(u,1,1,()=>{u=null}),ce())},i(c){o||(N(l),N(a),N(s),N(u),o=!0)},o(c){V(l),V(a),V(s),V(u),o=!1},d(c){l&&l.d(c),c&&x(t),a&&a.d(c),c&&x(n),s&&s.d(c),c&&x(r),u&&u.d(c),c&&x(i)}}}function Nf(e,t,n){let{feedback:r}=t,{is_retrieval:i}=t;return e.$$set=o=>{"feedback"in o&&n(0,r=o.feedback),"is_retrieval"in o&&n(1,i=o.is_retrieval)},[r,i]}class Pf extends ie{constructor(t){super(),se(this,t,Nf,If,re,{feedback:0,is_retrieval:1})}}function co(e,t,n){const r=e.slice();return r[2]=t[n],r}function fo(e){let t,n=e[2]+"",r,i;return{c(){t=R("option"),r=z(n),t.__value=i=e[2],t.value=t.__value},m(o,l){T(o,t,l),v(t,r)},p(o,l){l&1&&n!==(n=o[2]+"")&&Q(r,n),l&1&&i!==(i=o[2])&&(t.__value=i,t.value=t.__value)},d(o){o&&x(t)}}}function xf(e){let t,n=e[0],r=[];for(let i=0;i{const o=await fetch(`/data/${r}`);n(0,i=await o.json())}),e.$$set=o=>{"data_endpoint"in o&&n(1,r=o.data_endpoint)},[i,r]}class Of extends ie{constructor(t){super(),se(this,t,Tf,xf,re,{data_endpoint:1})}}function Ht(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Vf(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Es(e){let t,n,r;e.length!==2?(t=Ht,n=(a,s)=>Ht(e(a),s),r=(a,s)=>e(a)-s):(t=e===Ht||e===Vf?e:zf,n=e,r=e);function i(a,s,u=0,c=a.length){if(u>>1;n(a[f],s)<0?u=f+1:c=f}while(u>>1;n(a[f],s)<=0?u=f+1:c=f}while(uu&&r(a[f-1],s)>-r(a[f],s)?f-1:f}return{left:i,center:l,right:o}}function zf(){return 0}function Hf(e){return e===null?NaN:+e}function*Lf(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const qf=Es(Ht),Gf=qf.right;Es(Hf).center;const Ms=Gf;function jf(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function sn(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r=o&&(n=r=o):(n>o&&(n=o),r{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Fs(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var Qf=Array.prototype,Kf=Qf.slice;function Rr(e){return()=>e}const Jf=Math.sqrt(50),Zf=Math.sqrt(10),ed=Math.sqrt(2);function Kn(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),l=o>=Jf?10:o>=Zf?5:o>=ed?2:1;let a,s,u;return i<0?(u=Math.pow(10,-i)/l,a=Math.round(e*u),s=Math.round(t*u),a/ut&&--s,u=-u):(u=Math.pow(10,i)*l,a=Math.round(e/u),s=Math.round(t/u),a*ut&&--s),s0))return[];if(e===t)return[e];const r=t=i))return[];const a=o-i+1,s=new Array(a);if(r)if(l<0)for(let u=0;u0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function rd(e){return Math.max(1,Math.ceil(Math.log(jf(e))/Math.LN2)+1)}function Is(){var e=Xf,t=sn,n=rd;function r(i){Array.isArray(i)||(i=Array.from(i));var o,l=i.length,a,s,u=new Array(l);for(o=0;o=d)if(C>=d&&t===sn){const $=jt(f,d,A);isFinite($)&&($>0?d=(Math.floor(d/$)+1)*$:$<0&&(d=(Math.ceil(d*-$)+1)/-$))}else g.pop()}for(var p=g.length,m=0,_=p;g[m]<=f;)++m;for(;g[_-1]>d;)--_;(m||_0?g[o-1]:f,w.x1=o0)for(o=0;o=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function po(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ns(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Fs:Yf(i);r>n;){if(r-n>600){const s=r-n+1,u=t-n+1,c=Math.log(s),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(s-f)/s)*(u-s/2<0?-1:1),g=Math.max(n,Math.floor(t-u*f/s+d)),p=Math.min(r,Math.floor(t+(s-u)*f/s+d));Ns(e,t,g,p,i)}const o=e[t];let l=n,a=r;for(Kt(e,n,t),i(e[r],o)>0&&Kt(e,n,r);l0;)--a}i(e[n],o)===0?Kt(e,n,a):(++a,Kt(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Kt(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function id(e,t,n){if(e=Float64Array.from(Lf(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return po(e);if(t>=1)return Rt(e);var r,i=(r-1)*t,o=Math.floor(i),l=Rt(Ns(e,o).subarray(0,o+1)),a=po(e.subarray(o+1));return l+(a-l)*(i-o)}}function od(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jn(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Bt(e){return e=Jn(Math.abs(e)),e?e[1]:NaN}function sd(e,t){return function(n,r){for(var i=n.length,o=[],l=0,a=e[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(n.substring(i-=a,i+a)),!((s+=a+1)>r));)a=e[l=(l+1)%e.length];return o.reverse().join(t)}}function ad(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ud=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zn(e){if(!(t=ud.exec(e)))throw new Error("invalid format: "+e);var t;return new bi({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Zn.prototype=bi.prototype;function bi(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}bi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cd(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Ps;function fd(e,t){var n=Jn(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Ps=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Jn(e,Math.max(0,t+o-1))[0]}function mo(e,t){var n=Jn(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const _o={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ld,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>mo(e*100,t),r:mo,s:fd,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function vo(e){return e}var bo=Array.prototype.map,wo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dd(e){var t=e.grouping===void 0||e.thousands===void 0?vo:sd(bo.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?vo:ad(bo.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",s=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Zn(f);var d=f.fill,g=f.align,p=f.sign,m=f.symbol,_=f.zero,b=f.width,w=f.comma,C=f.precision,A=f.trim,$=f.type;$==="n"?(w=!0,$="g"):_o[$]||(C===void 0&&(C=12),A=!0,$="g"),(_||d==="0"&&g==="=")&&(_=!0,d="0",g="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",S=m==="$"?r:/[%p]/.test($)?l:"",k=_o[$],y=/[defgprs%]/.test($);C=C===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function M(I){var F=E,P=S,B,ge,oe;if($==="c")P=k(I)+P,I="";else{I=+I;var Ee=I<0||1/I<0;if(I=isNaN(I)?s:k(Math.abs(I),C),A&&(I=cd(I)),Ee&&+I==0&&p!=="+"&&(Ee=!1),F=(Ee?p==="("?p:a:p==="-"||p==="("?"":p)+F,P=($==="s"?wo[8+Ps/3]:"")+P+(Ee&&p==="("?")":""),y){for(B=-1,ge=I.length;++Boe||oe>57){P=(oe===46?i+I.slice(B+1):I.slice(B))+P,I=I.slice(0,B);break}}}w&&!_&&(I=t(I,1/0));var Me=F.length+I.length+P.length,ye=Me>1)+F+I+P+ye.slice(Me);break;default:I=ye+F+I+P;break}return o(I)}return M.toString=function(){return f+""},M}function c(f,d){var g=u((f=Zn(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Bt(d)/3)))*3,m=Math.pow(10,-p),_=wo[8+p/3];return function(b){return g(m*b)+_}}return{format:u,formatPrefix:c}}var An,Mt,xs;gd({thousands:",",grouping:[3],currency:["$",""]});function gd(e){return An=dd(e),Mt=An.format,xs=An.formatPrefix,An}function hd(e){return Math.max(0,-Bt(Math.abs(e)))}function pd(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bt(t)/3)))*3-Bt(Math.abs(e)))}function md(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bt(t)-Bt(e))+1}function wi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const yo=Symbol("implicit");function mr(){var e=new go,t=[],n=[],r=yo;function i(o){let l=e.get(o);if(l===void 0){if(r!==yo)return r;e.set(o,l=t.push(o)-1)}return n[l%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new go;for(const l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return mr(t,n).unknown(r)},wi.apply(i,arguments),i}function yi(){var e=mr().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,l,a=!1,s=0,u=0,c=.5;delete e.unknown;function f(){var d=t().length,g=i>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?En(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?En(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vd.exec(e))?new Te(t[1],t[2],t[3],1):(t=bd.exec(e))?new Te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wd.exec(e))?En(t[1],t[2],t[3],t[4]):(t=yd.exec(e))?En(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sd.exec(e))?Eo(t[1],t[2]/100,t[3]/100,1):(t=Cd.exec(e))?Eo(t[1],t[2]/100,t[3]/100,t[4]):So.hasOwnProperty(e)?$o(So[e]):e==="transparent"?new Te(NaN,NaN,NaN,0):null}function $o(e){return new Te(e>>16&255,e>>8&255,e&255,1)}function En(e,t,n,r){return r<=0&&(e=t=n=NaN),new Te(e,t,n,r)}function Rd(e){return e instanceof yn||(e=bn(e)),e?(e=e.rgb(),new Te(e.r,e.g,e.b,e.opacity)):new Te}function Jr(e,t,n,r){return arguments.length===1?Rd(e):new Te(e,t,n,r??1)}function Te(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Si(Te,Jr,Ts(yn,{brighter(e){return e=e==null?er:Math.pow(er,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Te($t(this.r),$t(this.g),$t(this.b),tr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ro,formatHex:Ro,formatHex8:Ad,formatRgb:Ao,toString:Ao}));function Ro(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}`}function Ad(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}${Ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){const e=tr(this.opacity);return`${e===1?"rgb(":"rgba("}${$t(this.r)}, ${$t(this.g)}, ${$t(this.b)}${e===1?")":`, ${e})`}`}function tr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $t(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ct(e){return e=$t(e),(e<16?"0":"")+e.toString(16)}function Eo(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,r)}function Os(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof yn||(e=bn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,a=o-i,s=(o+i)/2;return a?(t===o?l=(n-r)/a+(n0&&s<1?0:l,new Ue(l,a,s,e.opacity)}function Ed(e,t,n,r){return arguments.length===1?Os(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Si(Ue,Ed,Ts(yn,{brighter(e){return e=e==null?er:Math.pow(er,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_n:Math.pow(_n,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Te(Ar(e>=240?e-240:e+120,i,r),Ar(e,i,r),Ar(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ue(Mo(this.h),Mn(this.s),Mn(this.l),tr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=tr(this.opacity);return`${e===1?"hsl(":"hsla("}${Mo(this.h)}, ${Mn(this.s)*100}%, ${Mn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Mo(e){return e=(e||0)%360,e<0?e+360:e}function Mn(e){return Math.max(0,Math.min(1,e||0))}function Ar(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ci=e=>()=>e;function Md(e,t){return function(n){return e+n*t}}function Fd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Dd(e){return(e=+e)==1?Vs:function(t,n){return n-t?Fd(t,n,e):Ci(isNaN(t)?n:t)}}function Vs(e,t){var n=t-e;return n?Md(e,n):Ci(isNaN(e)?t:e)}const Fo=function e(t){var n=Dd(t);function r(i,o){var l=n((i=Jr(i)).r,(o=Jr(o)).r),a=n(i.g,o.g),s=n(i.b,o.b),u=Vs(i.opacity,o.opacity);return function(c){return i.r=l(c),i.g=a(c),i.b=s(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function Id(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;in&&(o=t.slice(n,o),a[l]?a[l]+=o:a[++l]=o),(r=r[0])===(i=i[0])?a[l]?a[l]+=i:a[++l]=i:(a[++l]=null,s.push({i:l,x:nr(r,i)})),n=Er.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function jd(e,t,n){var r=e[0],i=e[1],o=t[0],l=t[1];return i2?Bd:jd,s=u=null,f}function f(d){return d==null||isNaN(d=+d)?o:(s||(s=a(e.map(r),t,n)))(r(l(d)))}return f.invert=function(d){return l(i((u||(u=a(t,e.map(r),nr)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,qd),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Hd,c()},f.clamp=function(d){return arguments.length?(l=d?!0:Tt,c()):l!==Tt},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,g){return r=d,i=g,c()}}function Xd(){return Wd()(Tt,Tt)}function Yd(e,t,n,r){var i=td(e,t,n),o;switch(r=Zn(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=pd(i,l))&&(r.precision=o),xs(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=md(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=hd(i))&&(r.precision=o-(r.type==="%")*2);break}}return Mt(r)}function Qd(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ds(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Yd(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,l=r[i],a=r[o],s,u,c=10;for(a0;){if(u=jt(l,a,n),u===s)return r[i]=l,r[o]=a,t(r);if(u>0)l=Math.floor(l/u)*u,a=Math.ceil(a/u)*u;else if(u<0)l=Math.ceil(l*u)/u,a=Math.floor(a*u)/u;else break;s=u}return e},e}function We(){var e=Xd();return e.copy=function(){return Ud(e,We())},wi.apply(e,arguments),Qd(e)}function Fn(e){return function(){return e}}function Kd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ti(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,a=o.length;n=0;)n[t]=t;return n}function Jd(e,t){return e[t]}function Zd(e){const t=[];return t.key=e,t}function eg(){var e=Fn([]),t=ni,n=ti,r=Jd;function i(o){var l=Array.from(e.apply(this,arguments),Zd),a,s=l.length,u=-1,c;for(const f of o)for(a=0,++u;aFeedback Distribution

",n=D(),r=R("div"),i=U("svg");for(let s=0;se[19].call(r))},m(s,u){T(s,t,u),T(s,n,u),T(s,r,u),v(r,i);for(let c=0;cn(15,f=k)),ee(e,Ti,k=>n(4,d=k)),ee(e,xe,k=>n(16,g=k));let p=300,m=300;const _={up:2,down:1,"n/a":0,all:"all"},b={top:10,bottom:10,left:25,right:5},w=mr().range(["var(--yellow)","var(--red)","var(--green)"]),C=Mt(".0%");function A(k,y){r===k?n(5,r="all"):n(5,r=k),Oe(nt,f=r==="all"?"all":y,f)}const $=(k,y)=>A(k,y.key),E=(k,y)=>A(k,y.key);function S(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&32768&&n(5,r=_[f]),e.$$.dirty&2&&n(3,i=m-b.left-b.right),e.$$.dirty&1&&n(14,o=p-b.top-b.bottom),e.$$.dirty&65552&&g.forEach(k=>{Oe(Ti,d[k.vote_status]++,d)}),e.$$.dirty&16&&n(2,l=d.up+d.down+d["n/a"]),e.$$.dirty&16384&&n(8,a=yi().rangeRound([b.top,o-b.bottom]).padding(0).domain(["a"])),e.$$.dirty&12&&n(7,s=We().rangeRound([b.left,i-b.right]).domain([0,l])),e.$$.dirty&8208&&n(6,c=u([d]))},n(13,u=eg().keys(["n/a","down","up"]).order(ni).offset(ti)),[p,m,l,i,d,r,c,s,a,b,w,C,A,u,o,f,g,$,E,S]}class zs extends ie{constructor(t){super(),se(this,t,ng,tg,re,{})}}function rg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[3][e[2]]+"",g,p;return{c(){t=R("div"),n=R("div"),r=z("Q: "),i=z(e[0]),o=D(),l=R("div"),a=z("A: "),s=z(e[1]),u=D(),c=R("div"),f=z("Rating: "),g=z(d),h(n,"class","question svelte-szi0e"),h(l,"class","answer svelte-szi0e"),h(c,"class",p="feedback "+e[2]+" svelte-szi0e"),h(t,"class","qa-card svelte-szi0e")},m(m,_){T(m,t,_),v(t,n),v(n,r),v(n,i),v(t,o),v(t,l),v(l,a),v(l,s),v(t,u),v(t,c),v(c,f),v(c,g)},p(m,[_]){_&1&&Q(i,m[0]),_&2&&Q(s,m[1]),_&4&&d!==(d=m[3][m[2]]+"")&&Q(g,d),_&4&&p!==(p="feedback "+m[2]+" svelte-szi0e")&&h(c,"class",p)},i:H,o:H,d(m){m&&x(t)}}}function ig(e,t,n){let{question:r="What is gradient descent?"}=t,{answer:i="Gradient descent is an algorithm used to minimize a loss function by taking small steps in the direction of steepest descent."}=t,{feedback:o="Good: 👍"}=t;const l={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"};return e.$$set=a=>{"question"in a&&n(0,r=a.question),"answer"in a&&n(1,i=a.answer),"feedback"in a&&n(2,o=a.feedback)},[r,i,o,l]}class og extends ie{constructor(t){super(),se(this,t,ig,rg,re,{question:0,answer:1,feedback:2})}}function To(e,t,n){const r=e.slice();return r[5]=t[n].question,r[6]=t[n].answer,r[7]=t[n].vote_status,r}function Oo(e){let t,n,r,i,o;return n=new og({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=R("div"),Z(n.$$.fragment),r=D()},m(l,a){T(l,t,a),K(n,t,null),v(t,r),o=!0},p(l,a){const s={};a&1&&(s.question=l[5]),a&1&&(s.answer=l[6]),a&1&&(s.feedback=l[7]),n.$set(s)},i(l){o||(N(n.$$.fragment,l),l&&Se(()=>{o&&(i||(i=Ke(t,e[1],{duration:300},!0)),i.run(1))}),o=!0)},o(l){V(n.$$.fragment,l),l&&(i||(i=Ke(t,e[1],{duration:300},!1)),i.run(0)),o=!1},d(l){l&&x(t),J(n),l&&i&&i.end()}}}function lg(e){let t,n,r=e[0],i=[];for(let l=0;lV(i[l],1,1,()=>{i[l]=null});return{c(){t=R("div");for(let l=0;ln(4,i=s)),ee(e,nt,s=>n(2,o=s)),ee(e,pn,s=>n(3,l=s));const a=(s,{delay:u=0,duration:c=1e3,easing:f=pi})=>mn(s,{delay:u,duration:c,easing:f});return e.$$.update=()=>{e.$$.dirty&12&&n(0,r=o==="all"?l:l.filter(s=>s.vote_status===o)),e.$$.dirty&1&&Oe(Xr,i=Lc(r),i)},[r,a,o,l]}class Hs extends ie{constructor(t){super(),se(this,t,sg,lg,re,{})}}function Vo(e,t,n){const r=e.slice();return r[13]=t[n],r}function zo(e,t,n){const r=e.slice();return r[16]=t[n],r}function Ho(e,t,n){const r=e.slice();return r[16]=t[n],r}function Lo(e){let t,n,r,i,o=e[16]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[10].bottom+e[10].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-1oikip4"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[6](e[16])+e[6].bandwidth()/2} ${e[2]-e[10].bottom})`)},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[10].bottom+s[10].top)&&h(n,"y2",r),u&16&&o!==(o=s[16]+"")&&Q(l,o),u&84&&a!==(a=`translate(${s[6](s[16])+s[6].bandwidth()/2} ${s[2]-s[10].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function qo(e){let t,n,r,i;return{c(){t=U("g"),n=U("line"),h(n,"class","axis-tick svelte-1oikip4"),h(n,"x1",0),h(n,"x2",r=e[3]-e[10].right-e[10].left),h(n,"y1","0"),h(n,"y2","0"),h(n,"stroke","black"),h(t,"transform",i=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(o,l){T(o,t,l),v(t,n)},p(o,l){l&8&&r!==(r=o[3]-o[10].right-o[10].left)&&h(n,"x2",r),l&32&&i!==(i=`translate(${o[10].left} ${o[5](o[16])+0})`)&&h(t,"transform",i)},d(o){o&&x(t)}}}function Go(e){let t,n,r,i,o,l,a,s,u=Math.round(e[11](e[13].count))+"",c,f,d;return{c(){t=U("g"),n=U("rect"),s=U("text"),c=z(u),h(n,"x",r=e[6](e[13].question)),h(n,"y",i=e[5](e[13].count)),h(n,"height",o=e[2]-e[5](e[13].count)-e[10].bottom),h(n,"fill",l=e[9][e[7]]),h(n,"fill-opacity","0.95"),h(n,"width",a=e[6].bandwidth()),h(n,"class","svelte-1oikip4"),h(s,"class","axis-text svelte-1oikip4"),h(s,"x",f=e[6](e[13].question)+e[6].bandwidth()/2),h(s,"y",d=e[5](e[13].count)-5),h(s,"text-anchor","middle"),h(t,"class","series")},m(g,p){T(g,t,p),v(t,n),v(t,s),v(s,c)},p(g,p){p&80&&r!==(r=g[6](g[13].question))&&h(n,"x",r),p&48&&i!==(i=g[5](g[13].count))&&h(n,"y",i),p&52&&o!==(o=g[2]-g[5](g[13].count)-g[10].bottom)&&h(n,"height",o),p&128&&l!==(l=g[9][g[7]])&&h(n,"fill",l),p&64&&a!==(a=g[6].bandwidth())&&h(n,"width",a),p&16&&u!==(u=Math.round(g[11](g[13].count))+"")&&Q(c,u),p&80&&f!==(f=g[6](g[13].question)+g[6].bandwidth()/2)&&h(s,"x",f),p&48&&d!==(d=g[5](g[13].count)-5)&&h(s,"y",d)},d(g){g&&x(t)}}}function ag(e){let t,n,r,i,o,l,a=e[8][e[7]]+"",s,u,c,f,d,g,p,m,_,b=e[4].map(jo),w=[];for(let S=0;Se[12].call(t))},m(S,k){T(S,t,k),v(t,n);for(let y=0;ye.question;function ug(e,t,n){let r,i,o,l,a,s;ee(e,Xr,_=>n(4,a=_)),ee(e,nt,_=>n(7,s=_));const u={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"},c={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let f=300,d=300,g={top:35,bottom:10,left:25,right:5};const p=Mt(".1f");function m(){d=this.offsetWidth,f=this.offsetHeight,n(1,d),n(0,f)}return e.$$.update=()=>{e.$$.dirty&2&&n(3,r=d-g.left-g.right),e.$$.dirty&1&&n(2,i=f-g.top-g.bottom),e.$$.dirty&24&&n(6,o=yi().rangeRound([g.left,r-g.right]).padding(.05).domain(a.map(_=>_.question))),e.$$.dirty&20&&n(5,l=We().rangeRound([i-g.bottom,g.top]).domain([0,Rt(a,_=>_.count)])),e.$$.dirty&16&&console.log(a)},[f,d,i,r,a,l,o,s,u,c,g,p,m]}class Ls extends ie{constructor(t){super(),se(this,t,ug,ag,re,{})}}function Bo(e,t,n){const r=e.slice();r[19]=t[n];const i=r[7](r[19].x1)-r[7](r[19].x0);return r[20]=i,r}function Uo(e,t,n){const r=e.slice();return r[23]=t[n],r}function Wo(e){let t,n,r,i,o=e[23]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-kz2qh6"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[23])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&o!==(o=s[23]+"")&&Q(l,o),u&132&&a!==(a=`translate(${s[7](s[23])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function Xo(e){let t,n,r,i,o,l,a;return{c(){t=U("g"),n=U("rect"),h(n,"x",r=e[7](e[19].x0)+1),h(n,"width",i=e[20]),h(n,"y",o=e[6](e[19].length)),h(n,"height",l=e[6](0)-e[6](e[19].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[19].x0)+1)&&h(n,"x",r),u&136&&i!==(i=s[20])&&h(n,"width",i),u&72&&o!==(o=s[6](s[19].length))&&h(n,"y",o),u&72&&l!==(l=s[6](0)-s[6](s[19].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&x(t)}}}function cg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[14].call(t))},m(_,b){T(_,t,b),v(t,n);for(let w=0;wn(5,f=C)),ee(e,xe,C=>n(13,d=C));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,m=300,_={top:15,bottom:10,left:25,right:5};Mt(".1f");let b=Array.from({length:Yo},(C,A)=>A);function w(){m=this.offsetWidth,p=this.offsetHeight,n(1,m),n(0,p)}return e.$$.update=()=>{e.$$.dirty&8224&&n(12,r=f==="all"?d:d.filter(C=>C.vote_status===f)),e.$$.dirty&4096&&n(11,i=As(r)),e.$$.dirty&2&&n(4,o=m-_.left-_.right),e.$$.dirty&1&&n(2,l=p-_.top-_.bottom),e.$$.dirty&2048&&n(3,a=Is().thresholds(b).value(C=>C.answer)(i)),e.$$.dirty&16&&n(7,s=We().domain([3,Yo]).range([_.left,o-_.right])),e.$$.dirty&12&&n(6,u=We().domain([0,Rt(a,C=>C.length)]).range([l-_.bottom,_.top])),e.$$.dirty&2048&&n(10,c=Rt(i,C=>C.length)),e.$$.dirty&1056&&We().domain([0,c]).range(["white",g[f]]).interpolate(_r)},[p,m,l,a,o,f,u,s,g,_,c,i,r,d,w]}class qs extends ie{constructor(t){super(),se(this,t,fg,cg,re,{})}}function Qo(e,t,n){const r=e.slice();r[18]=t[n];const i=r[7](r[18].x1)-r[7](r[18].x0);return r[19]=i,r}function Ko(e,t,n){const r=e.slice();return r[22]=t[n],r}function Jo(e){let t,n,r,i,o=e[22]+"",l,a;return{c(){t=U("g"),n=U("line"),i=U("text"),l=z(o),h(n,"class","axis-tick svelte-kz2qh6"),h(n,"x1","0"),h(n,"x2","0"),h(n,"y1",0),h(n,"y2",r=-e[2]+e[9].bottom+e[9].top),h(n,"stroke","var(--squidink)"),h(n,"stroke-dasharray","4"),h(i,"class","axis-text svelte-kz2qh6"),h(i,"y","15"),h(i,"text-anchor","middle"),h(t,"transform",a=`translate(${e[7](e[22])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),h(t,"class","svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n),v(t,i),v(i,l)},p(s,u){u&4&&r!==(r=-s[2]+s[9].bottom+s[9].top)&&h(n,"y2",r),u&128&&o!==(o=s[22]+"")&&Q(l,o),u&132&&a!==(a=`translate(${s[7](s[22])+(s[7](1)-s[7](0))/2} ${s[2]-s[9].bottom})`)&&h(t,"transform",a)},d(s){s&&x(t)}}}function Zo(e){let t,n,r,i,o,l,a;return{c(){t=U("g"),n=U("rect"),h(n,"x",r=e[7](e[18].x0)+1),h(n,"width",i=e[19]),h(n,"y",o=e[6](e[18].length)),h(n,"height",l=e[6](0)-e[6](e[18].length)),h(n,"fill",a=e[8][e[5]]),h(n,"class","svelte-kz2qh6"),h(t,"class","histogram-bin svelte-kz2qh6")},m(s,u){T(s,t,u),v(t,n)},p(s,u){u&136&&r!==(r=s[7](s[18].x0)+1)&&h(n,"x",r),u&136&&i!==(i=s[19])&&h(n,"width",i),u&72&&o!==(o=s[6](s[18].length))&&h(n,"y",o),u&72&&l!==(l=s[6](0)-s[6](s[18].length))&&h(n,"height",l),u&32&&a!==(a=s[8][s[5]])&&h(n,"fill",a)},d(s){s&&x(t)}}}function dg(e){let t,n,r,i,o,l,a,s,u,c,f,d=e[7].ticks(),g=[];for(let _=0;_e[13].call(t))},m(_,b){T(_,t,b),v(t,n);for(let w=0;wn(5,c=w)),ee(e,xe,w=>n(12,f=w));const d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let g=300,p=300,m={top:15,bottom:10,left:25,right:5},_=Array.from({length:el},(w,C)=>C);mr().range(["var(--yellow)","var(--red)","var(--green)"]);function b(){p=this.offsetWidth,g=this.offsetHeight,n(1,p),n(0,g)}return e.$$.update=()=>{e.$$.dirty&4128&&n(11,r=c==="all"?f:f.filter(w=>w.vote_status===c)),e.$$.dirty&2048&&n(10,i=As(r)),e.$$.dirty&2&&n(4,o=p-m.left-m.right),e.$$.dirty&1&&n(2,l=g-m.top-m.bottom),e.$$.dirty&1024&&n(3,a=Is().thresholds(_).value(w=>w.question)(i)),e.$$.dirty&16&&n(7,s=We().domain([3,el]).range([m.left,o-m.right])),e.$$.dirty&12&&n(6,u=We().domain([0,Rt(a,w=>w.length)]).range([l-m.bottom,m.top])),e.$$.dirty&1024&&Rt(i,w=>w.length)},[g,p,l,a,o,c,u,s,d,m,i,r,f,b]}class Gs extends ie{constructor(t){super(),se(this,t,gg,dg,re,{})}}function hg(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=Math.round(e[5](e[3]))+"",m,_,b,w,C,A,$,E;return{c(){t=R("div"),n=R("div"),r=R("p"),r.textContent="Questions",i=D(),o=R("select"),l=R("option"),l.textContent="All",a=R("option"),a.textContent="Good",s=R("option"),s.textContent="Bad",u=R("option"),u.textContent="N/A",c=D(),f=R("div"),d=U("svg"),g=U("text"),m=z(p),C=D(),A=R("p"),A.textContent="number of responses",h(r,"class","card-text svelte-1pknxov"),l.__value="all",l.value=l.__value,h(l,"class","svelte-1pknxov"),a.__value="up",a.value=a.__value,h(a,"class","svelte-1pknxov"),s.__value="down",s.value=s.__value,h(s,"class","svelte-1pknxov"),u.__value="n/a",u.value=u.__value,h(u,"class","svelte-1pknxov"),h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),Re(o,"background",e[6][e[0]]),h(o,"class","svelte-1pknxov"),e[0]===void 0&&Se(()=>e[9].call(o)),h(n,"class","svelte-1pknxov"),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",b=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-1pknxov"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-1pknxov"),h(f,"class","svelte-1pknxov"),Se(()=>e[10].call(f)),h(A,"class","small svelte-1pknxov"),h(t,"class","card-container svelte-1pknxov"),Re(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,i),v(n,o),v(o,l),v(o,a),v(o,s),v(o,u),Un(o,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),w=Et(f,e[10].bind(f)),v(t,C),v(t,A),$||(E=j(o,"change",e[9]),$=!0)},p(S,[k]){k&1&&Re(o,"background",S[6][S[0]]),k&1&&Un(o,S[0]),k&8&&p!==(p=Math.round(S[5](S[3]))+"")&&Q(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&b!==(b=S[1]/2)&&h(g,"y",b),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&Re(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&x(t),w(),$=!1,E()}}}function pg(e,t){return t==="all"?e.length:e.filter(r=>r.vote_status===t).length}function mg(e,t,n){let r,i,o,l;ee(e,nt,p=>n(0,i=p)),ee(e,xe,p=>n(8,o=p));let a,s,u=mi(0);ee(e,u,p=>n(3,l=p));const c=Mt(".1f"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){i=as(this),nt.set(i)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=pg(o,i)),e.$$.dirty&128&&console.log("fbc",r),e.$$.dirty&128&&u.set(r)},[i,a,s,l,u,c,f,r,o,d,g]}class js extends ie{constructor(t){super(),se(this,t,mg,hg,re,{})}}function _g(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p=e[5](e[3])+"",m,_,b,w,C,A,$,E;return{c(){t=R("div"),n=R("div"),r=R("p"),r.textContent="Questions",i=D(),o=R("select"),l=R("option"),l.textContent="All",a=R("option"),a.textContent="Good",s=R("option"),s.textContent="Bad",u=R("option"),u.textContent="N/A",c=D(),f=R("div"),d=U("svg"),g=U("text"),m=z(p),C=D(),A=R("p"),A.textContent="percentage of responses",h(r,"class","card-text svelte-mchgj2"),l.__value="all",l.value=l.__value,a.__value="up",a.value=a.__value,s.__value="down",s.value=s.__value,u.__value="n/a",u.value=u.__value,h(o,"id","feedback-dropdown"),h(o,"name","feedback-dropdown"),Re(o,"background",e[6][e[0]]),h(o,"class","svelte-mchgj2"),e[0]===void 0&&Se(()=>e[9].call(o)),h(g,"dominant-baseline","middle"),h(g,"x",_=e[2]/2),h(g,"y",b=e[1]/2),h(g,"text-anchor","middle"),h(g,"class","svelte-mchgj2"),h(d,"width",e[2]),h(d,"height",e[1]),h(d,"class","svelte-mchgj2"),Se(()=>e[10].call(f)),h(A,"class","small svelte-mchgj2"),h(t,"class","card-container svelte-mchgj2"),Re(t,"background",e[6][e[0]])},m(S,k){T(S,t,k),v(t,n),v(n,r),v(n,i),v(n,o),v(o,l),v(o,a),v(o,s),v(o,u),Un(o,e[0],!0),v(t,c),v(t,f),v(f,d),v(d,g),v(g,m),w=Et(f,e[10].bind(f)),v(t,C),v(t,A),$||(E=j(o,"change",e[9]),$=!0)},p(S,[k]){k&1&&Re(o,"background",S[6][S[0]]),k&1&&Un(o,S[0]),k&8&&p!==(p=S[5](S[3])+"")&&Q(m,p),k&4&&_!==(_=S[2]/2)&&h(g,"x",_),k&2&&b!==(b=S[1]/2)&&h(g,"y",b),k&4&&h(d,"width",S[2]),k&2&&h(d,"height",S[1]),k&1&&Re(t,"background",S[6][S[0]])},i:H,o:H,d(S){S&&x(t),w(),$=!1,E()}}}function vg(e,t){const n=e.length;return t==="all"?1:e.filter(i=>i.vote_status===t).length/n}function bg(e,t,n){let r,i,o,l;ee(e,nt,p=>n(0,i=p)),ee(e,xe,p=>n(8,o=p));let a,s,u=mi(0);ee(e,u,p=>n(3,l=p));const c=Mt(".1%"),f={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function d(){i=as(this),nt.set(i)}function g(){s=this.clientWidth,a=this.clientHeight,n(2,s),n(1,a)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,r=vg(o,i)),e.$$.dirty&128&&u.set(r)},[i,a,s,l,u,c,f,r,o,d,g]}class Bs extends ie{constructor(t){super(),se(this,t,bg,_g,re,{})}}function wg(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return o=new js({}),s=new Bs({}),f=new zs({}),p=new Ls({props:{feedback:"Bad"}}),b=new Gs({}),A=new qs({}),M=new Hs({}),{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),Z(o.$$.fragment),l=D(),a=R("div"),Z(s.$$.fragment),u=D(),c=R("div"),Z(f.$$.fragment),d=D(),g=R("div"),Z(p.$$.fragment),m=D(),_=R("div"),Z(b.$$.fragment),w=D(),C=R("div"),Z(A.$$.fragment),$=D(),E=R("div"),S=R("div"),S.innerHTML=`
-
`,k=D(),y=R("div"),Z(M.$$.fragment),h(i,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(C,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"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,P){T(F,t,P),v(t,n),v(n,r),v(r,i),K(o,i,null),v(r,l),v(r,a),K(s,a,null),v(n,u),v(n,c),K(f,c,null),v(n,d),v(n,g),K(p,g,null),v(n,m),v(n,_),K(b,_,null),v(n,w),v(n,C),K(A,C,null),v(t,$),v(t,E),v(E,S),v(E,k),v(E,y),K(M,y,null),I=!0},p:H,i(F){I||(N(o.$$.fragment,F),N(s.$$.fragment,F),N(f.$$.fragment,F),N(p.$$.fragment,F),N(b.$$.fragment,F),N(A.$$.fragment,F),N(M.$$.fragment,F),I=!0)},o(F){V(o.$$.fragment,F),V(s.$$.fragment,F),V(f.$$.fragment,F),V(p.$$.fragment,F),V(b.$$.fragment,F),V(A.$$.fragment,F),V(M.$$.fragment,F),I=!1},d(F){F&&x(t),J(o),J(s),J(f),J(p),J(b),J(A),J(M)}}}function yg(e,t,n){let r;ee(e,pn,o=>n(0,r=o)),ut(()=>{i()});async function i(){const s=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(u=>({id:u[0],question:u[1],answer:u[2],vote_status:u[3]}));Oe(pn,r=[...s],r)}return[]}class Us extends ie{constructor(t){super(),se(this,t,yg,wg,re,{})}}/**! - * Sortable 1.15.0 - * @author RubaXa - * @author owenm - * @license MIT - */function tl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function kg(e,t){if(e==null)return{};var n=Cg(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var $g="1.15.0";function lt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ct=lt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Sn=lt(/Edge/i),nl=lt(/firefox/i),an=lt(/safari/i)&&!lt(/chrome/i)&&!lt(/android/i),Ws=lt(/iP(ad|od|hone)/i),Xs=lt(/chrome/i)&<(/android/i),Ys={capture:!1,passive:!1};function ne(e,t,n){e.addEventListener(t,n,!ct&&Ys)}function te(e,t,n){e.removeEventListener(t,n,!ct&&Ys)}function rr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Rg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Qe(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&rr(e,t):rr(e,t))||r&&e===n)return e;if(e===n)break}while(e=Rg(e))}return null}var rl=/\s+/g;function He(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(rl," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(rl," ")}}function q(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function qt(e,t){var n="";if(typeof e=="string")n=e;else do{var r=q(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Qs(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,o=r.length;if(n)for(;i=o:l=i<=o,!l)return r;if(r===et())break;r=ht(r,!1)}return!1}function Ut(e,t,n,r){for(var i=0,o=0,l=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=kg(r,Pg);Cn.pluginEvent.bind(L)(t,n,rt({dragEl:O,parentEl:me,ghostEl:X,rootEl:fe,nextEl:St,lastDownEl:Hn,cloneEl:de,cloneHidden:dt,dragStarted:tn,putSortable:Ce,activeSortable:L.active,originalEvent:i,oldIndex:Ot,oldDraggableIndex:cn,newIndex:Le,newDraggableIndex:ft,hideGhostForTarget:ra,unhideGhostForTarget:ia,cloneNowHidden:function(){dt=!0},cloneNowShown:function(){dt=!1},dispatchSortableEvent:function(a){Fe({sortable:n,name:a,originalEvent:i})}},o))};function Fe(e){Ng(rt({putSortable:Ce,cloneEl:de,targetEl:O,rootEl:fe,oldIndex:Ot,oldDraggableIndex:cn,newIndex:Le,newDraggableIndex:ft},e))}var O,me,X,fe,St,Hn,de,dt,Ot,Le,cn,ft,Dn,Ce,xt=!1,ir=!1,or=[],wt,Be,Dr,Ir,ll,sl,tn,Nt,fn,dn=!1,In=!1,Ln,$e,Nr=[],ri=!1,lr=[],vr=typeof document<"u",Nn=Ws,al=Sn||ct?"cssFloat":"float",xg=vr&&!Xs&&!Ws&&"draggable"in document.createElement("div"),ea=function(){if(vr){if(ct)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),ta=function(t,n){var r=q(t),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=Ut(t,0,n),l=Ut(t,1,n),a=o&&q(o),s=l&&q(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+we(o).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+we(l).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&a.float!=="none"){var f=a.float==="left"?"left":"right";return l&&(s.clear==="both"||s.clear===f)?"vertical":"horizontal"}return o&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=i&&r[al]==="none"||l&&r[al]==="none"&&u+c>i)?"vertical":"horizontal"},Tg=function(t,n,r){var i=r?t.left:t.top,o=r?t.right:t.bottom,l=r?t.width:t.height,a=r?n.left:n.top,s=r?n.right:n.bottom,u=r?n.width:n.height;return i===a||o===s||i+l/2===a+u/2},Og=function(t,n){var r;return or.some(function(i){var o=i[qe].options.emptyInsertThreshold;if(!(!o||ki(i))){var l=we(i),a=t>=l.left-o&&t<=l.right+o,s=n>=l.top-o&&n<=l.bottom+o;if(a&&s)return r=i}}),r},na=function(t){function n(o,l){return function(a,s,u,c){var f=a.options.group.name&&s.options.group.name&&a.options.group.name===s.options.group.name;if(o==null&&(l||f))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return n(o(a,s,u,c),l)(a,s,u,c);var d=(l?a:s).options.group.name;return o===!0||typeof o=="string"&&o===d||o.join&&o.indexOf(d)>-1}}var r={},i=t.group;(!i||zn(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,t.group=r},ra=function(){!ea&&X&&q(X,"display","none")},ia=function(){!ea&&X&&q(X,"display","")};vr&&!Xs&&document.addEventListener("click",function(e){if(ir)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ir=!1,!1},!0);var yt=function(t){if(O){t=t.touches?t.touches[0]:t;var n=Og(t.clientX,t.clientY);if(n){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[qe]._onDragOver(r)}}},Vg=function(t){O&&O.parentNode[qe]._isOutsideThisEl(t.target)};function L(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=at({},t),e[qe]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ta(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,a){l.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:L.supportPointer!==!1&&"PointerEvent"in window&&!an,emptyInsertThreshold:5};Cn.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);na(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:xg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ne(e,"pointerdown",this._onTapStart):(ne(e,"mousedown",this._onTapStart),ne(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ne(e,"dragover",this),ne(e,"dragenter",this)),or.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),at(this,Fg())}L.prototype={constructor:L,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Nt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,O):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,i=this.options,o=i.preventOnFilter,l=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,s=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=i.filter;if(Ug(r),!O&&!(/mousedown|pointerdown/.test(l)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&an&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Qe(s,i.draggable,r,!1),!(s&&s.animated)&&Hn!==s)){if(Ot=Ge(s),cn=Ge(s,i.draggable),typeof c=="function"){if(c.call(this,t,s,this)){Fe({sortable:n,rootEl:u,name:"filter",targetEl:s,toEl:r,fromEl:r}),Ne("filter",n,{evt:t}),o&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(f){if(f=Qe(u,f.trim(),r,!1),f)return Fe({sortable:n,rootEl:f,name:"filter",targetEl:s,fromEl:r,toEl:r}),Ne("filter",n,{evt:t}),!0}),c)){o&&t.cancelable&&t.preventDefault();return}i.handle&&!Qe(u,i.handle,r,!1)||this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(t,n,r){var i=this,o=i.el,l=i.options,a=o.ownerDocument,s;if(r&&!O&&r.parentNode===o){var u=we(r);if(fe=o,O=r,me=O.parentNode,St=O.nextSibling,Hn=r,Dn=l.group,L.dragged=O,wt={target:O,clientX:(n||t).clientX,clientY:(n||t).clientY},ll=wt.clientX-u.left,sl=wt.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,O.style["will-change"]="all",s=function(){if(Ne("delayEnded",i,{evt:t}),L.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!nl&&i.nativeDraggable&&(O.draggable=!0),i._triggerDragStart(t,n),Fe({sortable:i,name:"choose",originalEvent:t}),He(O,l.chosenClass,!0)},l.ignore.split(",").forEach(function(c){Qs(O,c.trim(),Pr)}),ne(a,"dragover",yt),ne(a,"mousemove",yt),ne(a,"touchmove",yt),ne(a,"mouseup",i._onDrop),ne(a,"touchend",i._onDrop),ne(a,"touchcancel",i._onDrop),nl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,O.draggable=!0),Ne("delayStart",this,{evt:t}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Sn||ct))){if(L.eventCanceled){this._onDrop();return}ne(a,"mouseup",i._disableDelayedDrag),ne(a,"touchend",i._disableDelayedDrag),ne(a,"touchcancel",i._disableDelayedDrag),ne(a,"mousemove",i._delayedDragTouchMoveHandler),ne(a,"touchmove",i._delayedDragTouchMoveHandler),l.supportPointer&&ne(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,l.delay)}else s()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){O&&Pr(O),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;te(t,"mouseup",this._disableDelayedDrag),te(t,"touchend",this._disableDelayedDrag),te(t,"touchcancel",this._disableDelayedDrag),te(t,"mousemove",this._delayedDragTouchMoveHandler),te(t,"touchmove",this._delayedDragTouchMoveHandler),te(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ne(document,"pointermove",this._onTouchMove):n?ne(document,"touchmove",this._onTouchMove):ne(document,"mousemove",this._onTouchMove):(ne(O,"dragend",this),ne(fe,"dragstart",this._onDragStart));try{document.selection?qn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(xt=!1,fe&&O){Ne("dragStarted",this,{evt:n}),this.nativeDraggable&&ne(document,"dragover",Vg);var r=this.options;!t&&He(O,r.dragClass,!1),He(O,r.ghostClass,!0),L.active=this,t&&this._appendGhost(),Fe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,ra();for(var t=document.elementFromPoint(Be.clientX,Be.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),t!==n);)n=t;if(O.parentNode[qe]._isOutsideThisEl(t),n)do{if(n[qe]){var r=void 0;if(r=n[qe]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);ia()}},_onTouchMove:function(t){if(wt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,o=t.touches?t.touches[0]:t,l=X&&qt(X,!0),a=X&&l&&l.a,s=X&&l&&l.d,u=Nn&&$e&&ol($e),c=(o.clientX-wt.clientX+i.x)/(a||1)+(u?u[0]-Nr[0]:0)/(a||1),f=(o.clientY-wt.clientY+i.y)/(s||1)+(u?u[1]-Nr[1]:0)/(s||1);if(!L.active&&!xt){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(Fe({rootEl:me,name:"add",toEl:me,fromEl:fe,originalEvent:t}),Fe({sortable:this,name:"remove",toEl:me,originalEvent:t}),Fe({rootEl:me,name:"sort",toEl:me,fromEl:fe,originalEvent:t}),Fe({sortable:this,name:"sort",toEl:me,originalEvent:t})),Ce&&Ce.save()):Le!==Ot&&Le>=0&&(Fe({sortable:this,name:"update",toEl:me,originalEvent:t}),Fe({sortable:this,name:"sort",toEl:me,originalEvent:t})),L.active&&((Le==null||Le===-1)&&(Le=Ot,ft=cn),Fe({sortable:this,name:"end",toEl:me,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Ne("nulling",this),fe=O=me=X=St=de=Hn=dt=wt=Be=tn=Le=ft=Ot=cn=Nt=fn=Ce=Dn=L.dragged=L.ghost=L.clone=L.active=null,lr.forEach(function(t){t.checked=!0}),lr.length=Dr=Ir=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":O&&(this._onDragOver(t),zg(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,r=this.el.children,i=0,o=r.length,l=this.options;ir.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function Gg(e,t,n,r,i,o,l,a){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!l){if(a&&Lnc+u*o/2:sf-Ln)return-fn}else if(s>c+u*(1-i)/2&&sf-u*o/2)?s>c+u/2?1:-1:0}function jg(e){return Ge(O)k[24];for(let k=0;kE[21];for(let E=0;EQ & A Comparison Instructions -
-

Ask a question and rank the answers across the models. Drag each answer to - rank it, in ascending order, from left-to-right. Optionally, select the - rank for each via the corresponding dropdown.

-
- `,r=D(),i=R("div"),o=R("section"),l=R("div");for(let E=0;E{e.scrollIntoView({behavior:"smooth"})},0)}async function ml(e){console.log("run update",e);const n=await fetch("/chat/comparator/db/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e})});if(n.ok)console.log("ok",n);else{const r=await n.text();alert(r)}}function Qg(e,t,n){let r,i,o;ee(e,kr,$=>n(7,o=$));let{numModels:l=1}=t,{models:a=[0]}=t,s="",u="",c=!1;ut(async()=>{if(await new Promise($=>setTimeout($,200)),g){const $=new L(g,{animation:150,onUpdate(E){$.toArray()}});$.toArray()}});const f=async $=>{$.preventDefault(),s=u,n(3,u=""),n(4,c=!0);let E={question:s};for(let k of a)E[k]="Loading...";Oe(kr,o=[...o,E],o);const S=await fetch(`/chat/comparator/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})});if(S.ok){const k=await S.json();n(1,a=Object.keys(k.answer)),n(0,l=a.length);for(let y of a)E[y]=k.answer[y];E.qid=k.qid,kr.update(y=>(y[y.length-1]=E,y))}else{const k=await S.text();alert(k)}n(4,c=!1)};let d=0;setInterval(()=>{n(11,d=(d+1)%4)},200);let g,p;function m($,E){const S=E,y=st($.currentTarget.parentNode).selectAll("div.answer").nodes().map(P=>P.id);y.forEach((P,B)=>{st(`#${P}`).select(".answer-rank").property("value",B+1)});let M=[];for(let[P,B]of y.entries()){const ge=parseInt(B.split("-")[1]),oe=a[ge],Ee={rank:P,model:oe};M.push(Ee)}let I=o.filter(P=>P.qid===S),F=[];for(let P of M){const B={model:P.model,qid:parseInt(S),rank:parseInt(P.rank)+1,answer:I[0][P.model]};F.push(B)}ml(F)}function _($,E,S){const k=E,y=parseInt($.target.value),M=a[S],I={qid:k,rank:parseInt(y),model:M};let F=[],B=o.filter(oe=>oe.qid===I.qid)[0][I.model];const ge={model:I.model,qid:parseInt(I.qid),rank:parseInt(I.rank),answer:B};F.push(ge),ml(F)}const b=($,E,S)=>_(S,$.qid,E),w=($,E)=>m(E,$.qid);function C($){hn[$?"unshift":"push"](()=>{g=$,n(2,g)})}function A(){u=this.value,n(3,u)}return e.$$set=$=>{"numModels"in $&&n(0,l=$.numModels),"models"in $&&n(1,a=$.models)},e.$$.update=()=>{e.$$.dirty&1&&n(6,r="1fr ".repeat(l).trim()),e.$$.dirty&2048&&n(5,i=".".repeat(d).padEnd(3)),e.$$.dirty&4100&&g&&(n(12,p=new L(g,{animation:150,dataIdAttr:"id",onUpdate($){p.toArray()}})),p.toArray())},[l,a,g,u,c,i,r,o,f,m,_,d,p,b,w,C,A]}class Kg extends ie{constructor(t){super(),se(this,t,Qg,Xg,re,{numModels:0,models:1})}}function Jg(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return la(this.cover(t,n),t,n,e)}function la(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,l={data:r},a=e._x0,s=e._y0,u=e._x1,c=e._y1,f,d,g,p,m,_,b,w;if(!o)return e._root=l,e;for(;o.length;)if((m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d,i=o,!(o=o[b=_<<1|m]))return i[b]=l,e;if(g=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===g&&n===p)return l.next=o,i?i[b]=l:e._root=l,e;do i=i?i[b]=new Array(4):e._root=new Array(4),(m=t>=(f=(a+u)/2))?a=f:u=f,(_=n>=(d=(s+c)/2))?s=d:c=d;while((b=_<<1|m)===(w=(p>=d)<<1|g>=f));return i[w]=o,i[b]=l,e}function Zg(e){var t,n,r=e.length,i,o,l=new Array(r),a=new Array(r),s=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=i),of&&(f=o));if(s>c||u>f)return this;for(this.cover(s,u).cover(c,f),n=0;ne||e>=i||r>t||t>=o;)switch(u=(tc||(a=p.y0)>f||(s=p.x1)=b)<<1|e>=_)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=p)}else{var w=e-+this._x.call(null,g.data),C=t-+this._y.call(null,g.data),A=w*w+C*C;if(A=(d=(l+s)/2))?l=d:s=d,(m=f>=(g=(a+u)/2))?a=g:u=g,t=n,!(n=n[_=m<<1|p]))return this;if(!n.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(r=t,b=_)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[_]=o:delete t[_],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[b]=n:this._root=n),this):(this._root=o,this)}function oh(e){for(var t=0,n=e.length;td.index){var I=g-k.x-k.vx,F=p-k.y-k.vy,P=I*I+F*F;Pg+M||Ep+M||Su.r&&(u.r=u[c].r)}function s(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u{}};function aa(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}jn.prototype=aa.prototype={constructor:jn,on:function(e,t){var n=this._,r=vh(e+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&e._call.call(void 0,t),e=e._next;--Wt}function wl(){At=(ur=wn.now())+br,Wt=on=0;try{yh()}finally{Wt=0,Ch(),At=0}}function Sh(){var e=wn.now(),t=e-ur;t>ua&&(br-=t,ur=e)}function Ch(){for(var e,t=ar,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ar=n);ln=e,ai(r)}function ai(e){if(!Wt){on&&(on=clearTimeout(on));var t=e-At;t>24?(e<1/0&&(on=setTimeout(wl,e-wn.now()-br)),Jt&&(Jt=clearInterval(Jt))):(Jt||(ur=wn.now(),Jt=setInterval(Sh,ua)),Wt=1,ca(wl))}}const kh=1664525,$h=1013904223,yl=4294967296;function Rh(){let e=1;return()=>(e=(kh*e+$h)%yl)/yl}var Ah=10,Eh=Math.PI*(3-Math.sqrt(5));function Mh(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,l=.6,a=new Map,s=da(f),u=aa("tick","end"),c=Rh();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(_==null?a.delete(m):a.set(m,p(_)),t):a.get(m)},find:function(m,_,b){var w=0,C=e.length,A,$,E,S,k;for(b==null?b=1/0:b*=b,w=0;w1?(u.on(m,_),t):u.on(m)}}}function Fh(e){var t=Je(.1),n,r,i;typeof e!="function"&&(e=Je(e==null?0:+e));function o(a){for(var s=0,u=n.length,c;se[4]?1:0),h(t,"class",g="file-circle-g "+(e[20].size>e[4]?"large":"")+" svelte-h2ab3o"),h(t,"style",p=e[5](e[20].x,e[20].y)),h(t,"role","img")},m(w,C){T(w,t,C),v(t,n),v(t,o),v(o,a),v(o,s),v(s,c),m=!0,_||(b=[j(t,"mouseover",e[6]),j(t,"mouseout",e[7]),j(t,"focus",e[6]),j(t,"blur",e[7])],_=!0)},p(w,C){(!m||C&12&&r!==(r=w[3](w[20].size)))&&h(n,"r",r),(!m||C&4)&&l!==(l=w[20].file+"")&&Q(a,l),(!m||C&4)&&u!==(u=Kr(w[20].size)+"")&&Q(c,u),(!m||C&20&&f!==(f=w[20].size>w[4]?1:0))&&h(o,"opacity",f),(!m||C&20&&g!==(g="file-circle-g "+(w[20].size>w[4]?"large":"")+" svelte-h2ab3o"))&&h(t,"class",g),(!m||C&4&&p!==(p=w[5](w[20].x,w[20].y)))&&h(t,"style",p)},i(w){m||(w&&Se(()=>{m&&(i||(i=Ke(n,Rn,{duration:1e3},!0)),i.run(1))}),w&&Se(()=>{m&&(d||(d=Ke(o,Rn,{duration:1e3},!0)),d.run(1))}),m=!0)},o(w){w&&(i||(i=Ke(n,Rn,{duration:1e3},!1)),i.run(0)),w&&(d||(d=Ke(o,Rn,{duration:1e3},!1)),d.run(0)),m=!1},d(w){w&&x(t),w&&i&&i.end(),w&&d&&d.end(),_=!1,_e(b)}}}function Ih(e){let t,n,r,i,o=e[2],l=[];for(let s=0;sV(l[s],1,1,()=>{l[s]=null});return{c(){t=R("div"),n=U("svg");for(let s=0;se[15].call(t))},m(s,u){T(s,t,u),v(t,n);for(let c=0;cn(14,c=$));let f=600,d=350,g=!0,p=!1;const m=($,E)=>`transform: translate(${$}px, ${E}px)`,_=[-4,4],b=[-1,1];function w(){n(8,g=!0),n(9,p=!0);const $=st(this);$r(".file-circle-g").select("text").style("opacity",0),$.raise(),$.select("circle").attr("fill","var(--red)"),$.select("text").style("opacity",1)}const C=()=>{const $=$r(".file-circle-g");$.select("circle").attr("fill","var(--yellow)"),$.select("text").style("opacity",0),n(9,p=!1),setTimeout(()=>{n(8,g=!1)},1e3)};function A(){f=this.offsetWidth,d=this.offsetHeight,n(0,f),n(1,d)}return e.$$.update=()=>{e.$$.dirty&16387&&n(2,r=c.map($=>({...$,x:f/2,y:d/2,tickCount:0}))),e.$$.dirty&16384&&console.log(c.map($=>$.size).sort(($,E)=>$-E)),e.$$.dirty&1&&n(13,i=Fh().x(f/2)),e.$$.dirty&2&&n(12,o=Dh().y(d/2)),e.$$.dirty&16384&&n(3,s=We().domain(sn(c,$=>$.size)).range([12,60])),e.$$.dirty&8&&n(10,l=mh().radius($=>s($.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,a=id(c.map($=>$.size).sort(($,E)=>$-E),.85)),e.$$.dirty&1&&We().domain(_).range([5,f]),e.$$.dirty&2&&We().domain(b).range([d,5]),e.$$.dirty&4&&n(11,u=Mh().nodes(r).on("tick",()=>{n(2,r=[...r])})),e.$$.dirty&15360&&(u.force("x",i),u.force("y",o),u.force("collide",l),u.alpha(.02),u.restart()),e.$$.dirty&19468&&(s.domain(sn(c,$=>$.size)),r.forEach($=>$.radius=s($.size)),u.nodes(r),l.radius($=>$.radius+.5)),e.$$.dirty&768&&g===!1&&(p||$r(".large").select("text").style("opacity",1))},[f,d,r,s,a,m,w,C,g,p,l,u,o,i,c,A]}class Ph extends ie{constructor(t){super(),se(this,t,Nh,Ih,re,{})}}/** - * 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 pt(e,t){return typeof e=="function"?e(t):e}function je(e,t){return n=>{t.setState(r=>({...r,[e]:pt(n,r[e])}))}}function fr(e){return e instanceof Function}function xh(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Th(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const l=t(o);l!=null&&l.length&&r(l)})};return r(e),n}function G(e,t,n){let r=[],i;return()=>{let o;n.key&&n.debug&&(o=Date.now());const l=e();if(!(l.length!==r.length||l.some((u,c)=>r[c]!==u)))return i;r=l;let s;if(n.key&&n.debug&&(s=Date.now()),i=t(...l),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-o)*100)/100,c=Math.round((Date.now()-s)*100)/100,f=c/16,d=(g,p)=>{for(g=String(g);g.length{let g=d;for(const m of s.split(".")){var p;g=(p=g)==null?void 0:p[m]}return g}:c=d=>d[a.accessorKey]),!u)throw new Error;let f={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:G(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(g=>g.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}}),getLeafColumns:G(()=>[e._getOrderColumnsFn()],d=>{var g;if((g=f.columns)!=null&&g.length){let p=f.columns.flatMap(m=>m.getLeafColumns());return d(p)}return[f]},{key:"column.getLeafColumns",debug:()=>{var d;return(d=e.options.debugAll)!=null?d:e.options.debugColumns}})};return f=e._features.reduce((d,g)=>Object.assign(d,g.createColumn==null?void 0:g.createColumn(f,e)),f),f}function $l(e,t,n){var r;let o={id:(r=n.id)!=null?r: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(o),l},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(l=>{Object.assign(o,l.createHeader==null?void 0:l.createHeader(o,e))}),o}const Vh={createTable:e=>({getHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,l;const a=(o=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],s=(l=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?l:[],u=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return xn(t,[...a,...u,...s],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),xn(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return xn(t,o,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:G(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?i:[];return xn(t,o,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:G(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:G(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:G(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:G(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:G(()=>[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:G(()=>[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:G(()=>[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:G(()=>[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:G(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftLeafHeaders:G(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightLeafHeaders:G(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeafHeaders:G(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,l,a,s,u;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(u=r[0])==null?void 0:u.headers)!=null?s:[]].map(c=>c.getLeafHeaders()).flat()},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})})};function xn(e,t,n,r){var i,o;let l=0;const a=function(d,g){g===void 0&&(g=1),l=Math.max(l,g),d.filter(p=>p.getIsVisible()).forEach(p=>{var m;(m=p.columns)!=null&&m.length&&a(p.columns,g+1)},0)};a(e);let s=[];const u=(d,g)=>{const p={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];d.forEach(_=>{const b=[...m].reverse()[0],w=_.column.depth===p.depth;let C,A=!1;if(w&&_.column.parent?C=_.column.parent:(C=_.column,A=!0),b&&(b==null?void 0:b.column)===C)b.subHeaders.push(_);else{const $=$l(n,C,{id:[r,g,C.id,_==null?void 0:_.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${m.filter(E=>E.column===C).length}`:void 0,depth:g,index:m.length});$.subHeaders.push(_),m.push($)}p.headers.push(_),_.headerGroup=p}),s.push(p),g>0&&u(m,g-1)},c=t.map((d,g)=>$l(n,d,{depth:l,index:g}));u(c,l-1),s.reverse();const f=d=>d.filter(p=>p.column.getIsVisible()).map(p=>{let m=0,_=0,b=[0];p.subHeaders&&p.subHeaders.length?(b=[],f(p.subHeaders).forEach(C=>{let{colSpan:A,rowSpan:$}=C;m+=A,b.push($)})):m=1;const w=Math.min(...b);return _=_+w,p.colSpan=m,p.rowSpan=_,{colSpan:m,rowSpan:_}});return f((i=(o=s[0])==null?void 0:o.headers)!=null?i:[]),s}const Tn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Vr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zh={getDefaultColumnDef:()=>Tn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Vr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:je("columnSizing",e),onColumnSizingInfoChange:je("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Tn.minSize,(r=o??e.columnDef.size)!=null?r:Tn.size),(i=e.columnDef.maxSize)!=null?i:Tn.maxSize)},getStart:n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),i=r.findIndex(o=>o.id===e.id);if(i>0){const o=r[i-1];return o.getStart(n)+o.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},getCanResize:()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},getIsResizing:()=>t.getState().columnSizingInfo.isResizingColumn===e.id}),createHeader:(e,t)=>({getSize:()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(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),r=n==null?void 0:n.getCanResize();return i=>{if(!n||!r||(i.persist==null||i.persist(),zr(i)&&i.touches&&i.touches.length>1))return;const o=e.getSize(),l=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=zr(i)?Math.round(i.touches[0].clientX):i.clientX,s={},u=(m,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(b=>{var w,C;const A=_-((w=b==null?void 0:b.startOffset)!=null?w:0),$=Math.max(A/((C=b==null?void 0:b.startSize)!=null?C:0),-.999999);return b.columnSizingStart.forEach(E=>{let[S,k]=E;s[S]=Math.round(Math.max(k+k*$,0)*100)/100}),{...b,deltaOffset:A,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(b=>({...b,...s})))},c=m=>u("move",m),f=m=>{u("end",m),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d={moveHandler:m=>c(m.clientX),upHandler:m=>{document.removeEventListener("mousemove",d.moveHandler),document.removeEventListener("mouseup",d.upHandler),f(m.clientX)}},g={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),c(m.touches[0].clientX),!1),upHandler:m=>{var _;document.removeEventListener("touchmove",g.moveHandler),document.removeEventListener("touchend",g.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((_=m.touches[0])==null?void 0:_.clientX)}},p=Hh()?{passive:!1}:!1;zr(i)?(document.addEventListener("touchmove",g.moveHandler,p),document.addEventListener("touchend",g.upHandler,p)):(document.addEventListener("mousemove",d.moveHandler,p),document.addEventListener("mouseup",d.upHandler,p)),t.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:o,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?Vr():(n=e.initialState.columnSizingInfo)!=null?n:Vr())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}})};let On=null;function Hh(){if(typeof On=="boolean")return On;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 On=e,On}function zr(e){return e.type==="touchstart"}const Lh={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:je("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},setExpanded:r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),toggleAllRowsExpanded:r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},resetExpanded:r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},getCanSomeRowsExpand:()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),getToggleAllRowsExpandedHandler:()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},getIsSomeRowsExpanded:()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},getIsAllRowsExpanded:()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},getExpandedDepth:()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const l=o.split(".");r=Math.max(r,l.length)}),r},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(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let l={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{l[a]=!0}):l=r,n=(i=n)!=null?i:!o,!o&&n)return{...l,[e.id]:!0};if(o&&!n){const{[e.id]:a,...s}=l;return s}return r})},getIsExpanded:()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},getCanExpand:()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},ga=(e,t,n)=>{var r,i,o;const l=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(i=r.toString())==null||(o=i.toLowerCase())==null)&&o.includes(l))};ga.autoRemove=e=>Xe(e);const ha=(e,t,n)=>{var r,i;return!!(!((r=e.getValue(t))==null||(i=r.toString())==null)&&i.includes(n))};ha.autoRemove=e=>Xe(e);const pa=(e,t,n)=>{var r,i;return((r=e.getValue(t))==null||(i=r.toString())==null?void 0:i.toLowerCase())===(n==null?void 0:n.toLowerCase())};pa.autoRemove=e=>Xe(e);const ma=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};ma.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const _a=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});_a.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const va=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});va.autoRemove=e=>Xe(e)||!(e!=null&&e.length);const ba=(e,t,n)=>e.getValue(t)===n;ba.autoRemove=e=>Xe(e);const wa=(e,t,n)=>e.getValue(t)==n;wa.autoRemove=e=>Xe(e);const Ei=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Ei.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(i)?1/0:i;if(o>l){const a=o;o=l,l=a}return[o,l]};Ei.autoRemove=e=>Xe(e)||Xe(e[0])&&Xe(e[1]);const it={includesString:ga,includesStringSensitive:ha,equalsString:pa,arrIncludes:ma,arrIncludesAll:_a,arrIncludesSome:va,equals:ba,weakEquals:wa,inNumberRange:Ei};function Xe(e){return e==null||e===""}const qh={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:je("columnFilters",e),onGlobalFilterChange:je("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,r;const i=(n=e.getCoreRowModel().flatRows[0])==null||(r=n._getAllCellsByColumnId()[t.id])==null?void 0:r.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?it.includesString:typeof r=="number"?it.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?it.equals:Array.isArray(r)?it.arrIncludes:it.weakEquals},getFilterFn:()=>{var n,r;return fr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:it[e.columnDef.filterFn]},getCanFilter:()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,r;return(n=t.getState().columnFilters)==null||(r=n.find(i=>i.id===e.id))==null?void 0:r.value},getFilterIndex:()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(c=>c.id===e.id),l=pt(n,o?o.value:void 0);if(Rl(i,l,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const s={id:e.id,value:l};if(o){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?s:c))!=null?u:[]}return r!=null&&r.length?[...r,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:()=>it.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:r}=e.options;return fr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:it[r]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=pt(t,i))==null?void 0:o.filter(l=>{const a=n.find(s=>s.id===l.id);if(a){const s=a.getFilterFn();if(Rl(s,l.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},setGlobalFilter:t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},resetGlobalFilter:t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},resetColumnFilters:t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.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 Rl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Gh=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),jh=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},Bh=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r=o)&&(r=o)}),r},Uh=(e,t,n)=>{let r,i;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r===void 0?l>=l&&(r=i=l):(r>l&&(r=l),i{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},Xh=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!xh(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,l)=>o-l);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},Yh=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Qh=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Kh=(e,t)=>t.length,Hr={sum:Gh,min:jh,max:Bh,extent:Uh,mean:Wh,median:Xh,unique:Yh,uniqueCount:Qh,count:Kh},Jh={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:je("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>({toggleGrouping:()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},getCanGroup:()=>{var n,r,i,o;return(n=(r=(i=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?i:t.options.enableGrouping)!=null?r:!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],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Hr.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Hr.extent},getAggregationFn:()=>{var n,r;if(!e)throw new Error;return fr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Hr[e.columnDef.aggregationFn]}}),createTable:e=>({setGrouping:t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),resetGrouping:t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.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 r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},_groupingValuesCache:{}}),createCell:(e,t,n,r)=>({getIsGrouped:()=>t.getIsGrouped()&&t.id===n.groupingColumnId,getIsPlaceholder:()=>!e.getIsGrouped()&&t.getIsGrouped(),getIsAggregated:()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}})};function Zh(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(l=>l.id===o)).filter(Boolean),...r]}const ep={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:je("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:G(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const l=[...t],a=[...i];for(;a.length&&l.length;){const s=l.shift(),u=a.findIndex(c=>c.id===s);u>-1&&o.push(a.splice(u,1)[0])}o=[...o,...a]}return Zh(o,n,r)},{key:!1})})},ui=0,ci=10,Lr=()=>({pageIndex:ui,pageSize:ci}),tp={getInitialState:e=>({...e,pagination:{...Lr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:je("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:r=>{const i=o=>pt(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},resetPagination:r=>{var i;e.setPagination(r?Lr():(i=e.initialState.pagination)!=null?i:Lr())},setPageIndex:r=>{e.setPagination(i=>{let o=pt(r,i.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...i,pageIndex:o}})},resetPageIndex:r=>{var i,o,l;e.setPageIndex(r?ui:(i=(o=e.initialState)==null||(l=o.pagination)==null?void 0:l.pageIndex)!=null?i:ui)},resetPageSize:r=>{var i,o,l;e.setPageSize(r?ci:(i=(o=e.initialState)==null||(l=o.pagination)==null?void 0:l.pageSize)!=null?i:ci)},setPageSize:r=>{e.setPagination(i=>{const o=Math.max(1,pt(r,i.pageSize)),l=i.pageSize*i.pageIndex,a=Math.floor(l/o);return{...i,pageIndex:a,pageSize:o}})},setPageCount:r=>e.setPagination(i=>{var o;let l=pt(r,(o=e.options.pageCount)!=null?o:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...i,pageCount:l}}),getPageOptions:G(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,l)=>l)),i},{key:!1,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),getCanPreviousPage:()=>e.getState().pagination.pageIndex>0,getCanNextPage:()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:re.setPageIndex(r=>r-1),nextPage:()=>e.setPageIndex(r=>r+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 r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}}},qr=()=>({left:[],right:[]}),np={getInitialState:e=>({columnPinning:qr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:je("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,l;if(n==="right"){var a,s;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((s=i==null?void 0:i.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var u,c;return{left:[...((u=i==null?void 0:i.left)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((c=i==null?void 0:i.right)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f)))}})},getCanPin:()=>e.getLeafColumns().some(r=>{var i,o;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=t.options.enablePinning)!=null?o:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),l=n.some(a=>i==null?void 0:i.includes(a));return o?"left":l?"right":!1},getPinnedIndex:()=>{var n,r,i;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(i=r[o])==null?void 0:i.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(l=>!o.includes(l.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:G(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,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,r;return e.setColumnPinning(t?qr():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qr())},getIsSomeColumnsPinned:t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},getLeftLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:G(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},rp={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:je("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 r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{fi(i,o.id,r,e)}),i}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:G(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Gr(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:G(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Gr(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:G(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Gr(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 r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},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 r=e.getIsSelected();t.setRowSelection(i=>{if(n=typeof n<"u"?n:!r,r===n)return i;const o={...i};return fi(o,e.id,n,t),o})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Mi(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return Al(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return Al(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 r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}})},fi=(e,t,n,r)=>{var i;const o=r.getRow(t);n?(o.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),o.getCanSelect()&&(e[t]=!0)):delete e[t],(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(l=>fi(e,l.id,n,r))};function Gr(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(l,a){return l.map(s=>{var u;const c=Mi(s,n);if(c&&(r.push(s),i[s.id]=s),(u=s.subRows)!=null&&u.length&&(s={...s,subRows:o(s.subRows)}),c)return s}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function Mi(e,t){var n;return(n=t[e.id])!=null?n:!1}function Al(e,t,n){if(e.subRows&&e.subRows.length){let r=!0,i=!1;return e.subRows.forEach(o=>{i&&!r||(Mi(o,t)?i=!0:r=!1)}),r?"all":i?"some":!1}return!1}const di=/([0-9]+)/gm,ip=(e,t,n)=>ya(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),op=(e,t,n)=>ya(_t(e.getValue(n)),_t(t.getValue(n))),lp=(e,t,n)=>Fi(_t(e.getValue(n)).toLowerCase(),_t(t.getValue(n)).toLowerCase()),sp=(e,t,n)=>Fi(_t(e.getValue(n)),_t(t.getValue(n))),ap=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:rFi(e.getValue(n),t.getValue(n));function Fi(e,t){return e===t?0:e>t?1:-1}function _t(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ya(e,t){const n=e.split(di).filter(Boolean),r=t.split(di).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),l=parseInt(i,10),a=parseInt(o,10),s=[l,a].sort();if(isNaN(s[0])){if(i>o)return 1;if(o>i)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-r.length}const Zt={alphanumeric:ip,alphanumericCaseSensitive:op,text:lp,textCaseSensitive:sp,datetime:ap,basic:up},cp={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:je("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Zt.datetime;if(typeof o=="string"&&(r=!0,o.split(di).length>1))return Zt.alphanumeric}return r?Zt.text:Zt.basic},getAutoSortDir:()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},getSortingFn:()=>{var n,r;if(!e)throw new Error;return fr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Zt[e.columnDef.sortingFn]},toggleSorting:(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(l=>{const a=l==null?void 0:l.find(g=>g.id===e.id),s=l==null?void 0:l.findIndex(g=>g.id===e.id);let u=[],c,f=o?n:i==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":l!=null&&l.length&&s!==l.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var d;u=[...l,{id:e.id,desc:f}],u.splice(0,u.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=l.map(g=>g.id===e.id?{...g,desc:f}:g):c==="remove"?u=l.filter(g=>g.id!==e.id):u=[{id:e.id,desc:f}];return u})},getFirstSortDir:()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},getNextSortingOrder:n=>{var r,i;const o=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:l==="desc"?"asc":"desc":o},getCanSort:()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},getCanMultiSort:()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},getIsSorted:()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},getSortIndex:()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},clearSorting:()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},getToggleSortingHandler:()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}}),createTable:e=>({setSorting:t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),resetSorting:t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.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())})},fp={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:je("columnVisibility",e)}),createColumn:(e,t)=>({toggleVisibility:n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},getIsVisible:()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},getCanHide:()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},getToggleVisibilityHandler:()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}}),createRow:(e,t)=>({_getAllVisibleCells:G(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getVisibleCells:G(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,r)=>G(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var i;return(i=e.options.debugAll)!=null?i: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 r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},toggleAllColumnsVisible:n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.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 r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}}},El=[Vh,fp,ep,np,qh,cp,Jh,Lh,tp,rp,zh];function dp(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:El};const r=n._features.reduce((c,f)=>Object.assign(c,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=c=>n.options.mergeOptions?n.options.mergeOptions(r,c):{...r,...c};let l={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(c=>{var f;l=(f=c.getInitialState==null?void 0:c.getInitialState(l))!=null?f:l});const a=[];let s=!1;const u={_features:El,options:{...r,...e},initialState:l,_queue:c=>{a.push(c),s||(s=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();s=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:c=>{const f=pt(c,n.options);n.options=i(f)},getState:()=>n.options.state,setState:c=>{n.options.onStateChange==null||n.options.onStateChange(c)},_getRowId:(c,f,d)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(c,f,d))!=null?g:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:c=>{const f=n.getRowModel().rowsById[c];if(!f)throw new Error;return f},_getDefaultColumnDef:G(()=>[n.options.defaultColumn],c=>{var f;return c=(f=c)!=null?f:{},{header:d=>{const g=d.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:d=>{var g,p;return(g=(p=d.renderValue())==null||p.toString==null?void 0:p.toString())!=null?g:null},...n._features.reduce((d,g)=>Object.assign(d,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...c}},{debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns},key:!1}),_getColumnDefs:()=>n.options.columns,getAllColumns:G(()=>[n._getColumnDefs()],c=>{const f=function(d,g,p){return p===void 0&&(p=0),d.map(m=>{const _=Oh(n,m,p,g),b=m;return _.columns=b.columns?f(b.columns,_,p+1):[],_})};return f(c)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllFlatColumns:G(()=>[n.getAllColumns()],c=>c.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),_getAllFlatColumnsById:G(()=>[n.getAllFlatColumns()],c=>c.reduce((f,d)=>(f[d.id]=d,f),{}),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllLeafColumns:G(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(c,f)=>{let d=c.flatMap(g=>g.getLeafColumns());return f(d)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getColumn:c=>n._getAllFlatColumnsById()[c]};return Object.assign(n,u),n._features.forEach(c=>Object.assign(n,c.createTable==null?void 0:c.createTable(n))),n}function gp(e,t,n,r){const i=()=>{var l;return(l=o.getValue())!=null?l:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:G(()=>[e,n,t,o],(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(o,l.createCell==null?void 0:l.createCell(o,n,t,e))},{}),o}const Di=(e,t,n,r,i,o,l)=>{let a={id:t,index:r,original:n,depth:i,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,r),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,r),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:o??[],getLeafRows:()=>Th(a.subRows,s=>s.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId):void 0,getParentRows:()=>{let s=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;s.push(c),u=c}return s.reverse()},getAllCells:G(()=>[e.getAllLeafColumns()],s=>s.map(u=>gp(e,a,u,u.id)),{key:!1,debug:()=>{var s;return(s=e.options.debugAll)!=null?s:e.options.debugRows}}),_getAllCellsByColumnId:G(()=>[a.getAllCells()],s=>s.reduce((u,c)=>(u[c.column.id]=c,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 Ml(){return e=>G(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,l){o===void 0&&(o=0);const a=[];for(let u=0;u{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Sa(e,t,n){return n.options.filterFromLeafRows?pp(e,t,n):mp(e,t,n)}function pp(e,t,n){var r;const i=[],o={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(s,u){u===void 0&&(u=0);const c=[];for(let d=0;dG(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d{var g;const p=e.getColumn(d.id);if(!p)return;const m=p.getFilterFn();m&&i.push({id:d.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(d.value))!=null?g:d.value})});const l=n.map(d=>d.id),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&s.length&&(l.push("__global__"),s.forEach(d=>{var g;o.push({id:d.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let u,c;for(let d=0;d{g.columnFiltersMeta[m]=_})}if(o.length){for(let p=0;p{g.columnFiltersMeta[m]=_})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const f=d=>{for(let g=0;g{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Dl(){return(e,t)=>G(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;const o=[...r.map(a=>a.id).filter(a=>a!==t),i?"__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 Il(){return e=>G(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(s=>{var u;return(u=e.getColumn(s.id))==null?void 0:u.getCanSort()}),l={};o.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((c,f)=>{for(let g=0;g{var f;i.push(c),(f=c.subRows)!=null&&f.length&&(c.subRows=a(c.subRows))}),u};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function _p(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Nl(e){return t=>G(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:l,flatRows:a,rowsById:s}=r;const u=i*o,c=u+i;l=l.slice(u,c);let f;t.options.paginateExpandedRows?f={rows:l,flatRows:a,rowsById:s}:f=_p({rows:l,flatRows:a,rowsById:s}),f.flatRows=[];const d=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(d)};return f.rows.forEach(d),f},{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 vp(e){let t;return{c(){t=z(e[0])},l(n){t=za(n,e[0])},m(n,r){xa(n,t,r)},p(n,[r]){r&1&&Q(t,n[0])},i:H,o:H,d(n){n&&x(t)}}}function bp(e,t,n){let{content:r}=t;return e.$$set=i=>{"content"in i&&n(0,r=i.content)},[r]}class wp extends ie{constructor(t){super(),se(this,t,bp,vp,re,{content:0})}}const yp=gs((e,t,n,r)=>`${tu(t.content)}`);var Sp=typeof document>"u"?yp:wp;function Cp(e,t,n){let r,i;return r=new t({props:n,$$inline:!0}),{c(){Z(r.$$.fragment)},l(o){ru(r.$$.fragment,o)},m(o,l){K(r,o,l),i=!0},p:H,i(o){i||(N(r.$$.fragment,o),i=!0)},o(o){V(r.$$.fragment,o),i=!1},d(o){J(r,o)}}}function kp(e,t){return class extends ie{constructor(r){super(),se(this,r,null,i=>Cp(i,e,t),re,{},void 0)}}}function $p(e,t){return gs((r,i,o,l)=>`${nu(e,"TableComponent").$$render(r,t,{},{})}`)}const gi=typeof window>"u"?$p:kp;function Rp(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function Ap(e){var t,n;let r="__SVELTE_HMR"in window;return e.prototype instanceof ie||r&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function Pl(e){return typeof document>"u"?Rp(e):Ap(e)}function xl(e){return gi(Sp,{content:e})}function dr(e,t){if(!e)return null;if(Pl(e))return gi(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:Pl(n)?gi(n,t):xl(n)}return xl(e)}function Tl(e){let t;"subscribe"in e?t=e:t=Ur(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...Aa(t)},r=dp(n),i=ke(r.initialState),o=ou([i,t],a=>a);return Ur(r,function(s){const u=o.subscribe(c=>{let[f,d]=c;r.setOptions(g=>({...g,...d,state:{...f,...d.state},onStateChange:p=>{p instanceof Function?i.update(p):i.set(p),n.onStateChange==null||n.onStateChange(p)}})),s(r)});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 Ca={À:"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"},Ep=Object.keys(Ca).join("|"),Mp=new RegExp(Ep,"g");function Fp(e){return e.replace(Mp,t=>Ca[t])}/** - * @name match-sorter - * @license MIT license. - * @copyright (c) 2099 Kent C. Dodds - * @author Kent C. Dodds (https://kentcdodds.com) - */const Pe={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Dp(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Pe.MATCHES,!n.accessors){const l=Ol(e,t,n);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:n.threshold,passed:l>=n.threshold}}const i=xp(e,n.accessors),o={rankedValue:e,rank:Pe.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let l=0;l=Pe.MATCHES?s=u:s>c&&(s=c),s=Math.min(s,c),s>=f&&s>o.rank&&(o.rank=s,o.passed=!0,o.accessorIndex=l,o.accessorThreshold=f,o.rankedValue=a.itemValue)}return o}function Ol(e,t,n){return e=Vl(e,n),t=Vl(t,n),t.length>e.length?Pe.NO_MATCH:e===t?Pe.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Pe.EQUAL:e.startsWith(t)?Pe.STARTS_WITH:e.includes(` ${t}`)?Pe.WORD_STARTS_WITH:e.includes(t)?Pe.CONTAINS:t.length===1?Pe.NO_MATCH:Ip(e).includes(t)?Pe.ACRONYM:Np(e,t))}function Ip(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function Np(e,t){let n=0,r=0;function i(s,u,c){for(let f=c,d=u.length;f-1))return Pe.NO_MATCH}const a=r-l;return o(a)}function Vl(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Fp(e)),e}function Pp(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function xp(e,t){const n=[];for(let r=0,i=t.length;r{J(p,1)}),ce()}c?(n=mt(c,f()),Z(n.$$.fragment),N(n.$$.fragment,1),K(n,t,r)):n=null}},i(d){a||(n&&N(n.$$.fragment,d),a=!0)},o(d){n&&V(n.$$.fragment,d),a=!1},d(d){d&&x(t),n&&J(n),s=!1,u()}}}function jl(e){let t,n,r=!e[26].isPlaceholder&&Op(e);return{c(){t=R("th"),r&&r.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(i,o){T(i,t,o),r&&r.m(t,null),n=!0},p(i,o){i[26].isPlaceholder||r.p(i,o)},i(i){n||(N(r),n=!0)},o(i){V(r),n=!1},d(i){i&&x(t),r&&r.d()}}}function Bl(e){let t,n,r,i=e[23].headers,o=[];for(let a=0;aV(o[a],1,1,()=>{o[a]=null});return{c(){t=R("tr");for(let a=0;a{J(u,1)}),ce()}o?(r=mt(o,l()),Z(r.$$.fragment),N(r.$$.fragment,1),K(r,n,null)):r=null}},i(a){i||(r&&N(r.$$.fragment,a),i=!0)},o(a){r&&V(r.$$.fragment,a),i=!1},d(a){a&&x(n),r&&J(r)}}}function Wl(e){let t,n=[],r=new Map,i,o,l=e[17].getVisibleCells();const a=s=>s[20].id;for(let s=0;s",Me,ye,ae,ze,kn,vt=e[5],he=[];for(let W=0;WV(he[W],1,1,()=>{he[W]=null});let bt=e[1].getRowModel().rows,pe=[];for(let W=0;WV(pe[W],1,1,()=>{pe[W]=null});return{c(){t=R("div"),n=R("input"),r=D(),i=R("div"),o=R("table"),l=R("thead");for(let W=0;W(o(),o=gr(b,$=>n(1,i=$)),b);ee(e,cr,$=>n(8,r=$)),e.$$.on_destroy.push(()=>o());const a=($,E,S,k)=>{if(console.log("yessir"),Array.isArray(S))return S.length===0?!0:S.includes($.getValue(E));typeof S=="number"&&(S=String(S));const y=Dp($.getValue(E),S);return k({itemRank:y}),y.passed},s=hp(),u=[s.accessor("file",{header:"File",cell:$=>$.getValue(),footer:$=>$.column.id}),s.accessor("size",{header:"Size",cell:$=>Kr($.getValue()),footer:$=>$.column.id}),s.accessor("type",{header:"Type",cell:$=>$.getValue(),footer:$=>$.column.id})];let c="",f=ke({data:r,columns:u,getCoreRowModel:Ml(),getSortedRowModel:Il(),getFilteredRowModel:Fl(),globalFilterFn:a,getFacetedRowModel:Dl(),getPaginationRowModel:Nl(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function d($){n(6,c=$),f.update(E=>({...E,state:{...E.state,globalFilter:$}}))}function g($){f.update(E=>{var S;return{...E,state:{...E.state,pagination:{...(S=E.state)==null?void 0:S.pagination,pageIndex:$}}}})}let p;function m($){clearTimeout(p),p=setTimeout(()=>{const E=$.target;d(E.value)},100)}function _($){const E=$.target;g(parseInt(E.value)-1)}let b=Tl(f);l();let w=i.getHeaderGroups();const C=()=>g(i.getState().pagination.pageIndex-1),A=()=>g(i.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,f={data:r,columns:u,getCoreRowModel:Ml(),getSortedRowModel:Il(),getFilteredRowModel:Fl(),globalFilterFn:a,getFacetedRowModel:Dl(),getPaginationRowModel:Nl(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),l(n(0,b=Tl(ke(f)))))},[b,i,g,m,_,w,c,f,r,C,A]}class Lp extends ie{constructor(t){super(),se(this,t,Hp,Vp,re,{})}}function Xl(e){let t,n;return{c(){t=R("p"),n=z(e[3])},m(r,i){T(r,t,i),v(t,n)},p(r,i){i&8&&Q(n,r[3])},d(r){r&&x(t)}}}function Yl(e){let t;return{c(){t=R("p"),t.textContent="Data Successfully indexed!"},m(n,r){T(n,t,r)},d(n){n&&x(t)}}}function Ql(e){let t,n;return t=new Lp({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function qp(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k=e[2]&&!e[1]&&Xl(e),y=e[1]&&Yl();C=new Ph({});let M=e[0]&&Ql();return{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),o=R("h4"),o.textContent="Upload Data",l=D(),a=R("br"),s=D(),u=R("form"),c=R("input"),f=D(),k&&k.c(),d=D(),y&&y.c(),g=D(),p=R("p"),p.textContent="These are the files your model will use as context.",m=D(),_=R("p"),_.innerHTML="Currently pdf, txt, and md are supported.",b=D(),w=R("div"),Z(C.$$.fragment),A=D(),M&&M.c(),h(c,"type","file"),c.multiple=!0,h(i,"class","upload-box svelte-1lu6hos"),h(r,"class","upload-container svelte-1lu6hos"),h(n,"class","file-container svelte-1lu6hos"),h(w,"class","charts-container svelte-1lu6hos"),h(t,"class","data-grid svelte-1lu6hos")},m(I,F){T(I,t,F),v(t,n),v(n,r),v(r,i),v(i,o),v(i,l),v(i,a),v(i,s),v(i,u),v(u,c),v(i,f),k&&k.m(i,null),v(i,d),y&&y.m(i,null),v(i,g),v(i,p),v(i,m),v(i,_),v(t,b),v(t,w),K(C,w,null),v(w,A),M&&M.m(w,null),$=!0,E||(S=j(c,"change",e[4]),E=!0)},p(I,[F]){I[2]&&!I[1]?k?k.p(I,F):(k=Xl(I),k.c(),k.m(i,d)):k&&(k.d(1),k=null),I[1]?y||(y=Yl(),y.c(),y.m(i,g)):y&&(y.d(1),y=null),I[0]?M?F&1&&N(M,1):(M=Ql(),M.c(),N(M,1),M.m(w,null)):M&&(ue(),V(M,1,1,()=>{M=null}),ce())},i(I){$||(N(C.$$.fragment,I),N(M),$=!0)},o(I){V(C.$$.fragment,I),V(M),$=!1},d(I){I&&x(t),k&&k.d(),y&&y.d(),J(C),M&&M.d(),E=!1,S()}}}function Gp(e,t,n){let r,i,o;ee(e,Sl,p=>n(6,i=p)),ee(e,cr,p=>n(7,o=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:b.name,size:b.size,type:b.type}));Oe(cr,o=[..._],o)}async function f(){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 d(){console.log("getting embeddings...");const m=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",m),Oe(Sl,i=m,i)}ut(()=>{c()});let g=0;return setInterval(()=>{n(5,g=(g+1)%4)},200),e.$$.update=()=>{e.$$.dirty&32&&n(3,r="Indexing"+".".repeat(g))},[l,a,s,r,u,g]}class jp extends ie{constructor(t){super(),se(this,t,Gp,qp,re,{})}}function Bp(e){let t,n,r,i,o,l,a,s,u,c,f,d,g,p,m,_,b,w,C,A,$,E,S,k,y,M,I;return o=new js({}),s=new Bs({}),f=new zs({}),p=new Ls({props:{feedback:"Bad"}}),b=new Gs({}),A=new qs({}),M=new Hs({}),{c(){t=R("div"),n=R("div"),r=R("div"),i=R("div"),Z(o.$$.fragment),l=D(),a=R("div"),Z(s.$$.fragment),u=D(),c=R("div"),Z(f.$$.fragment),d=D(),g=R("div"),Z(p.$$.fragment),m=D(),_=R("div"),Z(b.$$.fragment),w=D(),C=R("div"),Z(A.$$.fragment),$=D(),E=R("div"),S=R("div"),S.innerHTML=`
-
`,k=D(),y=R("div"),Z(M.$$.fragment),h(i,"class","card-1 svelte-14znspc"),h(a,"class","card-2"),h(r,"class","left-text svelte-14znspc"),h(c,"class","left-confidence svelte-14znspc"),h(g,"class","left-question svelte-14znspc"),h(_,"class","left-filter svelte-14znspc"),h(C,"class","left-filter2"),h(n,"class","feedback-left svelte-14znspc"),h(S,"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,P){T(F,t,P),v(t,n),v(n,r),v(r,i),K(o,i,null),v(r,l),v(r,a),K(s,a,null),v(n,u),v(n,c),K(f,c,null),v(n,d),v(n,g),K(p,g,null),v(n,m),v(n,_),K(b,_,null),v(n,w),v(n,C),K(A,C,null),v(t,$),v(t,E),v(E,S),v(E,k),v(E,y),K(M,y,null),I=!0},p:H,i(F){I||(N(o.$$.fragment,F),N(s.$$.fragment,F),N(f.$$.fragment,F),N(p.$$.fragment,F),N(b.$$.fragment,F),N(A.$$.fragment,F),N(M.$$.fragment,F),I=!0)},o(F){V(o.$$.fragment,F),V(s.$$.fragment,F),V(f.$$.fragment,F),V(p.$$.fragment,F),V(b.$$.fragment,F),V(A.$$.fragment,F),V(M.$$.fragment,F),I=!1},d(F){F&&x(t),J(o),J(s),J(f),J(p),J(b),J(A),J(M)}}}function Up(e,t,n){let r;ee(e,pn,o=>n(0,r=o)),ut(()=>{console.log("FEEDBACK on mount"),i()});async function i(){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(pn,r=[...s],r)}return[]}class Wp extends ie{constructor(t){super(),se(this,t,Up,Bp,re,{})}}function Xp(e){let t,n;return t=new Us({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Yp(e){let t,n;return t=new Wp({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Qp(e){let t,n;return t=new Us({}),{c(){Z(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(N(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){J(t,r)}}}function Kp(e){let t,n,r,i;const o=[Qp,Yp,Xp],l=[];function a(s,u){return s[0]==="vote"?0:s[0]==="rag"?1:2}return t=a(e),n=l[t]=o[t](e),{c(){n.c(),r=Ae()},m(s,u){l[t].m(s,u),T(s,r,u),i=!0},p(s,[u]){let c=t;t=a(s),t!==c&&(ue(),V(l[c],1,1,()=>{l[c]=null}),ce(),n=l[t],n||(n=l[t]=o[t](s),n.c()),N(n,1),n.m(r.parentNode,r))},i(s){i||(N(n),i=!0)},o(s){V(n),i=!1},d(s){l[t].d(s),s&&x(r)}}}function Jp(e,t,n){let{feedback:r}=t;return e.$$set=i=>{"feedback"in i&&n(0,r=i.feedback)},[r]}class Zp extends ie{constructor(t){super(),se(this,t,Jp,Kp,re,{feedback:0})}}function Kl(e,t,n){const r=e.slice();return r[7]=t[n],r}function Jl(e){let t,n=e[0],r=[];for(let i=0;i{J(c,1)}),ce()}o?(t=mt(o,l()),Z(t.$$.fragment),N(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else o&&t.$set(u)},i(a){r||(t&&N(t.$$.fragment,a),r=!0)},o(a){t&&V(t.$$.fragment,a),r=!1},d(a){a&&x(n),t&&J(t,a)}}}function em(e){let t,n,r,i=e[0].length>1&&Jl(e),o=e[1]&&es(e);return{c(){i&&i.c(),t=D(),o&&o.c(),n=Ae()},m(l,a){i&&i.m(l,a),T(l,t,a),o&&o.m(l,a),T(l,n,a),r=!0},p(l,[a]){l[0].length>1?i?i.p(l,a):(i=Jl(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null),l[1]?o?(o.p(l,a),a&2&&N(o,1)):(o=es(l),o.c(),N(o,1),o.m(n.parentNode,n)):o&&(ue(),V(o,1,1,()=>{o=null}),ce())},i(l){r||(N(o),r=!0)},o(l){V(o),r=!1},d(l){i&&i.d(l),l&&x(t),o&&o.d(l),l&&x(n)}}}function tm(e,t,n){let r,i;const o=ke([]);ee(e,o,c=>n(0,r=c));const l=ke(null);ee(e,l,c=>n(1,i=c));const a={Chatbot:Pf,Dropdown:Of,Feedback:Zp,Compare:Kg,RetrievalQA:jp},s=c=>{l.set(c)};return fetch("/components").then(c=>{if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);return c.json()}).then(c=>{o.set(c),l.set(c[0])}).catch(c=>{console.log("Fetch request failed",c)}),[r,i,o,l,a,s,c=>s(c)]}class nm extends ie{constructor(t){super(),se(this,t,tm,em,re,{})}}new nm({target:document.getElementById("app")}); diff --git a/pykoi/frontend/dist/index.html b/pykoi/frontend/dist/index.html index 6137fdc..8fe8bbf 100644 --- a/pykoi/frontend/dist/index.html +++ b/pykoi/frontend/dist/index.html @@ -5,8 +5,8 @@ Vite + Svelte - - + +