),Eu=new RegExp(`^rgb\\(${qe},${qe},${qe}\\) Vite + Svelte
),Cu=new RegExp(`^rgba\\(${St},${St},${St},${Ot}\\) Vite + Svelte
),Tu=new RegExp(`^rgba\\(${qe},${qe},${qe},${Ot}\\) Vite + Svelte
),Au=new RegExp(`^hsl\\(${Ot},${qe},${qe}\\) Vite + Svelte
),Mu=new RegExp(`^hsla\\(${Ot},${qe},${qe},${Ot}\\) Vite + Svelte
),Co={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xn(qt,Pt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:To,formatHex:To,formatHex8:ju,formatHsl:Du,formatRgb:Ao,toString:Ao});function To(){return this.rgb().formatHex()}function ju(){return this.rgb().formatHex8()}function Du(){return qo(this).formatHsl()}function Ao(){return this.rgb().formatRgb()}function Pt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Su.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Mo(t):n===3?new xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?un(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?un(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=zu.exec(e))?new xe(t[1],t[2],t[3],1):(t=Eu.exec(e))?new xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Cu.exec(e))?un(t[1],t[2],t[3],t[4]):(t=Tu.exec(e))?un(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Au.exec(e))?$o(t[1],t[2]/100,t[3]/100,1):(t=Mu.exec(e))?$o(t[1],t[2]/100,t[3]/100,t[4]):Co.hasOwnProperty(e)?Mo(Co[e]):e==="transparent"?new xe(NaN,NaN,NaN,0):null}function Mo(e){return new xe(e>>16&255,e>>8&255,e&255,1)}function un(e,t,n,r){return r<=0&&(e=t=n=NaN),new xe(e,t,n,r)}function $u(e){return e instanceof qt||(e=Pt(e)),e?(e=e.rgb(),new xe(e.r,e.g,e.b,e.opacity)):new xe}function Yn(e,t,n,r){return arguments.length===1?$u(e):new xe(e,t,n,r??1)}function xe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xn(xe,Yn,Eo(qt,{brighter(e){return e=e==null?sn:Math.pow(sn,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nt:Math.pow(Nt,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xe(st(this.r),st(this.g),st(this.b),fn(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:jo,formatHex:jo,formatHex8:qu,formatRgb:Do,toString:Do}));function jo(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}`}function qu(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}${ut((isNaN(this.opacity)?1:this.opacity)*255)}`}function Do(){const e=fn(this.opacity);return`${e===1?"rgb(":"rgba("}${st(this.r)}, ${st(this.g)}, ${st(this.b)}${e===1?")":`, ${e})`}`}function fn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function st(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ut(e){return e=st(e),(e<16?"0":"")+e.toString(16)}function $o(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new je(e,t,n,r)}function qo(e){if(e instanceof je)return new je(e.h,e.s,e.l,e.opacity);if(e instanceof qt||(e=Pt(e)),!e)return new je;if(e instanceof je)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),l=Math.max(t,n,r),a=NaN,s=l-o,u=(l+o)/2;return s?(t===l?a=(n-r)/s+(n0&&u<1?0:a,new je(a,s,u,e.opacity)}function Nu(e,t,n,r){return arguments.length===1?qo(e):new je(e,t,n,r??1)}function je(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xn(je,Nu,Eo(qt,{brighter(e){return e=e==null?sn:Math.pow(sn,e),new je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nt:Math.pow(Nt,e),new je(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,o=2*n-r;return new xe(Qn(e>=240?e-240:e+120,o,r),Qn(e,o,r),Qn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new je(No(this.h),cn(this.s),cn(this.l),fn(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=fn(this.opacity);return`${e===1?"hsl(":"hsla("}${No(this.h)}, ${cn(this.s)*100}%, ${cn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function No(e){return e=(e||0)%360,e<0?e+360:e}function cn(e){return Math.max(0,Math.min(1,e||0))}function Qn(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 Un=e=>()=>e;function Ou(e,t){return function(n){return e+n*t}}function Pu(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 Fu(e){return(e=+e)==1?Oo:function(t,n){return n-t?Pu(t,n,e):Un(isNaN(t)?n:t)}}function Oo(e,t){var n=t-e;return n?Ou(e,n):Un(isNaN(e)?t:e)}const Jn=function e(t){var n=Fu(t);function r(o,l){var a=n((o=Yn(o)).r,(l=Yn(l)).r),s=n(o.g,l.g),u=n(o.b,l.b),f=Oo(o.opacity,l.opacity);return function(d){return o.r=a(d),o.g=s(d),o.b=u(d),o.opacity=f(d),o+""}}return r.gamma=e,r}(1);function Iu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(l){for(o=0;on&&(l=t.slice(n,l),s[a]?s[a]+=l:s[++a]=l),(r=r[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,u.push({i:a,x:dn(r,o)})),n=Zn.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Uu(e,t,n){var r=e[0],o=e[1],l=t[0],a=t[1];return o2?Ju:Uu,u=f=null,h}function h(g){return g==null||isNaN(g=+g)?l:(u||(u=s(e.map(r),t,n)))(r(a(g)))}return h.invert=function(g){return a(o((f||(f=s(t,e.map(r),dn)))(g)))},h.domain=function(g){return arguments.length?(e=Array.from(g,Yu),d()):e.slice()},h.range=function(g){return arguments.length?(t=Array.from(g),d()):t.slice()},h.rangeRound=function(g){return t=Array.from(g),n=Po,d()},h.clamp=function(g){return arguments.length?(a=g?!0:Ue,d()):a!==Ue},h.interpolate=function(g){return arguments.length?(n=g,d()):n},h.unknown=function(g){return arguments.length?(l=g,h):l},function(g,m){return r=g,o=m,d()}}function ef(){return Zu()(Ue,Ue)}function tf(e,t,n,r){var o=lu(e,t,n),l;switch(r=ln(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(l=wu(o,a))&&(r.precision=l),ko(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(l=ku(o,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=l-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(l=yu(o))&&(r.precision=l-(r.type==="%")*2);break}}return He(r)}function Io(e){var t=e.domain;return e.ticks=function(n){var r=t();return po(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var o=t();return tf(o[0],o[o.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),o=0,l=r.length-1,a=r[o],s=r[l],u,f,d=10;for(s0;){if(f=kt(a,s,n),f===u)return r[o]=a,r[l]=s,t(r);if(f>0)a=Math.floor(a/f)*f,s=Math.ceil(s/f)*f;else if(f<0)a=Math.ceil(a*f)/f,s=Math.floor(s*f)/f;else break;u=f}return e},e}function Ne(){var e=ef();return e.copy=function(){return Ku(e,Ne())},Vn.apply(e,arguments),Io(e)}function nf(){var e=0,t=1,n,r,o,l,a=Ue,s=!1,u;function f(h){return h==null||isNaN(h=+h)?u:a(o===0?.5:(h=(l(h)-n)*o,s?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([e,t]=h,n=l(e=+e),r=l(t=+t),o=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(h){return arguments.length?(s=!!h,f):s},f.interpolator=function(h){return arguments.length?(a=h,f):a};function d(h){return function(g){var m,p;return arguments.length?([m,p]=g,a=h(m,p),f):[a(0),a(1)]}}return f.range=d(Ft),f.rangeRound=d(Po),f.unknown=function(h){return arguments.length?(u=h,f):u},function(h){return l=h,n=h(e),r=h(t),o=n===r?0:1/(r-n),f}}function rf(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ro(){var e=Io(nf()(Ue));return e.copy=function(){return rf(e,Ro())},xu.apply(e,arguments)}function Oe(e){return function(){return e}}const tr=Math.PI,nr=2*tr,ft=1e-6,of=nr-ft;function Bo(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Bo;const n=10**t;return function(r){this._+=r[0];for(let o=1,l=r.length;oft)if(!(Math.abs(h*u-f*d)>ft)||!l)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-a,p=o-s,b=u*u+f*f,v=m*m+p*p,S=Math.sqrt(b),k=Math.sqrt(g),z=l*Math.tan((tr-Math.acos((b+g-v)/(2*S*k)))/2),C=z/k,E=z/S;Math.abs(C-1)>ft&&this._append`L${t+C*d},${n+C*h}`,this._append`A${l},${l},0,0,${+(h*m>d*p)},${this._x1=t+E*u},${this._y1=n+E*f}`}}arc(t,n,r,o,l,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),u=r*Math.sin(o),f=t+s,d=n+u,h=1^a,g=a?o-l:l-o;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>ft||Math.abs(this._y1-d)>ft)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%nr+nr),g>of?this._append`A${r},${r},0,1,${h},${t-s},${n-u}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:g>ft&&this._append`A${r},${r},0,${+(g>=tr)},${h},${this._x1=t+r*Math.cos(l)},${this._y1=n+r*Math.sin(l)}`)}rect(t,n,r,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}}function sf(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new af(t)}function Lo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ho(e){this._context=e}Ho.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 uf(e){return new Ho(e)}function ff(e){return e[0]}function cf(e){return e[1]}function df(e,t){var n=Oe(!0),r=null,o=uf,l=null,a=sf(s);e=typeof e=="function"?e:e===void 0?ff:Oe(e),t=typeof t=="function"?t:t===void 0?cf:Oe(t);function s(u){var f,d=(u=Lo(u)).length,h,g=!1,m;for(r==null&&(l=o(m=a())),f=0;f<=d;++f)!(f1)for(var n=1,r,o,l=e[t[0]],a,s=l.length;n=0;)n[t]=t;return n}function hf(e,t){return e[t]}function pf(e){const t=[];return t.key=e,t}function gf(){var e=Oe([]),t=or,n=rr,r=hf;function o(l){var a=Array.from(e.apply(this,arguments),pf),s,u=a.length,f=-1,d;for(const h of l)for(s=0,++f;sFeedback Distribution

",n=I(),r=M("div"),o=O("svg");for(let u=0;ue[19].call(r))},m(u,f){P(u,t,f),P(u,n,f),P(u,r,f),_(r,o);for(let d=0;dn(15,h=x)),ee(e,Ir,x=>n(4,g=x)),ee(e,Te,x=>n(16,m=x));let p=300,b=300;const v={up:2,down:1,"n/a":0,all:"all"},S={top:10,bottom:10,left:25,right:5},k=Qe().range(["var(--yellow)","var(--red)","var(--green)"]),z=He(".0%");function C(x,w){r===x?n(5,r="all"):n(5,r=x),Ye($e,h=r==="all"?"all":w,h)}const E=(x,w)=>C(x,w.key),T=(x,w)=>C(x,w.key);function y(){b=this.offsetWidth,p=this.offsetHeight,n(1,b),n(0,p)}return e.$.update=()=>{e.$.dirty&32768&&n(5,r=v[h]),e.$.dirty&2&&n(3,o=b-S.left-S.right),e.$.dirty&1&&n(14,l=p-S.top-S.bottom),e.$.dirty&65552&&m.forEach(x=>{Ye(Ir,g[x.vote_status]++,g)}),e.$.dirty&16&&n(2,a=g.up+g.down+g["n/a"]),e.$.dirty&16384&&n(8,s=at().rangeRound([S.top,l-S.bottom]).padding(0).domain(["a"])),e.$.dirty&12&&n(7,u=Ne().rangeRound([S.left,o-S.right]).domain([0,a])),e.$.dirty&8208&&n(6,d=f([g]))},n(13,f=gf().keys(["n/a","down","up"]).order(or).offset(rr)),[p,b,a,o,g,r,d,u,s,S,k,z,C,f,l,h,m,E,T,y]}class bf extends ue{constructor(t){super(),se(this,t,vf,mf,ae,{})}}function _f(e,{delay:t=0,duration:n=400,easing:r=Pr,axis:o="y"}={}){const l=getComputedStyle(e),a=+l.opacity,s=o==="y"?"height":"width",u=parseFloat(l[s]),f=o==="y"?["top","bottom"]:["left","right"],d=f.map(S=>`${S[0].toUpperCase()}${S.slice(1)}`),h=parseFloat(l[`padding${d[0]}`]),g=parseFloat(l[`padding${d[1]}`]),m=parseFloat(l[`margin${d[0]}`]),p=parseFloat(l[`margin${d[1]}`]),b=parseFloat(l[`border${d[0]}Width`]),v=parseFloat(l[`border${d[1]}Width`]);return{delay:t,duration:n,easing:r,css:S=>`overflow: hidden;opacity: ${Math.min(S*20,1)*a};${s}: ${S*u}px;padding-${f[0]}: ${S*h}px;padding-${f[1]}: ${S*g}px;margin-${f[0]}: ${S*m}px;margin-${f[1]}: ${S*p}px;border-${f[0]}-width: ${S*b}px;border-${f[1]}-width: ${S*v}px;`}}const Zc="";function yf(e){let t,n,r,o,l,a,s,u,f,d,h,g=e[3][e[2]]+"",m,p;return{c(){t=M("div"),n=M("div"),r=R("Q: "),o=R(e[0]),l=I(),a=M("div"),s=R("A: "),u=R(e[1]),f=I(),d=M("div"),h=R("Rating: "),m=R(g),c(n,"class","question svelte-szi0e"),c(a,"class","answer svelte-szi0e"),c(d,"class",p="feedback "+e[2]+" svelte-szi0e"),c(t,"class","qa-card svelte-szi0e")},m(b,v){P(b,t,v),_(t,n),_(n,r),_(n,o),_(t,l),_(t,a),_(a,s),_(a,u),_(t,f),_(t,d),_(d,h),_(d,m)},p(b,[v]){v&1&&X(o,b[0]),v&2&&X(u,b[1]),v&4&&g!==(g=b[3][b[2]]+"")&&X(m,g),v&4&&p!==(p="feedback "+b[2]+" svelte-szi0e")&&c(d,"class",p)},i:W,o:W,d(b){b&&N(t)}}}function wf(e,t,n){let{question:r="What is gradient descent?"}=t,{answer:o="Gradient descent is an algorithm used to minimize a loss function by taking small steps in the direction of steepest descent."}=t,{feedback:l="Good: 👍"}=t;const a={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"};return e.$set=s=>{"question"in s&&n(0,r=s.question),"answer"in s&&n(1,o=s.answer),"feedback"in s&&n(2,l=s.feedback)},[r,o,l,a]}class kf extends ue{constructor(t){super(),se(this,t,wf,yf,ae,{question:0,answer:1,feedback:2})}}function xf(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 Yo(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}})}const ed="";function Qo(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 Uo(e){let t,n,r,o,l;return n=new kf({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=M("div"),me(n.$.fragment),r=I()},m(a,s){P(a,t,s),he(n,t,null),_(t,r),l=!0},p(a,s){const u={};s&1&&(u.question=a[5]),s&1&&(u.answer=a[6]),s&1&&(u.feedback=a[7]),n.$set(u)},i(a){l||(Y(n.$.fragment,a),a&&_e(()=>{l&&(o||(o=Or(t,e[1],{duration:300},!0)),o.run(1))}),l=!0)},o(a){Z(n.$.fragment,a),a&&(o||(o=Or(t,e[1],{duration:300},!1)),o.run(0)),l=!1},d(a){a&&N(t),pe(n),a&&o&&o.end()}}}function Sf(e){let t,n,r=e[0],o=[];for(let a=0;aZ(o[a],1,1,()=>{o[a]=null});return{c(){t=M("div");for(let a=0;an(4,o=u)),ee(e,$e,u=>n(2,l=u)),ee(e,Te,u=>n(3,a=u));const s=(u,{delay:f=0,duration:d=1e3,easing:h=Pr})=>_f(u,{delay:f,duration:d,easing:h});return e.$.update=()=>{e.$.dirty&12&&n(0,r=l==="all"?a:a.filter(u=>u.vote_status===l)),e.$.dirty&1&&Ye(Rn,o=xf(r),o)},[r,s,l,a]}class Ef extends ue{constructor(t){super(),se(this,t,zf,Sf,ae,{})}}const td="";function Jo(e,t,n){const r=e.slice();return r[13]=t[n],r}function Ko(e,t,n){const r=e.slice();return r[16]=t[n],r}function Zo(e,t,n){const r=e.slice();return r[16]=t[n],r}function ei(e){let t,n,r,o,l=e[16]+"",a,s;return{c(){t=O("g"),n=O("line"),o=O("text"),a=R(l),c(n,"class","axis-tick svelte-1oikip4"),c(n,"x1","0"),c(n,"x2","0"),c(n,"y1",0),c(n,"y2",r=-e[2]+e[10].bottom+e[10].top),c(n,"stroke","var(--squidink)"),c(n,"stroke-dasharray","4"),c(o,"class","axis-text svelte-1oikip4"),c(o,"y","15"),c(o,"text-anchor","middle"),c(t,"transform",s=`translate(${e[6](e[16])+e[6].bandwidth()/2} ${e[2]-e[10].bottom})`)},m(u,f){P(u,t,f),_(t,n),_(t,o),_(o,a)},p(u,f){f&4&&r!==(r=-u[2]+u[10].bottom+u[10].top)&&c(n,"y2",r),f&16&&l!==(l=u[16]+"")&&X(a,l),f&84&&s!==(s=`translate(${u[6](u[16])+u[6].bandwidth()/2} ${u[2]-u[10].bottom})`)&&c(t,"transform",s)},d(u){u&&N(t)}}}function ti(e){let t,n,r,o;return{c(){t=O("g"),n=O("line"),c(n,"class","axis-tick svelte-1oikip4"),c(n,"x1",0),c(n,"x2",r=e[3]-e[10].right-e[10].left),c(n,"y1","0"),c(n,"y2","0"),c(n,"stroke","black"),c(t,"transform",o=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(l,a){P(l,t,a),_(t,n)},p(l,a){a&8&&r!==(r=l[3]-l[10].right-l[10].left)&&c(n,"x2",r),a&32&&o!==(o=`translate(${l[10].left} ${l[5](l[16])+0})`)&&c(t,"transform",o)},d(l){l&&N(t)}}}function ni(e){let t,n,r,o,l,a,s,u,f=Math.round(e[11](e[13].count))+"",d,h,g;return{c(){t=O("g"),n=O("rect"),u=O("text"),d=R(f),c(n,"x",r=e[6](e[13].question)),c(n,"y",o=e[5](e[13].count)),c(n,"height",l=e[2]-e[5](e[13].count)-e[10].bottom),c(n,"fill",a=e[9][e[7]]),c(n,"fill-opacity","0.95"),c(n,"width",s=e[6].bandwidth()),c(n,"class","svelte-1oikip4"),c(u,"class","axis-text svelte-1oikip4"),c(u,"x",h=e[6](e[13].question)+e[6].bandwidth()/2),c(u,"y",g=e[5](e[13].count)-5),c(u,"text-anchor","middle"),c(t,"class","series")},m(m,p){P(m,t,p),_(t,n),_(t,u),_(u,d)},p(m,p){p&80&&r!==(r=m[6](m[13].question))&&c(n,"x",r),p&48&&o!==(o=m[5](m[13].count))&&c(n,"y",o),p&52&&l!==(l=m[2]-m[5](m[13].count)-m[10].bottom)&&c(n,"height",l),p&128&&a!==(a=m[9][m[7]])&&c(n,"fill",a),p&64&&s!==(s=m[6].bandwidth())&&c(n,"width",s),p&16&&f!==(f=Math.round(m[11](m[13].count))+"")&&X(d,f),p&80&&h!==(h=m[6](m[13].question)+m[6].bandwidth()/2)&&c(u,"x",h),p&48&&g!==(g=m[5](m[13].count)-5)&&c(u,"y",g)},d(m){m&&N(t)}}}function Cf(e){let t,n,r,o,l,a,s=e[8][e[7]]+"",u,f,d,h,g,m,p,b,v,S=e[4].map(ri),k=[];for(let y=0;ye[12].call(t))},m(y,x){P(y,t,x),_(t,n);for(let w=0;we.question;function Tf(e,t,n){let r,o,l,a,s,u;ee(e,Rn,v=>n(4,s=v)),ee(e,$e,v=>n(7,u=v));const f={up:"Good 👍",down:"Bad 👎","n/a":"No Rating",all:"All"},d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let h=300,g=300,m={top:35,bottom:10,left:25,right:5};const p=He(".1f");function b(){g=this.offsetWidth,h=this.offsetHeight,n(1,g),n(0,h)}return e.$.update=()=>{e.$.dirty&2&&n(3,r=g-m.left-m.right),e.$.dirty&1&&n(2,o=h-m.top-m.bottom),e.$.dirty&24&&n(6,l=at().rangeRound([m.left,r-m.right]).padding(.05).domain(s.map(v=>v.question))),e.$.dirty&20&&n(5,a=Ne().rangeRound([o-m.bottom,m.top]).domain([0,lt(s,v=>v.count)])),e.$.dirty&16&&console.log(s)},[h,g,o,r,s,a,l,u,f,d,m,p,b]}class Af extends ue{constructor(t){super(),se(this,t,Tf,Cf,ae,{})}}const nd="";function oi(e,t,n){const r=e.slice();r[19]=t[n];const o=r[7](r[19].x1)-r[7](r[19].x0);return r[20]=o,r}function ii(e,t,n){const r=e.slice();return r[23]=t[n],r}function li(e){let t,n,r,o,l=e[23]+"",a,s;return{c(){t=O("g"),n=O("line"),o=O("text"),a=R(l),c(n,"class","axis-tick svelte-kz2qh6"),c(n,"x1","0"),c(n,"x2","0"),c(n,"y1",0),c(n,"y2",r=-e[2]+e[9].bottom+e[9].top),c(n,"stroke","var(--squidink)"),c(n,"stroke-dasharray","4"),c(o,"class","axis-text svelte-kz2qh6"),c(o,"y","15"),c(o,"text-anchor","middle"),c(t,"transform",s=`translate(${e[7](e[23])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),c(t,"class","svelte-kz2qh6")},m(u,f){P(u,t,f),_(t,n),_(t,o),_(o,a)},p(u,f){f&4&&r!==(r=-u[2]+u[9].bottom+u[9].top)&&c(n,"y2",r),f&128&&l!==(l=u[23]+"")&&X(a,l),f&132&&s!==(s=`translate(${u[7](u[23])+(u[7](1)-u[7](0))/2} ${u[2]-u[9].bottom})`)&&c(t,"transform",s)},d(u){u&&N(t)}}}function ai(e){let t,n,r,o,l,a,s;return{c(){t=O("g"),n=O("rect"),c(n,"x",r=e[7](e[19].x0)+1),c(n,"width",o=e[20]),c(n,"y",l=e[6](e[19].length)),c(n,"height",a=e[6](0)-e[6](e[19].length)),c(n,"fill",s=e[8][e[5]]),c(n,"class","svelte-kz2qh6"),c(t,"class","histogram-bin svelte-kz2qh6")},m(u,f){P(u,t,f),_(t,n)},p(u,f){f&136&&r!==(r=u[7](u[19].x0)+1)&&c(n,"x",r),f&136&&o!==(o=u[20])&&c(n,"width",o),f&72&&l!==(l=u[6](u[19].length))&&c(n,"y",l),f&72&&a!==(a=u[6](0)-u[6](u[19].length))&&c(n,"height",a),f&32&&s!==(s=u[8][u[5]])&&c(n,"fill",s)},d(u){u&&N(t)}}}function Mf(e){let t,n,r,o,l,a,s,u,f,d,h,g=e[7].ticks(),m=[];for(let v=0;ve[14].call(t))},m(v,S){P(v,t,S),_(t,n);for(let k=0;kn(5,h=z)),ee(e,Te,z=>n(13,g=z));const m={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,b=300,v={top:15,bottom:10,left:25,right:5};He(".1f");let S=Array.from({length:si},(z,C)=>C);function k(){b=this.offsetWidth,p=this.offsetHeight,n(1,b),n(0,p)}return e.$.update=()=>{e.$.dirty&8224&&n(12,r=h==="all"?g:g.filter(z=>z.vote_status===h)),e.$.dirty&4096&&n(11,o=Yo(r)),e.$.dirty&2&&n(4,l=b-v.left-v.right),e.$.dirty&1&&n(2,a=p-v.top-v.bottom),e.$.dirty&2048&&n(3,s=go().thresholds(S).value(z=>z.answer)(o)),e.$.dirty&16&&n(7,u=Ne().domain([3,si]).range([v.left,l-v.right])),e.$.dirty&12&&n(6,f=Ne().domain([0,lt(s,z=>z.length)]).range([a-v.bottom,v.top])),e.$.dirty&2048&&n(10,d=lt(o,z=>z.length)),e.$.dirty&1056&&Ne().domain([0,d]).range(["white",m[h]]).interpolate(Ft)},[p,b,a,s,l,h,f,u,m,v,d,o,r,g,k]}class Df extends ue{constructor(t){super(),se(this,t,jf,Mf,ae,{})}}const rd="";function ui(e,t,n){const r=e.slice();r[18]=t[n];const o=r[7](r[18].x1)-r[7](r[18].x0);return r[19]=o,r}function fi(e,t,n){const r=e.slice();return r[22]=t[n],r}function ci(e){let t,n,r,o,l=e[22]+"",a,s;return{c(){t=O("g"),n=O("line"),o=O("text"),a=R(l),c(n,"class","axis-tick svelte-kz2qh6"),c(n,"x1","0"),c(n,"x2","0"),c(n,"y1",0),c(n,"y2",r=-e[2]+e[9].bottom+e[9].top),c(n,"stroke","var(--squidink)"),c(n,"stroke-dasharray","4"),c(o,"class","axis-text svelte-kz2qh6"),c(o,"y","15"),c(o,"text-anchor","middle"),c(t,"transform",s=`translate(${e[7](e[22])+(e[7](1)-e[7](0))/2} ${e[2]-e[9].bottom})`),c(t,"class","svelte-kz2qh6")},m(u,f){P(u,t,f),_(t,n),_(t,o),_(o,a)},p(u,f){f&4&&r!==(r=-u[2]+u[9].bottom+u[9].top)&&c(n,"y2",r),f&128&&l!==(l=u[22]+"")&&X(a,l),f&132&&s!==(s=`translate(${u[7](u[22])+(u[7](1)-u[7](0))/2} ${u[2]-u[9].bottom})`)&&c(t,"transform",s)},d(u){u&&N(t)}}}function di(e){let t,n,r,o,l,a,s;return{c(){t=O("g"),n=O("rect"),c(n,"x",r=e[7](e[18].x0)+1),c(n,"width",o=e[19]),c(n,"y",l=e[6](e[18].length)),c(n,"height",a=e[6](0)-e[6](e[18].length)),c(n,"fill",s=e[8][e[5]]),c(n,"class","svelte-kz2qh6"),c(t,"class","histogram-bin svelte-kz2qh6")},m(u,f){P(u,t,f),_(t,n)},p(u,f){f&136&&r!==(r=u[7](u[18].x0)+1)&&c(n,"x",r),f&136&&o!==(o=u[19])&&c(n,"width",o),f&72&&l!==(l=u[6](u[18].length))&&c(n,"y",l),f&72&&a!==(a=u[6](0)-u[6](u[18].length))&&c(n,"height",a),f&32&&s!==(s=u[8][u[5]])&&c(n,"fill",s)},d(u){u&&N(t)}}}function $f(e){let t,n,r,o,l,a,s,u,f,d,h,g=e[7].ticks(),m=[];for(let v=0;ve[13].call(t))},m(v,S){P(v,t,S),_(t,n);for(let k=0;kn(5,d=k)),ee(e,Te,k=>n(12,h=k));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let m=300,p=300,b={top:15,bottom:10,left:25,right:5},v=Array.from({length:hi},(k,z)=>z);Qe().range(["var(--yellow)","var(--red)","var(--green)"]);function S(){p=this.offsetWidth,m=this.offsetHeight,n(1,p),n(0,m)}return e.$.update=()=>{e.$.dirty&4128&&n(11,r=d==="all"?h:h.filter(k=>k.vote_status===d)),e.$.dirty&2048&&n(10,o=Yo(r)),e.$.dirty&2&&n(4,l=p-b.left-b.right),e.$.dirty&1&&n(2,a=m-b.top-b.bottom),e.$.dirty&1024&&n(3,s=go().thresholds(v).value(k=>k.question)(o)),e.$.dirty&16&&n(7,u=Ne().domain([3,hi]).range([b.left,l-b.right])),e.$.dirty&12&&n(6,f=Ne().domain([0,lt(s,k=>k.length)]).range([a-b.bottom,b.top])),e.$.dirty&1024&<(o,k=>k.length)},[m,p,a,s,l,d,f,u,g,b,o,r,h,S]}class Nf extends ue{constructor(t){super(),se(this,t,qf,$f,ae,{})}}const od="";function Of(e){let t,n,r,o,l,a,s,u,f,d,h,g,m,p=Math.round(e[5](e[3]))+"",b,v,S,k,z,C,E,T;return{c(){t=M("div"),n=M("div"),r=M("p"),r.textContent="Questions",o=I(),l=M("select"),a=M("option"),a.textContent="All",s=M("option"),s.textContent="Good",u=M("option"),u.textContent="Bad",f=M("option"),f.textContent="N/A",d=I(),h=M("div"),g=O("svg"),m=O("text"),b=R(p),z=I(),C=M("p"),C.textContent="number of responses",c(r,"class","card-text svelte-1pknxov"),a.__value="all",a.value=a.__value,c(a,"class","svelte-1pknxov"),s.__value="up",s.value=s.__value,c(s,"class","svelte-1pknxov"),u.__value="down",u.value=u.__value,c(u,"class","svelte-1pknxov"),f.__value="n/a",f.value=f.__value,c(f,"class","svelte-1pknxov"),c(l,"id","feedback-dropdown"),c(l,"name","feedback-dropdown"),de(l,"background",e[6][e[0]]),c(l,"class","svelte-1pknxov"),e[0]===void 0&&_e(()=>e[9].call(l)),c(n,"class","svelte-1pknxov"),c(m,"dominant-baseline","middle"),c(m,"x",v=e[2]/2),c(m,"y",S=e[1]/2),c(m,"text-anchor","middle"),c(m,"class","svelte-1pknxov"),c(g,"width",e[2]),c(g,"height",e[1]),c(g,"class","svelte-1pknxov"),c(h,"class","svelte-1pknxov"),_e(()=>e[10].call(h)),c(C,"class","small svelte-1pknxov"),c(t,"class","card-container svelte-1pknxov"),de(t,"background",e[6][e[0]])},m(y,x){P(y,t,x),_(t,n),_(n,r),_(n,o),_(n,l),_(l,a),_(l,s),_(l,u),_(l,f),Ut(l,e[0],!0),_(t,d),_(t,h),_(h,g),_(g,m),_(m,b),k=Re(h,e[10].bind(h)),_(t,z),_(t,C),E||(T=Q(l,"change",e[9]),E=!0)},p(y,[x]){x&1&&de(l,"background",y[6][y[0]]),x&1&&Ut(l,y[0]),x&8&&p!==(p=Math.round(y[5](y[3]))+"")&&X(b,p),x&4&&v!==(v=y[2]/2)&&c(m,"x",v),x&2&&S!==(S=y[1]/2)&&c(m,"y",S),x&4&&c(g,"width",y[2]),x&2&&c(g,"height",y[1]),x&1&&de(t,"background",y[6][y[0]])},i:W,o:W,d(y){y&&N(t),k(),E=!1,T()}}}function Pf(e,t){return t==="all"?e.length:e.filter(r=>r.vote_status===t).length}function Ff(e,t,n){let r,o,l,a;ee(e,$e,p=>n(0,o=p)),ee(e,Te,p=>n(8,l=p));let s,u,f=Pn(0);ee(e,f,p=>n(3,a=p));const d=He(".1f"),h={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){o=Mr(this),$e.set(o)}function m(){u=this.clientWidth,s=this.clientHeight,n(2,u),n(1,s)}return e.$.update=()=>{e.$.dirty&257&&n(7,r=Pf(l,o)),e.$.dirty&128&&console.log("fbc",r),e.$.dirty&128&&f.set(r)},[o,s,u,a,f,d,h,r,l,g,m]}class If extends ue{constructor(t){super(),se(this,t,Ff,Of,ae,{})}}const id="";function Rf(e){let t,n,r,o,l,a,s,u,f,d,h,g,m,p=e[5](e[3])+"",b,v,S,k,z,C,E,T;return{c(){t=M("div"),n=M("div"),r=M("p"),r.textContent="Questions",o=I(),l=M("select"),a=M("option"),a.textContent="All",s=M("option"),s.textContent="Good",u=M("option"),u.textContent="Bad",f=M("option"),f.textContent="N/A",d=I(),h=M("div"),g=O("svg"),m=O("text"),b=R(p),z=I(),C=M("p"),C.textContent="percentage of responses",c(r,"class","card-text svelte-mchgj2"),a.__value="all",a.value=a.__value,s.__value="up",s.value=s.__value,u.__value="down",u.value=u.__value,f.__value="n/a",f.value=f.__value,c(l,"id","feedback-dropdown"),c(l,"name","feedback-dropdown"),de(l,"background",e[6][e[0]]),c(l,"class","svelte-mchgj2"),e[0]===void 0&&_e(()=>e[9].call(l)),c(m,"dominant-baseline","middle"),c(m,"x",v=e[2]/2),c(m,"y",S=e[1]/2),c(m,"text-anchor","middle"),c(m,"class","svelte-mchgj2"),c(g,"width",e[2]),c(g,"height",e[1]),c(g,"class","svelte-mchgj2"),_e(()=>e[10].call(h)),c(C,"class","small svelte-mchgj2"),c(t,"class","card-container svelte-mchgj2"),de(t,"background",e[6][e[0]])},m(y,x){P(y,t,x),_(t,n),_(n,r),_(n,o),_(n,l),_(l,a),_(l,s),_(l,u),_(l,f),Ut(l,e[0],!0),_(t,d),_(t,h),_(h,g),_(g,m),_(m,b),k=Re(h,e[10].bind(h)),_(t,z),_(t,C),E||(T=Q(l,"change",e[9]),E=!0)},p(y,[x]){x&1&&de(l,"background",y[6][y[0]]),x&1&&Ut(l,y[0]),x&8&&p!==(p=y[5](y[3])+"")&&X(b,p),x&4&&v!==(v=y[2]/2)&&c(m,"x",v),x&2&&S!==(S=y[1]/2)&&c(m,"y",S),x&4&&c(g,"width",y[2]),x&2&&c(g,"height",y[1]),x&1&&de(t,"background",y[6][y[0]])},i:W,o:W,d(y){y&&N(t),k(),E=!1,T()}}}function Bf(e,t){const n=e.length;return t==="all"?1:e.filter(o=>o.vote_status===t).length/n}function Lf(e,t,n){let r,o,l,a;ee(e,$e,p=>n(0,o=p)),ee(e,Te,p=>n(8,l=p));let s,u,f=Pn(0);ee(e,f,p=>n(3,a=p));const d=He(".1%"),h={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){o=Mr(this),$e.set(o)}function m(){u=this.clientWidth,s=this.clientHeight,n(2,u),n(1,s)}return e.$.update=()=>{e.$.dirty&257&&n(7,r=Bf(l,o)),e.$.dirty&128&&f.set(r)},[o,s,u,a,f,d,h,r,l,g,m]}class Hf extends ue{constructor(t){super(),se(this,t,Lf,Rf,ae,{})}}const ld="";function Gf(e){let t,n,r,o,l,a,s,u,f,d,h,g,m,p,b,v,S,k,z,C,E,T,y,x,w,A,j;return l=new If({}),u=new Hf({}),h=new bf({}),p=new Af({props:{feedback:"Bad"}}),S=new Nf({}),C=new Df({}),A=new Ef({}),{c(){t=M("div"),n=M("div"),r=M("div"),o=M("div"),me(l.$.fragment),a=I(),s=M("div"),me(u.$.fragment),f=I(),d=M("div"),me(h.$.fragment),g=I(),m=M("div"),me(p.$.fragment),b=I(),v=M("div"),me(S.$.fragment),k=I(),z=M("div"),me(C.$.fragment),E=I(),T=M("div"),y=M("div"),y.innerHTML=`
`,x=I(),w=M("div"),me(A.$.fragment),c(o,"class","card-1 svelte-14znspc"),c(s,"class","card-2"),c(r,"class","left-text svelte-14znspc"),c(d,"class","left-confidence svelte-14znspc"),c(m,"class","left-question svelte-14znspc"),c(v,"class","left-filter svelte-14znspc"),c(z,"class","left-filter2"),c(n,"class","feedback-left svelte-14znspc"),c(y,"class","right-chart svelte-14znspc"),c(w,"class","right-table svelte-14znspc"),c(T,"class","feedback-right svelte-14znspc"),c(t,"class","feedback-container svelte-14znspc")},m(q,B){P(q,t,B),_(t,n),_(n,r),_(r,o),he(l,o,null),_(r,a),_(r,s),he(u,s,null),_(n,f),_(n,d),he(h,d,null),_(n,g),_(n,m),he(p,m,null),_(n,b),_(n,v),he(S,v,null),_(n,k),_(n,z),he(C,z,null),_(t,E),_(t,T),_(T,y),_(T,x),_(T,w),he(A,w,null),j=!0},p:W,i(q){j||(Y(l.$.fragment,q),Y(u.$.fragment,q),Y(h.$.fragment,q),Y(p.$.fragment,q),Y(S.$.fragment,q),Y(C.$.fragment,q),Y(A.$.fragment,q),j=!0)},o(q){Z(l.$.fragment,q),Z(u.$.fragment,q),Z(h.$.fragment,q),Z(p.$.fragment,q),Z(S.$.fragment,q),Z(C.$.fragment,q),Z(A.$.fragment,q),j=!1},d(q){q&&N(t),pe(l),pe(u),pe(h),pe(p),pe(S),pe(C),pe(A)}}}function Wf(e,t,n){let r;ee(e,Te,l=>n(0,r=l)),mt(()=>{o()});async function o(){const u=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map(f=>({id:f[0],question:f[1],answer:f[2],vote_status:f[3]}));Ye(Te,r=[...u],r)}return[]}class Vf extends ue{constructor(t){super(),se(this,t,Wf,Gf,ae,{})}}/**! * Sortable 1.15.0 * @author RubaXa * @author owenm * @license MIT */function pi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Qf(e,t){if(e==null)return{};var n=Yf(e,t),r,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Uf="1.15.0";function We(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Ve=We(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),It=We(/Edge/i),gi=We(/firefox/i),Rt=We(/safari/i)&&!We(/chrome/i)&&!We(/android/i),mi=We(/iP(ad|od|hone)/i),vi=We(/chrome/i)&&We(/android/i),bi={capture:!1,passive:!1};function K(e,t,n){e.addEventListener(t,n,!Ve&&bi)}function U(e,t,n){e.removeEventListener(t,n,!Ve&&bi)}function pn(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 Jf(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Fe(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&pn(e,t):pn(e,t))||r&&e===n)return e;if(e===n)break}while(e=Jf(e))}return null}var _i=/\s+/g;function ze(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(_i," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(_i," ")}}function H(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 zt(e,t){var n="";if(typeof e=="string")n=e;else do{var r=H(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function yi(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,l=r.length;if(n)for(;o=l:a=o<=l,!a)return r;if(r===Ie())break;r=Ke(r,!1)}return!1}function Et(e,t,n,r){for(var o=0,l=0,a=e.children;l2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,l=Qf(r,ic);Lt.pluginEvent.bind(L)(t,n,Pe({dragEl:$,parentEl:ie,ghostEl:V,rootEl:ne,nextEl:ct,lastDownEl:gn,cloneEl:oe,cloneHidden:Ze,dragStarted:Gt,putSortable:be,activeSortable:L.active,originalEvent:o,oldIndex:Tt,oldDraggableIndex:Ht,newIndex:Ce,newDraggableIndex:et,hideGhostForTarget:Di,unhideGhostForTarget:$i,cloneNowHidden:function(){Ze=!0},cloneNowShown:function(){Ze=!1},dispatchSortableEvent:function(s){ke({sortable:n,name:s,originalEvent:o})}},l))};function ke(e){oc(Pe({putSortable:be,cloneEl:oe,targetEl:$,rootEl:ne,oldIndex:Tt,oldDraggableIndex:Ht,newIndex:Ce,newDraggableIndex:et},e))}var $,ie,V,ne,ct,gn,oe,Ze,Tt,Ce,Ht,et,mn,be,At=!1,vn=!1,bn=[],dt,De,sr,ur,Ei,Ci,Gt,Mt,Wt,Vt=!1,_n=!1,yn,ye,fr=[],cr=!1,wn=[],kn=typeof document<"u",xn=mi,Ti=It||Ve?"cssFloat":"float",lc=kn&&!vi&&!mi&&"draggable"in document.createElement("div"),Ai=function(){if(kn){if(Ve)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Mi=function(t,n){var r=H(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),l=Et(t,0,n),a=Et(t,1,n),s=l&&H(l),u=a&&H(a),f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+ge(l).width,d=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+ge(a).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(l&&s.float&&s.float!=="none"){var h=s.float==="left"?"left":"right";return a&&(u.clear==="both"||u.clear===h)?"vertical":"horizontal"}return l&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||f>=o&&r[Ti]==="none"||a&&r[Ti]==="none"&&f+d>o)?"vertical":"horizontal"},ac=function(t,n,r){var o=r?t.left:t.top,l=r?t.right:t.bottom,a=r?t.width:t.height,s=r?n.left:n.top,u=r?n.right:n.bottom,f=r?n.width:n.height;return o===s||l===u||o+a/2===s+f/2},sc=function(t,n){var r;return bn.some(function(o){var l=o[Ee].options.emptyInsertThreshold;if(!(!l||ir(o))){var a=ge(o),s=t>=a.left-l&&t<=a.right+l,u=n>=a.top-l&&n<=a.bottom+l;if(s&&u)return r=o}}),r},ji=function(t){function n(l,a){return function(s,u,f,d){var h=s.options.group.name&&u.options.group.name&&s.options.group.name===u.options.group.name;if(l==null&&(a||h))return!0;if(l==null||l===!1)return!1;if(a&&l==="clone")return l;if(typeof l=="function")return n(l(s,u,f,d),a)(s,u,f,d);var g=(a?s:u).options.group.name;return l===!0||typeof l=="string"&&l===g||l.join&&l.indexOf(g)>-1}}var r={},o=t.group;(!o||hn(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=n(o.pull,!0),r.checkPut=n(o.put),r.revertClone=o.revertClone,t.group=r},Di=function(){!Ai&&V&&H(V,"display","none")},$i=function(){!Ai&&V&&H(V,"display","")};kn&&!vi&&document.addEventListener("click",function(e){if(vn)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),vn=!1,!1},!0);var ht=function(t){if($){t=t.touches?t.touches[0]:t;var n=sc(t.clientX,t.clientY);if(n){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=t[o]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[Ee]._onDragOver(r)}}},uc=function(t){&$.parentNode[Ee]._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=Ge({},t),e[Ee]=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 Mi(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(a,s){a.setData("Text",s.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&&!Rt,emptyInsertThreshold:5};Lt.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);ji(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:lc,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?K(e,"pointerdown",this._onTapStart):(K(e,"mousedown",this._onTapStart),K(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(K(e,"dragover",this),K(e,"dragenter",this)),bn.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Ge(this,tc())}L.prototype={constructor:L,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Mt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,$):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,l=o.preventOnFilter,a=t.type,s=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,u=(s||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||u,d=o.filter;if(vc(r),!&!(/mousedown|pointerdown/.test(a)&&t.button!==0||o.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Rt&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=Fe(u,o.draggable,r,!1),!(u&&u.animated)&&gn!==u)){if(Tt=Me(u),Ht=Me(u,o.draggable),typeof d=="function"){if(d.call(this,t,u,this)){ke({sortable:n,rootEl:f,name:"filter",targetEl:u,toEl:r,fromEl:r}),Se("filter",n,{evt:t}),l&&t.cancelable&&t.preventDefault();return}}else if(d&&(d=d.split(",").some(function(h){if(h=Fe(f,h.trim(),r,!1),h)return ke({sortable:n,rootEl:h,name:"filter",targetEl:u,fromEl:r,toEl:r}),Se("filter",n,{evt:t}),!0}),d)){l&&t.cancelable&&t.preventDefault();return}o.handle&&!Fe(f,o.handle,r,!1)||this._prepareDragStart(t,s,u)}}},_prepareDragStart:function(t,n,r){var o=this,l=o.el,a=o.options,s=l.ownerDocument,u;if(r&&!&r.parentNode===l){var f=ge(r);if(ne=l,$=r,ie=$.parentNode,ct=$.nextSibling,gn=r,mn=a.group,L.dragged=$,dt={target:$,clientX:(n||t).clientX,clientY:(n||t).clientY},Ei=dt.clientX-f.left,Ci=dt.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,$.style["will-change"]="all",u=function(){if(Se("delayEnded",o,{evt:t}),L.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!gi&&o.nativeDraggable&&($.draggable=!0),o._triggerDragStart(t,n),ke({sortable:o,name:"choose",originalEvent:t}),ze($,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){yi($,d.trim(),dr)}),K(s,"dragover",ht),K(s,"mousemove",ht),K(s,"touchmove",ht),K(s,"mouseup",o._onDrop),K(s,"touchend",o._onDrop),K(s,"touchcancel",o._onDrop),gi&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),Se("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(It||Ve))){if(L.eventCanceled){this._onDrop();return}K(s,"mouseup",o._disableDelayedDrag),K(s,"touchend",o._disableDelayedDrag),K(s,"touchcancel",o._disableDelayedDrag),K(s,"mousemove",o._delayedDragTouchMoveHandler),K(s,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&K(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(u,a.delay)}else u()}},_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(){&dr($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._disableDelayedDrag),U(t,"touchend",this._disableDelayedDrag),U(t,"touchcancel",this._disableDelayedDrag),U(t,"mousemove",this._delayedDragTouchMoveHandler),U(t,"touchmove",this._delayedDragTouchMoveHandler),U(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?K(document,"pointermove",this._onTouchMove):n?K(document,"touchmove",this._onTouchMove):K(document,"mousemove",this._onTouchMove):(K($,"dragend",this),K(ne,"dragstart",this._onDragStart));try{document.selection?zn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(At=!1,ne&&$){Se("dragStarted",this,{evt:n}),this.nativeDraggable&&K(document,"dragover",uc);var r=this.options;!t&&ze($,r.dragClass,!1),ze($,r.ghostClass,!0),L.active=this,t&&this._appendGhost(),ke({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(De){this._lastX=De.clientX,this._lastY=De.clientY,Di();for(var t=document.elementFromPoint(De.clientX,De.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(De.clientX,De.clientY),t!==n);)n=t;if($.parentNode[Ee]._isOutsideThisEl(t),n)do{if(n[Ee]){var r=void 0;if(r=n[Ee]._onDragOver({clientX:De.clientX,clientY:De.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);$i()}},_onTouchMove:function(t){if(dt){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,l=t.touches?t.touches[0]:t,a=V&&zt(V,!0),s=V&&a&&a.a,u=V&&a&&a.d,f=xn&&ye&&ki(ye),d=(l.clientX-dt.clientX+o.x)/(s||1)+(f?f[0]-fr[0]:0)/(s||1),h=(l.clientY-dt.clientY+o.y)/(u||1)+(f?f[1]-fr[1]:0)/(u||1);if(!L.active&&!At){if(r&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))&!$.animated||r===n&&!r.animated)&&(Mt=null),!s.dragoverBubble&&!t.rootEl&&r!==document&&($.parentNode[Ee]._isOutsideThisEl(t.target),!G&&ht(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),b=!0}function z(){Ce=Me($),et=Me($,s.draggable),ke({sortable:p,name:"change",toEl:n,newIndex:Ce,newDraggableIndex:et,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=Fe(r,s.draggable,n,!0),v("dragOver"),L.eventCanceled)return b;if($.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||p._ignoreWhileAnimating===r)return k(!1);if(vn=!1,f&&!s.disabled&&(d?h||(a=ie!==ne):be===this||(this.lastPutMode=mn.checkPull(this,f,$,t))&&u.checkPut(this,f,$,t))){if(m=this._getDirection(t,r)==="vertical",o=ge($),v("dragOverValid"),L.eventCanceled)return b;if(a)return ie=ne,S(),this._hideClone(),v("revert"),L.eventCanceled||(ct?ne.insertBefore($,ct):ne.appendChild($)),k(!0);var C=ir(n,s.draggable);if(!C||hc(t,m,this)&&!C.animated){if(C===$)return k(!1);if(C&&n===t.target&&(r=C),r&&(l=ge(r)),Sn(ne,n,$,o,r,l,t,!!r)!==!1)return S(),C&&C.nextSibling?n.insertBefore($,C.nextSibling):n.appendChild($),ie=n,z(),k(!0)}else if(C&&dc(t,m,this)){var E=Et(n,0,s,!0);if(E===$)return k(!1);if(r=E,l=ge(r),Sn(ne,n,$,o,r,l,t,!1)!==!1)return S(),n.insertBefore($,E),ie=n,z(),k(!0)}else if(r.parentNode===n){l=ge(r);var T=0,y,x=$.parentNode!==n,w=!ac($.animated&&$.toRect||o,r.animated&&r.toRect||l,m),A=m?"top":"left",j=wi(r,"top","top")||wi($,"top","top"),q=j?j.scrollTop:void 0;Mt!==r&&(y=l[A],Vt=!1,_n=!w&&s.invertSwap||x),T=pc(t,r,l,m,w?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,_n,Mt===r);var B;if(T!==0){var J=Me($);do J-=T,B=ie.children[J];while(B&&(H(B,"display")==="none"||B===V))}if(T===0||B===r)return k(!1);Mt=r,Wt=T;var re=r.nextElementSibling,le=!1;le=T===1;var D=Sn(ne,n,$,o,r,l,t,le);if(D!==!1)return(D===1||D===-1)&&(le=D===1),cr=!0,setTimeout(cc,30),S(),le&&!re?n.appendChild($):r.parentNode.insertBefore($,le?re:r),j&&Si(j,0,q-j.scrollTop),ie=$.parentNode,y!==void 0&&!_n&&(yn=Math.abs(y-ge(r)[A])),z(),k(!0)}if(n.contains($))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){U(document,"mousemove",this._onTouchMove),U(document,"touchmove",this._onTouchMove),U(document,"pointermove",this._onTouchMove),U(document,"dragover",ht),U(document,"mousemove",ht),U(document,"touchmove",ht)},_offUpEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._onDrop),U(t,"touchend",this._onDrop),U(t,"pointerup",this._onDrop),U(t,"touchcancel",this._onDrop),U(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Ce=Me($),et=Me($,r.draggable),Se("drop",this,{evt:t}),ie=&$.parentNode,Ce=Me($),et=Me($,r.draggable),L.eventCanceled){this._nulling();return}At=!1,_n=!1,Vt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hr(this.cloneId),hr(this._dragStartId),this.nativeDraggable&&(U(document,"drop",this),U(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Rt&&H(document.body,"user-select",""),H($,"transform",""),t&&(Gt&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(ne===ie||be&&be.lastPutMode!=="clone")&&oe&&oe.parentNode&&oe.parentNode.removeChild(oe),&(this.nativeDraggable&&U($,"dragend",this),dr($),$.style["will-change"]="",Gt&&!At&&ze($,be?be.options.ghostClass:this.options.ghostClass,!1),ze($,this.options.chosenClass,!1),ke({sortable:this,name:"unchoose",toEl:ie,newIndex:null,newDraggableIndex:null,originalEvent:t}),ne!==ie?(Ce>=0&&(ke({rootEl:ie,name:"add",toEl:ie,fromEl:ne,originalEvent:t}),ke({sortable:this,name:"remove",toEl:ie,originalEvent:t}),ke({rootEl:ie,name:"sort",toEl:ie,fromEl:ne,originalEvent:t}),ke({sortable:this,name:"sort",toEl:ie,originalEvent:t})),be&&be.save()):Ce!==Tt&&Ce>=0&&(ke({sortable:this,name:"update",toEl:ie,originalEvent:t}),ke({sortable:this,name:"sort",toEl:ie,originalEvent:t})),L.active&&((Ce==null||Ce===-1)&&(Ce=Tt,et=Ht),ke({sortable:this,name:"end",toEl:ie,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Se("nulling",this),ne=$=ie=V=ct=oe=gn=Ze=dt=De=Gt=Ce=et=Tt=Ht=Mt=Wt=be=mn=L.dragged=L.ghost=L.clone=L.active=null,wn.forEach(function(t){t.checked=!0}),wn.length=sr=ur=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":&(this._onDragOver(t),fc(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,l=r.length,a=this.options;or.right+o||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+o}function pc(e,t,n,r,o,l,a,s){var u=r?e.clientY:e.clientX,f=r?n.height:n.width,d=r?n.top:n.left,h=r?n.bottom:n.right,g=!1;if(!a){if(s&&ynd+f*l/2:uh-yn)return-Wt}else if(u>d+f*(1-o)/2&&uh-f*l/2)?u>d+f/2?1:-1:0}function gc(e){return Me($)x[24];for(let x=0;xT[21];for(let T=0;TQ & 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=I(),o=M("div"),l=M("section"),a=M("div");for(let T=0;T{e.scrollIntoView({behavior:"smooth"})},0)}async function Li(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 wc(e,t,n){let r,o,l;ee(e,In,E=>n(7,l=E));let{numModels:a=1}=t,{models:s=[0]}=t,u="",f="",d=!1;mt(async()=>{if(await new Promise(E=>setTimeout(E,200)),m){const E=new L(m,{animation:150,onUpdate(T){E.toArray()}});E.toArray()}});const h=async E=>{E.preventDefault(),u=f,n(3,f=""),n(4,d=!0);let T={question:u};for(let x of s)T[x]="Loading...";Ye(In,l=[...l,T],l);const y=await fetch(`/chat/comparator/${u}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:u})});if(y.ok){const x=await y.json();n(1,s=Object.keys(x.answer)),n(0,a=s.length);for(let w of s)T[w]=x.answer[w];T.qid=x.qid,In.update(w=>(w[w.length-1]=T,w))}else{const x=await y.text();alert(x)}n(4,d=!1)};let g=0;setInterval(()=>{n(11,g=(g+1)%4)},200);let m,p;function b(E,T){const y=T,w=wt(E.currentTarget.parentNode).selectAll("div.answer").nodes().map(B=>B.id);w.forEach((B,J)=>{wt(`#${B}`).select(".answer-rank").property("value",J+1)});let A=[];for(let[B,J]of w.entries()){const re=parseInt(J.split("-")[1]),le=s[re],D={rank:B,model:le};A.push(D)}let j=l.filter(B=>B.qid===y),q=[];for(let B of A){const J={model:B.model,qid:parseInt(y),rank:parseInt(B.rank)+1,answer:j[0][B.model]};q.push(J)}Li(q)}function v(E,T,y){const x=T,w=parseInt(E.target.value),A=s[y],j={qid:x,rank:parseInt(w),model:A};let q=[],J=l.filter(le=>le.qid===j.qid)[0][j.model];const re={model:j.model,qid:parseInt(j.qid),rank:parseInt(j.rank),answer:J};q.push(re),Li(q)}const S=(E,T,y)=>v(y,E.qid,T),k=(E,T)=>b(T,E.qid);function z(E){Dn[E?"unshift":"push"](()=>{m=E,n(2,m)})}function C(){f=this.value,n(3,f)}return e.$set=E=>{"numModels"in E&&n(0,a=E.numModels),"models"in E&&n(1,s=E.models)},e.$.update=()=>{e.$.dirty&1&&n(6,r="1fr ".repeat(a).trim()),e.$.dirty&2048&&n(5,o=".".repeat(g).padEnd(3)),e.$.dirty&4100&&m&&(n(12,p=new L(m,{animation:150,dataIdAttr:"id",onUpdate(E){p.toArray()}})),p.toArray())},[a,s,m,f,d,o,r,l,h,b,v,g,p,S,k,z,C]}class kc extends ue{constructor(t){super(),se(this,t,wc,_c,ae,{numModels:0,models:1})}}const Qt=Le([{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."},{model:"llama",qid:3,rank:1,answer:"Llama's third unique answer."},{model:"gpt3.5",qid:3,rank:4,answer:"GPT-3.5's third unique answer."},{model:"gpt4",qid:3,rank:4,answer:"GPT-4's third unique answer."},{model:"claude",qid:3,rank:2,answer:"'s third unique answer."},{model:"llama",qid:4,rank:1,answer:"Llama's fourth unique answer."},{model:"gpt3.5",qid:4,rank:3,answer:"GPT-3.5's unique answer."},{model:"gpt4",qid:4,rank:2,answer:"GPT-4's unique answer."},{model:"claude",qid:4,rank:4,answer:"'s unique answer."},{model:"llama",qid:5,rank:1,answer:"Llama's unique answer."},{model:"gpt3.5",qid:5,rank:2,answer:"GPT-3.5's nique answer."},{model:"gpt4",qid:5,rank:3,answer:"GPT-4's fifth unique answer."},{model:"claude",qid:5,rank:4,answer:"'s fifthnswer."},{model:"llama",qid:6,rank:1,answer:"Llama's sixth unique answer."},{model:"gpt3.5",qid:6,rank:2,answer:"GPT-3.5's sixth unique answer."},{model:"gpt4",qid:6,rank:3,answer:"GPT-4's sixth unique answer."},{model:"claude",qid:6,rank:4,answer:"'s sixth uniq."}]),sd="";function Hi(e,t,n){const r=e.slice();return r[21]=t[n],r}function Gi(e,t,n){const r=e.slice();return r[21]=t[n],r[25]=n,r}function Wi(e,t,n){const r=e.slice();return r[26]=t[n],r}function Vi(e,t,n){const r=e.slice();return r[26]=t[n],r}function Xi(e){let t,n,r,o,l=`Q.${e[26]}`,a,s;return{c(){t=O("g"),n=O("line"),o=O("text"),a=R(l),c(n,"class","axis-tick svelte-1nna9rx"),c(n,"x1","0"),c(n,"x2","0"),c(n,"y1",0),c(n,"y2",r=-e[6]+e[12].bottom+e[12].top),c(n,"stroke","black"),c(n,"stroke-dasharray","4"),c(o,"class","axis-text svelte-1nna9rx"),c(o,"y","15"),c(o,"text-anchor","middle"),c(t,"transform",s=`translate(${e[3](e[26])+0} ${e[6]-e[12].bottom})`),c(t,"class","svelte-1nna9rx")},m(u,f){P(u,t,f),_(t,n),_(t,o),_(o,a)},p(u,f){f&64&&r!==(r=-u[6]+u[12].bottom+u[12].top)&&c(n,"y2",r),f&512&&l!==(l=`Q.${u[26]}`)&&X(a,l),f&584&&s!==(s=`translate(${u[3](u[26])+0} ${u[6]-u[12].bottom})`)&&c(t,"transform",s)},d(u){u&&N(t)}}}function Yi(e){let t=Number.isInteger(e[26]),n,r=t&&Xi(e);return{c(){r&&r.c(),n=we()},m(o,l){r&&r.m(o,l),P(o,n,l)},p(o,l){l&512&&(t=Number.isInteger(o[26])),t?r?r.p(o,l):(r=Xi(o),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},d(o){r&&r.d(o),o&&N(n)}}}function Qi(e){let t,n;return{c(){t=O("g"),c(t,"transform",n=`translate(${e[12].left} ${e[5](e[26])+0})`),c(t,"class","svelte-1nna9rx")},m(r,o){P(r,t,o)},p(r,o){o&32&&n!==(n=`translate(${r[12].left} ${r[5](r[26])+0})`)&&c(t,"transform",n)},d(r){r&&N(t)}}}function Ui(e,t){let n,r,o,l,a,s,u,f,d;function h(){return t[15](t[25])}function g(){return t[16](t[25])}return{key:e,first:null,c(){n=O("path"),l=O("path"),c(n,"class","model-path-outer svelte-1nna9rx"),c(n,"d",r=t[10](t[21])),c(n,"stroke","white"),c(n,"data-model",o=t[2][t[25]]),c(l,"class","model-path svelte-1nna9rx"),c(l,"d",a=t[10](t[21])),c(l,"role","img"),c(l,"stroke",s=t[11](t[2][t[25]])),c(l,"data-model",u=t[2][t[25]]),this.first=n},m(m,p){P(m,n,p),P(m,l,p),f||(d=[Q(l,"mouseover",h),Q(l,"focus",g),Q(l,"mouseout",Tn),Q(l,"blur",Tn)],f=!0)},p(m,p){t=m,p&1040&&r!==(r=t[10](t[21]))&&c(n,"d",r),p&20&&o!==(o=t[2][t[25]])&&c(n,"data-model",o),p&1040&&a!==(a=t[10](t[21]))&&c(l,"d",a),p&2068&&s!==(s=t[11](t[2][t[25]]))&&c(l,"stroke",s),p&20&&u!==(u=t[2][t[25]])&&c(l,"data-model",u)},d(m){m&&N(n),m&&N(l),f=!1,ve(d)}}}function Ji(e,t){let n,r,o,l,a,s,u=t[21].rank+"",f,d,h,g;return{key:e,first:null,c(){n=O("g"),r=O("circle"),s=O("text"),f=R(u),c(r,"r",o=t[21].answer.length/2*0+12),c(r,"fill",l=t[11](t[21].model)),c(r,"stroke","white"),c(r,"class","model-circle svelte-1nna9rx"),c(r,"role","img"),c(r,"data-model",a=t[21].model),c(s,"class","bump-text svelte-1nna9rx"),c(s,"text-anchor","middle"),c(s,"alignment-baseline","middle"),c(s,"color","white"),c(s,"fill","white"),c(n,"transform",d=`translate(${t[3](t[21].qid)}, ${t[5](t[21].rank)})`),c(n,"class","svelte-1nna9rx"),this.first=n},m(m,p){P(m,n,p),_(n,r),_(n,s),_(s,f),h||(g=[Q(r,"mouseover",t[17]),Q(r,"focus",t[18]),Q(r,"mouseout",Tn),Q(r,"blur",Tn)],h=!0)},p(m,p){t=m,p&256&&o!==(o=t[21].answer.length/2*0+12)&&c(r,"r",o),p&2304&&l!==(l=t[11](t[21].model))&&c(r,"fill",l),p&256&&a!==(a=t[21].model)&&c(r,"data-model",a),p&256&&u!==(u=t[21].rank+"")&&X(f,u),p&296&&d!==(d=`translate(${t[3](t[21].qid)}, ${t[5](t[21].rank)})`)&&c(n,"transform",d)},d(m){m&&N(n),h=!1,ve(g)}}}function xc(e){let t,n,r,o,l,a,s,u,f,d,h,g,m,p,b=[],v=new Map,S,k=[],z=new Map,C,E,T,y,x,w=e[9],A=[];for(let D=0;DD[25];for(let D=0;DD[21].model+D[21].qid;for(let D=0;De[19].call(t))},m(D,G){P(D,t,G),_(t,n),_(n,r);for(let F=0;F{e.style.opacity=1})}function Sc(e,t,n){let r,o,l,a,s,u,f,d,h,g,m;ee(e,Qt,y=>n(8,m=y));let p,b,v={top:35,bottom:15,left:10,right:0};function S(y){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(x=>{x.style.opacity=.12}),document.querySelectorAll(`.model-path[data-model="${r[y]}"], .model-circle[data-model="${r[y]}"]`).forEach(x=>{x.style.opacity=1})}const k=y=>S(y),z=y=>S(y),C=()=>S(i),E=()=>S(i);function T(){b=this.offsetWidth,p=this.offsetHeight,n(1,b),n(0,p)}return e.$.update=()=>{e.$.dirty&256&&m.filter(y=>y.qid===3).map(y=>({model:y.model,rank:y.rank})),e.$.dirty&256&&console.log("firstData",m),e.$.dirty&256&&n(2,r=Array.from(new Set(m.map(y=>y.model)))),e.$.dirty&4&&console.log("models",r),e.$.dirty&2&&n(7,o=b-v.left-v.right),e.$.dirty&1&&n(6,l=p-v.top-v.bottom),e.$.dirty&384&&n(3,a=zo().domain(m.map(y=>y.qid)).padding(.3).range([v.left,o-v.right])),e.$.dirty&256&&n(14,s=m.map(y=>y.rank).sort((y,x)=>y-x)),e.$.dirty&16448&&n(5,u=zo().domain(s).padding(1).range([v.top,l-v.bottom])),e.$.dirty&256&&n(11,f=Qe().domain(m.map(y=>y.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"])),e.$.dirty&40&&n(10,d=df().x(y=>a(y.qid)).y(y=>u(y.rank))),e.$.dirty&260&&n(4,h=r.map(y=>m.filter(x=>x.model===y))),e.$.dirty&16&&console.log("md",h),e.$.dirty&256&&console.log("ranks",m.map(y=>y.rank)),e.$.dirty&8&&n(9,g=a.domain().length>10?a.domain().filter((y,x)=>x%2===0):a.domain())},[p,b,r,a,h,u,l,o,m,g,d,f,v,S,s,k,z,C,E,T]}class zc extends ue{constructor(t){super(),se(this,t,Sc,xc,ae,{})}}const ud="";function Ki(e,t,n){const r=e.slice();return r[13]=t[n],r[15]=n,r}function Zi(e,t,n){const r=e.slice();return r[16]=t[n],r}function el(e,t,n){const r=e.slice();return r[16]=t[n],r}function tl(e){let t,n,r=e[16]+"",o,l;return{c(){t=O("g"),n=O("text"),o=R(r),c(n,"class","axis-text svelte-1y9gffu"),c(n,"x","-5"),c(n,"y","0"),c(n,"text-anchor","end"),c(t,"transform",l=`translate(${e[9].left} ${e[8](e[16])+e[8].bandwidth()/2})`)},m(a,s){P(a,t,s),_(t,n),_(n,o)},p(a,s){s&4&&r!==(r=a[16]+"")&&X(o,r),s&260&&l!==(l=`translate(${a[9].left} ${a[8](a[16])+a[8].bandwidth()/2})`)&&c(t,"transform",l)},d(a){a&&N(t)}}}function nl(e){let t,n,r=e[16]+"",o,l;return{c(){t=O("g"),n=O("text"),o=R(r),c(n,"class","axis-text svelte-1y9gffu"),c(n,"y","15"),c(n,"text-anchor","middle"),c(t,"transform",l=`translate(${e[7](e[16])}, ${e[4]-e[9].bottom})`)},m(a,s){P(a,t,s),_(t,n),_(n,o)},p(a,s){s&128&&r!==(r=a[16]+"")&&X(o,r),s&144&&l!==(l=`translate(${a[7](a[16])}, ${a[4]-a[9].bottom})`)&&c(t,"transform",l)},d(a){a&&N(t)}}}function rl(e){let t,n=e[16]%2==0&&nl(e);return{c(){n&&n.c(),t=we()},m(r,o){n&&n.m(r,o),P(r,t,o)},p(r,o){r[16]%2==0?n?n.p(r,o):(n=nl(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(r){n&&n.d(r),r&&N(t)}}}function ol(e){let t,n,r,o,l,a,s,u=e[13].avgRank.toFixed(2)+"",f,d,h;return{c(){t=O("rect"),s=O("text"),f=R(u),c(t,"y",n=e[8](e[13].model)),c(t,"x",e[9].left),c(t,"width",r=e[7](e[13].avgRank)-e[9].left),c(t,"height",o=e[8].bandwidth()),c(t,"fill",l=e[6](e[13].model)),c(t,"class","model-path"),c(t,"data-model",a=e[5][e[15]]),c(s,"class","label-text svelte-1y9gffu"),c(s,"y",d=e[8](e[13].model)+e[8].bandwidth()/2),c(s,"x",h=e[7](e[13].avgRank)+5),c(s,"text-anchor","start"),c(s,"dominant-baseline","middle")},m(g,m){P(g,t,m),P(g,s,m),_(s,f)},p(g,m){m&260&&n!==(n=g[8](g[13].model))&&c(t,"y",n),m&132&&r!==(r=g[7](g[13].avgRank)-g[9].left)&&c(t,"width",r),m&256&&o!==(o=g[8].bandwidth())&&c(t,"height",o),m&68&&l!==(l=g[6](g[13].model))&&c(t,"fill",l),m&32&&a!==(a=g[5][g[15]])&&c(t,"data-model",a),m&4&&u!==(u=g[13].avgRank.toFixed(2)+"")&&X(f,u),m&260&&d!==(d=g[8](g[13].model)+g[8].bandwidth()/2)&&c(s,"y",d),m&132&&h!==(h=g[7](g[13].avgRank)+5)&&c(s,"x",h)},d(g){g&&N(t),g&&N(s)}}}function Ec(e){let t,n,r,o,l,a,s,u,f,d,h,g,m=e[2].map(il),p=[];for(let z=0;ze[12].call(t))},m(z,C){P(z,t,C),_(t,n);for(let E=0;Ee.model;function Cc(e,t,n){let r,o,l,a,s,u,f,d,h;ee(e,Qt,v=>n(11,h=v));let g=300,m=500,p={top:50,bottom:0,left:100,right:0};function b(){m=this.offsetWidth,g=this.offsetHeight,n(1,m),n(0,g)}return e.$.update=()=>{e.$.dirty&2048&&n(10,r=h.reduce((v,S)=>(v[S.model]?(v[S.model].sum+=S.rank,v[S.model].count++):v[S.model]={sum:S.rank,count:1},v),{})),e.$.dirty&1024&&n(2,o=Object.keys(r).map(v=>({model:v,avgRank:r[v].sum/r[v].count}))),e.$.dirty&2&&n(3,l=m-p.left-p.right),e.$.dirty&1&&n(4,a=g-p.top-p.bottom),e.$.dirty&20&&n(8,s=at().rangeRound([p.top,a-p.bottom]).padding(.05).domain(o.map(v=>v.model))),e.$.dirty&12&&n(7,u=Ne().rangeRound([p.left,l-p.right]).domain([0,lt(o,v=>v.avgRank)])),e.$.dirty&4&&n(6,f=Qe().domain(o.map(v=>v.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$.dirty&2048&&n(5,d=Array.from(new Set(h.map(v=>v.model))))},[g,m,o,l,a,d,f,u,s,p,r,h,b]}class Tc extends ue{constructor(t){super(),se(this,t,Cc,Ec,ae,{})}}const fd="",cd="";function ll(e,t,n){const r=e.slice();return r[20]=t[n],r[22]=n,r}function al(e,t,n){const r=e.slice();return r[23]=t[n],r[25]=n,r}function sl(e,t,n){const r=e.slice();return r[23]=t[n],r}function ul(e){let t,n=e[23].key+"",r,o,l;function a(){return e[10](e[23])}return{c(){t=M("th"),r=R(n),c(t,"class","svelte-owgjbp")},m(s,u){P(s,t,u),_(t,r),o||(l=Q(t,"click",a),o=!0)},p(s,u){e=s,u&64&&n!==(n=e[23].key+"")&&X(r,n)},d(s){s&&N(t),o=!1,l()}}}function fl(e,t){let n,r=(t[20][t[23].key].length>dl&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"",o,l,a,s;function u(){return t[11](t[22],t[25])}return{key:e,first:null,c(){n=M("td"),o=R(r),c(n,"class",l="cell-type-"+t[23].type+" svelte-owgjbp"),de(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),jr(n,"active",t[4]===`${t[22]}-${t[25]}`),this.first=n},m(f,d){P(f,n,d),_(n,o),a||(s=Q(n,"click",u),a=!0)},p(f,d){t=f,d&112&&r!==(r=(t[20][t[23].key].length>dl&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"")&&X(o,r),d&64&&l!==(l="cell-type-"+t[23].type+" svelte-owgjbp")&&c(n,"class",l),d&96&&de(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),d&80&&jr(n,"active",t[4]===`${t[22]}-${t[25]}`)},d(f){f&&N(n),a=!1,s()}}}function cl(e){let t,n=[],r=new Map,o,l=e[6];const a=s=>s[23].key;for(let s=0;sn(9,a=C));let s={};const u=He(".2f");function f(C){let E=C.reduce((y,x)=>(y[x.model]||(y[x.model]=[]),y[x.model].push(x.rank),y),{});return Object.entries(E).map(([y,x])=>{let w=x.reduce((j,q)=>(j[q]=(j[q]||0)+1,j),{}),A=Object.entries(w).reduce((j,q)=>q[1]>j[1]?q:j)[0];return{model:y,overall_rank:Number(A),average_rank:u(fu(x)),standard_deviation_rank:u(Us(x))}})}s={...{columns:{},style:"normal",paged:25},...s};const h=Ne().domain([-1,0,1]).range(["#FF5470","#f8f8f8","#00ebc7"]);let{sortable:g,index:m,paged:p}=s,b,v=!0;if(g&&m)throw new Error("A table can either be ranked or sortable, but not both");m=1,g=1;let S=null;const k=C=>{g&&(b===C.key&&n(2,v=!v),n(1,b=C.key))},z=(C,E)=>{n(4,S=S===`${C}-${E}`?null:`${C}-${E}`)};return e.$.update=()=>{if(e.$.dirty&512,e.$.dirty&512&&n(8,r=f(a)),e.$.dirty&774){b&&n(8,r=r.slice().sort((E,T)=>{let y=E[b],x=T[b];if(y==x)return JSON.stringify(E).localeCompare(JSON.stringify(T));let w=y>x?1:y{const E=s.columns[C]||{};return{key:C,type:E.type||typeof r[0][C],options:E}}))},n(5,l=[]),[s,b,v,g,S,l,o,h,r,a,k,z]}class Dc extends ue{constructor(t){super(),se(this,t,jc,Ac,ae,{})}}const dd="";function hl(e,t,n){const r=e.slice();return r[19]=t[n],r}function pl(e,t,n){const r=e.slice();return r[22]=t[n],r}function gl(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function ml(e){let t,n=e[25]+"",r,o,l,a=e[25]+"",s,u;return{c(){t=O("text"),r=R(n),l=O("text"),s=R(a),c(t,"class","axis-text svelte-t6wv8i"),c(t,"x",o=e[7].left+e[5](e[25])+e[5].bandwidth()/2),c(t,"y",e[7].top-10),c(t,"text-anchor","middle"),c(l,"class","axis-text svelte-t6wv8i"),c(l,"x",e[7].left-10),c(l,"y",u=e[7].top+e[4](e[25])+e[4].bandwidth()/2),c(l,"text-anchor","end"),c(l,"dominant-baseline","middle")},m(f,d){P(f,t,d),_(t,r),P(f,l,d),_(l,s)},p(f,d){d&8&&n!==(n=f[25]+"")&&X(r,n),d&40&&o!==(o=f[7].left+f[5](f[25])+f[5].bandwidth()/2)&&c(t,"x",o),d&8&&a!==(a=f[25]+"")&&X(s,a),d&24&&u!==(u=f[7].top+f[4](f[25])+f[4].bandwidth()/2)&&c(l,"y",u)},d(f){f&&N(t),f&&N(l)}}}function vl(e){let t,n,r,o,l,a,s,u,f=e[6](e[2][e[19]][e[22]])+"",d,h,g,m;return{c(){t=O("rect"),u=O("text"),d=R(f),c(t,"x",n=e[7].left+e[5](e[22])),c(t,"y",r=e[7].top+e[4](e[19])),c(t,"width",o=e[5].bandwidth()),c(t,"height",l=e[4].bandwidth()),c(t,"fill",a=e[8](e[19],e[22])),c(t,"rx","4"),c(t,"ry","4"),c(t,"class","model-path"),c(t,"data-model",s=e[19]),c(u,"x",h=e[7].left+e[5](e[22])+e[5].bandwidth()/2),c(u,"y",g=e[7].top+e[4](e[19])+e[4].bandwidth()/2),c(u,"text-anchor","middle"),c(u,"dominant-baseline","middle"),c(u,"class","model-path"),c(u,"data-model",m=e[19])},m(p,b){P(p,t,b),P(p,u,b),_(u,d)},p(p,b){b&40&&n!==(n=p[7].left+p[5](p[22]))&&c(t,"x",n),b&24&&r!==(r=p[7].top+p[4](p[19]))&&c(t,"y",r),b&32&&o!==(o=p[5].bandwidth())&&c(t,"width",o),b&16&&l!==(l=p[4].bandwidth())&&c(t,"height",l),b&8&&a!==(a=p[8](p[19],p[22]))&&c(t,"fill",a),b&8&&s!==(s=p[19])&&c(t,"data-model",s),b&12&&f!==(f=p[6](p[2][p[19]][p[22]])+"")&&X(d,f),b&40&&h!==(h=p[7].left+p[5](p[22])+p[5].bandwidth()/2)&&c(u,"x",h),b&24&&g!==(g=p[7].top+p[4](p[19])+p[4].bandwidth()/2)&&c(u,"y",g),b&8&&m!==(m=p[19])&&c(u,"data-model",m)},d(p){p&&N(t),p&&N(u)}}}function bl(e){let t,n=e[3],r=[];for(let o=0;oe[16].call(t))},m(g,m){P(g,t,m),_(t,n);for(let p=0;pn(15,m=E));const p=He(".1f");function b(E){let T=E.reduce((w,A)=>(w[A.qid]||(w[A.qid]=[]),w[A.qid].push(A),w),{}),y=Array.from(new Set(E.map(w=>w.model))),x=y.reduce((w,A)=>(w[A]=y.reduce((j,q)=>(j[q]={sum:0,count:0},j),{}),w),{});for(let w in T){let A=T[w];for(let j of y)for(let q of y){let B=A.find(re=>re.model===j),J=A.find(re=>re.model===q);B&&J&&(x[j][q].sum+=J.rank-B.rank,x[j][q].count++)}}for(let w in x)for(let A in x[w])x[w][A].count>0?x[w][A]=x[w][A].sum/x[w][A].count:x[w][A]=0;return x}let v=500,S=500,k={top:50,bottom:0,left:65,right:25};function z(E,T){let y=r[E][T];return y===0?"white":y>=0?g(E):g(T)}function C(){S=this.offsetWidth,v=this.offsetHeight,n(1,S),n(0,v)}return e.$.update=()=>{e.$.dirty&32768&&n(2,r=b(m)),e.$.dirty&32768&&n(3,o=Array.from(new Set(m.map(E=>E.model)))),e.$.dirty&2&&n(14,l=S-k.left-k.right),e.$.dirty&1&&n(13,a=v-k.top-k.bottom),e.$.dirty&16392&&n(5,s=at().range([0,l]).domain(o).padding(.05)),e.$.dirty&8200&&n(4,u=at().range([0,a]).domain(o).padding(.05)),e.$.dirty&4&&n(12,f=Object.values(r).flatMap(E=>Object.values(E))),e.$.dirty&4096&&n(11,d=uu(f)),e.$.dirty&4096&&n(10,h=lt(f)),e.$.dirty&8&&n(9,g=Qe().domain(o).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$.dirty&3592&&o.reduce((E,T)=>(E[T]=Ro().domain([d,h]).interpolator(Jn("white",g(T))),E),{})},[v,S,r,o,u,s,p,k,z,g,h,d,f,a,l,m,C]}class Nc extends ue{constructor(t){super(),se(this,t,qc,$c,ae,{})}}const hd="";function _l(e,t,n){const r=e.slice();return r[8]=t[n],r[10]=n,r}function Oc(e){let t;return{c(){t=M("div"),t.innerHTML="
To view the comparison dashboard, you must first rank some comparisons!
",c(t,"class","holder svelte-1gze3r0")},m(n,r){P(n,t,r)},p:W,i:W,o:W,d(n){n&&N(t)}}}function Pc(e){let t,n,r,o,l,a,s,u,f,d,h,g,m,p,b,v,S,k,z,C,E,T=e[1],y=[];for(let x=0;x0?0:1}return o=f(e),l=u[o]=s[o](e),{c(){t=M("div"),n=M("div"),n.innerHTML=`
Comparisons

This panes represents the training performance of your model.

`,r=I(),l.c(),c(n,"class","instructions svelte-1gze3r0"),c(t,"class","main-container svelte-1gze3r0")},m(d,h){P(d,t,h),_(t,n),_(t,r),u[o].m(t,null),a=!0},p(d,[h]){let g=o;o=f(d),o===g?u[o].p(d,h):(nt(),Z(u[g],1,1,()=>{u[g]=null}),rt(),l=u[o],l?l.p(d,h):(l=u[o]=s[o](d),l.c()),Y(l,1),l.m(t,null))},i(d){a||(Y(l),a=!0)},o(d){Z(l),a=!1},d(d){d&&N(t),u[o].d()}}}function wl(){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(e=>{e.style.opacity=1})}function Ic(e,t,n){let r,o,l;ee(e,Qt,f=>n(0,l=f)),mt(()=>{});function a(f){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(d=>{d.style.opacity=.12}),document.querySelectorAll(`.model-path[data-model="${r[f]}"], .model-circle[data-model="${r[f]}"]`).forEach(d=>{d.style.opacity=1})}const s=f=>a(f),u=f=>a(f);return e.$.update=()=>{e.$.dirty&1&&n(1,r=Array.from(new Set(l.map(f=>f.model)))),e.$.dirty&1&&n(2,o=Qe().domain(l.map(f=>f.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"]))},[l,r,o,a,s,u]}class Rc extends ue{constructor(t){super(),se(this,t,Ic,Fc,ae,{})}}const pd="";function kl(e,t,n){const r=e.slice();return r[7]=t[n],r}function xl(e){let t,n=e[0],r=[];for(let o=0;o{pe(d,1)}),rt()}l?(t=Dr(l,a()),me(t.$.fragment),Y(t.$.fragment,1),he(t,n.parentNode,n)):t=null}else l&&t.$set(f)},i(s){r||(t&&Y(t.$.fragment,s),r=!0)},o(s){t&&Z(t.$.fragment,s),r=!1},d(s){s&&N(n),t&&pe(t,s)}}}function Bc(e){let t,n,r,o,l=e[0].length>1&&xl(e),a=e[1]&&zl(e);return r=new Rc({}),{c(){l&&l.c(),t=I(),a&&a.c(),n=I(),me(r.$.fragment)},m(s,u){l&&l.m(s,u),P(s,t,u),a&&a.m(s,u),P(s,n,u),he(r,s,u),o=!0},p(s,[u]){s[0].length>1?l?l.p(s,u):(l=xl(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),s[1]?a?(a.p(s,u),u&2&&Y(a,1)):(a=zl(s),a.c(),Y(a,1),a.m(n.parentNode,n)):a&&(nt(),Z(a,1,1,()=>{a=null}),rt())},i(s){o||(Y(a),Y(r.$.fragment,s),o=!0)},o(s){Z(a),Z(r.$.fragment,s),o=!1},d(s){l&&l.d(s),s&&N(t),a&&a.d(s),s&&N(n),pe(r,s)}}}function Lc(e,t,n){let r,o;const l=Le([]);ee(e,l,d=>n(0,r=d));const a=Le(null);ee(e,a,d=>n(1,o=d));const s={Chatbot:Rs,Dropdown:Hs,Feedback:Vf,Compare:kc},u=d=>{a.set(d)};return fetch("/components").then(d=>{if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);return d.json()}).then(d=>{l.set(d),a.set(d[0])}).catch(d=>{console.log("Fetch request failed",d)}),[r,o,l,a,s,u,d=>u(d)]}class Hc extends ue{constructor(t){super(),se(this,t,Lc,Bc,ae,{})}}new Hc({target:document.getElementById("app")})})();