diff --git a/pykoi/frontend/dist/assets/index-51debcf5.css b/pykoi/frontend/dist/assets/index-10f2d9f3.css similarity index 83% rename from pykoi/frontend/dist/assets/index-51debcf5.css rename to pykoi/frontend/dist/assets/index-10f2d9f3.css index f44f9cc..8a05e68 100644 --- a/pykoi/frontend/dist/assets/index-51debcf5.css +++ b/pykoi/frontend/dist/assets/index-10f2d9f3.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}dialog.svelte-g384pz.svelte-g384pz{max-width:32em;border-radius:1em;border:none;padding:0}dialog.svelte-g384pz.svelte-g384pz::backdrop{background:rgba(0,0,0,.3)}dialog.svelte-g384pz>div.svelte-g384pz{padding:1em}dialog[open].svelte-g384pz.svelte-g384pz{animation:svelte-g384pz-zoom .3s cubic-bezier(.34,1.56,.64,1)}@keyframes svelte-g384pz-zoom{0%{transform:scale(.95)}to{transform:scale(1)}}dialog[open].svelte-g384pz.svelte-g384pz::backdrop{animation:svelte-g384pz-fade .2s ease-out}@keyframes svelte-g384pz-fade{0%{opacity:0}to{opacity:1}}button.svelte-g384pz.svelte-g384pz{display:block}.close-button.svelte-g384pz.svelte-g384pz{display:block;height:30px;width:30px;border-radius:50%;border:1px solid var(--grey);padding:0}.close-button.svelte-g384pz.svelte-g384pz:hover{background-color:var(--lightGrey)}.btn-container.svelte-g384pz.svelte-g384pz{display:flex;justify-content:flex-end}.btn-container.svelte-sy2m0x.svelte-sy2m0x{display:flex;justify-content:center;padding-top:1em}div.inputs.svelte-sy2m0x.svelte-sy2m0x{display:grid;grid-template-columns:max-content max-content;grid-gap:5px}div.inputs.svelte-sy2m0x label.svelte-sy2m0x{text-align:right}h4.svelte-sy2m0x.svelte-sy2m0x{margin:20px 0}.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}.instructions.svelte-19cad35 button.svelte-19cad35{font-size:var(--smallText)}.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-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-vgv4ev.svelte-vgv4ev{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-vgv4ev.svelte-vgv4ev{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{display:flex;width:100%}.btnyousend.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{opacity:1}.green.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--green)}.red.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--red)}.instructions.svelte-vgv4ev.svelte-vgv4ev{text-align:center;padding:5%}.instructions.svelte-vgv4ev h5.svelte-vgv4ev{text-align:left}.instructions.svelte-vgv4ev p.svelte-vgv4ev{font-size:var(--smallText);text-align:left}.instructions.svelte-vgv4ev button.svelte-vgv4ev{font-size:var(--smallText)}.ranked-feedback-container.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%}.underline.svelte-vgv4ev.svelte-vgv4ev{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-vgv4ev .question.svelte-vgv4ev{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-vgv4ev .answer.svelte-vgv4ev{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-vgv4ev .answers.svelte-vgv4ev{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-vgv4ev.svelte-vgv4ev{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}dialog.svelte-g384pz.svelte-g384pz{max-width:32em;border-radius:1em;border:none;padding:0}dialog.svelte-g384pz.svelte-g384pz::backdrop{background:rgba(0,0,0,.3)}dialog.svelte-g384pz>div.svelte-g384pz{padding:1em}dialog[open].svelte-g384pz.svelte-g384pz{animation:svelte-g384pz-zoom .3s cubic-bezier(.34,1.56,.64,1)}@keyframes svelte-g384pz-zoom{0%{transform:scale(.95)}to{transform:scale(1)}}dialog[open].svelte-g384pz.svelte-g384pz::backdrop{animation:svelte-g384pz-fade .2s ease-out}@keyframes svelte-g384pz-fade{0%{opacity:0}to{opacity:1}}button.svelte-g384pz.svelte-g384pz{display:block}.close-button.svelte-g384pz.svelte-g384pz{display:block;height:30px;width:30px;border-radius:50%;border:1px solid var(--grey);padding:0}.close-button.svelte-g384pz.svelte-g384pz:hover{background-color:var(--lightGrey)}.btn-container.svelte-g384pz.svelte-g384pz{display:flex;justify-content:flex-end}.btn-container.svelte-sy2m0x.svelte-sy2m0x{display:flex;justify-content:center;padding-top:1em}div.inputs.svelte-sy2m0x.svelte-sy2m0x{display:grid;grid-template-columns:max-content max-content;grid-gap:5px}div.inputs.svelte-sy2m0x label.svelte-sy2m0x{text-align:right}h4.svelte-sy2m0x.svelte-sy2m0x{margin:20px 0}.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}.instructions.svelte-19cad35 button.svelte-19cad35{font-size:var(--smallText)}.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-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%;width:100%}.ranked-chat.svelte-vgv4ev.svelte-vgv4ev{height:100vh;display:grid;grid-template-columns:100%;grid-template-rows:80% 20%}.message.svelte-vgv4ev.svelte-vgv4ev{font-size:var(--smallText);padding-left:40px;padding-right:40px;margin:0 auto}.chat-input-holder.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;align-items:center;padding:5px;width:100%;max-width:820px;margin:auto}.chat-input-textarea.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{display:flex;width:100%}.btnyousend.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{opacity:1}.green.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--green)}.red.svelte-vgv4ev.svelte-vgv4ev{border-bottom:2px solid var(--red)}.instructions.svelte-vgv4ev.svelte-vgv4ev{text-align:center;padding:5%}.instructions.svelte-vgv4ev h5.svelte-vgv4ev{text-align:left}.instructions.svelte-vgv4ev p.svelte-vgv4ev{font-size:var(--smallText);text-align:left}.instructions.svelte-vgv4ev button.svelte-vgv4ev{font-size:var(--smallText)}.ranked-feedback-container.svelte-vgv4ev.svelte-vgv4ev{display:grid;grid-template-columns:20% 80%}.underline.svelte-vgv4ev.svelte-vgv4ev{border-bottom:var(--line)}.bold{font-weight:700;font-size:var(--smallText);margin:0;padding:0}.chatbox.svelte-vgv4ev.svelte-vgv4ev{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-vgv4ev.svelte-vgv4ev{flex:1;overflow-y:auto;padding:0 10px;box-sizing:border-box}.chat-message.svelte-vgv4ev.svelte-vgv4ev{background-color:var(--white);border-bottom:var(--line);box-sizing:border-box}.chat-message-center.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;padding:12px;box-sizing:border-box}.message-content.svelte-vgv4ev.svelte-vgv4ev{display:flex;flex-direction:column;box-sizing:border-box}.message-content.svelte-vgv4ev .question.svelte-vgv4ev{text-align:left;border:1px solid var(--grey);padding:5px;background-color:var(--lightGrey)}.message-content.svelte-vgv4ev .answer.svelte-vgv4ev{display:inline-block;text-align:left;padding:10px;border:1px solid var(--black)}.message-content.svelte-vgv4ev .answers.svelte-vgv4ev{display:grid;grid-template-columns:100%;gap:0%;width:100%;margin:auto}.rag-sources.svelte-vgv4ev.svelte-vgv4ev{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-42540648.js b/pykoi/frontend/dist/assets/index-42540648.js deleted file mode 100644 index 10ee4e8..0000000 --- a/pykoi/frontend/dist/assets/index-42540648.js +++ /dev/null @@ -1,70 +0,0 @@ -(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-b2c98be3.js b/pykoi/frontend/dist/assets/index-b2c98be3.js deleted file mode 100644 index ed8049e..0000000 --- a/pykoi/frontend/dist/assets/index-b2c98be3.js +++ /dev/null @@ -1,64 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function U(){}const gs=e=>e;function mn(e,t){for(const n in t)e[n]=t[n];return e}function hs(e){return e()}function Xo(){return Object.create(null)}function be(e){e.forEach(hs)}function He(e){return typeof e=="function"}function ce(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Va(e){return Object.keys(e).length===0}function vo(e,...t){if(e==null)return U;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function za(e){let t;return vo(e,n=>t=n)(),t}function ae(e,t,n){e.$$.on_destroy.push(vo(t,n))}function Vr(e,t,n,o){if(e){const r=ps(e,t,n,o);return e[0](r)}}function ps(e,t,n,o){return e[1]&&o?mn(n.ctx.slice(),e[1](o(t))):n.ctx}function zr(e,t,n,o){if(e[2]&&o){const r=e[2](o(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const i=[],l=Math.max(t.dirty.length,r.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let o=0;owindow.performance.now():()=>Date.now(),br=ms?e=>requestAnimationFrame(e):U;const Lt=new Set;function vs(e){Lt.forEach(t=>{t.c(e)||(Lt.delete(t),t.f())}),Lt.size!==0&&br(vs)}function bs(e){let t;return Lt.size===0&&br(vs),{promise:new Promise(n=>{Lt.add(t={c:e,f:n})}),abort(){Lt.delete(t)}}}let bo=!1;function La(){bo=!0}function Ha(){bo=!1}function qa(e,t,n,o){for(;e>1);n(r)<=o?e=r+1:t=r}return e}function Ga(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[r]].claim_order<=u?r+1:qa(1,r,g=>t[n[g]].claim_order,u))-1;o[s]=n[f]+1;const c=f+1;n[c]=s,r=Math.max(c,r)}const i=[],l=[];let a=t.length-1;for(let s=n[r]+1;s!=0;s=o[s-1]){for(i.push(t[s-1]);a>=s;a--)l.push(t[a]);a--}for(;a>=0;a--)l.push(t[a]);i.reverse(),l.sort((s,u)=>s.claim_order-u.claim_order);for(let s=0,u=0;s=i[u].claim_order;)u++;const f=ue.removeEventListener(t,n,o)}function Xa(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Ya(e){return function(t){t.target===this&&e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Qa(e){return Array.from(e.childNodes)}function Ka(e){e.claim_info===void 0&&(e.claim_info={last_index:0,total_claimed:0})}function Ja(e,t,n,o,r=!1){Ka(e);const i=(()=>{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,r?s===void 0&&e.claim_info.last_index--:e.claim_info.last_index=l,a}}return o()})();return i.claim_order=e.claim_info.total_claimed,e.claim_info.total_claimed+=1,i}function Za(e,t){return Ja(e,n=>n.nodeType===3,n=>{const o=""+t;if(n.data.startsWith(o)){if(n.data.length!==o.length)return n.splitText(o.length)}else n.data=o},()=>z(t),!0)}function ie(e,t){t=""+t,e.data!==t&&(e.data=t)}function We(e,t){e.value=t??""}function Ie(e,t,n,o){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,o?"important":"")}function Qn(e,t,n){for(let o=0;o{l.source===o.contentWindow&&t()})):(o.src="about:blank",o.onload=()=>{i=j(o.contentWindow,"resize",t),t()}),v(e,o),()=>{(r||i&&o.contentWindow)&&i(),N(o)}}function on(e,t,n){e.classList[n?"add":"remove"](t)}function tu(e,t,{bubbles:n=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n,o,t),r}function bt(e,t){return new e(t)}const Kn=new Map;let Jn=0;function nu(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function ou(e,t){const n={stylesheet:Ba(t),rules:{}};return Kn.set(e,n),n}function Gr(e,t,n,o,r,i,l,a=0){const s=16.666/o;let u=`{ -`;for(let _=0;_<=1;_+=s){const w=t+(n-t)*i(_);u+=_*100+`%{${l(w,1-w)}} -`}const f=u+`100% {${l(n,1-n)}} -}`,c=`__svelte_${nu(f)}_${a}`,g=ws(e),{stylesheet:d,rules:p}=Kn.get(g)||ou(g,e);p[c]||(p[c]=!0,d.insertRule(`@keyframes ${c} ${f}`,d.cssRules.length));const m=e.style.animation||"";return e.style.animation=`${m?`${m}, `:""}${c} ${o}ms linear ${r}ms 1 both`,Jn+=1,c}function ru(e,t){const n=(e.style.animation||"").split(", "),o=n.filter(t?i=>i.indexOf(t)<0:i=>i.indexOf("__svelte")===-1),r=n.length-o.length;r&&(e.style.animation=o.join(", "),Jn-=r,Jn||iu())}function iu(){br(()=>{Jn||(Kn.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&N(t)}),Kn.clear())})}let jt;function At(e){jt=e}function lu(){if(!jt)throw new Error("Function called outside component initialization");return jt}function dt(e){lu().$$.on_mount.push(e)}function su(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(o=>o.call(this,t))}const Tt=[],Ze=[];let Ht=[];const Yo=[],au=Promise.resolve();let Qo=!1;function uu(){Qo||(Qo=!0,au.then(Ss))}function Re(e){Ht.push(e)}function vn(e){Yo.push(e)}const $o=new Set;let It=0;function Ss(){if(It!==0)return;const e=jt;do{try{for(;Ite.indexOf(o)===-1?t.push(o):n.push(o)),n.forEach(o=>o()),Ht=t}let Jt;function du(){return Jt||(Jt=Promise.resolve(),Jt.then(()=>{Jt=null})),Jt}function Ao(e,t,n){e.dispatchEvent(tu(`${t?"intro":"outro"}${n}`))}const Gn=new Set;let at;function _e(){at={r:0,c:[],p:at}}function ve(){at.r||be(at.c),at=at.p}function P(e,t){e&&e.i&&(Gn.delete(e),e.i(t))}function T(e,t,n,o){if(e&&e.o){if(Gn.has(e))return;Gn.add(e),at.c.push(()=>{Gn.delete(e),o&&(n&&e.d(1),o())}),e.o(t)}else o&&o()}const gu={duration:0};function tt(e,t,n,o){const r={direction:"both"};let i=t(e,n,r),l=o?0:1,a=null,s=null,u=null;function f(){u&&ru(e,u)}function c(d,p){const m=d.b-l;return p*=Math.abs(m),{a:l,b:d.b,d:m,duration:p,start:d.start,end:d.start+p,group:d.group}}function g(d){const{delay:p=0,duration:m=300,easing:_=gs,tick:w=U,css:b}=i||gu,k={start:_s()+p,b:d};d||(k.group=at,at.r+=1),a||s?s=k:(b&&(f(),u=Gr(e,l,d,m,p,_,b)),d&&w(0,1),a=c(k,m),Re(()=>Ao(e,d,"start")),bs(A=>{if(s&&A>s.start&&(a=c(s,m),s=null,Ao(e,a.b,"start"),b&&(f(),u=Gr(e,l,a.b,a.duration,0,_,i.css))),a){if(A>=a.end)w(l=a.b,1-l),Ao(e,a.b,"end"),s||(a.b?f():--a.group.r||be(a.group.c)),a=null;else if(A>=a.start){const R=A-a.start;l=a.a+a.d*_(R/a.duration),w(l,1-l)}}return!!(a||s)}))}return{run(d){He(i)?du().then(()=>{i=i(r),g(d)}):g(d)},end(){f(),a=s=null}}}function wo(e,t){e.d(1),t.delete(e.key)}function Cs(e,t){T(e,1,1,()=>{t.delete(e.key)})}function Qt(e,t,n,o,r,i,l,a,s,u,f,c){let g=e.length,d=i.length,p=g;const m={};for(;p--;)m[e[p].key]=p;const _=[],w=new Map,b=new Map,k=[];for(p=d;p--;){const C=c(r,i,p),$=n(C);let y=l.get($);y?o&&k.push(()=>y.p(C,t)):(y=u($,C),y.c()),w.set($,_[p]=y),$ in m&&b.set($,Math.abs(p-m[$]))}const A=new Set,R=new Set;function E(C){P(C,1),C.m(a,f),l.set(C.key,C),f=C.first,d--}for(;g&&d;){const C=_[d-1],$=e[g-1],y=C.key,M=$.key;C===$?(f=C.first,g--,d--):w.has(M)?!l.has(y)||A.has(y)?E(C):R.has(M)?g--:b.get(y)>b.get(M)?(R.add(y),E(C)):(A.add(M),g--):(s($,l),g--)}for(;g--;){const C=e[g];w.has(C.key)||s(C,l)}for(;d;)E(_[d-1]);return be(k),_}function ks(e,t){const n={},o={},r={$$scope:1};let i=e.length;for(;i--;){const l=e[i],a=t[i];if(a){for(const s in l)s in a||(o[s]=1);for(const s in a)r[s]||(n[s]=a[s],r[s]=1);e[i]=a}else for(const s in l)r[s]=1}for(const l in o)l in n||(n[l]=void 0);return n}function $s(e){return typeof e=="object"&&e!==null?e:{}}const hu=/[&"]/g,pu=/[&<]/g;function mu(e,t=!1){const n=String(e),o=t?hu:pu;o.lastIndex=0;let r="",i=0;for(;o.test(n);){const l=o.lastIndex-1,a=n[l];r+=n.substring(i,l)+(a==="&"?"&":a==='"'?""":"<"),i=l+1}return r+n.substring(i)}function _u(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 Ro;function As(e){function t(n,o,r,i,l){const a=jt,s={on_destroy:Ro,context:new Map(l||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Xo()};At({$$:s});const u=e(n,o,r,i);return At(a),u}return{render:(n={},{$$slots:o={},context:r=new Map}={})=>{Ro=[];const i={title:"",head:"",css:new Set},l=t(i,n,{},o,r);return be(Ro),{html:l,css:{code:Array.from(i.css).map(a=>a.code).join(` -`),map:null},head:i.title+i.head}},$$render:t}}function bn(e,t,n){const o=e.$$.props[t];o!==void 0&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function ne(e){e&&e.c()}function vu(e,t){e&&e.l(t)}function Z(e,t,n,o){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),o||Re(()=>{const l=e.$$.on_mount.map(hs).filter(He);e.$$.on_destroy?e.$$.on_destroy.push(...l):be(l),e.$$.on_mount=[]}),i.forEach(Re)}function ee(e,t){const n=e.$$;n.fragment!==null&&(cu(n.after_update),be(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bu(e,t){e.$$.dirty[0]===-1&&(Tt.push(e),uu(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=d.length?d[0]:g;return u.ctx&&r(u.ctx[c],u.ctx[c]=p)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](p),f&&bu(e,c)),g}):[],u.update(),f=!0,be(u.before_update),u.fragment=o?o(u.ctx):!1,t.target){if(t.hydrate){La();const c=Qa(t.target);u.fragment&&u.fragment.l(c),c.forEach(N)}else u.fragment&&u.fragment.c();t.intro&&P(e.$$.fragment),Z(e,t.target,t.anchor,t.customElement),Ha(),Ss()}At(s)}class de{$destroy(){ee(this,1),this.$destroy=U}$on(t,n){if(!He(n))return U;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const r=o.indexOf(n);r!==-1&&o.splice(r,1)}}$set(t){this.$$set&&!Va(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Nt=[];function Ko(e,t){return{subscribe:Fe(e,t).subscribe}}function Fe(e,t=U){let n;const o=new Set;function r(a){if(ce(e,a)&&(e=a,n)){const s=!Nt.length;for(const u of o)u[1](),Nt.push(u,e);if(s){for(let u=0;u{o.delete(u),o.size===0&&n&&(n(),n=null)}}return{set:r,update:i,subscribe:l}}function wu(e,t,n){const o=!Array.isArray(e),r=o?[e]:e,i=t.length<2;return Ko(n,l=>{let a=!1;const s=[];let u=0,f=U;const c=()=>{if(u)return;f();const d=t(o?s[0]:s,l);i?l(d):f=He(d)?d:U},g=r.map((d,p)=>vo(d,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 o=t.map((r,i)=>Jo(e[i],r));return r=>o.map(i=>i(r))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(Br(e)&&Br(t)){e=e.getTime(),t=t.getTime();const i=t-e;return l=>new Date(e+l*i)}const o=Object.keys(t),r={};return o.forEach(i=>{r[i]=Jo(e[i],t[i])}),i=>{const l={};return o.forEach(a=>{l[a]=r[a](i)}),l}}if(n==="number"){const o=t-e;return r=>e+r*o}throw new Error(`Cannot interpolate ${n} values`)}function yr(e,t={}){const n=Fe(e);let o,r=e;function i(l,a){if(e==null)return n.set(e=l),Promise.resolve();r=l;let s=o,u=!1,{delay:f=0,duration:c=400,easing:g=gs,interpolate:d=Jo}=mn(mn({},t),a);if(c===0)return s&&(s.abort(),s=null),n.set(e=r),Promise.resolve();const p=_s()+f;let m;return o=bs(_=>{if(_c?(n.set(e=l),!1):(n.set(e=m(g(w/c))),!0)}),o.promise}return{set:i,update:(l,a)=>i(l(r,e),a),subscribe:n.subscribe}}const ze=Fe([]),Mo=Fe([]),Zt=Fe([]),wn=Fe([]),it=Fe("all"),jr=Fe({"n/a":1,up:1,down:1}),yu=["who","what","how","why","where","does","can","n/a"],Zo=yr(yu.map(e=>({question:e,count:0}))),er=Fe(new Set);var tr="http://www.w3.org/1999/xhtml";const Ur={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 Rs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ur.hasOwnProperty(t)?{space:Ur[t],local:e}:e}function Su(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 Cu(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ms(e){var t=Rs(e);return(t.local?Cu:Su)(t)}function ku(){}function Es(e){return e==null?ku:function(){return this.querySelector(e)}}function $u(e){typeof e!="function"&&(e=Es(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r=k&&(k=b+1);!(R=_[k])&&++k=0;)(l=o[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Ku(e){e||(e=Ju);function t(c,g){return c&&g?e(c.__data__,g.__data__):!c-!g}for(var n=this._groups,o=n.length,r=new Array(o),i=0;it?1:e>=t?0:NaN}function Zu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ef(){return Array.from(this)}function tf(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?gf:typeof t=="function"?pf:hf)(e,t,n??"")):_f(this.node(),e)}function _f(e,t){return e.style.getPropertyValue(t)||Ns(e).getComputedStyle(e,null).getPropertyValue(t)}function vf(e){return function(){delete this[e]}}function bf(e,t){return function(){this[e]=t}}function wf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yf(e,t){return arguments.length>1?this.each((t==null?vf:typeof t=="function"?wf:bf)(e,t)):this.node()[e]}function Ps(e){return e.trim().split(/^|\s+/)}function Sr(e){return e.classList||new Os(e)}function Os(e){this._node=e,this._names=Ps(e.getAttribute("class")||"")}Os.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 Ts(e,t){for(var n=Sr(e),o=-1,r=t.length;++o=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Yf(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n({}),Wr=e=>({});function rc(e){let t,n,o,r,i,l,a,s,u;const f=e[4].header,c=Vr(f,e,e[3],Wr),g=e[4].default,d=Vr(g,e,e[3],null);return{c(){t=S("dialog"),n=S("div"),o=S("div"),r=S("button"),r.textContent="X",i=D(),c&&c.c(),l=D(),d&&d.c(),h(r,"class","close-button svelte-g384pz"),h(o,"class","btn-container svelte-g384pz"),h(n,"class","svelte-g384pz"),h(t,"class","svelte-g384pz")},m(p,m){O(p,t,m),v(t,n),v(n,o),v(o,r),v(n,i),c&&c.m(n,null),v(n,l),d&&d.m(n,null),e[6](t),a=!0,s||(u=[j(r,"click",function(){He(e[1])&&e[1].apply(this,arguments)}),j(n,"click",Xa(e[5])),j(t,"close",function(){He(e[1])&&e[1].apply(this,arguments)}),j(t,"click",Ya(function(){He(e[1])&&e[1].apply(this,arguments)}))],s=!0)},p(p,[m]){e=p,c&&c.p&&(!a||m&8)&&Lr(c,f,e,e[3],a?zr(f,e[3],m,oc):Hr(e[3]),Wr),d&&d.p&&(!a||m&8)&&Lr(d,g,e,e[3],a?zr(g,e[3],m,null):Hr(e[3]),null)},i(p){a||(P(c,p),P(d,p),a=!0)},o(p){T(c,p),T(d,p),a=!1},d(p){p&&N(t),c&&c.d(p),d&&d.d(p),e[6](null),s=!1,be(u)}}}function ic(e,t,n){let{$$slots:o={},$$scope:r}=t,{showModal:i}=t,{dialog:l}=t,{handleClose:a}=t;function s(f){su.call(this,e,f)}function u(f){Ze[f?"unshift":"push"](()=>{l=f,n(0,l)})}return e.$$set=f=>{"showModal"in f&&n(2,i=f.showModal),"dialog"in f&&n(0,l=f.dialog),"handleClose"in f&&n(1,a=f.handleClose),"$$scope"in f&&n(3,r=f.$$scope)},e.$$.update=()=>{e.$$.dirty&5&&l&&i&&l.showModal()},[l,a,i,r,o,s,u]}class lc extends de{constructor(t){super(),pe(this,t,ic,rc,ce,{showModal:2,dialog:0,handleClose:1})}}function Xr(e){let t,n,o,r,i,l,a,s,u;return{c(){t=S("form"),n=S("div"),o=S("label"),o.textContent="Filename",r=D(),i=S("input"),l=D(),a=S("div"),a.innerHTML='',h(o,"for","file_name"),h(o,"class","svelte-sy2m0x"),h(i,"type","text"),h(i,"placeholder","Please enter filename"),h(i,"name","file_name"),i.required=!0,h(n,"class","inputs svelte-sy2m0x"),h(a,"class","btn-container svelte-sy2m0x")},m(f,c){O(f,t,c),v(t,n),v(n,o),v(n,r),v(n,i),We(i,e[2]),v(t,l),v(t,a),s||(u=[j(i,"input",e[8]),j(t,"submit",e[5])],s=!0)},p(f,c){c&4&&i.value!==f[2]&&We(i,f[2])},d(f){f&&N(t),s=!1,be(u)}}}function Yr(e){let t,n,o,r,i,l,a,s,u;return{c(){t=S("div"),n=z("✅ Data downloaded to ~/pykoi/"),o=z(e[2]),r=z(".csv"),i=D(),l=S("div"),a=S("button"),a.textContent="Close",h(l,"class","btn-container svelte-sy2m0x")},m(f,c){O(f,t,c),v(t,n),v(t,o),v(t,r),O(f,i,c),O(f,l,c),v(l,a),s||(u=j(a,"click",e[6]),s=!0)},p(f,c){c&4&&ie(o,f[2])},d(f){f&&N(t),f&&N(i),f&&N(l),s=!1,u()}}}function Qr(e){let t,n,o,r,i,l,a,s;return{c(){t=S("div"),t.textContent="⚠️ Download failed. Please try again.",n=D(),o=S("div"),r=S("button"),r.textContent="Retry",i=D(),l=S("button"),l.textContent="Close",h(o,"class","btn-container svelte-sy2m0x")},m(u,f){O(u,t,f),O(u,n,f),O(u,o,f),v(o,r),v(o,i),v(o,l),a||(s=[j(r,"click",e[9]),j(l,"click",e[6])],a=!0)},p:U,d(u){u&&N(t),u&&N(n),u&&N(o),a=!1,be(s)}}}function sc(e){let t,n,o,r=e[3]===e[4].FILE_INPUT&&Xr(e),i=e[3]===e[4].DOWNLOADED&&Yr(e),l=e[3]===e[4].FAILED_DOWNLOAD&&Qr(e);return{c(){r&&r.c(),t=D(),i&&i.c(),n=D(),l&&l.c(),o=Ee()},m(a,s){r&&r.m(a,s),O(a,t,s),i&&i.m(a,s),O(a,n,s),l&&l.m(a,s),O(a,o,s)},p(a,s){a[3]===a[4].FILE_INPUT?r?r.p(a,s):(r=Xr(a),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),a[3]===a[4].DOWNLOADED?i?i.p(a,s):(i=Yr(a),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null),a[3]===a[4].FAILED_DOWNLOAD?l?l.p(a,s):(l=Qr(a),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null)},d(a){r&&r.d(a),a&&N(t),i&&i.d(a),a&&N(n),l&&l.d(a),a&&N(o)}}}function ac(e){let t;return{c(){t=S("h4"),t.textContent="Download Data",h(t,"slot","header"),h(t,"class","svelte-sy2m0x")},m(n,o){O(n,t,o)},p:U,d(n){n&&N(t)}}}function uc(e){let t,n,o,r;function i(s){e[10](s)}function l(s){e[11](s)}let a={handleClose:e[6],$$slots:{header:[ac],default:[sc]},$$scope:{ctx:e}};return e[0]!==void 0&&(a.showModal=e[0]),e[1]!==void 0&&(a.dialog=e[1]),t=new lc({props:a}),Ze.push(()=>bn(t,"showModal",i)),Ze.push(()=>bn(t,"dialog",l)),{c(){ne(t.$$.fragment)},m(s,u){Z(t,s,u),r=!0},p(s,[u]){const f={};u&4108&&(f.$$scope={dirty:u,ctx:s}),!n&&u&1&&(n=!0,f.showModal=s[0],vn(()=>n=!1)),!o&&u&2&&(o=!0,f.dialog=s[1],vn(()=>o=!1)),t.$set(f)},i(s){r||(P(t.$$.fragment,s),r=!0)},o(s){T(t.$$.fragment,s),r=!1},d(s){ee(t,s)}}}function fc(e,t,n){let{showModal:o,table:r}=t,i,l="";const a={FILE_INPUT:0,DOWNLOADED:1,FAILED_DOWNLOAD:2};let s=a.FILE_INPUT;const u=async m=>{m.preventDefault();const _={file_name:l},b=await(await fetch(`/chat/${r}/save_to_csv`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})).json();console.log("Download Complete: ",b),b.status==="200"?(console.log("success"),n(3,s=a.DOWNLOADED)):(console.log("failed"),n(3,s=a.FAILED_DOWNLOAD))};function f(){n(0,o=!1),n(3,s=a.FILE_INPUT),i.close()}function c(){l=this.value,n(2,l)}const g=()=>n(3,s=a.FILE_INPUT);function d(m){o=m,n(0,o)}function p(m){i=m,n(1,i)}return e.$$set=m=>{"showModal"in m&&n(0,o=m.showModal),"table"in m&&n(7,r=m.table)},[o,i,l,s,a,u,f,r,c,g,d,p]}class Cr extends de{constructor(t){super(),pe(this,t,fc,uc,ce,{showModal:0,table:7})}}function Kr(e,t,n){const o=e.slice();return o[19]=t[n],o[21]=n,o}function Jr(e){let t,n,o,r,i,l;function a(...u){return e[12](e[21],...u)}function s(...u){return e[13](e[21],...u)}return{c(){t=S("div"),n=S("button"),n.textContent="👍",o=D(),r=S("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(u,f){O(u,t,f),v(t,n),v(t,o),v(t,r),i||(l=[j(n,"click",a),j(r,"click",s)],i=!0)},p(u,f){e=u},d(u){u&&N(t),i=!1,be(l)}}}function Zr(e,t){let n,o,r,i,l,a,s,u,f,c=t[19].question+"",g,d,p,m,_,w,b,k=t[19].answer+"",A,R,E,C,$,y,M=t[0]&&Jr(t);return{key:e,first:null,c(){n=S("div"),o=S("div"),r=S("div"),i=D(),l=S("div"),a=S("div"),s=S("h5"),s.textContent="Question:",u=D(),f=S("p"),g=z(c),d=D(),p=S("div"),m=S("div"),_=S("h5"),_.textContent="Response:",w=D(),b=S("p"),A=z(k),R=D(),M&&M.c(),E=D(),h(r,"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(o,"class","chat-message-center svelte-19cad35"),h(n,"class","chat-message svelte-19cad35"),this.first=n},m(I,F){O(I,n,F),v(n,o),v(o,r),v(o,i),v(o,l),v(l,a),v(a,s),v(a,u),v(a,f),v(f,g),v(l,d),v(l,p),v(p,m),v(m,_),v(m,w),v(m,b),v(b,A),v(m,R),M&&M.m(m,null),v(n,E),$||(y=_n(C=dc.call(null,n,t[21]===t[5].length-1)),$=!0)},p(I,F){t=I,F&32&&c!==(c=t[19].question+"")&&ie(g,c),F&32&&k!==(k=t[19].answer+"")&&ie(A,k),t[0]?M?M.p(t,F):(M=Jr(t),M.c(),M.m(m,null)):M&&(M.d(1),M=null),C&&He(C.update)&&F&32&&C.update.call(null,t[21]===t[5].length-1)},d(I){I&&N(n),M&&M.d(),$=!1,y()}}}function cc(e){let t,n,o,r,i,l,a,s,u,f,c,g,d,p,m=[],_=new Map,w,b,k,A,R,E,C=(e[3]?e[4]:"Send")+"",$,y,M,I,F,x,q;function le(L){e[11](L)}let oe={table:"qa_table"};e[1]!==void 0&&(oe.showModal=e[1]),t=new Cr({props:oe}),Ze.push(()=>bn(t,"showModal",le));let se=e[5];const ge=L=>L[21];for(let L=0;L👍 - button. If the repsonse is not satisfactory, click on the - 👎 button.`,u=D(),f=S("button"),f.textContent="Download Data",c=D(),g=S("div"),d=S("section"),p=S("div");for(let L=0;Ln=!1)),t.$set(H),B&161&&(se=L[5],m=Qt(m,B,ge,1,L,se,_,p,wo,Zr,null,Kr)),B&4&&A.value!==L[2]&&We(A,L[2]),(!F||B&24)&&C!==(C=(L[3]?L[4]:"Send")+"")&&ie($,C),(!F||B&4&&y!==(y="btnyousend "+(L[2]===""?"":"active")+" svelte-19cad35"))&&h(E,"class",y)},i(L){F||(P(t.$$.fragment,L),F=!0)},o(L){T(t.$$.fragment,L),F=!1},d(L){ee(t,L),L&&N(o),L&&N(r);for(let B=0;B{e.scrollIntoView({behavior:"smooth"})},0)}async function gc(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 hc(e,t,n){let o,r;ae(e,ze,A=>n(5,r=A));let i=!1,{feedback:l=!1}=t,{is_retrieval:a=!1}=t,s="",u="",f=!1;dt(()=>{c()});async function c(){const C=(await(await fetch("/chat/qa_table/retrieve")).json()).rows.map($=>({id:$[0],question:$[1],answer:$[2],vote_status:$[3]}));Oe(ze,r=[...C],r)}const g=async A=>{A.preventDefault(),s=u,n(2,u=""),n(3,f=!0);let R={id:r.length+1,question:s,answer:"Loading...",vote_status:"na"};Oe(ze,r=[...r,R],r);const E=a?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})}):await fetch(`/chat/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s})});if(E.ok){const C=await E.json();console.log("response data",C),R.answer=C.answer,ze.update($=>($[$.length-1]=R,$))}else{const C=await E.text();alert(C)}n(3,f=!1)};let d=0;setInterval(()=>{n(10,d=(d+1)%4)},200);function p(A,R,E){const C=r[E];C.vote=R;const $={id:E+1,vote_status:R};gc($),ft(A.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),ft(A.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}function m(){n(1,i=!0)}[...Array(10).keys()].map(A=>String.fromCharCode(65+A));function _(A){i=A,n(1,i)}const w=(A,R)=>p(R,"up",A),b=(A,R)=>p(R,"down",A);function k(){u=this.value,n(2,u)}return e.$$set=A=>{"feedback"in A&&n(0,l=A.feedback),"is_retrieval"in A&&n(9,a=A.is_retrieval)},e.$$.update=()=>{e.$$.dirty&1024&&n(4,o=".".repeat(d).padEnd(3))},[l,i,u,f,o,r,g,p,m,a,d,_,w,b,k]}class kr extends de{constructor(t){super(),pe(this,t,hc,cc,ce,{feedback:0,is_retrieval:9})}}function ei(e,t,n){const o=e.slice();return o[14]=t[n],o[16]=n,o}function ti(e,t){let n,o,r,i,l,a,s,u,f,c=t[14].question+"",g,d,p,m,_,w,b,k=t[14].up_ranking_answer+"",A,R,E,C,$,y,M=t[14].low_ranking_answer+"",I,F,x,q,le;function oe(...B){return t[7](t[14],t[16],...B)}function se(...B){return t[8](t[14],t[16],...B)}function ge(...B){return t[9](t[14],t[16],...B)}function L(...B){return t[10](t[14],t[16],...B)}return{key:e,first:null,c(){n=S("div"),o=S("div"),r=S("div"),i=D(),l=S("div"),a=S("div"),s=S("h5"),s.textContent="Question:",u=D(),f=S("p"),g=z(c),d=D(),p=S("div"),m=S("div"),_=S("h5"),_.textContent="Response 1:",w=D(),b=S("p"),A=z(k),R=D(),E=S("div"),C=S("h5"),C.textContent="Response 2:",$=D(),y=S("p"),I=z(M),F=D(),h(r,"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(C,"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(o,"class","chat-message-center svelte-au920n"),h(n,"class","chat-message svelte-au920n"),this.first=n},m(B,H){O(B,n,H),v(n,o),v(o,r),v(o,i),v(o,l),v(l,a),v(a,s),v(a,u),v(a,f),v(f,g),v(l,d),v(l,p),v(p,m),v(m,_),v(m,w),v(m,b),v(b,A),v(p,R),v(p,E),v(E,C),v(E,$),v(E,y),v(y,I),v(n,F),q||(le=[j(m,"click",oe),j(m,"keydown",se),j(E,"click",ge),j(E,"keydown",L),_n(x=mc.call(null,n,t[16]===t[3].length-1))],q=!0)},p(B,H){t=B,H&8&&c!==(c=t[14].question+"")&&ie(g,c),H&8&&k!==(k=t[14].up_ranking_answer+"")&&ie(A,k),H&8&&M!==(M=t[14].low_ranking_answer+"")&&ie(I,M),x&&He(x.update)&&H&8&&x.update.call(null,t[16]===t[3].length-1)},d(B){B&&N(n),q=!1,be(le)}}}function pc(e){let t,n,o,r,i,l,a=[],s=new Map,u,f,c,g,d,p,m=(e[1]?e[2]:"Send")+"",_,w,b,k,A,R,E=e[3];const C=$=>$[16];for(let $=0;$Ranked 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.

- `,o=D(),r=S("div"),i=S("section"),l=S("div");for(let $=0;${e.scrollIntoView({behavior:"smooth"})},0)}async function _c(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 vc(e,t,n){let o,r;ae(e,Mo,_=>n(3,r=_));let i="",l="",a=!1;dt(()=>{});const s=async _=>{_.preventDefault(),i=l,n(0,l=""),n(1,a=!0);let w={question:i,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Oe(Mo,r=[...r,w],r);const b=await fetch(`/chat/multi_responses/${i}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:i})});if(b.ok){const k=await b.json();w.up_ranking_answer=k.answer[0],w.low_ranking_answer=k.answer[1],Mo.update(A=>(A[A.length-1]=w,A))}else{const k=await b.text();alert(k)}n(1,a=!1)};let u=0;setInterval(()=>{n(6,u=(u+1)%4)},200);function f(_,w,b,k){const A=r[b],R={1:"up_ranking_answer",2:"low_ranking_answer"},E={question:A.question,up_ranking_answer:A[R[k]],low_ranking_answer:A[R[k%2+1]]};_c(E),ft(_.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),ft(_.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const c=(_,w,b)=>f(b,_,w,1),g=(_,w,b)=>f(b,_,w,1),d=(_,w,b)=>f(b,_,w,2),p=(_,w,b)=>f(b,_,w,2);function m(){l=this.value,n(0,l)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,o=".".repeat(u).padEnd(3))},[l,a,o,r,s,f,u,c,g,d,p,m]}class bc extends de{constructor(t){super(),pe(this,t,vc,pc,ce,{})}}function ni(e,t,n){const o=e.slice();return o[8]=t[n],o[10]=n,o}function oi(e){let t,n,o,r,i=e[8].name+"",l,a,s,u,f;function c(...g){return e[6](e[8],...g)}return{c(){t=S("label"),n=S("input"),l=z(i),a=D(),h(n,"type","checkbox"),h(n,"id",o=e[8].id),n.checked=r=e[1].has(e[8].name),h(t,"for",s=e[8].id)},m(g,d){O(g,t,d),v(t,n),v(t,l),v(t,a),u||(f=j(n,"change",c),u=!0)},p(g,d){e=g,d&1&&o!==(o=e[8].id)&&h(n,"id",o),d&3&&r!==(r=e[1].has(e[8].name))&&(n.checked=r),d&1&&i!==(i=e[8].name+"")&&ie(l,i),d&1&&s!==(s=e[8].id)&&h(t,"for",s)},d(g){g&&N(t),u=!1,f()}}}function wc(e){let t,n,o,r,i,l,a,s,u,f,c,g=e[0],d=[];for(let p=0;pn(1,o=c));let{documents:r=[]}=t,i=!1,l;function a(){n(2,i=!i)}function s(c,g){g.target.checked?o.add(c):o.delete(c),er.set(new Set(o))}const u=(c,g)=>s(c.name,g);function f(c){Ze[c?"unshift":"push"](()=>{l=c,n(3,l)})}return e.$$set=c=>{"documents"in c&&n(0,r=c.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(o)},[r,o,i,l,a,s,u,f]}let Sc=class extends de{constructor(t){super(),pe(this,t,yc,wc,ce,{documents:0})}};function nr(e,t=2){if(e===0)return"0 Bytes";const n=1024,o=t<0?0:t,r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(o))+" "+r[i]}function Cc(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let o=0;o({question:o,count:t[o]}))}function Ls(e){return e.map(t=>{const n=t.question.split(" ").length,o=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+o,vote:t.vote}})}function kc(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",o),e.addEventListener("blur",o),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function o(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",o),e.removeEventListener("blur",o),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 yn(e,{delay:t=0,duration:n=400,easing:o=wr,axis:r="y"}={}){const i=getComputedStyle(e),l=+i.opacity,a=r==="y"?"height":"width",s=parseFloat(i[a]),u=r==="y"?["top","bottom"]:["left","right"],f=u.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),c=parseFloat(i[`padding${f[0]}`]),g=parseFloat(i[`padding${f[1]}`]),d=parseFloat(i[`margin${f[0]}`]),p=parseFloat(i[`margin${f[1]}`]),m=parseFloat(i[`border${f[0]}Width`]),_=parseFloat(i[`border${f[1]}Width`]);return{delay:t,duration:n,easing:o,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*l};${a}: ${w*s}px;padding-${u[0]}: ${w*c}px;padding-${u[1]}: ${w*g}px;margin-${u[0]}: ${w*d}px;margin-${u[1]}: ${w*p}px;border-${u[0]}-width: ${w*m}px;border-${u[1]}-width: ${w*_}px;`}}function Dn(e,{delay:t=0,duration:n=400,easing:o=wr,start:r=0,opacity:i=0}={}){const l=getComputedStyle(e),a=+l.opacity,s=l.transform==="none"?"":l.transform,u=1-r,f=a*(1-i);return{delay:t,duration:n,easing:o,css:(c,g)=>` - transform: ${s} scale(${1-u*g}); - opacity: ${a-f*g} - `}}function $c(e){let t;return{c(){t=S("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function Ac(e){let t;return{c(){t=S("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function ri(e){let t,n,o,r,i;return{c(){t=S("div"),n=S("p"),o=z(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(l,a){O(l,t,a),v(t,n),v(n,o),i=!0},p(l,a){(!i||a&2)&&ie(o,l[1])},i(l){i||(Re(()=>{i&&(r||(r=tt(t,yn,{},!0)),r.run(1))}),i=!0)},o(l){r||(r=tt(t,yn,{},!1)),r.run(0),i=!1},d(l){l&&N(t),l&&r&&r.end()}}}function Rc(e){let t,n,o,r=e[2]+1+"",i,l,a,s,u,f,c,g,d;function p(b,k){return b[3]?Ac:$c}let m=p(e),_=m(e),w=e[3]&&ri(e);return{c(){t=S("div"),n=S("div"),o=S("p"),i=z(r),l=z(": "),a=z(e[0]),s=D(),_.c(),f=D(),w&&w.c(),h(o,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(b,k){O(b,t,k),v(t,n),v(n,o),v(o,i),v(o,l),v(o,a),v(n,s),_.m(n,null),v(t,f),w&&w.m(t,null),c=!0,g||(d=j(n,"click",e[4]),g=!0)},p(b,[k]){(!c||k&4)&&r!==(r=b[2]+1+"")&&ie(i,r),(!c||k&1)&&ie(a,b[0]),m!==(m=p(b))&&(_.d(1),_=m(b),_&&(_.c(),_.m(n,null))),b[3]?w?(w.p(b,k),k&8&&P(w,1)):(w=ri(b),w.c(),P(w,1),w.m(t,null)):w&&(_e(),T(w,1,1,()=>{w=null}),ve())},i(b){c||(Re(()=>{c&&(u||(u=tt(n,yn,{},!0)),u.run(1))}),P(w),c=!0)},o(b){u||(u=tt(n,yn,{},!1)),u.run(0),T(w),c=!1},d(b){b&&N(t),_.d(),b&&u&&u.end(),w&&w.d(),g=!1,d()}}}function Mc(e,t,n){let{source:o=""}=t,{source_content:r=""}=t,{i=0}=t,l=i===0;const a=()=>n(3,l=!l);return e.$$set=s=>{"source"in s&&n(0,o=s.source),"source_content"in s&&n(1,r=s.source_content),"i"in s&&n(2,i=s.i)},[o,r,i,l,a]}class Ec extends de{constructor(t){super(),pe(this,t,Mc,Rc,ce,{source:0,source_content:1,i:2})}}function ii(e,t,n){const o=e.slice();return o[4]=t[n],o[6]=n,o}function li(e){let t,n,o,r;const i=[Nc,Ic,Dc,Fc],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]=i[t](e),{c(){n.c(),o=Ee()},m(s,u){l[t].m(s,u),O(s,o,u),r=!0},p(s,u){let f=t;t=a(s),t===f?l[t].p(s,u):(_e(),T(l[f],1,1,()=>{l[f]=null}),ve(),n=l[t],n?n.p(s,u):(n=l[t]=i[t](s),n.c()),P(n,1),n.m(o.parentNode,o))},i(s){r||(P(n),r=!0)},o(s){T(n),r=!1},d(s){l[t].d(s),s&&N(o)}}}function Fc(e){let t,n,o,r=e[0].length+"",i,l,a,s,u,f,c,g;function d(w,b){return w[2]?Oc:Pc}let p=d(e),m=p(e),_=e[2]&&si(e);return{c(){t=S("div"),n=S("h5"),o=z("📖 Response Sources ("),i=z(r),l=z(")"),a=D(),m.c(),s=D(),_&&_.c(),u=Ee(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(w,b){O(w,t,b),v(t,n),v(n,o),v(n,i),v(n,l),v(t,a),m.m(t,null),O(w,s,b),_&&_.m(w,b),O(w,u,b),f=!0,c||(g=j(t,"click",e[3]),c=!0)},p(w,b){(!f||b&1)&&r!==(r=w[0].length+"")&&ie(i,r),p!==(p=d(w))&&(m.d(1),m=p(w),m&&(m.c(),m.m(t,null))),w[2]?_?(_.p(w,b),b&4&&P(_,1)):(_=si(w),_.c(),P(_,1),_.m(u.parentNode,u)):_&&(_e(),T(_,1,1,()=>{_=null}),ve())},i(w){f||(P(_),f=!0)},o(w){T(_),f=!1},d(w){w&&N(t),m.d(),w&&N(s),_&&_.d(w),w&&N(u),c=!1,g()}}}function Dc(e){let t;return{c(){t=S("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,o){O(n,t,o)},p:U,i:U,o:U,d(n){n&&N(t)}}}function Ic(e){let t;return{c(){t=S("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,o){O(n,t,o)},p:U,i:U,o:U,d(n){n&&N(t)}}}function Nc(e){let t;return{c(){t=S("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,o){O(n,t,o)},p:U,i:U,o:U,d(n){n&&N(t)}}}function Pc(e){let t;return{c(){t=S("span"),t.textContent="⌄"},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function Oc(e){let t;return{c(){t=S("span"),t.textContent="⌃"},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function si(e){let t,n,o=e[0],r=[];for(let l=0;lT(r[l],1,1,()=>{r[l]=null});return{c(){for(let l=0;l{o=null}),ve())},i(r){n||(P(o),n=!0)},o(r){T(o),n=!1},d(r){r&&N(t),o&&o.d()}}}function xc(e,t,n){let{sources:o=[]}=t,{source_content:r=[]}=t,i=!1;const l=()=>n(2,i=!i);return e.$$set=a=>{"sources"in a&&n(0,o=a.sources),"source_content"in a&&n(1,r=a.source_content)},[o,r,i,l]}class Vc extends de{constructor(t){super(),pe(this,t,xc,Tc,ce,{sources:0,source_content:1})}}function ui(e,t,n){const o=e.slice();return o[4]=t[n],o}function fi(e,t,n){const o=e.slice();return o[4]=t[n],o}function ci(e){let t,n,o,r=e[4].label+"",i,l,a,s,u;return{c(){t=S("li"),n=S("span"),o=S("h5"),i=z(r),l=D(),h(o,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",a=qr(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(f,c){O(f,t,c),v(t,n),v(n,o),v(o,i),v(t,l),s||(u=j(n,"click",function(){He(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),s=!0)},p(f,c){e=f,c&2&&r!==(r=e[4].label+"")&&ie(i,r),c&3&&a!==(a=qr(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",a)},d(f){f&&N(t),s=!1,u()}}}function di(e){let t,n,o,r;const i=[e[2]];var l=e[4].component;function a(s){let u={};for(let f=0;f{ee(c,1)}),ve()}l?(n=bt(l,a()),ne(n.$$.fragment),P(n.$$.fragment,1),Z(n,t,o)):n=null}else l&&n.$set(f)},i(s){r||(n&&P(n.$$.fragment,s),r=!0)},o(s){n&&T(n.$$.fragment,s),r=!1},d(s){s&&N(t),n&&ee(n)}}}function gi(e){let t,n,o=e[0]==e[4].value&&di(e);return{c(){o&&o.c(),t=Ee()},m(r,i){o&&o.m(r,i),O(r,t,i),n=!0},p(r,i){r[0]==r[4].value?o?(o.p(r,i),i&3&&P(o,1)):(o=di(r),o.c(),P(o,1),o.m(t.parentNode,t)):o&&(_e(),T(o,1,1,()=>{o=null}),ve())},i(r){n||(P(o),n=!0)},o(r){T(o),n=!1},d(r){o&&o.d(r),r&&N(t)}}}function zc(e){let t,n,o,r,i=e[1],l=[];for(let f=0;fT(s[f],1,1,()=>{s[f]=null});return{c(){t=S("ul");for(let f=0;f()=>n(0,r=a);return e.$$set=a=>{"items"in a&&n(1,o=a.items),"activeTabValue"in a&&n(0,r=a.activeTabValue),"tabProps"in a&&n(2,i=a.tabProps)},[r,o,i,l]}class Hc extends de{constructor(t){super(),pe(this,t,Lc,zc,ce,{items:1,activeTabValue:0,tabProps:2})}}function hi(e){let t;return{c(){t=z("Press ENTER to autofill with the RAG answer.")},m(n,o){O(n,t,o)},d(n){n&&N(t)}}}function qc(e){let t,n,o,r,i,l,a,s,u,f,c,g,d,p=e[0].edited_answer===eo&&hi();return{c(){t=S("form"),n=S("textarea"),r=D(),i=S("div"),l=S("div"),p&&p.c(),a=D(),s=S("div"),u=S("button"),u.textContent="Update",f=D(),c=S("button"),c.textContent="Reset",h(n,"placeholder",o=e[0].answer),h(l,"class","note svelte-i9wciy"),h(i,"class","button-container svelte-i9wciy")},m(m,_){O(m,t,_),v(t,n),We(n,e[0].edited_answer),e[6](n),v(t,r),v(t,i),v(i,l),p&&p.m(l,null),v(i,a),v(i,s),v(s,u),v(s,f),v(s,c),g||(d=[j(n,"input",e[5]),j(n,"keydown",e[4]),j(u,"click",e[2]),j(c,"click",e[3])],g=!0)},p(m,[_]){_&1&&o!==(o=m[0].answer)&&h(n,"placeholder",o),_&1&&We(n,m[0].edited_answer),m[0].edited_answer===eo?p||(p=hi(),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},i:U,o:U,d(m){m&&N(t),e[6](null),p&&p.d(),g=!1,be(d)}}}const eo="";function Gc(e,t,n){let{message:o={}}=t,r;const i=async c=>{const g={id:o.id,new_answer:c},d=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(d.ok)console.log("Answer updated successfully",d),n(0,o.edited_answer=c,o);else{const p=await d.text();alert(p)}},l=c=>{c.preventDefault(),i(o.edited_answer)},a=c=>{c.preventDefault(),i(eo)},s=c=>{c.key=="Enter"&&o.edited_answer===eo&&(c.preventDefault(),console.log("ENTER"),n(0,o.edited_answer=o.answer,o))};dt(function(){r.focus()});function u(){o.edited_answer=this.value,n(0,o)}function f(c){Ze[c?"unshift":"push"](()=>{r=c,n(1,r)})}return e.$$set=c=>{"message"in c&&n(0,o=c.message)},[o,r,l,a,s,u,f]}class Bc extends de{constructor(t){super(),pe(this,t,Gc,qc,ce,{message:0})}}function pi(e){let t,n,o,r,i,l;return{c(){t=S("div"),n=S("button"),n.textContent="👍",o=D(),r=S("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(a,s){O(a,t,s),v(t,n),v(t,o),v(t,r),i||(l=[j(n,"click",e[4]),j(r,"click",e[5])],i=!0)},p:U,d(a){a&&N(t),i=!1,be(l)}}}function jc(e){let t,n=e[0].answer+"",o,r,i,l=e[1]&&pi(e);return{c(){t=S("div"),o=z(n),r=D(),l&&l.c(),i=Ee()},m(a,s){O(a,t,s),v(t,o),O(a,r,s),l&&l.m(a,s),O(a,i,s)},p(a,[s]){s&1&&n!==(n=a[0].answer+"")&&ie(o,n),a[1]?l?l.p(a,s):(l=pi(a),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&N(t),a&&N(r),l&&l.d(a),a&&N(i)}}}async function Uc(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 Wc(e,t,n){let o;ae(e,ze,f=>n(6,o=f));let{message:r={}}=t,{feedback:i=!1}=t,{index:l=0}=t;function a(f,c,g){const d=o[g];d.vote=c;const p={id:g+1,vote_status:c};Uc(p),ft(f.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),ft(f.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const s=f=>a(f,"up",l),u=f=>a(f,"down",l);return e.$$set=f=>{"message"in f&&n(0,r=f.message),"feedback"in f&&n(1,i=f.feedback),"index"in f&&n(2,l=f.index)},[r,i,l,a,s,u]}class Xc extends de{constructor(t){super(),pe(this,t,Wc,jc,ce,{message:0,feedback:1,index:2})}}function mi(e,t,n){const o=e.slice();return o[19]=t[n],o[21]=n,o}function _i(e,t){let n,o,r,i,l,a,s,u,f,c=t[19].question+"",g,d,p,m,_,w,b,k,A,R,E,C,$,y,M,I;return A=new Hc({props:{items:t[8],tabProps:{message:t[19],feedback:t[0],index:t[21]}}}),E=new Vc({props:{sources:t[19].source,source_content:t[19].source_content}}),{key:e,first:null,c(){n=S("div"),o=S("div"),r=S("div"),i=D(),l=S("div"),a=S("div"),s=S("h5"),s.textContent="Question:",u=D(),f=S("p"),g=z(c),d=D(),p=S("div"),m=S("p"),m.textContent="ℹ️ Retrieval Sources",w=D(),b=S("div"),k=S("div"),ne(A.$$.fragment),R=D(),ne(E.$$.fragment),C=D(),h(r,"class","avatar"),h(s,"class","bold"),h(m,"class","bold"),h(p,"class","rag-sources svelte-vgv4ev"),h(a,"class","question svelte-vgv4ev"),h(k,"class","answer svelte-vgv4ev"),h(b,"class","answers svelte-vgv4ev"),h(l,"class","message-content svelte-vgv4ev"),h(o,"class","chat-message-center svelte-vgv4ev"),h(n,"class","chat-message svelte-vgv4ev"),this.first=n},m(F,x){O(F,n,x),v(n,o),v(o,r),v(o,i),v(o,l),v(l,a),v(a,s),v(a,u),v(a,f),v(f,g),v(a,d),v(a,p),v(p,m),v(l,w),v(l,b),v(b,k),Z(A,k,null),v(l,R),Z(E,l,null),v(n,C),y=!0,M||(I=[_n(_=kc.call(null,m,vi(t[19]))),_n($=Qc.call(null,n,t[21]===t[5].length-1))],M=!0)},p(F,x){t=F,(!y||x&32)&&c!==(c=t[19].question+"")&&ie(g,c),_&&He(_.update)&&x&32&&_.update.call(null,vi(t[19]));const q={};x&33&&(q.tabProps={message:t[19],feedback:t[0],index:t[21]}),A.$set(q);const le={};x&32&&(le.sources=t[19].source),x&32&&(le.source_content=t[19].source_content),E.$set(le),$&&He($.update)&&x&32&&$.update.call(null,t[21]===t[5].length-1)},i(F){y||(P(A.$$.fragment,F),P(E.$$.fragment,F),y=!0)},o(F){T(A.$$.fragment,F),T(E.$$.fragment,F),y=!1},d(F){F&&N(n),ee(A),ee(E),M=!1,be(I)}}}function Yc(e){let t,n,o,r,i,l,a,s,u,f,c,g,d,p,m=[],_=new Map,w,b,k,A,R,E,C,$,y,M=(e[2]?e[4]:"Send")+"",I,F,x,q,le,oe,se;function ge(G){e[13](G)}let L={table:"rag_table"};e[3]!==void 0&&(L.showModal=e[3]),t=new Cr({props:L}),Ze.push(()=>bn(t,"showModal",ge));let B=e[5];const H=G=>G[21];for(let G=0;G👍 - button. If the response is not satisfactory, click on the - 👎 button.`,u=D(),f=S("button"),f.textContent="Download Data",c=D(),g=S("div"),d=S("section"),p=S("div");for(let G=0;Gn=!1)),t.$set(ue),Y&289&&(B=G[5],_e(),m=Qt(m,Y,H,1,G,B,_,p,Cs,_i,null,mi),ve());const En={};Y&64&&(En.documents=G[6]),A.$set(En),Y&2&&C.value!==G[1]&&We(C,G[1]),(!le||Y&20)&&M!==(M=(G[2]?G[4]:"Send")+"")&&ie(I,M),(!le||Y&2&&F!==(F="btnyousend "+(G[1]===""?"":"active")+" svelte-vgv4ev"))&&h(y,"class",F)},i(G){if(!le){P(t.$$.fragment,G);for(let Y=0;Y{e.scrollIntoView({behavior:"smooth"})},0)}function vi(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Kc(e,t,n){let o,r,i,l;ae(e,ze,E=>n(5,r=E)),ae(e,er,E=>n(16,i=E));let{feedback:a=!1}=t,{is_retrieval:s=!1}=t;const u=Fe([]);ae(e,u,E=>n(6,l=E));let f="",c="",g=!1,d=!1,p=[{label:"Answer",value:1,component:Xc},{label:"Modified Answer",value:2,component:Bc}];dt(()=>{_(),m()});async function m(){const C=await(await fetch("/retrieval/file/get")).json();console.log("data",C.files);const y=C.files.map((M,I)=>({id:String(I),name:M.name}));console.log("files",y),Oe(u,l=[...y],l)}async function _(){const $=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",$);const y=$.map(M=>({id:M[0],question:M[1],answer:M[2],edited_answer:M[3],vote_status:M[4],rag_sources:M[5],source:M[6],source_content:M[7]}));Oe(ze,r=[...y],r)}const w=async E=>{E.preventDefault(),f=c,n(1,c=""),n(2,g=!0);const C=[...i];let $={id:r.length+1,question:f,answer:"Loading...",rag_sources:C,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Oe(ze,r=[...r,$],r);const y=s?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:f,file_names:C})}):await fetch(`/chat/${f}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:f})});if(y.ok){const M=await y.json();console.log("response data",M),$.answer=M.answer,$.source=M.source,$.source_content=M.source_content,ze.update(I=>(I[I.length-1]=$,I))}else{const M=await y.text();alert(M)}n(2,g=!1)};let b=0;setInterval(()=>{n(12,b=(b+1)%4)},200);function k(){n(3,d=!0)}function A(E){d=E,n(3,d)}function R(){c=this.value,n(1,c)}return e.$$set=E=>{"feedback"in E&&n(0,a=E.feedback),"is_retrieval"in E&&n(11,s=E.is_retrieval)},e.$$.update=()=>{e.$$.dirty&4096&&n(4,o=".".repeat(b).padEnd(3))},[a,c,g,d,o,r,l,u,p,w,k,s,b,A,R]}class Jc extends de{constructor(t){super(),pe(this,t,Kc,Yc,ce,{feedback:0,is_retrieval:11})}}function bi(e){let t,n;return t=new kr({props:{is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},p(o,r){const i={};r&2&&(i.is_retrieval=o[1]),t.$set(i)},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function wi(e){let t,n;return t=new kr({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},p(o,r){const i={};r&2&&(i.is_retrieval=o[1]),t.$set(i)},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function yi(e){let t,n;return t=new Jc({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},p(o,r){const i={};r&2&&(i.is_retrieval=o[1]),t.$set(i)},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function Si(e){let t,n,o,r;const i=[ed,Zc],l=[];function a(s,u){return s[1]?0:1}return t=a(e),n=l[t]=i[t](e),{c(){n.c(),o=Ee()},m(s,u){l[t].m(s,u),O(s,o,u),r=!0},p(s,u){let f=t;t=a(s),t===f?l[t].p(s,u):(_e(),T(l[f],1,1,()=>{l[f]=null}),ve(),n=l[t],n?n.p(s,u):(n=l[t]=i[t](s),n.c()),P(n,1),n.m(o.parentNode,o))},i(s){r||(P(n),r=!0)},o(s){T(n),r=!1},d(s){l[t].d(s),s&&N(o)}}}function Zc(e){let t,n;return t=new bc({}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},p:U,i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function ed(e){let t,n;return t=new kr({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(o,r){Z(t,o,r),n=!0},p(o,r){const i={};r&2&&(i.is_retrieval=o[1]),t.$set(i)},i(o){n||(P(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){ee(t,o)}}}function td(e){let t,n,o,r,i,l=!e[0]&&bi(e),a=e[0]==="vote"&&wi(e),s=e[0]==="rag"&&yi(e),u=e[0]==="rank"&&Si(e);return{c(){l&&l.c(),t=D(),a&&a.c(),n=D(),s&&s.c(),o=D(),u&&u.c(),r=Ee()},m(f,c){l&&l.m(f,c),O(f,t,c),a&&a.m(f,c),O(f,n,c),s&&s.m(f,c),O(f,o,c),u&&u.m(f,c),O(f,r,c),i=!0},p(f,[c]){f[0]?l&&(_e(),T(l,1,1,()=>{l=null}),ve()):l?(l.p(f,c),c&1&&P(l,1)):(l=bi(f),l.c(),P(l,1),l.m(t.parentNode,t)),f[0]==="vote"?a?(a.p(f,c),c&1&&P(a,1)):(a=wi(f),a.c(),P(a,1),a.m(n.parentNode,n)):a&&(_e(),T(a,1,1,()=>{a=null}),ve()),f[0]==="rag"?s?(s.p(f,c),c&1&&P(s,1)):(s=yi(f),s.c(),P(s,1),s.m(o.parentNode,o)):s&&(_e(),T(s,1,1,()=>{s=null}),ve()),f[0]==="rank"?u?(u.p(f,c),c&1&&P(u,1)):(u=Si(f),u.c(),P(u,1),u.m(r.parentNode,r)):u&&(_e(),T(u,1,1,()=>{u=null}),ve())},i(f){i||(P(l),P(a),P(s),P(u),i=!0)},o(f){T(l),T(a),T(s),T(u),i=!1},d(f){l&&l.d(f),f&&N(t),a&&a.d(f),f&&N(n),s&&s.d(f),f&&N(o),u&&u.d(f),f&&N(r)}}}function nd(e,t,n){let{feedback:o}=t,{is_retrieval:r}=t;return e.$$set=i=>{"feedback"in i&&n(0,o=i.feedback),"is_retrieval"in i&&n(1,r=i.is_retrieval)},[o,r]}class od extends de{constructor(t){super(),pe(this,t,nd,td,ce,{feedback:0,is_retrieval:1})}}function Ci(e,t,n){const o=e.slice();return o[2]=t[n],o}function ki(e){let t,n=e[2]+"",o,r;return{c(){t=S("option"),o=z(n),t.__value=r=e[2],t.value=t.__value},m(i,l){O(i,t,l),v(t,o)},p(i,l){l&1&&n!==(n=i[2]+"")&&ie(o,n),l&1&&r!==(r=i[2])&&(t.__value=r,t.value=t.__value)},d(i){i&&N(t)}}}function rd(e){let t,n=e[0],o=[];for(let r=0;r{const i=await fetch(`/data/${o}`);n(0,r=await i.json())}),e.$$set=i=>{"data_endpoint"in i&&n(1,o=i.data_endpoint)},[r,o]}class ld extends de{constructor(t){super(),pe(this,t,id,rd,ce,{data_endpoint:1})}}function qt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function sd(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Hs(e){let t,n,o;e.length!==2?(t=qt,n=(a,s)=>qt(e(a),s),o=(a,s)=>e(a)-s):(t=e===qt||e===sd?e:ad,n=e,o=e);function r(a,s,u=0,f=a.length){if(u>>1;n(a[c],s)<0?u=c+1:f=c}while(u>>1;n(a[c],s)<=0?u=c+1:f=c}while(uu&&o(a[c-1],s)>-o(a[c],s)?c-1:c}return{left:r,center:l,right:i}}function ad(){return 0}function ud(e){return e===null?NaN:+e}function*fd(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let o of e)(o=t(o,++n,e))!=null&&(o=+o)>=o&&(yield o)}}const cd=Hs(qt),dd=cd.right;Hs(ud).center;const qs=dd;function gd(e,t){let n=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&++n;else{let o=-1;for(let r of e)(r=t(r,++o,e))!=null&&(r=+r)>=r&&++n}return n}function fn(e,t){let n,o;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=o=r):(n>r&&(n=r),o=i&&(n=o=i):(n>i&&(n=i),o{const o=e(t,n);return o||o===0?o:(e(n,n)===0)-(e(t,t)===0)}}function Gs(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var bd=Array.prototype,wd=bd.slice;function Fo(e){return()=>e}const yd=Math.sqrt(50),Sd=Math.sqrt(10),Cd=Math.sqrt(2);function to(e,t,n){const o=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),l=i>=yd?10:i>=Sd?5:i>=Cd?2:1;let a,s,u;return r<0?(u=Math.pow(10,-r)/l,a=Math.round(e*u),s=Math.round(t*u),a/ut&&--s,u=-u):(u=Math.pow(10,r)*l,a=Math.round(e/u),s=Math.round(t/u),a*ut&&--s),s0))return[];if(e===t)return[e];const o=t=r))return[];const a=i-r+1,s=new Array(a);if(o)if(l<0)for(let u=0;u0?(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),o=r}}function Ad(e){return Math.max(1,Math.ceil(Math.log(gd(e))/Math.LN2)+1)}function js(){var e=_d,t=fn,n=Ad;function o(r){Array.isArray(r)||(r=Array.from(r));var i,l=r.length,a,s,u=new Array(l);for(i=0;i=g)if(k>=g&&t===fn){const R=Ut(c,g,A);isFinite(R)&&(R>0?g=(Math.floor(g/R)+1)*R:R<0&&(g=(Math.ceil(g*-R)+1)/-R))}else d.pop()}for(var p=d.length,m=0,_=p;d[m]<=c;)++m;for(;d[_-1]>g;)--_;(m||_0?d[i-1]:c,b.x1=i0)for(i=0;i=o)&&(n=o);else{let o=-1;for(let r of e)(r=t(r,++o,e))!=null&&(n=r)&&(n=r)}return n}function Ri(e,t){let n;if(t===void 0)for(const o of e)o!=null&&(n>o||n===void 0&&o>=o)&&(n=o);else{let o=-1;for(let r of e)(r=t(r,++o,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Us(e,t,n=0,o=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(e.length-1,o)),!(n<=t&&t<=o))return e;for(r=r===void 0?Gs:vd(r);o>n;){if(o-n>600){const s=o-n+1,u=t-n+1,f=Math.log(s),c=.5*Math.exp(2*f/3),g=.5*Math.sqrt(f*c*(s-c)/s)*(u-s/2<0?-1:1),d=Math.max(n,Math.floor(t-u*c/s+g)),p=Math.min(o,Math.floor(t+(s-u)*c/s+g));Us(e,t,d,p,r)}const i=e[t];let l=n,a=o;for(en(e,n,t),r(e[o],i)>0&&en(e,n,o);l0;)--a}r(e[n],i)===0?en(e,n,a):(++a,en(e,a,o)),a<=t&&(n=a+1),t<=a&&(o=a-1)}return e}function en(e,t,n){const o=e[t];e[t]=e[n],e[n]=o}function Rd(e,t,n){if(e=Float64Array.from(fd(e,n)),!(!(o=e.length)||isNaN(t=+t))){if(t<=0||o<2)return Ri(e);if(t>=1)return Mt(e);var o,r=(o-1)*t,i=Math.floor(r),l=Mt(Us(e,i).subarray(0,i+1)),a=Ri(e.subarray(i+1));return l+(a-l)*(r-i)}}function Md(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(r);++o=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function no(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,o=e.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+e.slice(n+1)]}function Wt(e){return e=no(Math.abs(e)),e?e[1]:NaN}function Fd(e,t){return function(n,o){for(var r=n.length,i=[],l=0,a=e[0],s=0;r>0&&a>0&&(s+a+1>o&&(a=Math.max(1,o-s)),i.push(n.substring(r-=a,r+a)),!((s+=a+1)>o));)a=e[l=(l+1)%e.length];return i.reverse().join(t)}}function Dd(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Id=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function oo(e){if(!(t=Id.exec(e)))throw new Error("invalid format: "+e);var t;return new $r({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]})}oo.prototype=$r.prototype;function $r(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+""}$r.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 Nd(e){e:for(var t=e.length,n=1,o=-1,r;n0&&(o=0);break}return o>0?e.slice(0,o)+e.slice(r+1):e}var Ws;function Pd(e,t){var n=no(e,t);if(!n)return e+"";var o=n[0],r=n[1],i=r-(Ws=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,l=o.length;return i===l?o:i>l?o+new Array(i-l+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+no(e,Math.max(0,t+i-1))[0]}function Mi(e,t){var n=no(e,t);if(!n)return e+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}const Ei={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ed,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)=>Mi(e*100,t),r:Mi,s:Pd,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Fi(e){return e}var Di=Array.prototype.map,Ii=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Od(e){var t=e.grouping===void 0||e.thousands===void 0?Fi:Fd(Di.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",o=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Fi:Dd(Di.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(c){c=oo(c);var g=c.fill,d=c.align,p=c.sign,m=c.symbol,_=c.zero,w=c.width,b=c.comma,k=c.precision,A=c.trim,R=c.type;R==="n"?(b=!0,R="g"):Ei[R]||(k===void 0&&(k=12),A=!0,R="g"),(_||g==="0"&&d==="=")&&(_=!0,g="0",d="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(R)?"0"+R.toLowerCase():"",C=m==="$"?o:/[%p]/.test(R)?l:"",$=Ei[R],y=/[defgprs%]/.test(R);k=k===void 0?6:/[gprs]/.test(R)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function M(I){var F=E,x=C,q,le,oe;if(R==="c")x=$(I)+x,I="";else{I=+I;var se=I<0||1/I<0;if(I=isNaN(I)?s:$(Math.abs(I),k),A&&(I=Nd(I)),se&&+I==0&&p!=="+"&&(se=!1),F=(se?p==="("?p:a:p==="-"||p==="("?"":p)+F,x=(R==="s"?Ii[8+Ws/3]:"")+x+(se&&p==="("?")":""),y){for(q=-1,le=I.length;++qoe||oe>57){x=(oe===46?r+I.slice(q+1):I.slice(q))+x,I=I.slice(0,q);break}}}b&&!_&&(I=t(I,1/0));var ge=F.length+I.length+x.length,L=ge>1)+F+I+x+L.slice(ge);break;default:I=L+F+I+x;break}return i(I)}return M.toString=function(){return c+""},M}function f(c,g){var d=u((c=oo(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(Wt(g)/3)))*3,m=Math.pow(10,-p),_=Ii[8+p/3];return function(w){return d(m*w)+_}}return{format:u,formatPrefix:f}}var In,Dt,Xs;Td({thousands:",",grouping:[3],currency:["$",""]});function Td(e){return In=Od(e),Dt=In.format,Xs=In.formatPrefix,In}function xd(e){return Math.max(0,-Wt(Math.abs(e)))}function Vd(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wt(t)/3)))*3-Wt(Math.abs(e)))}function zd(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wt(t)-Wt(e))+1}function Ar(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Ni=Symbol("implicit");function yo(){var e=new $i,t=[],n=[],o=Ni;function r(i){let l=e.get(i);if(l===void 0){if(o!==Ni)return o;e.set(i,l=t.push(i)-1)}return n[l%n.length]}return r.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new $i;for(const l of i)e.has(l)||e.set(l,t.push(l)-1);return r},r.range=function(i){return arguments.length?(n=Array.from(i),r):n.slice()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return yo(t,n).unknown(o)},Ar.apply(r,arguments),r}function Rr(){var e=yo().unknown(void 0),t=e.domain,n=e.range,o=0,r=1,i,l,a=!1,s=0,u=0,f=.5;delete e.unknown;function c(){var g=t().length,d=r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Nn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Nn(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=Hd.exec(e))?new Le(t[1],t[2],t[3],1):(t=qd.exec(e))?new Le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gd.exec(e))?Nn(t[1],t[2],t[3],t[4]):(t=Bd.exec(e))?Nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jd.exec(e))?Li(t[1],t[2]/100,t[3]/100,1):(t=Ud.exec(e))?Li(t[1],t[2]/100,t[3]/100,t[4]):Pi.hasOwnProperty(e)?xi(Pi[e]):e==="transparent"?new Le(NaN,NaN,NaN,0):null}function xi(e){return new Le(e>>16&255,e>>8&255,e&255,1)}function Nn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Le(e,t,n,o)}function Yd(e){return e instanceof An||(e=kn(e)),e?(e=e.rgb(),new Le(e.r,e.g,e.b,e.opacity)):new Le}function or(e,t,n,o){return arguments.length===1?Yd(e):new Le(e,t,n,o??1)}function Le(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Mr(Le,or,Ys(An,{brighter(e){return e=e==null?ro:Math.pow(ro,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sn:Math.pow(Sn,e),new Le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Le(Rt(this.r),Rt(this.g),Rt(this.b),io(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:Vi,formatHex:Vi,formatHex8:Qd,formatRgb:zi,toString:zi}));function Vi(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}`}function Qd(){return`#${$t(this.r)}${$t(this.g)}${$t(this.b)}${$t((isNaN(this.opacity)?1:this.opacity)*255)}`}function zi(){const e=io(this.opacity);return`${e===1?"rgb(":"rgba("}${Rt(this.r)}, ${Rt(this.g)}, ${Rt(this.b)}${e===1?")":`, ${e})`}`}function io(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $t(e){return e=Rt(e),(e<16?"0":"")+e.toString(16)}function Li(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qe(e,t,n,o)}function Qs(e){if(e instanceof Qe)return new Qe(e.h,e.s,e.l,e.opacity);if(e instanceof An||(e=kn(e)),!e)return new Qe;if(e instanceof Qe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),l=NaN,a=i-r,s=(i+r)/2;return a?(t===i?l=(n-o)/a+(n0&&s<1?0:l,new Qe(l,a,s,e.opacity)}function Kd(e,t,n,o){return arguments.length===1?Qs(e):new Qe(e,t,n,o??1)}function Qe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Mr(Qe,Kd,Ys(An,{brighter(e){return e=e==null?ro:Math.pow(ro,e),new Qe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sn:Math.pow(Sn,e),new Qe(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,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Le(Do(e>=240?e-240:e+120,r,o),Do(e,r,o),Do(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Qe(Hi(this.h),Pn(this.s),Pn(this.l),io(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=io(this.opacity);return`${e===1?"hsl(":"hsla("}${Hi(this.h)}, ${Pn(this.s)*100}%, ${Pn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Hi(e){return e=(e||0)%360,e<0?e+360:e}function Pn(e){return Math.max(0,Math.min(1,e||0))}function Do(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 Er=e=>()=>e;function Jd(e,t){return function(n){return e+n*t}}function Zd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function eg(e){return(e=+e)==1?Ks:function(t,n){return n-t?Zd(t,n,e):Er(isNaN(t)?n:t)}}function Ks(e,t){var n=t-e;return n?Jd(e,n):Er(isNaN(e)?t:e)}const qi=function e(t){var n=eg(t);function o(r,i){var l=n((r=or(r)).r,(i=or(i)).r),a=n(r.g,i.g),s=n(r.b,i.b),u=Ks(r.opacity,i.opacity);return function(f){return r.r=l(f),r.g=a(f),r.b=s(f),r.opacity=u(f),r+""}}return o.gamma=e,o}(1);function tg(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;rn&&(i=t.slice(n,i),a[l]?a[l]+=i:a[++l]=i),(o=o[0])===(r=r[0])?a[l]?a[l]+=r:a[++l]=r:(a[++l]=null,s.push({i:l,x:lo(o,r)})),n=Io.lastIndex;return nt&&(n=e,e=t,t=n),function(o){return Math.max(e,Math.min(t,o))}}function gg(e,t,n){var o=e[0],r=e[1],i=t[0],l=t[1];return r2?hg:gg,s=u=null,c}function c(g){return g==null||isNaN(g=+g)?i:(s||(s=a(e.map(o),t,n)))(o(l(g)))}return c.invert=function(g){return l(r((u||(u=a(t,e.map(o),lo)))(g)))},c.domain=function(g){return arguments.length?(e=Array.from(g,cg),f()):e.slice()},c.range=function(g){return arguments.length?(t=Array.from(g),f()):t.slice()},c.rangeRound=function(g){return t=Array.from(g),n=ug,f()},c.clamp=function(g){return arguments.length?(l=g?!0:Vt,f()):l!==Vt},c.interpolate=function(g){return arguments.length?(n=g,f()):n},c.unknown=function(g){return arguments.length?(i=g,c):i},function(g,d){return o=g,r=d,f()}}function _g(){return mg()(Vt,Vt)}function vg(e,t,n,o){var r=kd(e,t,n),i;switch(o=oo(o??",f"),o.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return o.precision==null&&!isNaN(i=Vd(r,l))&&(o.precision=i),Xs(o,l)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=zd(r,Math.max(Math.abs(e),Math.abs(t))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=xd(r))&&(o.precision=i-(o.type==="%")*2);break}}return Dt(o)}function bg(e){var t=e.domain;return e.ticks=function(n){var o=t();return Bs(o[0],o[o.length-1],n??10)},e.tickFormat=function(n,o){var r=t();return vg(r[0],r[r.length-1],n??10,o)},e.nice=function(n){n==null&&(n=10);var o=t(),r=0,i=o.length-1,l=o[r],a=o[i],s,u,f=10;for(a0;){if(u=Ut(l,a,n),u===s)return o[r]=l,o[i]=a,t(o);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 Ke(){var e=_g();return e.copy=function(){return pg(e,Ke())},Ar.apply(e,arguments),bg(e)}function On(e){return function(){return e}}function wg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lr(e,t){if((l=e.length)>1)for(var n=1,o,r,i=e[t[0]],l,a=i.length;n=0;)n[t]=t;return n}function yg(e,t){return e[t]}function Sg(e){const t=[];return t.key=e,t}function Cg(){var e=On([]),t=sr,n=lr,o=yg;function r(i){var l=Array.from(e.apply(this,arguments),Sg),a,s=l.length,u=-1,f;for(const c of i)for(a=0,++u;aFeedback Distribution

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

Ask a question and click on the better of the two responses. The better + response will be outlined in green, the worse + response outlined in red. This data will be + automatically fed to RLHF.

+ `,l=N(),o=R("div"),r=R("section"),s=R("div");for(let A=0;A{e.scrollIntoView({behavior:"smooth"})},0)}async function ad(e){const t=await fetch("/chat/ranking_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function ud(e,t,n){let l,o;ue(e,Il,v=>n(3,o=v));let r="",s="",u=!1;ft(()=>{});const a=async v=>{v.preventDefault(),r=s,n(0,s=""),n(1,u=!0);let w={question:r,up_ranking_answer:"Loading...",low_ranking_answer:"Loading..."};Pe(Il,o=[...o,w],o);const y=await fetch(`/chat/multi_responses/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:r})});if(y.ok){const C=await y.json();w.up_ranking_answer=C.answer[0],w.low_ranking_answer=C.answer[1],Il.update(M=>(M[M.length-1]=w,M))}else{const C=await y.text();alert(C)}n(1,u=!1)};let f=0;setInterval(()=>{n(6,f=(f+1)%4)},200);function c(v,w,y,C){const M=o[y],$={1:"up_ranking_answer",2:"low_ranking_answer"},F={question:M.question,up_ranking_answer:M[$[C]],low_ranking_answer:M[$[C%2+1]]};ad(F),pt(v.currentTarget.parentNode).selectAll("div").style("outline","2px solid var(--red)").style("border","1px solid var(--red)"),pt(v.currentTarget).style("outline","2px solid var(--green)").style("border","1px solid var(--green)")}const d=(v,w,y)=>c(y,v,w,1),g=(v,w,y)=>c(y,v,w,1),p=(v,w,y)=>c(y,v,w,2),m=(v,w,y)=>c(y,v,w,2);function _(){s=this.value,n(0,s)}return e.$$.update=()=>{e.$$.dirty&64&&n(2,l=".".repeat(f).padEnd(3))},[s,u,l,o,a,c,f,d,g,p,m,_]}class fd extends ce{constructor(t){super(),de(this,t,ud,rd,fe,{})}}function fi(e,t,n){const l=e.slice();return l[8]=t[n],l[10]=n,l}function ci(e){let t,n,l,o,r=e[8].name+"",s,u,a,f,c;function d(...g){return e[6](e[8],...g)}return{c(){t=R("label"),n=R("input"),s=H(r),u=N(),h(n,"type","checkbox"),h(n,"id",l=e[8].id),n.checked=o=e[1].has(e[8].name),h(t,"for",a=e[8].id)},m(g,p){T(g,t,p),b(t,n),b(t,s),b(t,u),f||(c=x(n,"change",d),f=!0)},p(g,p){e=g,p&1&&l!==(l=e[8].id)&&h(n,"id",l),p&3&&o!==(o=e[1].has(e[8].name))&&(n.checked=o),p&1&&r!==(r=e[8].name+"")&&K(s,r),p&1&&a!==(a=e[8].id)&&h(t,"for",a)},d(g){g&&P(t),f=!1,c()}}}function cd(e){let t,n,l,o,r,s,u,a,f,c,d,g=e[0],p=[];for(let m=0;mn(1,l=d));let{documents:o=[]}=t,r=!1,s;function u(){n(2,r=!r)}function a(d,g){g.target.checked?l.add(d):l.delete(d),oo.set(new Set(l))}const f=(d,g)=>a(d.name,g);function c(d){et[d?"unshift":"push"](()=>{s=d,n(3,s)})}return e.$$set=d=>{"documents"in d&&n(0,o=d.documents)},e.$$.update=()=>{e.$$.dirty&2&&console.log(l)},[o,l,r,s,u,a,f,c]}let hd=class extends ce{constructor(t){super(),de(this,t,dd,cd,fe,{documents:0})}};function ro(e,t=2){if(e===0)return"0 Bytes";const n=1024,l=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,r)).toFixed(l))+" "+o[r]}function gd(e){let t={who:0,what:0,how:0,why:0,where:0,does:0,can:0,"n/a":0};for(let l=0;l({question:l,count:t[l]}))}function Ca(e){return e.map(t=>{const n=t.question.split(" ").length,l=t.answer.split(" ").length;return{index:t.index,question:+n,answer:+l,vote:t.vote}})}function pd(e,t){e.classList.add("tooltip"),e.setAttribute("tabindex",0);function n(){const o=document.createElement("span");o.textContent=t,o.setAttribute("id","tooltip"),e.appendChild(o),e.addEventListener("mouseleave",l),e.addEventListener("blur",l),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}function l(){e.removeChild(e.querySelector("#tooltip")),e.removeEventListener("mouseleave",l),e.removeEventListener("blur",l),e.addEventListener("mouseenter",n),e.addEventListener("focus",n)}return e.addEventListener("mouseenter",n),e.addEventListener("focus",n),{onDestroy(){e.classList.remove("tooltip"),e.removeEventListener("mouseenter",n),e.removeEventListener("focus",n)}}}function Mn(e,{delay:t=0,duration:n=400,easing:l=Eo,axis:o="y"}={}){const r=getComputedStyle(e),s=+r.opacity,u=o==="y"?"height":"width",a=parseFloat(r[u]),f=o==="y"?["top","bottom"]:["left","right"],c=f.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),d=parseFloat(r[`padding${c[0]}`]),g=parseFloat(r[`padding${c[1]}`]),p=parseFloat(r[`margin${c[0]}`]),m=parseFloat(r[`margin${c[1]}`]),_=parseFloat(r[`border${c[0]}Width`]),v=parseFloat(r[`border${c[1]}Width`]);return{delay:t,duration:n,easing:l,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*s};${u}: ${w*a}px;padding-${f[0]}: ${w*d}px;padding-${f[1]}: ${w*g}px;margin-${f[0]}: ${w*p}px;margin-${f[1]}: ${w*m}px;border-${f[0]}-width: ${w*_}px;border-${f[1]}-width: ${w*v}px;`}}function Ln(e,{delay:t=0,duration:n=400,easing:l=Eo,start:o=0,opacity:r=0}={}){const s=getComputedStyle(e),u=+s.opacity,a=s.transform==="none"?"":s.transform,f=1-o,c=u*(1-r);return{delay:t,duration:n,easing:l,css:(d,g)=>` + transform: ${a} scale(${1-f*g}); + opacity: ${u-c*g} + `}}function md(e){let t;return{c(){t=R("p"),t.textContent="⌄",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function _d(e){let t;return{c(){t=R("p"),t.textContent="⌃",h(t,"class","svelte-1pk2e1k")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function di(e){let t,n,l,o,r;return{c(){t=R("div"),n=R("p"),l=H(e[1]),h(n,"class","bold svelte-1pk2e1k"),h(t,"class","source_content svelte-1pk2e1k")},m(s,u){T(s,t,u),b(t,n),b(n,l),r=!0},p(s,u){(!r||u&2)&&K(l,s[1])},i(s){r||(Me(()=>{r&&(o||(o=lt(t,Mn,{},!0)),o.run(1))}),r=!0)},o(s){o||(o=lt(t,Mn,{},!1)),o.run(0),r=!1},d(s){s&&P(t),s&&o&&o.end()}}}function vd(e){let t,n,l,o=e[2]+1+"",r,s,u,a,f,c,d,g,p;function m(y,C){return y[3]?_d:md}let _=m(e),v=_(e),w=e[3]&&di(e);return{c(){t=R("div"),n=R("div"),l=R("p"),r=H(o),s=H(": "),u=H(e[0]),a=N(),v.c(),c=N(),w&&w.c(),h(l,"class","bold svelte-1pk2e1k"),h(n,"class","source_tab svelte-1pk2e1k"),h(t,"class","source svelte-1pk2e1k")},m(y,C){T(y,t,C),b(t,n),b(n,l),b(l,r),b(l,s),b(l,u),b(n,a),v.m(n,null),b(t,c),w&&w.m(t,null),d=!0,g||(p=x(n,"click",e[4]),g=!0)},p(y,[C]){(!d||C&4)&&o!==(o=y[2]+1+"")&&K(r,o),(!d||C&1)&&K(u,y[0]),_!==(_=m(y))&&(v.d(1),v=_(y),v&&(v.c(),v.m(n,null))),y[3]?w?(w.p(y,C),C&8&&V(w,1)):(w=di(y),w.c(),V(w,1),w.m(t,null)):w&&(we(),z(w,1,1,()=>{w=null}),ye())},i(y){d||(Me(()=>{d&&(f||(f=lt(n,Mn,{},!0)),f.run(1))}),V(w),d=!0)},o(y){f||(f=lt(n,Mn,{},!1)),f.run(0),z(w),d=!1},d(y){y&&P(t),v.d(),y&&f&&f.end(),w&&w.d(),g=!1,p()}}}function bd(e,t,n){let{source:l=""}=t,{source_content:o=""}=t,{i:r=0}=t,s=r===0;const u=()=>n(3,s=!s);return e.$$set=a=>{"source"in a&&n(0,l=a.source),"source_content"in a&&n(1,o=a.source_content),"i"in a&&n(2,r=a.i)},[l,o,r,s,u]}class wd extends ce{constructor(t){super(),de(this,t,bd,vd,fe,{source:0,source_content:1,i:2})}}function hi(e,t,n){const l=e.slice();return l[4]=t[n],l[6]=n,l}function gi(e){let t,n,l,o;const r=[Cd,Sd,kd,yd],s=[];function u(a,f){return a[0][0]==="N/A"?0:a[0][0]==="Loading..."?1:a[0][0]==="Not loaded"?2:3}return t=u(e),n=s[t]=r[t](e),{c(){n.c(),l=Se()},m(a,f){s[t].m(a,f),T(a,l,f),o=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),n=s[t],n?n.p(a,f):(n=s[t]=r[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){o||(V(n),o=!0)},o(a){z(n),o=!1},d(a){s[t].d(a),a&&P(l)}}}function yd(e){let t,n,l,o=e[0].length+"",r,s,u,a,f,c,d,g;function p(w,y){return w[2]?Ad:$d}let m=p(e),_=m(e),v=e[2]&&pi(e);return{c(){t=R("div"),n=R("h5"),l=H("📖 Response Sources ("),r=H(o),s=H(")"),u=N(),_.c(),a=N(),v&&v.c(),f=Se(),h(n,"class","bold"),h(t,"class","sources-header svelte-1r759df")},m(w,y){T(w,t,y),b(t,n),b(n,l),b(n,r),b(n,s),b(t,u),_.m(t,null),T(w,a,y),v&&v.m(w,y),T(w,f,y),c=!0,d||(g=x(t,"click",e[3]),d=!0)},p(w,y){(!c||y&1)&&o!==(o=w[0].length+"")&&K(r,o),m!==(m=p(w))&&(_.d(1),_=m(w),_&&(_.c(),_.m(t,null))),w[2]?v?(v.p(w,y),y&4&&V(v,1)):(v=pi(w),v.c(),V(v,1),v.m(f.parentNode,f)):v&&(we(),z(v,1,1,()=>{v=null}),ye())},i(w){c||(V(v),c=!0)},o(w){z(v),c=!1},d(w){w&&P(t),_.d(),w&&P(a),v&&v.d(w),w&&P(f),d=!1,g()}}}function kd(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No sources loaded",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function Sd(e){let t;return{c(){t=R("h5"),t.textContent="📖 Loading...",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function Cd(e){let t;return{c(){t=R("h5"),t.textContent="⚠️ No Retrieval Sources selected",h(t,"class","bold")},m(n,l){T(n,t,l)},p:U,i:U,o:U,d(n){n&&P(t)}}}function $d(e){let t;return{c(){t=R("span"),t.textContent="⌄"},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function Ad(e){let t;return{c(){t=R("span"),t.textContent="⌃"},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function pi(e){let t,n,l=e[0],o=[];for(let s=0;sz(o[s],1,1,()=>{o[s]=null});return{c(){for(let s=0;s{l=null}),ye())},i(o){n||(V(l),n=!0)},o(o){z(l),n=!1},d(o){o&&P(t),l&&l.d()}}}function Md(e,t,n){let{sources:l=[]}=t,{source_content:o=[]}=t,r=!1;const s=()=>n(2,r=!r);return e.$$set=u=>{"sources"in u&&n(0,l=u.sources),"source_content"in u&&n(1,o=u.source_content)},[l,o,r,s]}class Ed extends ce{constructor(t){super(),de(this,t,Md,Rd,fe,{sources:0,source_content:1})}}function _i(e,t,n){const l=e.slice();return l[4]=t[n],l}function vi(e,t,n){const l=e.slice();return l[4]=t[n],l}function bi(e){let t,n,l,o=e[4].label+"",r,s,u,a,f;return{c(){t=R("li"),n=R("span"),l=R("h5"),r=H(o),s=N(),h(l,"class","bold"),h(n,"class","svelte-iwm583"),h(t,"class",u=Qo(e[0]===e[4].value?"active":"")+" svelte-iwm583")},m(c,d){T(c,t,d),b(t,n),b(n,l),b(l,r),b(t,s),a||(f=x(n,"click",function(){Ge(e[3](e[4].value))&&e[3](e[4].value).apply(this,arguments)}),a=!0)},p(c,d){e=c,d&2&&o!==(o=e[4].label+"")&&K(r,o),d&3&&u!==(u=Qo(e[0]===e[4].value?"active":"")+" svelte-iwm583")&&h(t,"class",u)},d(c){c&&P(t),a=!1,f()}}}function wi(e){let t,n,l,o;const r=[e[2]];var s=e[4].component;function u(a){let f={};for(let c=0;c{te(d,1)}),ye()}s?(n=At(s,u()),ne(n.$$.fragment),V(n.$$.fragment,1),ee(n,t,l)):n=null}else s&&n.$set(c)},i(a){o||(n&&V(n.$$.fragment,a),o=!0)},o(a){n&&z(n.$$.fragment,a),o=!1},d(a){a&&P(t),n&&te(n)}}}function yi(e){let t,n,l=e[0]==e[4].value&&wi(e);return{c(){l&&l.c(),t=Se()},m(o,r){l&&l.m(o,r),T(o,t,r),n=!0},p(o,r){o[0]==o[4].value?l?(l.p(o,r),r&3&&V(l,1)):(l=wi(o),l.c(),V(l,1),l.m(t.parentNode,t)):l&&(we(),z(l,1,1,()=>{l=null}),ye())},i(o){n||(V(l),n=!0)},o(o){z(l),n=!1},d(o){l&&l.d(o),o&&P(t)}}}function Fd(e){let t,n,l,o,r=e[1],s=[];for(let c=0;cz(a[c],1,1,()=>{a[c]=null});return{c(){t=R("ul");for(let c=0;c()=>n(0,o=u);return e.$$set=u=>{"items"in u&&n(1,l=u.items),"activeTabValue"in u&&n(0,o=u.activeTabValue),"tabProps"in u&&n(2,r=u.tabProps)},[o,l,r,s]}class Id extends ce{constructor(t){super(),de(this,t,Dd,Fd,fe,{items:1,activeTabValue:0,tabProps:2})}}function ki(e){let t;return{c(){t=H("Press ENTER to autofill with the RAG answer.")},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function Nd(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m=e[0].edited_answer===sl&&ki();return{c(){t=R("form"),n=R("textarea"),o=N(),r=R("div"),s=R("div"),m&&m.c(),u=N(),a=R("div"),f=R("button"),f.textContent="Update",c=N(),d=R("button"),d.textContent="Reset",h(n,"placeholder",l=e[0].answer),h(s,"class","note svelte-i9wciy"),h(r,"class","button-container svelte-i9wciy")},m(_,v){T(_,t,v),b(t,n),Ye(n,e[0].edited_answer),e[6](n),b(t,o),b(t,r),b(r,s),m&&m.m(s,null),b(r,u),b(r,a),b(a,f),b(a,c),b(a,d),g||(p=[x(n,"input",e[5]),x(n,"keydown",e[4]),x(f,"click",e[2]),x(d,"click",e[3])],g=!0)},p(_,[v]){v&1&&l!==(l=_[0].answer)&&h(n,"placeholder",l),v&1&&Ye(n,_[0].edited_answer),_[0].edited_answer===sl?m||(m=ki(),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},i:U,o:U,d(_){_&&P(t),e[6](null),m&&m.d(),g=!1,be(p)}}}const sl="";function Pd(e,t,n){let{message:l={}}=t,o;const r=async d=>{const g={id:l.id,new_answer:d},p=await fetch("/chat/rag_table/update_answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g)});if(p.ok)console.log("Answer updated successfully",p),n(0,l.edited_answer=d,l);else{const m=await p.text();alert(m)}},s=d=>{d.preventDefault(),r(l.edited_answer)},u=d=>{d.preventDefault(),r(sl)},a=d=>{d.key=="Enter"&&l.edited_answer===sl&&(d.preventDefault(),console.log("ENTER"),n(0,l.edited_answer=l.answer,l))};ft(function(){o.focus()});function f(){l.edited_answer=this.value,n(0,l)}function c(d){et[d?"unshift":"push"](()=>{o=d,n(1,o)})}return e.$$set=d=>{"message"in d&&n(0,l=d.message)},[l,o,s,u,a,f,c]}class Td extends ce{constructor(t){super(),de(this,t,Pd,Nd,fe,{message:0})}}function Si(e){let t,n,l,o,r,s;return{c(){t=R("div"),n=R("button"),n.textContent="👍",l=N(),o=R("button"),o.textContent="👎",h(n,"class","small-button thumbs-up svelte-1u8cd0w"),h(o,"class","small-button thumbs-down svelte-1u8cd0w"),h(t,"class","feedback-buttons svelte-1u8cd0w")},m(u,a){T(u,t,a),b(t,n),b(t,l),b(t,o),r||(s=[x(n,"click",e[4]),x(o,"click",e[5])],r=!0)},p:U,d(u){u&&P(t),r=!1,be(s)}}}function Od(e){let t,n=e[0].answer+"",l,o,r,s=e[1]&&Si(e);return{c(){t=R("div"),l=H(n),o=N(),s&&s.c(),r=Se()},m(u,a){T(u,t,a),b(t,l),T(u,o,a),s&&s.m(u,a),T(u,r,a)},p(u,[a]){a&1&&n!==(n=u[0].answer+"")&&K(l,n),u[1]?s?s.p(u,a):(s=Si(u),s.c(),s.m(r.parentNode,r)):s&&(s.d(1),s=null)},i:U,o:U,d(u){u&&P(t),u&&P(o),s&&s.d(u),u&&P(r)}}}async function Vd(e){const t=await fetch("/chat/rag_table/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)console.log("response",t);else{const n=await t.text();alert(n)}}function zd(e,t,n){let l;ue(e,qe,c=>n(6,l=c));let{message:o={}}=t,{feedback:r=!1}=t,{index:s=0}=t;function u(c,d,g){const p=l[g];p.vote=d;const m={id:g+1,vote_status:d};Vd(m),pt(c.currentTarget.parentNode).selectAll("button").style("border","3px solid transparent").style("opacity",.65),pt(c.currentTarget).style("border","3px solid var(--black)").style("opacity",1)}const a=c=>u(c,"up",s),f=c=>u(c,"down",s);return e.$$set=c=>{"message"in c&&n(0,o=c.message),"feedback"in c&&n(1,r=c.feedback),"index"in c&&n(2,s=c.index)},[o,r,s,u,a,f]}class Ld extends ce{constructor(t){super(),de(this,t,zd,Od,fe,{message:0,feedback:1,index:2})}}function Ci(e,t,n){const l=e.slice();return l[19]=t[n],l[21]=n,l}function $i(e,t){let n,l,o,r,s,u,a,f,c,d=t[19].question+"",g,p,m,_,v,w,y,C,M,$,F,S,A,k,E,I;return M=new Id({props:{items:t[8],tabProps:{message:t[19],feedback:t[0],index:t[21]}}}),F=new Ed({props:{sources:t[19].source,source_content:t[19].source_content}}),{key:e,first:null,c(){n=R("div"),l=R("div"),o=R("div"),r=N(),s=R("div"),u=R("div"),a=R("h5"),a.textContent="Question:",f=N(),c=R("p"),g=H(d),p=N(),m=R("div"),_=R("p"),_.textContent="ℹ️ Retrieval Sources",w=N(),y=R("div"),C=R("div"),ne(M.$$.fragment),$=N(),ne(F.$$.fragment),S=N(),h(o,"class","avatar"),h(a,"class","bold"),h(_,"class","bold"),h(m,"class","rag-sources svelte-vgv4ev"),h(u,"class","question svelte-vgv4ev"),h(C,"class","answer svelte-vgv4ev"),h(y,"class","answers svelte-vgv4ev"),h(s,"class","message-content svelte-vgv4ev"),h(l,"class","chat-message-center svelte-vgv4ev"),h(n,"class","chat-message svelte-vgv4ev"),this.first=n},m(D,L){T(D,n,L),b(n,l),b(l,o),b(l,r),b(l,s),b(s,u),b(u,a),b(u,f),b(u,c),b(c,g),b(u,p),b(u,m),b(m,_),b(s,w),b(s,y),b(y,C),ee(M,C,null),b(s,$),ee(F,s,null),b(n,S),k=!0,E||(I=[Cn(v=pd.call(null,_,Ai(t[19]))),Cn(A=Hd.call(null,n,t[21]===t[5].length-1))],E=!0)},p(D,L){t=D,(!k||L&32)&&d!==(d=t[19].question+"")&&K(g,d),v&&Ge(v.update)&&L&32&&v.update.call(null,Ai(t[19]));const O={};L&33&&(O.tabProps={message:t[19],feedback:t[0],index:t[21]}),M.$set(O);const B={};L&32&&(B.sources=t[19].source),L&32&&(B.source_content=t[19].source_content),F.$set(B),A&&Ge(A.update)&&L&32&&A.update.call(null,t[21]===t[5].length-1)},i(D){k||(V(M.$$.fragment,D),V(F.$$.fragment,D),k=!0)},o(D){z(M.$$.fragment,D),z(F.$$.fragment,D),k=!1},d(D){D&&P(n),te(M),te(F),E=!1,be(I)}}}function qd(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_=[],v=new Map,w,y,C,M,$,F,S,A,k,E=(e[2]?e[4]:"Send")+"",I,D,L,O,B,j,ae;function pe(Y){e[13](Y)}let W={table:"rag_table"};e[3]!==void 0&&(W.showModal=e[3]),t=new Io({props:W}),et.push(()=>An(t,"showModal",pe));let Q=e[5];const X=Y=>Y[21];for(let Y=0;Y👍 + button. If the response is not satisfactory, click on the + 👎 button.`,f=N(),c=R("button"),c.textContent="Download Data",d=N(),g=R("div"),p=R("section"),m=R("div");for(let Y=0;Y<_.length;Y+=1)_[Y].c();w=N(),y=R("div"),C=R("div"),ne(M.$$.fragment),$=N(),F=R("form"),S=R("input"),A=N(),k=R("button"),I=H(E),L=N(),O=R("p"),O.textContent="Note - may produce inaccurate information.",h(s,"class","underline bold svelte-vgv4ev"),h(a,"class","svelte-vgv4ev"),h(c,"class","svelte-vgv4ev"),h(r,"class","instructions svelte-vgv4ev"),h(m,"class","chat-log svelte-vgv4ev"),h(p,"class","chatbox svelte-vgv4ev"),h(S,"class","chat-input-textarea svelte-vgv4ev"),h(S,"placeholder","Type Question Here"),h(k,"class",D="btnyousend "+(e[1]===""?"":"active")+" svelte-vgv4ev"),h(k,"type","submit"),h(F,"class","chat-input-form svelte-vgv4ev"),h(C,"class","chat-and-question svelte-vgv4ev"),h(O,"class","message svelte-vgv4ev"),h(y,"class","chat-input-holder svelte-vgv4ev"),h(g,"class","ranked-chat svelte-vgv4ev"),h(o,"class","ranked-feedback-container svelte-vgv4ev")},m(Y,le){ee(t,Y,le),T(Y,l,le),T(Y,o,le),b(o,r),b(r,s),b(r,u),b(r,a),b(r,f),b(r,c),b(o,d),b(o,g),b(g,p),b(p,m);for(let he=0;he<_.length;he+=1)_[he]&&_[he].m(m,null);b(g,w),b(g,y),b(y,C),ee(M,C,null),b(C,$),b(C,F),b(F,S),Ye(S,e[1]),b(F,A),b(F,k),b(k,I),b(y,L),b(y,O),B=!0,j||(ae=[x(c,"click",e[10]),x(S,"input",e[14]),x(F,"submit",e[9])],j=!0)},p(Y,[le]){const he={};!n&&le&8&&(n=!0,he.showModal=Y[3],$n(()=>n=!1)),t.$set(he),le&289&&(Q=Y[5],we(),_=gt(_,le,X,1,Y,Q,v,m,sa,$i,null,Ci),ye());const Vn={};le&64&&(Vn.documents=Y[6]),M.$set(Vn),le&2&&S.value!==Y[1]&&Ye(S,Y[1]),(!B||le&20)&&E!==(E=(Y[2]?Y[4]:"Send")+"")&&K(I,E),(!B||le&2&&D!==(D="btnyousend "+(Y[1]===""?"":"active")+" svelte-vgv4ev"))&&h(k,"class",D)},i(Y){if(!B){V(t.$$.fragment,Y);for(let le=0;le{e.scrollIntoView({behavior:"smooth"})},0)}function Ai(e){return e.rag_sources.length===0?"No Sources":e.rag_sources.join(", ")}function Gd(e,t,n){let l,o,r,s;ue(e,qe,F=>n(5,o=F)),ue(e,oo,F=>n(16,r=F));let{feedback:u=!1}=t,{is_retrieval:a=!1}=t;const f=De([]);ue(e,f,F=>n(6,s=F));let c="",d="",g=!1,p=!1,m=[{label:"Answer",value:1,component:Ld},{label:"Modified Answer",value:2,component:Td}];ft(()=>{v(),_()});async function _(){const S=await(await fetch("/retrieval/file/get")).json();console.log("data",S.files);const k=S.files.map((E,I)=>({id:String(I),name:E.name}));console.log("files",k),Pe(f,s=[...k],s)}async function v(){const A=(await(await fetch("/chat/rag_table/retrieve")).json()).rows;console.log("Got data from db",A);const k=A.map(E=>({id:E[0],question:E[1],answer:E[2],edited_answer:E[3],vote_status:E[4],rag_sources:E[5],source:E[6],source_content:E[7]}));Pe(qe,o=[...k],o)}const w=async F=>{F.preventDefault(),c=d,n(1,d=""),n(2,g=!0);const S=[...r];let A={id:o.length+1,question:c,answer:"Loading...",rag_sources:S,vote_status:"na",source:["Loading..."],source_content:["Loading..."]};Pe(qe,o=[...o,A],o);const k=a?await fetch("/retrieval/new_message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c,file_names:S})}):await fetch(`/chat/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:c})});if(k.ok){const E=await k.json();console.log("response data",E),A.answer=E.answer,A.source=E.source,A.source_content=E.source_content,qe.update(I=>(I[I.length-1]=A,I))}else{const E=await k.text();alert(E)}n(2,g=!1)};let y=0;setInterval(()=>{n(12,y=(y+1)%4)},200);function C(){n(3,p=!0)}function M(F){p=F,n(3,p)}function $(){d=this.value,n(1,d)}return e.$$set=F=>{"feedback"in F&&n(0,u=F.feedback),"is_retrieval"in F&&n(11,a=F.is_retrieval)},e.$$.update=()=>{e.$$.dirty&4096&&n(4,l=".".repeat(y).padEnd(3))},[u,d,g,p,l,o,s,f,m,w,C,a,y,M,$]}class Bd extends ce{constructor(t){super(),de(this,t,Gd,qd,fe,{feedback:0,is_retrieval:11})}}function Ri(e){let t,n;return t=new No({props:{is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Mi(e){let t,n;return t=new No({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Ei(e){let t,n;return t=new Bd({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Fi(e){let t,n,l,o;const r=[xd,jd],s=[];function u(a,f){return a[1]?0:1}return t=u(e),n=s[t]=r[t](e),{c(){n.c(),l=Se()},m(a,f){s[t].m(a,f),T(a,l,f),o=!0},p(a,f){let c=t;t=u(a),t===c?s[t].p(a,f):(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),n=s[t],n?n.p(a,f):(n=s[t]=r[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){o||(V(n),o=!0)},o(a){z(n),o=!1},d(a){s[t].d(a),a&&P(l)}}}function jd(e){let t,n;return t=new fd({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p:U,i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function xd(e){let t,n;return t=new No({props:{feedback:!0,is_retrieval:e[1]}}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},p(l,o){const r={};o&2&&(r.is_retrieval=l[1]),t.$set(r)},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function Ud(e){let t,n,l,o,r,s=!e[0]&&Ri(e),u=e[0]==="vote"&&Mi(e),a=e[0]==="rag"&&Ei(e),f=e[0]==="rank"&&Fi(e);return{c(){s&&s.c(),t=N(),u&&u.c(),n=N(),a&&a.c(),l=N(),f&&f.c(),o=Se()},m(c,d){s&&s.m(c,d),T(c,t,d),u&&u.m(c,d),T(c,n,d),a&&a.m(c,d),T(c,l,d),f&&f.m(c,d),T(c,o,d),r=!0},p(c,[d]){c[0]?s&&(we(),z(s,1,1,()=>{s=null}),ye()):s?(s.p(c,d),d&1&&V(s,1)):(s=Ri(c),s.c(),V(s,1),s.m(t.parentNode,t)),c[0]==="vote"?u?(u.p(c,d),d&1&&V(u,1)):(u=Mi(c),u.c(),V(u,1),u.m(n.parentNode,n)):u&&(we(),z(u,1,1,()=>{u=null}),ye()),c[0]==="rag"?a?(a.p(c,d),d&1&&V(a,1)):(a=Ei(c),a.c(),V(a,1),a.m(l.parentNode,l)):a&&(we(),z(a,1,1,()=>{a=null}),ye()),c[0]==="rank"?f?(f.p(c,d),d&1&&V(f,1)):(f=Fi(c),f.c(),V(f,1),f.m(o.parentNode,o)):f&&(we(),z(f,1,1,()=>{f=null}),ye())},i(c){r||(V(s),V(u),V(a),V(f),r=!0)},o(c){z(s),z(u),z(a),z(f),r=!1},d(c){s&&s.d(c),c&&P(t),u&&u.d(c),c&&P(n),a&&a.d(c),c&&P(l),f&&f.d(c),c&&P(o)}}}function Wd(e,t,n){let{feedback:l}=t,{is_retrieval:o}=t;return e.$$set=r=>{"feedback"in r&&n(0,l=r.feedback),"is_retrieval"in r&&n(1,o=r.is_retrieval)},[l,o]}class Xd extends ce{constructor(t){super(),de(this,t,Wd,Ud,fe,{feedback:0,is_retrieval:1})}}function Di(e,t,n){const l=e.slice();return l[2]=t[n],l}function Ii(e){let t,n=e[2]+"",l,o;return{c(){t=R("option"),l=H(n),t.__value=o=e[2],t.value=t.__value},m(r,s){T(r,t,s),b(t,l)},p(r,s){s&1&&n!==(n=r[2]+"")&&K(l,n),s&1&&o!==(o=r[2])&&(t.__value=o,t.value=t.__value)},d(r){r&&P(t)}}}function Yd(e){let t,n=e[0],l=[];for(let o=0;o{const r=await fetch(`/data/${l}`);n(0,o=await r.json())}),e.$$set=r=>{"data_endpoint"in r&&n(1,l=r.data_endpoint)},[o,l]}class Kd extends ce{constructor(t){super(),de(this,t,Qd,Yd,fe,{data_endpoint:1})}}function Qt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Jd(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function $a(e){let t,n,l;e.length!==2?(t=Qt,n=(u,a)=>Qt(e(u),a),l=(u,a)=>e(u)-a):(t=e===Qt||e===Jd?e:Zd,n=e,l=e);function o(u,a,f=0,c=u.length){if(f>>1;n(u[d],a)<0?f=d+1:c=d}while(f>>1;n(u[d],a)<=0?f=d+1:c=d}while(ff&&l(u[d-1],a)>-l(u[d],a)?d-1:d}return{left:o,center:s,right:r}}function Zd(){return 0}function eh(e){return e===null?NaN:+e}function*th(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let l of e)(l=t(l,++n,e))!=null&&(l=+l)>=l&&(yield l)}}const nh=$a(Qt),lh=nh.right;$a(eh).center;const Aa=lh;function oh(e,t){let n=0;if(t===void 0)for(let l of e)l!=null&&(l=+l)>=l&&++n;else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(o=+o)>=o&&++n}return n}function ih(e,t){let n=0,l,o=0,r=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(l=s-o,o+=l/++n,r+=l*(s-o));else{let s=-1;for(let u of e)(u=t(u,++s,e))!=null&&(u=+u)>=u&&(l=u-o,o+=l/++n,r+=l*(u-o))}if(n>1)return r/(n-1)}function rh(e,t){const n=ih(e,t);return n&&Math.sqrt(n)}function _n(e,t){let n,l;if(t===void 0)for(const o of e)o!=null&&(n===void 0?o>=o&&(n=l=o):(n>o&&(n=o),l=r&&(n=l=r):(n>r&&(n=r),l{const l=e(t,n);return l||l===0?l:(e(n,n)===0)-(e(t,t)===0)}}function Ra(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}var dh=Array.prototype,hh=dh.slice;function Pl(e){return()=>e}const gh=Math.sqrt(50),ph=Math.sqrt(10),mh=Math.sqrt(2);function al(e,t,n){const l=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(l)),r=l/Math.pow(10,o),s=r>=gh?10:r>=ph?5:r>=mh?2:1;let u,a,f;return o<0?(f=Math.pow(10,-o)/s,u=Math.round(e*f),a=Math.round(t*f),u/ft&&--a,f=-f):(f=Math.pow(10,o)*s,u=Math.round(e/f),a=Math.round(t/f),u*ft&&--a),a0))return[];if(e===t)return[e];const l=t=o))return[];const u=r-o+1,a=new Array(u);if(l)if(s<0)for(let f=0;f0?(e=Math.floor(e/o)*o,t=Math.ceil(t/o)*o):o<0&&(e=Math.ceil(e*o)/o,t=Math.floor(t*o)/o),l=o}}function bh(e){return Math.max(1,Math.ceil(Math.log(oh(e))/Math.LN2)+1)}function Ea(){var e=fh,t=_n,n=bh;function l(o){Array.isArray(o)||(o=Array.from(o));var r,s=o.length,u,a,f=new Array(s);for(r=0;r=g)if(C>=g&&t===_n){const $=en(d,g,M);isFinite($)&&($>0?g=(Math.floor(g/$)+1)*$:$<0&&(g=(Math.ceil(g*-$)+1)/-$))}else p.pop()}for(var m=p.length,_=0,v=m;p[_]<=d;)++_;for(;p[v-1]>g;)--v;(_||v0?p[r-1]:d,y.x1=r0)for(r=0;r=l)&&(n=l);else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n=o)&&(n=o)}return n}function so(e,t){let n;if(t===void 0)for(const l of e)l!=null&&(n>l||n===void 0&&l>=l)&&(n=l);else{let l=-1;for(let o of e)(o=t(o,++l,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function Fa(e,t,n=0,l=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),l=Math.floor(Math.min(e.length-1,l)),!(n<=t&&t<=l))return e;for(o=o===void 0?Ra:ch(o);l>n;){if(l-n>600){const a=l-n+1,f=t-n+1,c=Math.log(a),d=.5*Math.exp(2*c/3),g=.5*Math.sqrt(c*d*(a-d)/a)*(f-a/2<0?-1:1),p=Math.max(n,Math.floor(t-f*d/a+g)),m=Math.min(l,Math.floor(t+(a-f)*d/a+g));Fa(e,t,p,m,o)}const r=e[t];let s=n,u=l;for(un(e,n,t),o(e[l],r)>0&&un(e,n,l);s0;)--u}o(e[n],r)===0?un(e,n,u):(++u,un(e,u,l)),u<=t&&(n=u+1),t<=u&&(l=u-1)}return e}function un(e,t,n){const l=e[t];e[t]=e[n],e[n]=l}function wh(e,t,n){if(e=Float64Array.from(th(e,n)),!(!(l=e.length)||isNaN(t=+t))){if(t<=0||l<2)return so(e);if(t>=1)return mt(e);var l,o=(l-1)*t,r=Math.floor(o),s=mt(Fa(e,r).subarray(0,r+1)),u=so(e.subarray(r+1));return s+(u-s)*(o-r)}}function yh(e,t){let n=0,l=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(++n,l+=o);else{let o=-1;for(let r of e)(r=t(r,++o,e))!=null&&(r=+r)>=r&&(++n,l+=r)}if(n)return l/n}function kh(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var l=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,r=new Array(o);++l=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ul(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 tn(e){return e=ul(Math.abs(e)),e?e[1]:NaN}function Ch(e,t){return function(n,l){for(var o=n.length,r=[],s=0,u=e[0],a=0;o>0&&u>0&&(a+u+1>l&&(u=Math.max(1,l-a)),r.push(n.substring(o-=u,o+u)),!((a+=u+1)>l));)u=e[s=(s+1)%e.length];return r.reverse().join(t)}}function $h(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ah=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fl(e){if(!(t=Ah.exec(e)))throw new Error("invalid format: "+e);var t;return new Po({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]})}fl.prototype=Po.prototype;function Po(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+""}Po.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,o;n0&&(l=0);break}return l>0?e.slice(0,l)+e.slice(o+1):e}var Da;function Mh(e,t){var n=ul(e,t);if(!n)return e+"";var l=n[0],o=n[1],r=o-(Da=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=l.length;return r===s?l:r>s?l+new Array(r-s+1).join("0"):r>0?l.slice(0,r)+"."+l.slice(r):"0."+new Array(1-r).join("0")+ul(e,Math.max(0,t+r-1))[0]}function Ti(e,t){var n=ul(e,t);if(!n)return e+"";var l=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+l:l.length>o+1?l.slice(0,o+1)+"."+l.slice(o+1):l+new Array(o-l.length+2).join("0")}const Oi={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Sh,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)=>Ti(e*100,t),r:Ti,s:Mh,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Vi(e){return e}var zi=Array.prototype.map,Li=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Eh(e){var t=e.grouping===void 0||e.thousands===void 0?Vi:Ch(zi.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",l=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",r=e.numerals===void 0?Vi:$h(zi.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=fl(d);var g=d.fill,p=d.align,m=d.sign,_=d.symbol,v=d.zero,w=d.width,y=d.comma,C=d.precision,M=d.trim,$=d.type;$==="n"?(y=!0,$="g"):Oi[$]||(C===void 0&&(C=12),M=!0,$="g"),(v||g==="0"&&p==="=")&&(v=!0,g="0",p="=");var F=_==="$"?n:_==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",S=_==="$"?l:/[%p]/.test($)?s:"",A=Oi[$],k=/[defgprs%]/.test($);C=C===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function E(I){var D=F,L=S,O,B,j;if($==="c")L=A(I)+L,I="";else{I=+I;var ae=I<0||1/I<0;if(I=isNaN(I)?a:A(Math.abs(I),C),M&&(I=Rh(I)),ae&&+I==0&&m!=="+"&&(ae=!1),D=(ae?m==="("?m:u:m==="-"||m==="("?"":m)+D,L=($==="s"?Li[8+Da/3]:"")+L+(ae&&m==="("?")":""),k){for(O=-1,B=I.length;++Oj||j>57){L=(j===46?o+I.slice(O+1):I.slice(O))+L,I=I.slice(0,O);break}}}y&&!v&&(I=t(I,1/0));var pe=D.length+I.length+L.length,W=pe>1)+D+I+L+W.slice(pe);break;default:I=W+D+I+L;break}return r(I)}return E.toString=function(){return d+""},E}function c(d,g){var p=f((d=fl(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(tn(g)/3)))*3,_=Math.pow(10,-m),v=Li[8+m/3];return function(w){return p(_*w)+v}}return{format:f,formatPrefix:c}}var qn,vt,Ia;Fh({thousands:",",grouping:[3],currency:["$",""]});function Fh(e){return qn=Eh(e),vt=qn.format,Ia=qn.formatPrefix,qn}function Dh(e){return Math.max(0,-tn(Math.abs(e)))}function Ih(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(tn(t)/3)))*3-tn(Math.abs(e)))}function Nh(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,tn(t)-tn(e))+1}function To(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ph(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 qi=Symbol("implicit");function Mt(){var e=new Ni,t=[],n=[],l=qi;function o(r){let s=e.get(r);if(s===void 0){if(l!==qi)return l;e.set(r,s=t.push(r)-1)}return n[s%n.length]}return o.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new Ni;for(const s of r)e.has(s)||e.set(s,t.push(s)-1);return o},o.range=function(r){return arguments.length?(n=Array.from(r),o):n.slice()},o.unknown=function(r){return arguments.length?(l=r,o):l},o.copy=function(){return Mt(t,n).unknown(l)},To.apply(o,arguments),o}function Lt(){var e=Mt().unknown(void 0),t=e.domain,n=e.range,l=0,o=1,r,s,u=!1,a=0,f=0,c=.5;delete e.unknown;function d(){var g=t().length,p=o>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hn(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=Oh.exec(e))?new He(t[1],t[2],t[3],1):(t=Vh.exec(e))?new He(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zh.exec(e))?Hn(t[1],t[2],t[3],t[4]):(t=Lh.exec(e))?Hn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qh.exec(e))?Xi(t[1],t[2]/100,t[3]/100,1):(t=Hh.exec(e))?Xi(t[1],t[2]/100,t[3]/100,t[4]):Gi.hasOwnProperty(e)?xi(Gi[e]):e==="transparent"?new He(NaN,NaN,NaN,0):null}function xi(e){return new He(e>>16&255,e>>8&255,e&255,1)}function Hn(e,t,n,l){return l<=0&&(e=t=n=NaN),new He(e,t,n,l)}function jh(e){return e instanceof Nn||(e=Dn(e)),e?(e=e.rgb(),new He(e.r,e.g,e.b,e.opacity)):new He}function ao(e,t,n,l){return arguments.length===1?jh(e):new He(e,t,n,l??1)}function He(e,t,n,l){this.r=+e,this.g=+t,this.b=+n,this.opacity=+l}Oo(He,ao,Pa(Nn,{brighter(e){return e=e==null?cl:Math.pow(cl,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?En:Math.pow(En,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(Vt(this.r),Vt(this.g),Vt(this.b),dl(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:Ui,formatHex:Ui,formatHex8:xh,formatRgb:Wi,toString:Wi}));function Ui(){return`#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}`}function xh(){return`#${Tt(this.r)}${Tt(this.g)}${Tt(this.b)}${Tt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wi(){const e=dl(this.opacity);return`${e===1?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${e===1?")":`, ${e})`}`}function dl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tt(e){return e=Vt(e),(e<16?"0":"")+e.toString(16)}function Xi(e,t,n,l){return l<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Je(e,t,n,l)}function Ta(e){if(e instanceof Je)return new Je(e.h,e.s,e.l,e.opacity);if(e instanceof Nn||(e=Dn(e)),!e)return new Je;if(e instanceof Je)return e;e=e.rgb();var t=e.r/255,n=e.g/255,l=e.b/255,o=Math.min(t,n,l),r=Math.max(t,n,l),s=NaN,u=r-o,a=(r+o)/2;return u?(t===r?s=(n-l)/u+(n0&&a<1?0:s,new Je(s,u,a,e.opacity)}function Uh(e,t,n,l){return arguments.length===1?Ta(e):new Je(e,t,n,l??1)}function Je(e,t,n,l){this.h=+e,this.s=+t,this.l=+n,this.opacity=+l}Oo(Je,Uh,Pa(Nn,{brighter(e){return e=e==null?cl:Math.pow(cl,e),new Je(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?En:Math.pow(En,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,l=n+(n<.5?n:1-n)*t,o=2*n-l;return new He(Tl(e>=240?e-240:e+120,o,l),Tl(e,o,l),Tl(e<120?e+240:e-120,o,l),this.opacity)},clamp(){return new Je(Yi(this.h),Gn(this.s),Gn(this.l),dl(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=dl(this.opacity);return`${e===1?"hsl(":"hsla("}${Yi(this.h)}, ${Gn(this.s)*100}%, ${Gn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yi(e){return e=(e||0)%360,e<0?e+360:e}function Gn(e){return Math.max(0,Math.min(1,e||0))}function Tl(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 Vo=e=>()=>e;function Wh(e,t){return function(n){return e+n*t}}function Xh(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 Yh(e){return(e=+e)==1?Oa:function(t,n){return n-t?Xh(t,n,e):Vo(isNaN(t)?n:t)}}function Oa(e,t){var n=t-e;return n?Wh(e,n):Vo(isNaN(e)?t:e)}const uo=function e(t){var n=Yh(t);function l(o,r){var s=n((o=ao(o)).r,(r=ao(r)).r),u=n(o.g,r.g),a=n(o.b,r.b),f=Oa(o.opacity,r.opacity);return function(c){return o.r=s(c),o.g=u(c),o.b=a(c),o.opacity=f(c),o+""}}return l.gamma=e,l}(1);function Qh(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,l=t.slice(),o;return function(r){for(o=0;on&&(r=t.slice(n,r),u[s]?u[s]+=r:u[++s]=r),(l=l[0])===(o=o[0])?u[s]?u[s]+=o:u[++s]=o:(u[++s]=null,a.push({i:s,x:hl(l,o)})),n=Ol.lastIndex;return nt&&(n=e,e=t,t=n),function(l){return Math.max(e,Math.min(t,l))}}function sg(e,t,n){var l=e[0],o=e[1],r=t[0],s=t[1];return o2?ag:sg,a=f=null,d}function d(g){return g==null||isNaN(g=+g)?r:(a||(a=u(e.map(l),t,n)))(l(s(g)))}return d.invert=function(g){return s(o((f||(f=u(t,e.map(l),hl)))(g)))},d.domain=function(g){return arguments.length?(e=Array.from(g,ig),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=Va,c()},d.clamp=function(g){return arguments.length?(s=g?!0:kt,c()):s!==kt},d.interpolate=function(g){return arguments.length?(n=g,c()):n},d.unknown=function(g){return arguments.length?(r=g,d):r},function(g,p){return l=g,o=p,c()}}function cg(){return fg()(kt,kt)}function dg(e,t,n,l){var o=_h(e,t,n),r;switch(l=fl(l??",f"),l.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return l.precision==null&&!isNaN(r=Ih(o,s))&&(l.precision=r),Ia(l,s)}case"":case"e":case"g":case"p":case"r":{l.precision==null&&!isNaN(r=Nh(o,Math.max(Math.abs(e),Math.abs(t))))&&(l.precision=r-(l.type==="e"));break}case"f":case"%":{l.precision==null&&!isNaN(r=Dh(o))&&(l.precision=r-(l.type==="%")*2);break}}return vt(l)}function za(e){var t=e.domain;return e.ticks=function(n){var l=t();return Ma(l[0],l[l.length-1],n??10)},e.tickFormat=function(n,l){var o=t();return dg(o[0],o[o.length-1],n??10,l)},e.nice=function(n){n==null&&(n=10);var l=t(),o=0,r=l.length-1,s=l[o],u=l[r],a,f,c=10;for(u0;){if(f=en(s,u,n),f===a)return l[o]=s,l[r]=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 We(){var e=cg();return e.copy=function(){return ug(e,We())},To.apply(e,arguments),za(e)}function hg(){var e=0,t=1,n,l,o,r,s=kt,u=!1,a;function f(d){return d==null||isNaN(d=+d)?a:s(o===0?.5:(d=(r(d)-n)*o,u?Math.max(0,Math.min(1,d)):d))}f.domain=function(d){return arguments.length?([e,t]=d,n=r(e=+e),l=r(t=+t),o=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(Pn),f.rangeRound=c(Va),f.unknown=function(d){return arguments.length?(a=d,f):a},function(d){return r=d,n=d(e),l=d(t),o=n===l?0:1/(l-n),f}}function gg(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function La(){var e=za(hg()(kt));return e.copy=function(){return gg(e,La())},Ph.apply(e,arguments)}function nt(e){return function(){return e}}const ho=Math.PI,go=2*ho,It=1e-6,pg=go-It;function qa(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return qa;const n=10**t;return function(l){this._+=l[0];for(let o=1,r=l.length;oIt)if(!(Math.abs(d*a-f*c)>It)||!r)this._append`L${this._x1=t},${this._y1=n}`;else{let p=l-s,m=o-u,_=a*a+f*f,v=p*p+m*m,w=Math.sqrt(_),y=Math.sqrt(g),C=r*Math.tan((ho-Math.acos((_+g-v)/(2*w*y)))/2),M=C/y,$=C/w;Math.abs(M-1)>It&&this._append`L${t+M*c},${n+M*d}`,this._append`A${r},${r},0,0,${+(d*p>c*m)},${this._x1=t+$*a},${this._y1=n+$*f}`}}arc(t,n,l,o,r,s){if(t=+t,n=+n,l=+l,s=!!s,l<0)throw new Error(`negative radius: ${l}`);let u=l*Math.cos(o),a=l*Math.sin(o),f=t+u,c=n+a,d=1^s,g=s?o-r:r-o;this._x1===null?this._append`M${f},${c}`:(Math.abs(this._x1-f)>It||Math.abs(this._y1-c)>It)&&this._append`L${f},${c}`,l&&(g<0&&(g=g%go+go),g>pg?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>It&&this._append`A${l},${l},0,${+(g>=ho)},${d},${this._x1=t+l*Math.cos(r)},${this._y1=n+l*Math.sin(r)}`)}rect(t,n,l,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${l=+l}v${+o}h${-l}Z`}toString(){return this._}}function vg(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 _g(t)}function Ha(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ga(e){this._context=e}Ga.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 bg(e){return new Ga(e)}function wg(e){return e[0]}function yg(e){return e[1]}function kg(e,t){var n=nt(!0),l=null,o=bg,r=null,s=vg(u);e=typeof e=="function"?e:e===void 0?wg:nt(e),t=typeof t=="function"?t:t===void 0?yg:nt(t);function u(a){var f,c=(a=Ha(a)).length,d,g=!1,p;for(l==null&&(r=o(p=s())),f=0;f<=c;++f)!(f1)for(var n=1,l,o,r=e[t[0]],s,u=r.length;n=0;)n[t]=t;return n}function Sg(e,t){return e[t]}function Cg(e){const t=[];return t.key=e,t}function $g(){var e=nt([]),t=mo,n=po,l=Sg;function o(r){var s=Array.from(e.apply(this,arguments),Cg),u,a=s.length,f=-1,c;for(const d of r)for(u=0,++f;uFeedback Distribution

",n=N(),l=R("div"),o=G("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,o);for(let c=0;cn(15,d=A)),ue(e,Zo,A=>n(4,g=A)),ue(e,qe,A=>n(16,p=A));let m=300,_=300;const v={up:2,down:1,"n/a":0,all:"all"},w={top:10,bottom:10,left:25,right:5},y=Mt().range(["var(--yellow)","var(--red)","var(--green)"]),C=vt(".0%");function M(A,k){l===A?n(5,l="all"):n(5,l=A),Pe(st,d=l==="all"?"all":k,d)}const $=(A,k)=>M(A,k.key),F=(A,k)=>M(A,k.key);function S(){_=this.offsetWidth,m=this.offsetHeight,n(1,_),n(0,m)}return e.$$.update=()=>{e.$$.dirty&32768&&n(5,l=v[d]),e.$$.dirty&2&&n(3,o=_-w.left-w.right),e.$$.dirty&1&&n(14,r=m-w.top-w.bottom),e.$$.dirty&65552&&p.forEach(A=>{Pe(Zo,g[A.vote_status]++,g)}),e.$$.dirty&16&&n(2,s=g.up+g.down+g["n/a"]),e.$$.dirty&16384&&n(8,u=Lt().rangeRound([w.top,r-w.bottom]).padding(0).domain(["a"])),e.$$.dirty&12&&n(7,a=We().rangeRound([w.left,o-w.right]).domain([0,s])),e.$$.dirty&8208&&n(6,c=f([g]))},n(13,f=$g().keys(["n/a","down","up"]).order(mo).offset(po)),[m,_,s,o,g,l,c,a,u,w,y,C,M,f,r,d,p,$,F,S]}class Ba extends ce{constructor(t){super(),de(this,t,Rg,Ag,fe,{})}}function Mg(e){let t,n,l,o,r,s,u,a,f,c,d,g=e[3][e[2]]+"",p,m;return{c(){t=R("div"),n=R("div"),l=H("Q: "),o=H(e[0]),r=N(),s=R("div"),u=H("A: "),a=H(e[1]),f=N(),c=R("div"),d=H("Rating: "),p=H(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(_,t,v),b(t,n),b(n,l),b(n,o),b(t,r),b(t,s),b(s,u),b(s,a),b(t,f),b(t,c),b(c,d),b(c,p)},p(_,[v]){v&1&&K(o,_[0]),v&2&&K(a,_[1]),v&4&&g!==(g=_[3][_[2]]+"")&&K(p,g),v&4&&m!==(m="feedback "+_[2]+" svelte-szi0e")&&h(c,"class",m)},i:U,o:U,d(_){_&&P(t)}}}function Eg(e,t,n){let{question:l="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:r="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,o=u.answer),"feedback"in u&&n(2,r=u.feedback)},[l,o,r,s]}class Fg extends ce{constructor(t){super(),de(this,t,Eg,Mg,fe,{question:0,answer:1,feedback:2})}}function tr(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 nr(e){let t,n,l,o,r;return n=new Fg({props:{question:e[5],answer:e[6],feedback:e[7]}}),{c(){t=R("div"),ne(n.$$.fragment),l=N()},m(s,u){T(s,t,u),ee(n,t,null),b(t,l),r=!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){r||(V(n.$$.fragment,s),s&&Me(()=>{r&&(o||(o=lt(t,e[1],{duration:300},!0)),o.run(1))}),r=!0)},o(s){z(n.$$.fragment,s),s&&(o||(o=lt(t,e[1],{duration:300},!1)),o.run(0)),r=!1},d(s){s&&P(t),te(n),s&&o&&o.end()}}}function Dg(e){let t,n,l=e[0],o=[];for(let s=0;sz(o[s],1,1,()=>{o[s]=null});return{c(){t=R("div");for(let s=0;sn(4,o=a)),ue(e,st,a=>n(2,r=a)),ue(e,Rn,a=>n(3,s=a));const u=(a,{delay:f=0,duration:c=1e3,easing:d=Eo})=>Mn(a,{delay:f,duration:c,easing:d});return e.$$.update=()=>{e.$$.dirty&12&&n(0,l=r==="all"?s:s.filter(a=>a.vote_status===r)),e.$$.dirty&1&&Pe(lo,o=gd(l),o)},[l,u,r,s]}class ja extends ce{constructor(t){super(),de(this,t,Ig,Dg,fe,{})}}function lr(e,t,n){const l=e.slice();return l[13]=t[n],l}function or(e,t,n){const l=e.slice();return l[16]=t[n],l}function ir(e,t,n){const l=e.slice();return l[16]=t[n],l}function rr(e){let t,n,l,o,r=e[16]+"",s,u;return{c(){t=G("g"),n=G("line"),o=G("text"),s=H(r),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(o,"class","axis-text svelte-1oikip4"),h(o,"y","15"),h(o,"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,o),b(o,s)},p(a,f){f&4&&l!==(l=-a[2]+a[10].bottom+a[10].top)&&h(n,"y2",l),f&16&&r!==(r=a[16]+"")&&K(s,r),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&&P(t)}}}function sr(e){let t,n,l,o;return{c(){t=G("g"),n=G("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",o=`translate(${e[10].left} ${e[5](e[16])+0})`)},m(r,s){T(r,t,s),b(t,n)},p(r,s){s&8&&l!==(l=r[3]-r[10].right-r[10].left)&&h(n,"x2",l),s&32&&o!==(o=`translate(${r[10].left} ${r[5](r[16])+0})`)&&h(t,"transform",o)},d(r){r&&P(t)}}}function ar(e){let t,n,l,o,r,s,u,a,f=Math.round(e[11](e[13].count))+"",c,d,g;return{c(){t=G("g"),n=G("rect"),a=G("text"),c=H(f),h(n,"x",l=e[6](e[13].question)),h(n,"y",o=e[5](e[13].count)),h(n,"height",r=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&&o!==(o=p[5](p[13].count))&&h(n,"y",o),m&52&&r!==(r=p[2]-p[5](p[13].count)-p[10].bottom)&&h(n,"height",r),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))+"")&&K(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&&P(t)}}}function Ng(e){let t,n,l,o,r,s,u=e[8][e[7]]+"",a,f,c,d,g,p,m,_,v,w=e[4].map(ur),y=[];for(let S=0;Se[12].call(t))},m(S,A){T(S,t,A),b(t,n);for(let k=0;ke.question;function Pg(e,t,n){let l,o,r,s,u,a;ue(e,lo,v=>n(4,u=v)),ue(e,st,v=>n(7,a=v));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=vt(".1f");function _(){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,o=d-p.top-p.bottom),e.$$.dirty&24&&n(6,r=Lt().rangeRound([p.left,l-p.right]).padding(.05).domain(u.map(v=>v.question))),e.$$.dirty&20&&n(5,s=We().rangeRound([o-p.bottom,p.top]).domain([0,mt(u,v=>v.count)])),e.$$.dirty&16&&console.log(u)},[d,g,o,l,u,s,r,a,f,c,p,m,_]}class xa extends ce{constructor(t){super(),de(this,t,Pg,Ng,fe,{})}}function fr(e,t,n){const l=e.slice();l[19]=t[n];const o=l[7](l[19].x1)-l[7](l[19].x0);return l[20]=o,l}function cr(e,t,n){const l=e.slice();return l[23]=t[n],l}function dr(e){let t,n,l,o,r=e[23]+"",s,u;return{c(){t=G("g"),n=G("line"),o=G("text"),s=H(r),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(o,"class","axis-text svelte-kz2qh6"),h(o,"y","15"),h(o,"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,o),b(o,s)},p(a,f){f&4&&l!==(l=-a[2]+a[9].bottom+a[9].top)&&h(n,"y2",l),f&128&&r!==(r=a[23]+"")&&K(s,r),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&&P(t)}}}function hr(e){let t,n,l,o,r,s,u;return{c(){t=G("g"),n=G("rect"),h(n,"x",l=e[7](e[19].x0)+1),h(n,"width",o=e[20]),h(n,"y",r=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&&o!==(o=a[20])&&h(n,"width",o),f&72&&r!==(r=a[6](a[19].length))&&h(n,"y",r),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&&P(t)}}}function Tg(e){let t,n,l,o,r,s,u,a,f,c,d,g=e[7].ticks(),p=[];for(let v=0;ve[14].call(t))},m(v,w){T(v,t,w),b(t,n);for(let y=0;yn(5,d=C)),ue(e,qe,C=>n(13,g=C));const p={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let m=300,_=300,v={top:15,bottom:10,left:25,right:5};vt(".1f");let w=Array.from({length:gr},(C,M)=>M);function y(){_=this.offsetWidth,m=this.offsetHeight,n(1,_),n(0,m)}return e.$$.update=()=>{e.$$.dirty&8224&&n(12,l=d==="all"?g:g.filter(C=>C.vote_status===d)),e.$$.dirty&4096&&n(11,o=Ca(l)),e.$$.dirty&2&&n(4,r=_-v.left-v.right),e.$$.dirty&1&&n(2,s=m-v.top-v.bottom),e.$$.dirty&2048&&n(3,u=Ea().thresholds(w).value(C=>C.answer)(o)),e.$$.dirty&16&&n(7,a=We().domain([3,gr]).range([v.left,r-v.right])),e.$$.dirty&12&&n(6,f=We().domain([0,mt(u,C=>C.length)]).range([s-v.bottom,v.top])),e.$$.dirty&2048&&n(10,c=mt(o,C=>C.length)),e.$$.dirty&1056&&We().domain([0,c]).range(["white",p[d]]).interpolate(Pn)},[m,_,s,u,r,d,f,a,p,v,c,o,l,g,y]}class Ua extends ce{constructor(t){super(),de(this,t,Og,Tg,fe,{})}}function pr(e,t,n){const l=e.slice();l[18]=t[n];const o=l[7](l[18].x1)-l[7](l[18].x0);return l[19]=o,l}function mr(e,t,n){const l=e.slice();return l[22]=t[n],l}function _r(e){let t,n,l,o,r=e[22]+"",s,u;return{c(){t=G("g"),n=G("line"),o=G("text"),s=H(r),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(o,"class","axis-text svelte-kz2qh6"),h(o,"y","15"),h(o,"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,o),b(o,s)},p(a,f){f&4&&l!==(l=-a[2]+a[9].bottom+a[9].top)&&h(n,"y2",l),f&128&&r!==(r=a[22]+"")&&K(s,r),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&&P(t)}}}function vr(e){let t,n,l,o,r,s,u;return{c(){t=G("g"),n=G("rect"),h(n,"x",l=e[7](e[18].x0)+1),h(n,"width",o=e[19]),h(n,"y",r=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&&o!==(o=a[19])&&h(n,"width",o),f&72&&r!==(r=a[6](a[18].length))&&h(n,"y",r),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&&P(t)}}}function Vg(e){let t,n,l,o,r,s,u,a,f,c,d,g=e[7].ticks(),p=[];for(let v=0;ve[13].call(t))},m(v,w){T(v,t,w),b(t,n);for(let y=0;yn(5,c=y)),ue(e,qe,y=>n(12,d=y));const g={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"#bfbfbf"};let p=300,m=300,_={top:15,bottom:10,left:25,right:5},v=Array.from({length:br},(y,C)=>C);Mt().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,o=Ca(l)),e.$$.dirty&2&&n(4,r=m-_.left-_.right),e.$$.dirty&1&&n(2,s=p-_.top-_.bottom),e.$$.dirty&1024&&n(3,u=Ea().thresholds(v).value(y=>y.question)(o)),e.$$.dirty&16&&n(7,a=We().domain([3,br]).range([_.left,r-_.right])),e.$$.dirty&12&&n(6,f=We().domain([0,mt(u,y=>y.length)]).range([s-_.bottom,_.top])),e.$$.dirty&1024&&mt(o,y=>y.length)},[p,m,s,u,r,c,f,a,g,_,o,l,d,w]}class Wa extends ce{constructor(t){super(),de(this,t,zg,Vg,fe,{})}}function Lg(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m=Math.round(e[5](e[3]))+"",_,v,w,y,C,M,$,F;return{c(){t=R("div"),n=R("div"),l=R("p"),l.textContent="Questions",o=N(),r=R("select"),s=R("option"),s.textContent="All",u=R("option"),u.textContent="Good",a=R("option"),a.textContent="Bad",f=R("option"),f.textContent="N/A",c=N(),d=R("div"),g=G("svg"),p=G("text"),_=H(m),C=N(),M=R("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(r,"id","feedback-dropdown"),h(r,"name","feedback-dropdown"),Re(r,"background",e[6][e[0]]),h(r,"class","svelte-1pknxov"),e[0]===void 0&&Me(()=>e[9].call(r)),h(n,"class","svelte-1pknxov"),h(p,"dominant-baseline","middle"),h(p,"x",v=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"),Me(()=>e[10].call(d)),h(M,"class","small svelte-1pknxov"),h(t,"class","card-container svelte-1pknxov"),Re(t,"background",e[6][e[0]])},m(S,A){T(S,t,A),b(t,n),b(n,l),b(n,o),b(n,r),b(r,s),b(r,u),b(r,a),b(r,f),ll(r,e[0],!0),b(t,c),b(t,d),b(d,g),b(g,p),b(p,_),y=ut(d,e[10].bind(d)),b(t,C),b(t,M),$||(F=x(r,"change",e[9]),$=!0)},p(S,[A]){A&1&&Re(r,"background",S[6][S[0]]),A&1&&ll(r,S[0]),A&8&&m!==(m=Math.round(S[5](S[3]))+"")&&K(_,m),A&4&&v!==(v=S[2]/2)&&h(p,"x",v),A&2&&w!==(w=S[1]/2)&&h(p,"y",w),A&4&&h(g,"width",S[2]),A&2&&h(g,"height",S[1]),A&1&&Re(t,"background",S[6][S[0]])},i:U,o:U,d(S){S&&P(t),y(),$=!1,F()}}}function qg(e,t){return t==="all"?e.length:e.filter(l=>l.vote_status===t).length}function Hg(e,t,n){let l,o,r,s;ue(e,st,m=>n(0,o=m)),ue(e,qe,m=>n(8,r=m));let u,a,f=Fo(0);ue(e,f,m=>n(3,s=m));const c=vt(".1f"),d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){o=ia(this),st.set(o)}function p(){a=this.clientWidth,u=this.clientHeight,n(2,a),n(1,u)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,l=qg(r,o)),e.$$.dirty&128&&console.log("fbc",l),e.$$.dirty&128&&f.set(l)},[o,u,a,s,f,c,d,l,r,g,p]}class Xa extends ce{constructor(t){super(),de(this,t,Hg,Lg,fe,{})}}function Gg(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m=e[5](e[3])+"",_,v,w,y,C,M,$,F;return{c(){t=R("div"),n=R("div"),l=R("p"),l.textContent="Questions",o=N(),r=R("select"),s=R("option"),s.textContent="All",u=R("option"),u.textContent="Good",a=R("option"),a.textContent="Bad",f=R("option"),f.textContent="N/A",c=N(),d=R("div"),g=G("svg"),p=G("text"),_=H(m),C=N(),M=R("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(r,"id","feedback-dropdown"),h(r,"name","feedback-dropdown"),Re(r,"background",e[6][e[0]]),h(r,"class","svelte-mchgj2"),e[0]===void 0&&Me(()=>e[9].call(r)),h(p,"dominant-baseline","middle"),h(p,"x",v=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"),Me(()=>e[10].call(d)),h(M,"class","small svelte-mchgj2"),h(t,"class","card-container svelte-mchgj2"),Re(t,"background",e[6][e[0]])},m(S,A){T(S,t,A),b(t,n),b(n,l),b(n,o),b(n,r),b(r,s),b(r,u),b(r,a),b(r,f),ll(r,e[0],!0),b(t,c),b(t,d),b(d,g),b(g,p),b(p,_),y=ut(d,e[10].bind(d)),b(t,C),b(t,M),$||(F=x(r,"change",e[9]),$=!0)},p(S,[A]){A&1&&Re(r,"background",S[6][S[0]]),A&1&&ll(r,S[0]),A&8&&m!==(m=S[5](S[3])+"")&&K(_,m),A&4&&v!==(v=S[2]/2)&&h(p,"x",v),A&2&&w!==(w=S[1]/2)&&h(p,"y",w),A&4&&h(g,"width",S[2]),A&2&&h(g,"height",S[1]),A&1&&Re(t,"background",S[6][S[0]])},i:U,o:U,d(S){S&&P(t),y(),$=!1,F()}}}function Bg(e,t){const n=e.length;return t==="all"?1:e.filter(o=>o.vote_status===t).length/n}function jg(e,t,n){let l,o,r,s;ue(e,st,m=>n(0,o=m)),ue(e,qe,m=>n(8,r=m));let u,a,f=Fo(0);ue(e,f,m=>n(3,s=m));const c=vt(".1%"),d={up:"#00ebc7",down:"#FF5470","n/a":"#fde24f",all:"var(--white)"};function g(){o=ia(this),st.set(o)}function p(){a=this.clientWidth,u=this.clientHeight,n(2,a),n(1,u)}return e.$$.update=()=>{e.$$.dirty&257&&n(7,l=Bg(r,o)),e.$$.dirty&128&&f.set(l)},[o,u,a,s,f,c,d,l,r,g,p]}class Ya extends ce{constructor(t){super(),de(this,t,jg,Gg,fe,{})}}function xg(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_,v,w,y,C,M,$,F,S,A,k,E,I;return r=new Xa({}),a=new Ya({}),d=new Ba({}),m=new xa({props:{feedback:"Bad"}}),w=new Wa({}),M=new Ua({}),E=new ja({}),{c(){t=R("div"),n=R("div"),l=R("div"),o=R("div"),ne(r.$$.fragment),s=N(),u=R("div"),ne(a.$$.fragment),f=N(),c=R("div"),ne(d.$$.fragment),g=N(),p=R("div"),ne(m.$$.fragment),_=N(),v=R("div"),ne(w.$$.fragment),y=N(),C=R("div"),ne(M.$$.fragment),$=N(),F=R("div"),S=R("div"),S.innerHTML=`
+
`,A=N(),k=R("div"),ne(E.$$.fragment),h(o,"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(v,"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(k,"class","right-table svelte-14znspc"),h(F,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(D,L){T(D,t,L),b(t,n),b(n,l),b(l,o),ee(r,o,null),b(l,s),b(l,u),ee(a,u,null),b(n,f),b(n,c),ee(d,c,null),b(n,g),b(n,p),ee(m,p,null),b(n,_),b(n,v),ee(w,v,null),b(n,y),b(n,C),ee(M,C,null),b(t,$),b(t,F),b(F,S),b(F,A),b(F,k),ee(E,k,null),I=!0},p:U,i(D){I||(V(r.$$.fragment,D),V(a.$$.fragment,D),V(d.$$.fragment,D),V(m.$$.fragment,D),V(w.$$.fragment,D),V(M.$$.fragment,D),V(E.$$.fragment,D),I=!0)},o(D){z(r.$$.fragment,D),z(a.$$.fragment,D),z(d.$$.fragment,D),z(m.$$.fragment,D),z(w.$$.fragment,D),z(M.$$.fragment,D),z(E.$$.fragment,D),I=!1},d(D){D&&P(t),te(r),te(a),te(d),te(m),te(w),te(M),te(E)}}}function Ug(e,t,n){let l;ue(e,Rn,r=>n(0,l=r)),ft(()=>{o()});async function o(){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]}));Pe(Rn,l=[...a],l)}return[]}class Qa extends ce{constructor(t){super(),de(this,t,Ug,xg,fe,{})}}/**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,l)}return n}function at(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function Yg(e,t){if(e==null)return{};var n=Xg(e,t),l,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}var Qg="1.15.0";function ht(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var bt=ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Tn=ht(/Edge/i),yr=ht(/firefox/i),vn=ht(/safari/i)&&!ht(/chrome/i)&&!ht(/android/i),Ka=ht(/iP(ad|od|hone)/i),Ja=ht(/chrome/i)&&ht(/android/i),Za={capture:!1,passive:!1};function me(e,t,n){e.addEventListener(t,n,!bt&&Za)}function ge(e,t,n){e.removeEventListener(t,n,!bt&&Za)}function gl(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 Kg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function tt(e,t,n,l){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&gl(e,t):gl(e,t))||l&&e===n)return e;if(e===n)break}while(e=Kg(e))}return null}var kr=/\s+/g;function je(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var l=(" "+e.className+" ").replace(kr," ").replace(" "+t+" "," ");e.className=(l+(n?" "+t:"")).replace(kr," ")}}function Z(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 Jt(e,t){var n="";if(typeof e=="string")n=e;else do{var l=Z(e,"transform");l&&l!=="none"&&(n=l+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function eu(e,t,n){if(e){var l=e.getElementsByTagName(t),o=0,r=l.length;if(n)for(;o=r:s=o<=r,!s)return l;if(l===rt())break;l=Ct(l,!1)}return!1}function nn(e,t,n,l){for(var o=0,r=0,s=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},o=l.evt,r=Yg(l,ip);On.pluginEvent.bind(J)(t,n,at({dragEl:q,parentEl:Ae,ghostEl:re,rootEl:ke,nextEl:Nt,lastDownEl:Jn,cloneEl:Ce,cloneHidden:yt,dragStarted:dn,putSortable:Ie,activeSortable:J.active,originalEvent:o,oldIndex:Wt,oldDraggableIndex:wn,newIndex:xe,newDraggableIndex:wt,hideGhostForTarget:su,unhideGhostForTarget:au,cloneNowHidden:function(){yt=!0},cloneNowShown:function(){yt=!1},dispatchSortableEvent:function(u){Te({sortable:n,name:u,originalEvent:o})}},r))};function Te(e){op(at({putSortable:Ie,cloneEl:Ce,targetEl:q,rootEl:ke,oldIndex:Wt,oldDraggableIndex:wn,newIndex:xe,newDraggableIndex:wt},e))}var q,Ae,re,ke,Nt,Jn,Ce,yt,Wt,xe,wn,wt,Bn,Ie,Ut=!1,pl=!1,ml=[],Ft,Ke,Ll,ql,$r,Ar,dn,jt,yn,kn=!1,jn=!1,Zn,Ne,Hl=[],_o=!1,_l=[],Rl=typeof document<"u",xn=Ka,Rr=Tn||bt?"cssFloat":"float",rp=Rl&&!Ja&&!Ka&&"draggable"in document.createElement("div"),ou=function(){if(Rl){if(bt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),iu=function(t,n){var l=Z(t),o=parseInt(l.width)-parseInt(l.paddingLeft)-parseInt(l.paddingRight)-parseInt(l.borderLeftWidth)-parseInt(l.borderRightWidth),r=nn(t,0,n),s=nn(t,1,n),u=r&&Z(r),a=s&&Z(s),f=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Fe(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Fe(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(r&&u.float&&u.float!=="none"){var d=u.float==="left"?"left":"right";return s&&(a.clear==="both"||a.clear===d)?"vertical":"horizontal"}return r&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||f>=o&&l[Rr]==="none"||s&&l[Rr]==="none"&&f+c>o)?"vertical":"horizontal"},sp=function(t,n,l){var o=l?t.left:t.top,r=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 o===u||r===a||o+s/2===u+f/2},ap=function(t,n){var l;return ml.some(function(o){var r=o[Ue].options.emptyInsertThreshold;if(!(!r||zo(o))){var s=Fe(o),u=t>=s.left-r&&t<=s.right+r,a=n>=s.top-r&&n<=s.bottom+r;if(u&&a)return l=o}}),l},ru=function(t){function n(r,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(r==null&&(s||d))return!0;if(r==null||r===!1)return!1;if(s&&r==="clone")return r;if(typeof r=="function")return n(r(u,a,f,c),s)(u,a,f,c);var g=(s?u:a).options.group.name;return r===!0||typeof r=="string"&&r===g||r.join&&r.indexOf(g)>-1}}var l={},o=t.group;(!o||Kn(o)!="object")&&(o={name:o}),l.name=o.name,l.checkPull=n(o.pull,!0),l.checkPut=n(o.put),l.revertClone=o.revertClone,t.group=l},su=function(){!ou&&re&&Z(re,"display","none")},au=function(){!ou&&re&&Z(re,"display","")};Rl&&!Ja&&document.addEventListener("click",function(e){if(pl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),pl=!1,!1},!0);var Dt=function(t){if(q){t=t.touches?t.touches[0]:t;var n=ap(t.clientX,t.clientY);if(n){var l={};for(var o in t)t.hasOwnProperty(o)&&(l[o]=t[o]);l.target=l.rootEl=n,l.preventDefault=void 0,l.stopPropagation=void 0,n[Ue]._onDragOver(l)}}},up=function(t){q&&q.parentNode[Ue]._isOutsideThisEl(t.target)};function J(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=_t({},t),e[Ue]=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 iu(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:J.supportPointer!==!1&&"PointerEvent"in window&&!vn,emptyInsertThreshold:5};On.initializePlugins(this,e,n);for(var l in n)!(l in t)&&(t[l]=n[l]);ru(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:rp,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?me(e,"pointerdown",this._onTapStart):(me(e,"mousedown",this._onTapStart),me(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(me(e,"dragover",this),me(e,"dragenter",this)),ml.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),_t(this,tp())}J.prototype={constructor:J,_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,o=this.options,r=o.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=o.filter;if(_p(l),!q&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&vn&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=tt(a,o.draggable,l,!1),!(a&&a.animated)&&Jn!==a)){if(Wt=Xe(a),wn=Xe(a,o.draggable),typeof c=="function"){if(c.call(this,t,a,this)){Te({sortable:n,rootEl:f,name:"filter",targetEl:a,toEl:l,fromEl:l}),ze("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=tt(f,d.trim(),l,!1),d)return Te({sortable:n,rootEl:d,name:"filter",targetEl:a,fromEl:l,toEl:l}),ze("filter",n,{evt:t}),!0}),c)){r&&t.cancelable&&t.preventDefault();return}o.handle&&!tt(f,o.handle,l,!1)||this._prepareDragStart(t,u,a)}}},_prepareDragStart:function(t,n,l){var o=this,r=o.el,s=o.options,u=r.ownerDocument,a;if(l&&!q&&l.parentNode===r){var f=Fe(l);if(ke=r,q=l,Ae=q.parentNode,Nt=q.nextSibling,Jn=l,Bn=s.group,J.dragged=q,Ft={target:q,clientX:(n||t).clientX,clientY:(n||t).clientY},$r=Ft.clientX-f.left,Ar=Ft.clientY-f.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,q.style["will-change"]="all",a=function(){if(ze("delayEnded",o,{evt:t}),J.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!yr&&o.nativeDraggable&&(q.draggable=!0),o._triggerDragStart(t,n),Te({sortable:o,name:"choose",originalEvent:t}),je(q,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){eu(q,c.trim(),Gl)}),me(u,"dragover",Dt),me(u,"mousemove",Dt),me(u,"touchmove",Dt),me(u,"mouseup",o._onDrop),me(u,"touchend",o._onDrop),me(u,"touchcancel",o._onDrop),yr&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),ze("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Tn||bt))){if(J.eventCanceled){this._onDrop();return}me(u,"mouseup",o._disableDelayedDrag),me(u,"touchend",o._disableDelayedDrag),me(u,"touchcancel",o._disableDelayedDrag),me(u,"mousemove",o._delayedDragTouchMoveHandler),me(u,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&me(u,"pointermove",o._delayedDragTouchMoveHandler),o._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&&Gl(q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ge(t,"mouseup",this._disableDelayedDrag),ge(t,"touchend",this._disableDelayedDrag),ge(t,"touchcancel",this._disableDelayedDrag),ge(t,"mousemove",this._delayedDragTouchMoveHandler),ge(t,"touchmove",this._delayedDragTouchMoveHandler),ge(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?me(document,"pointermove",this._onTouchMove):n?me(document,"touchmove",this._onTouchMove):me(document,"mousemove",this._onTouchMove):(me(q,"dragend",this),me(ke,"dragstart",this._onDragStart));try{document.selection?el(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ut=!1,ke&&q){ze("dragStarted",this,{evt:n}),this.nativeDraggable&&me(document,"dragover",up);var l=this.options;!t&&je(q,l.dragClass,!1),je(q,l.ghostClass,!0),J.active=this,t&&this._appendGhost(),Te({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ke){this._lastX=Ke.clientX,this._lastY=Ke.clientY,su();for(var t=document.elementFromPoint(Ke.clientX,Ke.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ke.clientX,Ke.clientY),t!==n);)n=t;if(q.parentNode[Ue]._isOutsideThisEl(t),n)do{if(n[Ue]){var l=void 0;if(l=n[Ue]._onDragOver({clientX:Ke.clientX,clientY:Ke.clientY,target:t,rootEl:n}),l&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);au()}},_onTouchMove:function(t){if(Ft){var n=this.options,l=n.fallbackTolerance,o=n.fallbackOffset,r=t.touches?t.touches[0]:t,s=re&&Jt(re,!0),u=re&&s&&s.a,a=re&&s&&s.d,f=xn&&Ne&&Cr(Ne),c=(r.clientX-Ft.clientX+o.x)/(u||1)+(f?f[0]-Hl[0]:0)/(u||1),d=(r.clientY-Ft.clientY+o.y)/(a||1)+(f?f[1]-Hl[1]:0)/(a||1);if(!J.active&&!Ut){if(l&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(Te({rootEl:Ae,name:"add",toEl:Ae,fromEl:ke,originalEvent:t}),Te({sortable:this,name:"remove",toEl:Ae,originalEvent:t}),Te({rootEl:Ae,name:"sort",toEl:Ae,fromEl:ke,originalEvent:t}),Te({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),Ie&&Ie.save()):xe!==Wt&&xe>=0&&(Te({sortable:this,name:"update",toEl:Ae,originalEvent:t}),Te({sortable:this,name:"sort",toEl:Ae,originalEvent:t})),J.active&&((xe==null||xe===-1)&&(xe=Wt,wt=wn),Te({sortable:this,name:"end",toEl:Ae,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ze("nulling",this),ke=q=Ae=re=Nt=Ce=Jn=yt=Ft=Ke=dn=xe=wt=Wt=wn=jt=yn=Ie=Bn=J.dragged=J.ghost=J.clone=J.active=null,_l.forEach(function(t){t.checked=!0}),_l.length=Ll=ql=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":q&&(this._onDragOver(t),fp(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,l=this.el.children,o=0,r=l.length,s=this.options;ol.right+o||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+o}function gp(e,t,n,l,o,r,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&&Znc+f*r/2:ad-Zn)return-yn}else if(a>c+f*(1-o)/2&&ad-f*r/2)?a>c+f/2?1:-1:0}function pp(e){return Xe(q)A[28];for(let A=0;AAn(t,"showModal",ae));let W=e[8];const Q=X=>X[25];for(let X=0;Xn=!1)),t.$set(le),Y&3463&&(W=X[8],C=gt(C,Y,Q,1,X,W,M,y,zt,Pr,null,Er)),Y&8&&A.value!==X[3]&&Ye(A,X[3]),(!O||Y&80)&&I!==(I=(X[4]?X[6]:"Send")+"")&&K(D,I),(!O||Y&8&&L!==(L="btnyousend "+(X[3]===""?"":"active")+" svelte-1nj8mt0"))&&h(E,"class",L)},i(X){O||(V(t.$$.fragment,X),O=!0)},o(X){z(t.$$.fragment,X),O=!1},d(X){te(t,X),X&&P(l),X&&P(o);for(let Y=0;Y{e.scrollIntoView({behavior:"smooth"})},0)}async function Tr(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 yp(e,t,n){let l,o,r;ue(e,an,k=>n(8,r=k));let{numModels:s=1}=t,{models:u=[0]}=t,a="",f="",c=!1,d=!1;ft(async()=>{if(await new Promise(k=>setTimeout(k,200)),_){const k=new J(_,{animation:150,onUpdate(E){k.toArray()}});k.toArray()}g()});async function g(){const E=await(await fetch("/chat/comparator/db/retrieve")).json();console.log(E);const I=E.data;let D={},L=new Set;for(const O of I)L.add(O.model),D[O.qid]||(D[O.qid]={},D[O.qid].qid=O.qid,D[O.qid].question=O.question),D[O.qid][O.model]=O.answer,console.log(D);n(1,u=Array.from(L)),n(0,s=u.length),console.log(Object.values(D)),Pe(an,r=[...Object.values(D)],r)}const p=async k=>{k.preventDefault(),a=f,n(3,f=""),n(4,c=!0);let E={question:a};for(let D of u)E[D]="Loading...";Pe(an,r=[...r,E],r),console.log("compare chat log",an);const I=await fetch(`/chat/comparator/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:a})});if(I.ok){const D=await I.json();n(1,u=Object.keys(D.answer)),n(0,s=u.length);for(let L of u)E[L]=D.answer[L];E.qid=D.qid,an.update(L=>(L[L.length-1]=E,L))}else{const D=await I.text();alert(D)}n(4,c=!1)};let m=0;setInterval(()=>{n(13,m=(m+1)%4)},200);let _,v;function w(k,E){const I=E,L=pt(k.currentTarget.parentNode).selectAll("div.answer").nodes().map(ae=>ae.id);L.forEach((ae,pe)=>{pt(`#${ae}`).select(".answer-rank").property("value",pe+1)});let O=[];for(let[ae,pe]of L.entries()){const W=parseInt(pe.split("-")[1]),Q=u[W],X={rank:ae,model:Q};O.push(X)}let B=r.filter(ae=>ae.qid===I),j=[];for(let ae of O){const pe={model:ae.model,qid:parseInt(I),rank:parseInt(ae.rank)+1,answer:B[0][ae.model]};j.push(pe)}Tr(j)}function y(k,E,I){const D=E,L=parseInt(k.target.value),O=u[I],B={qid:D,rank:parseInt(L),model:O};let j=[],pe=r.filter(Q=>Q.qid===B.qid)[0][B.model];const W={model:B.model,qid:parseInt(B.qid),rank:parseInt(B.rank),answer:pe};j.push(W),Tr(j)}function C(){n(5,d=!0)}function M(k){d=k,n(5,d)}const $=(k,E,I)=>y(I,k.qid,E),F=(k,E)=>w(E,k.qid);function S(k){et[k?"unshift":"push"](()=>{_=k,n(2,_)})}function A(){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(7,l="1fr ".repeat(s).trim()),e.$$.dirty&8192&&n(6,o=".".repeat(m).padEnd(3)),e.$$.dirty&16388&&_&&(n(14,v=new J(_,{animation:150,dataIdAttr:"id",onUpdate(k){v.toArray()}})),v.toArray())},[s,u,_,f,c,d,o,l,r,p,w,y,C,m,v,M,$,F,S,A]}class kp extends ce{constructor(t){super(),de(this,t,yp,bp,fe,{numModels:0,models:1})}}const ln=De([{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 Or(e,t,n){const l=e.slice();return l[20]=t[n],l}function Vr(e,t,n){const l=e.slice();return l[20]=t[n],l[24]=n,l}function zr(e,t,n){const l=e.slice();return l[25]=t[n],l}function Lr(e){let t,n,l,o,r=`Q.${e[25]}`,s,u;return{c(){t=G("g"),n=G("line"),o=G("text"),s=H(r),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(o,"class","axis-text svelte-1nna9rx"),h(o,"y","15"),h(o,"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,o),b(o,s)},p(a,f){f&32&&l!==(l=-a[5]+a[12].bottom+a[12].top)&&h(n,"y2",l),f&256&&r!==(r=`Q.${a[25]}`)&&K(s,r),f&296&&u!==(u=`translate(${a[3](a[25])+0} ${a[5]-a[12].bottom})`)&&h(t,"transform",u)},d(a){a&&P(t)}}}function qr(e){let t=Number.isInteger(e[25]),n,l=t&&Lr(e);return{c(){l&&l.c(),n=Se()},m(o,r){l&&l.m(o,r),T(o,n,r)},p(o,r){r&256&&(t=Number.isInteger(o[25])),t?l?l.p(o,r):(l=Lr(o),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(o){l&&l.d(o),o&&P(n)}}}function Hr(e,t){let n,l,o,r,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=G("path"),r=G("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",o=t[2][t[24]]),h(r,"class","model-path svelte-1nna9rx"),h(r,"d",s=t[10](t[20])),h(r,"role","img"),h(r,"stroke",u=t[11](t[2][t[24]])),h(r,"data-model",a=t[2][t[24]]),this.first=n},m(p,m){T(p,n,m),T(p,r,m),f||(c=[x(r,"mouseover",d),x(r,"focus",g),x(r,"mouseout",bl),x(r,"blur",bl)],f=!0)},p(p,m){t=p,m&1536&&l!==(l=t[10](t[20]))&&h(n,"d",l),m&516&&o!==(o=t[2][t[24]])&&h(n,"data-model",o),m&1536&&s!==(s=t[10](t[20]))&&h(r,"d",s),m&2564&&u!==(u=t[11](t[2][t[24]]))&&h(r,"stroke",u),m&516&&a!==(a=t[2][t[24]])&&h(r,"data-model",a)},d(p){p&&P(n),p&&P(r),f=!1,be(c)}}}function Gr(e,t){let n,l,o,r,s,u,a=t[20].rank+"",f,c,d,g;return{key:e,first:null,c(){n=G("g"),l=G("circle"),u=G("text"),f=H(a),h(l,"r",o=t[20].answer.length/2*0+12),h(l,"fill",r=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=[x(l,"mouseover",t[17]),x(l,"focus",t[18]),x(l,"mouseout",bl),x(l,"blur",bl)],d=!0)},p(p,m){t=p,m&128&&o!==(o=t[20].answer.length/2*0+12)&&h(l,"r",o),m&2176&&r!==(r=t[11](t[20].model))&&h(l,"fill",r),m&128&&s!==(s=t[20].model)&&h(l,"data-model",s),m&128&&a!==(a=t[20].rank+"")&&K(f,a),m&152&&c!==(c=`translate(${t[3](t[20].qid)}, ${t[4](t[20].rank)})`)&&h(n,"transform",c)},d(p){p&&P(n),d=!1,be(g)}}}function Sp(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m=[],_=new Map,v,w=[],y=new Map,C,M,$,F,S,A=e[8],k=[];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,B){T(O,t,B),b(t,n),b(n,l);for(let j=0;j{e.style.opacity=1})}function Cp(e,t,n){let l,o,r,s,u,a,f,c,d,g,p;ue(e,ln,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(A=>{A.style.opacity=.12}),document.querySelectorAll(`.model-path[data-model="${l[S]}"], .model-circle[data-model="${l[S]}"]`).forEach(A=>{A.style.opacity=1})}const y=S=>w(S),C=S=>w(S),M=()=>w(i),$=()=>w(i);function F(){_=this.offsetWidth,m=this.offsetHeight,n(1,_),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,o=_-v.left-v.right),e.$$.dirty&1&&n(5,r=m-v.top-v.bottom),e.$$.dirty&192&&n(3,s=Hi().domain(p.map(S=>S.qid)).padding(.3).range([v.left,o-v.right])),e.$$.dirty&128&&n(14,u=p.map(S=>S.rank).sort((S,A)=>S-A)),e.$$.dirty&16416&&n(4,a=Hi().domain(u).padding(1).range([v.top,r-v.bottom])),e.$$.dirty&128&&n(11,f=Mt().domain(p.map(S=>S.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"])),e.$$.dirty&24&&n(10,c=kg().x(S=>s(S.qid)).y(S=>a(S.rank))),e.$$.dirty&132&&n(9,d=l.map(S=>p.filter(A=>A.model===S))),e.$$.dirty&8&&n(8,g=s.domain().length>10?s.domain().filter((S,A)=>A%2===0):s.domain())},[m,_,l,s,a,r,o,p,g,d,c,f,v,w,u,y,C,M,$,F]}class $p extends ce{constructor(t){super(),de(this,t,Cp,Sp,fe,{})}}function Br(e,t,n){const l=e.slice();return l[13]=t[n],l[15]=n,l}function jr(e,t,n){const l=e.slice();return l[16]=t[n],l}function xr(e,t,n){const l=e.slice();return l[16]=t[n],l}function Ur(e){let t,n,l=e[16]+"",o,r;return{c(){t=G("g"),n=G("text"),o=H(l),h(n,"class","axis-text svelte-1y9gffu"),h(n,"x","-5"),h(n,"y","0"),h(n,"text-anchor","end"),h(t,"transform",r=`translate(${e[9].left} ${e[8](e[16])+e[8].bandwidth()/2})`)},m(s,u){T(s,t,u),b(t,n),b(n,o)},p(s,u){u&4&&l!==(l=s[16]+"")&&K(o,l),u&260&&r!==(r=`translate(${s[9].left} ${s[8](s[16])+s[8].bandwidth()/2})`)&&h(t,"transform",r)},d(s){s&&P(t)}}}function Wr(e){let t,n,l=e[16]+"",o,r;return{c(){t=G("g"),n=G("text"),o=H(l),h(n,"class","axis-text svelte-1y9gffu"),h(n,"y","15"),h(n,"text-anchor","middle"),h(t,"transform",r=`translate(${e[7](e[16])}, ${e[4]-e[9].bottom})`)},m(s,u){T(s,t,u),b(t,n),b(n,o)},p(s,u){u&128&&l!==(l=s[16]+"")&&K(o,l),u&144&&r!==(r=`translate(${s[7](s[16])}, ${s[4]-s[9].bottom})`)&&h(t,"transform",r)},d(s){s&&P(t)}}}function Xr(e){let t,n=e[16]%2==0&&Wr(e);return{c(){n&&n.c(),t=Se()},m(l,o){n&&n.m(l,o),T(l,t,o)},p(l,o){l[16]%2==0?n?n.p(l,o):(n=Wr(l),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(l){n&&n.d(l),l&&P(t)}}}function Yr(e){let t,n,l,o,r,s,u,a=e[13].avgRank.toFixed(2)+"",f,c,d;return{c(){t=G("rect"),u=G("text"),f=H(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",o=e[8].bandwidth()),h(t,"fill",r=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&&o!==(o=g[8].bandwidth())&&h(t,"height",o),p&68&&r!==(r=g[6](g[13].model))&&h(t,"fill",r),p&32&&s!==(s=g[5][g[15]])&&h(t,"data-model",s),p&4&&a!==(a=g[13].avgRank.toFixed(2)+"")&&K(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&&P(t),g&&P(u)}}}function Ap(e){let t,n,l,o,r,s,u,a,f,c,d,g,p=e[2].map(Qr),m=[];for(let C=0;Ce[12].call(t))},m(C,M){T(C,t,M),b(t,n);for(let $=0;$e.model;function Rp(e,t,n){let l,o,r,s,u,a,f,c,d;ue(e,ln,v=>n(11,d=v));let g=300,p=500,m={top:50,bottom:0,left:100,right:0};function _(){p=this.offsetWidth,g=this.offsetHeight,n(1,p),n(0,g)}return e.$$.update=()=>{e.$$.dirty&2048&&n(10,l=d.reduce((v,w)=>(v[w.model]?(v[w.model].sum+=w.rank,v[w.model].count++):v[w.model]={sum:w.rank,count:1},v),{})),e.$$.dirty&1024&&n(2,o=Object.keys(l).map(v=>({model:v,avgRank:l[v].sum/l[v].count}))),e.$$.dirty&2&&n(3,r=p-m.left-m.right),e.$$.dirty&1&&n(4,s=g-m.top-m.bottom),e.$$.dirty&20&&n(8,u=Lt().rangeRound([m.top,s-m.bottom]).padding(.05).domain(o.map(v=>v.model))),e.$$.dirty&12&&n(7,a=We().rangeRound([m.left,r-m.right]).domain([0,mt(o,v=>v.avgRank)])),e.$$.dirty&4&&n(6,f=Mt().domain(o.map(v=>v.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$$.dirty&2048&&n(5,c=Array.from(new Set(d.map(v=>v.model))))},[g,p,o,r,s,c,f,a,u,m,l,d,_]}class Mp extends ce{constructor(t){super(),de(this,t,Rp,Ap,fe,{})}}function Kr(e,t,n){const l=e.slice();return l[20]=t[n],l[22]=n,l}function Jr(e,t,n){const l=e.slice();return l[23]=t[n],l[25]=n,l}function Zr(e,t,n){const l=e.slice();return l[23]=t[n],l}function es(e){let t,n=e[23].key+"",l,o,r;function s(){return e[10](e[23])}return{c(){t=R("th"),l=H(n),h(t,"class","svelte-owgjbp")},m(u,a){T(u,t,a),b(t,l),o||(r=x(t,"click",s),o=!0)},p(u,a){e=u,a&64&&n!==(n=e[23].key+"")&&K(l,n)},d(u){u&&P(t),o=!1,r()}}}function ts(e,t){let n,l=(t[20][t[23].key].length>ls&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"",o,r,s,u;function a(){return t[11](t[22],t[25])}return{key:e,first:null,c(){n=R("td"),o=H(l),h(n,"class",r="cell-type-"+t[23].type+" svelte-owgjbp"),Re(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),Pt(n,"active",t[4]===`${t[22]}-${t[25]}`),this.first=n},m(f,c){T(f,n,c),b(n,o),s||(u=x(n,"click",a),s=!0)},p(f,c){t=f,c&112&&l!==(l=(t[20][t[23].key].length>ls&&t[4]!==`${t[22]}-${t[25]}`?`${t[20][t[23].key].substring(0,40)}...`:t[20][t[23].key])+"")&&K(o,l),c&64&&r!==(r="cell-type-"+t[23].type+" svelte-owgjbp")&&h(n,"class",r),c&96&&Re(n,"background",t[23].key==="change"?t[7](t[20][t[23].key]):"none"),c&80&&Pt(n,"active",t[4]===`${t[22]}-${t[25]}`)},d(f){f&&P(n),s=!1,u()}}}function ns(e){let t,n=[],l=new Map,o,r=e[6];const s=u=>u[23].key;for(let u=0;un(9,s=M));let u={};const a=vt(".2f");function f(M){let $=M.reduce((S,A)=>(S[A.model]||(S[A.model]=[]),S[A.model].push(A.rank),S),{});return Object.entries($).map(([S,A])=>{let k=A.reduce((I,D)=>(I[D]=(I[D]||0)+1,I),{}),E=Object.entries(k).reduce((I,D)=>D[1]>I[1]?D:I)[0];return{model:S,overall_rank:Number(E),average_rank:a(yh(A)),standard_deviation_rank:a(rh(A))}})}u={...{columns:{},style:"normal",paged:25},...u};const d=We().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&&(_===M.key&&n(2,v=!v),n(1,_=M.key))},C=(M,$)=>{n(4,w=w===`${M}-${$}`?null:`${M}-${$}`)};return e.$$.update=()=>{if(e.$$.dirty&512,e.$$.dirty&512&&n(8,l=f(s)),e.$$.dirty&774){_&&n(8,l=l.slice().sort(($,F)=>{let S=$[_],A=F[_];if(S==A)return JSON.stringify($).localeCompare(JSON.stringify(F));let k=S>A?1:S{const $=u.columns[M]||{};return{key:M,type:$.type||typeof l[0][M],options:$}}))},n(5,r=[]),[u,_,v,g,w,r,o,d,l,s,y,C]}let Ip=class extends ce{constructor(t){super(),de(this,t,Dp,Ep,fe,{})}};function os(e,t,n){const l=e.slice();return l[19]=t[n],l}function is(e,t,n){const l=e.slice();return l[22]=t[n],l}function rs(e,t,n){const l=e.slice();return l[25]=t[n],l[27]=n,l}function ss(e){let t,n=e[25]+"",l,o,r,s=e[25]+"",u,a;return{c(){t=G("text"),l=H(n),r=G("text"),u=H(s),h(t,"class","axis-text svelte-t6wv8i"),h(t,"x",o=e[7].left+e[5](e[25])+e[5].bandwidth()/2),h(t,"y",e[7].top-10),h(t,"text-anchor","middle"),h(r,"class","axis-text svelte-t6wv8i"),h(r,"x",e[7].left-10),h(r,"y",a=e[7].top+e[4](e[25])+e[4].bandwidth()/2),h(r,"text-anchor","end"),h(r,"dominant-baseline","middle")},m(f,c){T(f,t,c),b(t,l),T(f,r,c),b(r,u)},p(f,c){c&8&&n!==(n=f[25]+"")&&K(l,n),c&40&&o!==(o=f[7].left+f[5](f[25])+f[5].bandwidth()/2)&&h(t,"x",o),c&8&&s!==(s=f[25]+"")&&K(u,s),c&24&&a!==(a=f[7].top+f[4](f[25])+f[4].bandwidth()/2)&&h(r,"y",a)},d(f){f&&P(t),f&&P(r)}}}function as(e){let t,n,l,o,r,s,u,a,f=e[6](e[2][e[19]][e[22]])+"",c,d,g,p;return{c(){t=G("rect"),a=G("text"),c=H(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",o=e[5].bandwidth()),h(t,"height",r=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,_){T(m,t,_),T(m,a,_),b(a,c)},p(m,_){_&40&&n!==(n=m[7].left+m[5](m[22]))&&h(t,"x",n),_&24&&l!==(l=m[7].top+m[4](m[19]))&&h(t,"y",l),_&32&&o!==(o=m[5].bandwidth())&&h(t,"width",o),_&16&&r!==(r=m[4].bandwidth())&&h(t,"height",r),_&8&&s!==(s=m[8](m[19],m[22]))&&h(t,"fill",s),_&8&&u!==(u=m[19])&&h(t,"data-model",u),_&12&&f!==(f=m[6](m[2][m[19]][m[22]])+"")&&K(c,f),_&40&&d!==(d=m[7].left+m[5](m[22])+m[5].bandwidth()/2)&&h(a,"x",d),_&24&&g!==(g=m[7].top+m[4](m[19])+m[4].bandwidth()/2)&&h(a,"y",g),_&8&&p!==(p=m[19])&&h(a,"data-model",p)},d(m){m&&P(t),m&&P(a)}}}function us(e){let t,n=e[3],l=[];for(let o=0;oe[16].call(t))},m(g,p){T(g,t,p),b(t,n);for(let m=0;mn(15,p=$));const m=vt(".1f");function _($){let F=$.reduce((k,E)=>(k[E.qid]||(k[E.qid]=[]),k[E.qid].push(E),k),{}),S=Array.from(new Set($.map(k=>k.model))),A=S.reduce((k,E)=>(k[E]=S.reduce((I,D)=>(I[D]={sum:0,count:0},I),{}),k),{});for(let k in F){let E=F[k];for(let I of S)for(let D of S){let L=E.find(B=>B.model===I),O=E.find(B=>B.model===D);L&&O&&(A[I][D].sum+=O.rank-L.rank,A[I][D].count++)}}for(let k in A)for(let E in A[k])A[k][E].count>0?A[k][E]=A[k][E].sum/A[k][E].count:A[k][E]=0;return A}let v=500,w=500,y={top:50,bottom:0,left:65,right:25};function C($,F){let S=l[$][F];return S===0?"white":S>=0?g($):g(F)}function M(){w=this.offsetWidth,v=this.offsetHeight,n(1,w),n(0,v)}return e.$$.update=()=>{e.$$.dirty&32768&&n(2,l=_(p)),e.$$.dirty&32768&&n(3,o=Array.from(new Set(p.map($=>$.model)))),e.$$.dirty&2&&n(14,r=w-y.left-y.right),e.$$.dirty&1&&n(13,s=v-y.top-y.bottom),e.$$.dirty&16392&&n(5,u=Lt().range([0,r]).domain(o).padding(.05)),e.$$.dirty&8200&&n(4,a=Lt().range([0,s]).domain(o).padding(.05)),e.$$.dirty&4&&n(12,f=Object.values(l).flatMap($=>Object.values($))),e.$$.dirty&4096&&n(11,c=so(f)),e.$$.dirty&4096&&n(10,d=mt(f)),e.$$.dirty&8&&n(9,g=Mt().domain(o).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F"])),e.$$.dirty&3592&&o.reduce(($,F)=>($[F]=La().domain([c,d]).interpolator(uo("white",g(F))),$),{})},[v,w,l,o,a,u,m,y,C,g,d,c,f,s,r,p,M]}class Tp extends ce{constructor(t){super(),de(this,t,Pp,Np,fe,{})}}function fs(e,t,n){const l=e.slice();return l[7]=t[n],l[9]=n,l}function Op(e){let t;return{c(){t=R("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:U,i:U,o:U,d(n){n&&P(t)}}}function Vp(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_,v,w,y,C,M,$,F=e[1],S=[];for(let A=0;A0?0:1}return n=u(e),l=s[n]=r[n](e),{c(){t=R("div"),l.c(),h(t,"class","main-container svelte-7imt18")},m(a,f){T(a,t,f),s[n].m(t,null),o=!0},p(a,[f]){let c=n;n=u(a),n===c?s[n].p(a,f):(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),l=s[n],l?l.p(a,f):(l=s[n]=r[n](a),l.c()),V(l,1),l.m(t,null))},i(a){o||(V(l),o=!0)},o(a){z(l),o=!1},d(a){a&&P(t),s[n].d()}}}function ds(){document.querySelectorAll(".model-path, .model-path-outer, .model-circle").forEach(e=>{e.style.opacity=1})}function Lp(e,t,n){let l,o,r;ue(e,ln,c=>n(0,r=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)}));Pe(ln,r=[...p],r)}ft(()=>{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(r.map(c=>c.model)))),e.$$.dirty&1&&n(2,o=Mt().domain(r.map(c=>c.model)).range(["#FF5470","#1B2D45","#00EBC7","#FDE24F","red"]))},[r,l,o,u,a,f]}class qp extends ce{constructor(t){super(),de(this,t,Lp,zp,fe,{})}}function Hp(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return fu(this.cover(t,n),t,n,e)}function fu(e,t,n,l){if(isNaN(t)||isNaN(n))return e;var o,r=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(!r)return e._root=s,e;for(;r.length;)if((_=t>=(d=(u+f)/2))?u=d:f=d,(v=n>=(g=(a+c)/2))?a=g:c=g,o=r,!(r=r[w=v<<1|_]))return o[w]=s,e;if(p=+e._x.call(null,r.data),m=+e._y.call(null,r.data),t===p&&n===m)return s.next=r,o?o[w]=s:e._root=s,e;do o=o?o[w]=new Array(4):e._root=new Array(4),(_=t>=(d=(u+f)/2))?u=d:f=d,(v=n>=(g=(a+c)/2))?a=g:c=g;while((w=v<<1|_)===(y=(m>=g)<<1|p>=d));return o[y]=r,o[w]=s,e}function Gp(e){var t,n,l=e.length,o,r,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=o),rd&&(d=r));if(a>c||f>d)return this;for(this.cover(a,f).cover(c,d),n=0;ne||e>=o||l>t||t>=r;)switch(f=(tc||(u=m.y0)>d||(a=m.x1)=w)<<1|e>=v)&&(m=g[g.length-1],g[g.length-1]=g[g.length-1-_],g[g.length-1-_]=m)}else{var y=e-+this._x.call(null,p.data),C=t-+this._y.call(null,p.data),M=y*y+C*C;if(M=(g=(s+a)/2))?s=g:a=g,(_=d>=(p=(u+f)/2))?u=p:f=p,t=n,!(n=n[v=_<<1|m]))return this;if(!n.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(l=t,w=v)}for(;n.data!==e;)if(o=n,!(n=n.next))return this;return(r=n.next)&&delete n.next,o?(r?o.next=r:delete o.next,this):t?(r?t[v]=r:delete t[v],(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=r,this)}function Xp(e){for(var t=0,n=e.length;tg.index){var I=p-A.x-A.vx,D=m-A.y-A.vy,L=I*I+D*D;Lp+E||Fm+E||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 du(){for(var e=0,t=arguments.length,n={},l;e=0&&(l=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:l}})}nl.prototype=du.prototype={constructor:nl,on:function(e,t){var n=this._,l=sm(e+"",n),o,r=-1,s=l.length;if(arguments.length<2){for(;++r0)for(var n=new Array(o),l=0,o,r;l=0&&e._call.call(void 0,t),e=e._next;--on}function ms(){qt=(yl=In.now())+Ml,on=pn=0;try{fm()}finally{on=0,dm(),qt=0}}function cm(){var e=In.now(),t=e-yl;t>hu&&(Ml-=t,yl=e)}function dm(){for(var e,t=wl,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:wl=n);mn=e,ko(l)}function ko(e){if(!on){pn&&(pn=clearTimeout(pn));var t=e-qt;t>24?(e<1/0&&(pn=setTimeout(ms,e-In.now()-Ml)),fn&&(fn=clearInterval(fn))):(fn||(yl=In.now(),fn=setInterval(cm,hu)),on=1,gu(ms))}}const hm=1664525,gm=1013904223,_s=4294967296;function pm(){let e=1;return()=>(e=(hm*e+gm)%_s)/_s}var mm=10,_m=Math.PI*(3-Math.sqrt(5));function vm(e){var t,n=1,l=.001,o=1-Math.pow(l,1/300),r=0,s=.6,u=new Map,a=mu(d),f=du("tick","end"),c=pm();e==null&&(e=[]);function d(){g(),f.call("tick",t),n1?(v==null?u.delete(_):u.set(_,m(v)),t):u.get(_)},find:function(_,v,w){var y=0,C=e.length,M,$,F,S,A;for(w==null?w=1/0:w*=w,y=0;y1?(f.on(_,v),t):f.on(_)}}}function bm(e){var t=ot(.1),n,l,o;typeof e!="function"&&(e=ot(e==null?0:+e));function r(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,C){T(y,t,C),b(t,n),b(t,r),b(r,u),b(r,a),b(a,c),_=!0,v||(w=[x(t,"mouseover",e[6]),x(t,"mouseout",e[7]),x(t,"focus",e[6]),x(t,"blur",e[7])],v=!0)},p(y,C){(!_||C&12&&l!==(l=y[3](y[20].size)))&&h(n,"r",l),(!_||C&4)&&s!==(s=y[20].file+"")&&K(u,s),(!_||C&4)&&f!==(f=ro(y[20].size)+"")&&K(c,f),(!_||C&20&&d!==(d=y[20].size>y[4]?1:0))&&h(r,"opacity",d),(!_||C&20&&p!==(p="file-circle-g "+(y[20].size>y[4]?"large":"")+" svelte-h2ab3o"))&&h(t,"class",p),(!_||C&4&&m!==(m=y[5](y[20].x,y[20].y)))&&h(t,"style",m)},i(y){_||(y&&Me(()=>{_&&(o||(o=lt(n,Ln,{duration:1e3},!0)),o.run(1))}),y&&Me(()=>{_&&(g||(g=lt(r,Ln,{duration:1e3},!0)),g.run(1))}),_=!0)},o(y){y&&(o||(o=lt(n,Ln,{duration:1e3},!1)),o.run(0)),y&&(g||(g=lt(r,Ln,{duration:1e3},!1)),g.run(0)),_=!1},d(y){y&&P(t),y&&o&&o.end(),y&&g&&g.end(),v=!1,be(w)}}}function ym(e){let t,n,l,o,r=e[2],s=[];for(let a=0;az(s[a],1,1,()=>{s[a]=null});return{c(){t=R("div"),n=G("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=$));let d=600,g=350,p=!0,m=!1;const _=($,F)=>`transform: translate(${$}px, ${F}px)`,v=[-4,4],w=[-1,1];function y(){n(8,p=!0),n(9,m=!0);const $=pt(this);Nl(".file-circle-g").select("text").style("opacity",0),$.raise(),$.select("circle").attr("fill","var(--red)"),$.select("text").style("opacity",1)}const C=()=>{const $=Nl(".file-circle-g");$.select("circle").attr("fill","var(--yellow)"),$.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($=>({...$,x:d/2,y:g/2,tickCount:0}))),e.$$.dirty&16384&&console.log(c.map($=>$.size).sort(($,F)=>$-F)),e.$$.dirty&1&&n(13,o=bm().x(d/2)),e.$$.dirty&2&&n(12,r=wm().y(g/2)),e.$$.dirty&16384&&n(3,a=We().domain(_n(c,$=>$.size)).range([12,60])),e.$$.dirty&8&&n(10,s=im().radius($=>a($.size)+1).iterations(3)),e.$$.dirty&16384&&n(4,u=wh(c.map($=>$.size).sort(($,F)=>$-F),.85)),e.$$.dirty&1&&We().domain(v).range([5,d]),e.$$.dirty&2&&We().domain(w).range([g,5]),e.$$.dirty&4&&n(11,f=vm().nodes(l).on("tick",()=>{n(2,l=[...l])})),e.$$.dirty&15360&&(f.force("x",o),f.force("y",r),f.force("collide",s),f.alpha(.02),f.restart()),e.$$.dirty&19468&&(a.domain(_n(c,$=>$.size)),l.forEach($=>$.radius=a($.size)),f.nodes(l),s.radius($=>$.radius+.5)),e.$$.dirty&768&&p===!1&&(m||Nl(".large").select("text").style("opacity",1))},[d,g,l,a,u,_,y,C,p,m,s,f,r,o,c,M]}class Sm extends ce{constructor(t){super(),de(this,t,km,ym,fe,{})}}/** + * 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 $t(e,t){return typeof e=="function"?e(t):e}function Qe(e,t){return n=>{t.setState(l=>({...l,[e]:$t(n,l[e])}))}}function Sl(e){return e instanceof Function}function Cm(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function $m(e,t){const n=[],l=o=>{o.forEach(r=>{n.push(r);const s=t(r);s!=null&&s.length&&l(s)})};return l(e),n}function oe(e,t,n){let l=[],o;return()=>{let r;n.key&&n.debug&&(r=Date.now());const s=e();if(!(s.length!==l.length||s.some((f,c)=>l[c]!==f)))return o;l=s;let a;if(n.key&&n.debug&&(a=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-r)*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 _ of a.split(".")){var m;p=(m=p)==null?void 0:m[_]}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:oe(()=>[!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:oe(()=>[e._getOrderColumnsFn()],g=>{var p;if((p=d.columns)!=null&&p.length){let m=d.columns.flatMap(_=>_.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 ys(e,t,n){var l;let r={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(r),s},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(s=>{Object.assign(r,s.createHeader==null?void 0:s.createHeader(r,e))}),r}const Rm={createTable:e=>({getHeaderGroups:oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,l,o)=>{var r,s;const u=(r=l==null?void 0:l.map(d=>n.find(g=>g.id===d)).filter(Boolean))!=null?r:[],a=(s=o==null?void 0:o.map(d=>n.find(g=>g.id===d)).filter(Boolean))!=null?s:[],f=n.filter(d=>!(l!=null&&l.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Wn(t,[...u,...f,...a],e)},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterHeaderGroups:oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,l,o)=>(n=n.filter(r=>!(l!=null&&l.includes(r.id))&&!(o!=null&&o.includes(r.id))),Wn(t,n,e,"center")),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftHeaderGroups:oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,l)=>{var o;const r=(o=l==null?void 0:l.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?o:[];return Wn(t,r,e,"left")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightHeaderGroups:oe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,l)=>{var o;const r=(o=l==null?void 0:l.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?o:[];return Wn(t,r,e,"right")},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFooterGroups:oe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getLeftFooterGroups:oe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getCenterFooterGroups:oe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getRightFooterGroups:oe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),getFlatHeaders:oe(()=>[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:oe(()=>[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:oe(()=>[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:oe(()=>[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:oe(()=>[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:oe(()=>[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:oe(()=>[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:oe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,l)=>{var o,r,s,u,a,f;return[...(o=(r=t[0])==null?void 0:r.headers)!=null?o:[],...(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 Wn(e,t,n,l){var o,r;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 _;(_=m.columns)!=null&&_.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:[]},_=[];g.forEach(v=>{const w=[..._].reverse()[0],y=v.column.depth===m.depth;let C,M=!1;if(y&&v.column.parent?C=v.column.parent:(C=v.column,M=!0),w&&(w==null?void 0:w.column)===C)w.subHeaders.push(v);else{const $=ys(n,C,{id:[l,p,C.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${_.filter(F=>F.column===C).length}`:void 0,depth:p,index:_.length});$.subHeaders.push(v),_.push($)}m.headers.push(v),v.headerGroup=m}),a.push(m),p>0&&f(_,p-1)},c=t.map((g,p)=>ys(n,g,{depth:s,index:p}));f(c,s-1),a.reverse();const d=g=>g.filter(m=>m.column.getIsVisible()).map(m=>{let _=0,v=0,w=[0];m.subHeaders&&m.subHeaders.length?(w=[],d(m.subHeaders).forEach(C=>{let{colSpan:M,rowSpan:$}=C;_+=M,w.push($)})):_=1;const y=Math.min(...w);return v=v+y,m.colSpan=_,m.rowSpan=v,{colSpan:_,rowSpan:v}});return d((o=(r=a[0])==null?void 0:r.headers)!=null?o:[]),a}const Xn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ul=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Mm={getDefaultColumnDef:()=>Xn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ul(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:Qe("columnSizing",e),onColumnSizingInfoChange:Qe("columnSizingInfo",e)}),createColumn:(e,t)=>({getSize:()=>{var n,l,o;const r=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Xn.minSize,(l=r??e.columnDef.size)!=null?l:Xn.size),(o=e.columnDef.maxSize)!=null?o:Xn.maxSize)},getStart:n=>{const l=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=l.findIndex(r=>r.id===e.id);if(o>0){const r=l[o-1];return r.getStart(n)+r.getSize()}return 0},resetSize:()=>{t.setColumnSizing(n=>{let{[e.id]:l,...o}=n;return o})},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=o=>{if(o.subHeaders.length)o.subHeaders.forEach(l);else{var r;n+=(r=o.column.getSize())!=null?r: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 o=>{if(!n||!l||(o.persist==null||o.persist(),Wl(o)&&o.touches&&o.touches.length>1))return;const r=e.getSize(),s=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[n.id,n.getSize()]],u=Wl(o)?Math.round(o.touches[0].clientX):o.clientX,a={},f=(_,v)=>{typeof v=="number"&&(t.setColumnSizingInfo(w=>{var y,C;const M=v-((y=w==null?void 0:w.startOffset)!=null?y:0),$=Math.max(M/((C=w==null?void 0:w.startSize)!=null?C:0),-.999999);return w.columnSizingStart.forEach(F=>{let[S,A]=F;a[S]=Math.round(Math.max(A+A*$,0)*100)/100}),{...w,deltaOffset:M,deltaPercentage:$}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(w=>({...w,...a})))},c=_=>f("move",_),d=_=>{f("end",_),t.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g={moveHandler:_=>c(_.clientX),upHandler:_=>{document.removeEventListener("mousemove",g.moveHandler),document.removeEventListener("mouseup",g.upHandler),d(_.clientX)}},p={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),c(_.touches[0].clientX),!1),upHandler:_=>{var v;document.removeEventListener("touchmove",p.moveHandler),document.removeEventListener("touchend",p.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),d((v=_.touches[0])==null?void 0:v.clientX)}},m=Em()?{passive:!1}:!1;Wl(o)?(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(_=>({..._,startOffset:u,startSize:r,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?Ul():(n=e.initialState.columnSizingInfo)!=null?n:Ul())},getTotalSize:()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((l,o)=>l+o.getSize(),0))!=null?t:0},getLeftTotalSize:()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((l,o)=>l+o.getSize(),0))!=null?t:0},getCenterTotalSize:()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((l,o)=>l+o.getSize(),0))!=null?t:0},getRightTotalSize:()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((l,o)=>l+o.getSize(),0))!=null?t:0}})};let Yn=null;function Em(){if(typeof Yn=="boolean")return Yn;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 Yn=e,Yn}function Wl(e){return e.type==="touchstart"}const Fm={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Qe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;return{_autoResetExpanded:()=>{var l,o;if(!t){e._queue(()=>{t=!0});return}if((l=(o=e.options.autoResetAll)!=null?o: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 o,r;e.setExpanded(l?{}:(o=(r=e.initialState)==null?void 0:r.expanded)!=null?o:{})},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(o=>!o.getIsExpanded()))},getExpandedDepth:()=>{let l=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const s=r.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 o;const r=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=(o=n)!=null?o:!r,!r&&n)return{...s,[e.id]:!0};if(r&&!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,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((l=t.options.enableExpanding)!=null?l:!0)&&!!((o=e.subRows)!=null&&o.length)},getToggleExpandedHandler:()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}})},_u=(e,t,n)=>{var l,o,r;const s=n.toLowerCase();return!!(!((l=e.getValue(t))==null||(o=l.toString())==null||(r=o.toLowerCase())==null)&&r.includes(s))};_u.autoRemove=e=>Ze(e);const vu=(e,t,n)=>{var l,o;return!!(!((l=e.getValue(t))==null||(o=l.toString())==null)&&o.includes(n))};vu.autoRemove=e=>Ze(e);const bu=(e,t,n)=>{var l,o;return((l=e.getValue(t))==null||(o=l.toString())==null?void 0:o.toLowerCase())===(n==null?void 0:n.toLowerCase())};bu.autoRemove=e=>Ze(e);const wu=(e,t,n)=>{var l;return(l=e.getValue(t))==null?void 0:l.includes(n)};wu.autoRemove=e=>Ze(e)||!(e!=null&&e.length);const yu=(e,t,n)=>!n.some(l=>{var o;return!((o=e.getValue(t))!=null&&o.includes(l))});yu.autoRemove=e=>Ze(e)||!(e!=null&&e.length);const ku=(e,t,n)=>n.some(l=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(l)});ku.autoRemove=e=>Ze(e)||!(e!=null&&e.length);const Su=(e,t,n)=>e.getValue(t)===n;Su.autoRemove=e=>Ze(e);const Cu=(e,t,n)=>e.getValue(t)==n;Cu.autoRemove=e=>Ze(e);const Go=(e,t,n)=>{let[l,o]=n;const r=e.getValue(t);return r>=l&&r<=o};Go.resolveFilterValue=e=>{let[t,n]=e,l=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,r=t===null||Number.isNaN(l)?-1/0:l,s=n===null||Number.isNaN(o)?1/0:o;if(r>s){const u=r;r=s,s=u}return[r,s]};Go.autoRemove=e=>Ze(e)||Ze(e[0])&&Ze(e[1]);const ct={includesString:_u,includesStringSensitive:vu,equalsString:bu,arrIncludes:wu,arrIncludesAll:yu,arrIncludesSome:ku,equals:Su,weakEquals:Cu,inNumberRange:Go};function Ze(e){return e==null||e===""}const Dm={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Qe("columnFilters",e),onGlobalFilterChange:Qe("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n,l;const o=(n=e.getCoreRowModel().flatRows[0])==null||(l=n._getAllCellsByColumnId()[t.id])==null?void 0:l.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>({getAutoFilterFn:()=>{const n=t.getCoreRowModel().flatRows[0],l=n==null?void 0:n.getValue(e.id);return typeof l=="string"?ct.includesString:typeof l=="number"?ct.inNumberRange:typeof l=="boolean"||l!==null&&typeof l=="object"?ct.equals:Array.isArray(l)?ct.arrIncludes:ct.weakEquals},getFilterFn:()=>{var n,l;return Sl(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:ct[e.columnDef.filterFn]},getCanFilter:()=>{var n,l,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((l=t.options.enableColumnFilters)!=null?l:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},getCanGlobalFilter:()=>{var n,l,o,r;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((l=t.options.enableGlobalFilter)!=null?l:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((r=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn},getIsFiltered:()=>e.getFilterIndex()>-1,getFilterValue:()=>{var n,l;return(n=t.getState().columnFilters)==null||(l=n.find(o=>o.id===e.id))==null?void 0:l.value},getFilterIndex:()=>{var n,l;return(n=(l=t.getState().columnFilters)==null?void 0:l.findIndex(o=>o.id===e.id))!=null?n:-1},setFilterValue:n=>{t.setColumnFilters(l=>{const o=e.getFilterFn(),r=l==null?void 0:l.find(c=>c.id===e.id),s=$t(n,r?r.value:void 0);if(ks(o,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(r){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:()=>ct.includesString,getGlobalFilterFn:()=>{var t,n;const{globalFilterFn:l}=e.options;return Sl(l)?l:l==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[l])!=null?t:ct[l]},setColumnFilters:t=>{const n=e.getAllLeafColumns(),l=o=>{var r;return(r=$t(t,o))==null?void 0:r.filter(s=>{const u=n.find(a=>a.id===s.id);if(u){const a=u.getFilterFn();if(ks(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 ks(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Im=(e,t,n)=>n.reduce((l,o)=>{const r=o.getValue(e);return l+(typeof r=="number"?r:0)},0),Nm=(e,t,n)=>{let l;return n.forEach(o=>{const r=o.getValue(e);r!=null&&(l>r||l===void 0&&r>=r)&&(l=r)}),l},Pm=(e,t,n)=>{let l;return n.forEach(o=>{const r=o.getValue(e);r!=null&&(l=r)&&(l=r)}),l},Tm=(e,t,n)=>{let l,o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(l===void 0?s>=s&&(l=o=s):(l>s&&(l=s),o{let n=0,l=0;if(t.forEach(o=>{let r=o.getValue(e);r!=null&&(r=+r)>=r&&(++n,l+=r)}),n)return l/n},Vm=(e,t)=>{if(!t.length)return;const n=t.map(r=>r.getValue(e));if(!Cm(n))return;if(n.length===1)return n[0];const l=Math.floor(n.length/2),o=n.sort((r,s)=>r-s);return n.length%2!==0?o[l]:(o[l-1]+o[l])/2},zm=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Lm=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,qm=(e,t)=>t.length,Xl={sum:Im,min:Nm,max:Pm,extent:Tm,mean:Om,median:Vm,unique:zm,uniqueCount:Lm,count:qm},Hm={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:Qe("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,o,r;return(n=(l=(o=(r=e.columnDef.enableGrouping)!=null?r:!0)!=null?o: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 Xl.sum;if(Object.prototype.toString.call(l)==="[object Date]")return Xl.extent},getAggregationFn:()=>{var n,l;if(!e)throw new Error;return Sl(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:Xl[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 o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}})};function Gm(e,t,n){if(!(t!=null&&t.length)||!n)return e;const l=e.filter(r=>!t.includes(r.id));return n==="remove"?l:[...t.map(r=>e.find(s=>s.id===r)).filter(Boolean),...l]}const Bm={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Qe("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:oe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,l)=>o=>{let r=[];if(!(t!=null&&t.length))r=o;else{const s=[...t],u=[...o];for(;u.length&&s.length;){const a=s.shift(),f=u.findIndex(c=>c.id===a);f>-1&&r.push(u.splice(f,1)[0])}r=[...r,...u]}return Gm(r,n,l)},{key:!1})})},So=0,Co=10,Yl=()=>({pageIndex:So,pageSize:Co}),jm={getInitialState:e=>({...e,pagination:{...Yl(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Qe("pagination",e)}),createTable:e=>{let t=!1,n=!1;return{_autoResetPageIndex:()=>{var l,o;if(!t){e._queue(()=>{t=!0});return}if((l=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?l:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},setPagination:l=>{const o=r=>$t(l,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},resetPagination:l=>{var o;e.setPagination(l?Yl():(o=e.initialState.pagination)!=null?o:Yl())},setPageIndex:l=>{e.setPagination(o=>{let r=$t(l,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,s)),{...o,pageIndex:r}})},resetPageIndex:l=>{var o,r,s;e.setPageIndex(l?So:(o=(r=e.initialState)==null||(s=r.pagination)==null?void 0:s.pageIndex)!=null?o:So)},resetPageSize:l=>{var o,r,s;e.setPageSize(l?Co:(o=(r=e.initialState)==null||(s=r.pagination)==null?void 0:s.pageSize)!=null?o:Co)},setPageSize:l=>{e.setPagination(o=>{const r=Math.max(1,$t(l,o.pageSize)),s=o.pageSize*o.pageIndex,u=Math.floor(s/r);return{...o,pageIndex:u,pageSize:r}})},setPageCount:l=>e.setPagination(o=>{var r;let s=$t(l,(r=e.options.pageCount)!=null?r:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),getPageOptions:oe(()=>[e.getPageCount()],l=>{let o=[];return l&&l>0&&(o=[...new Array(l)].fill(null).map((r,s)=>s)),o},{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,o=e.getPageCount();return o===-1?!0:o===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)}}}},Ql=()=>({left:[],right:[]}),xm={getInitialState:e=>({columnPinning:Ql(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Qe("columnPinning",e)}),createColumn:(e,t)=>({pin:n=>{const l=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var r,s;if(n==="right"){var u,a;return{left:((u=o==null?void 0:o.left)!=null?u:[]).filter(d=>!(l!=null&&l.includes(d))),right:[...((a=o==null?void 0:o.right)!=null?a:[]).filter(d=>!(l!=null&&l.includes(d))),...l]}}if(n==="left"){var f,c;return{left:[...((f=o==null?void 0:o.left)!=null?f:[]).filter(d=>!(l!=null&&l.includes(d))),...l],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(d=>!(l!=null&&l.includes(d)))}}return{left:((r=o==null?void 0:o.left)!=null?r:[]).filter(d=>!(l!=null&&l.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(l!=null&&l.includes(d)))}})},getCanPin:()=>e.getLeafColumns().some(l=>{var o,r;return((o=l.columnDef.enablePinning)!=null?o:!0)&&((r=t.options.enablePinning)!=null?r:!0)}),getIsPinned:()=>{const n=e.getLeafColumns().map(u=>u.id),{left:l,right:o}=t.getState().columnPinning,r=n.some(u=>l==null?void 0:l.includes(u)),s=n.some(u=>o==null?void 0:o.includes(u));return r?"left":s?"right":!1},getPinnedIndex:()=>{var n,l,o;const r=e.getIsPinned();return r?(n=(l=t.getState().columnPinning)==null||(o=l[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}}),createRow:(e,t)=>({getCenterVisibleCells:oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,l,o)=>{const r=[...l??[],...o??[]];return n.filter(s=>!r.includes(s.column.id))},{key:"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getLeftVisibleCells:oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,l)=>(l??[]).map(r=>n.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),{key:"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),getRightVisibleCells:oe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,l)=>(l??[]).map(r=>n.find(s=>s.column.id===r)).filter(Boolean).map(r=>({...r,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?Ql():(n=(l=e.initialState)==null?void 0:l.columnPinning)!=null?n:Ql())},getIsSomeColumnsPinned:t=>{var n;const l=e.getState().columnPinning;if(!t){var o,r;return!!((o=l.left)!=null&&o.length||(r=l.right)!=null&&r.length)}return!!((n=l[t])!=null&&n.length)},getLeftLeafColumns:oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(l=>t.find(o=>o.id===l)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getRightLeafColumns:oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(l=>t.find(o=>o.id===l)).filter(Boolean),{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),getCenterLeafColumns:oe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,l)=>{const o=[...n??[],...l??[]];return t.filter(r=>!o.includes(r.id))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}})})},Um={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Qe("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},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(r=>{r.getCanSelect()&&(l[r.id]=!0)}):o.forEach(r=>{delete l[r.id]}),l})},toggleAllPageRowsSelected:t=>e.setRowSelection(n=>{const l=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(r=>{$o(o,r.id,l,e)}),o}),getPreSelectedRowModel:()=>e.getCoreRowModel(),getSelectedRowModel:oe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Kl(e,n):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getFilteredSelectedRowModel:oe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Kl(e,n):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),getGroupedSelectedRowModel:oe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Kl(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(o=>o.getCanSelect()&&!n[o.id])&&(l=!1),l},getIsAllPageRowsSelected:()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some(o=>!n[o.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(o=>{if(n=typeof n<"u"?n:!l,l===n)return o;const r={...o};return $o(r,e.id,n,t),r})},getIsSelected:()=>{const{rowSelection:n}=t.getState();return Bo(e,n)},getIsSomeSelected:()=>{const{rowSelection:n}=t.getState();return Ss(e,n)==="some"},getIsAllSubRowsSelected:()=>{const{rowSelection:n}=t.getState();return Ss(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 o;n&&e.toggleSelected((o=l.target)==null?void 0:o.checked)}}})},$o=(e,t,n,l)=>{var o;const r=l.getRow(t);n?(r.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),r.getCanSelect()&&(e[t]=!0)):delete e[t],(o=r.subRows)!=null&&o.length&&r.getCanSelectSubRows()&&r.subRows.forEach(s=>$o(e,s.id,n,l))};function Kl(e,t){const n=e.getState().rowSelection,l=[],o={},r=function(s,u){return s.map(a=>{var f;const c=Bo(a,n);if(c&&(l.push(a),o[a.id]=a),(f=a.subRows)!=null&&f.length&&(a={...a,subRows:r(a.subRows)}),c)return a}).filter(Boolean)};return{rows:r(t.rows),flatRows:l,rowsById:o}}function Bo(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ss(e,t,n){if(e.subRows&&e.subRows.length){let l=!0,o=!1;return e.subRows.forEach(r=>{o&&!l||(Bo(r,t)?o=!0:l=!1)}),l?"all":o?"some":!1}return!1}const Ao=/([0-9]+)/gm,Wm=(e,t,n)=>$u(Rt(e.getValue(n)).toLowerCase(),Rt(t.getValue(n)).toLowerCase()),Xm=(e,t,n)=>$u(Rt(e.getValue(n)),Rt(t.getValue(n))),Ym=(e,t,n)=>jo(Rt(e.getValue(n)).toLowerCase(),Rt(t.getValue(n)).toLowerCase()),Qm=(e,t,n)=>jo(Rt(e.getValue(n)),Rt(t.getValue(n))),Km=(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:ljo(e.getValue(n),t.getValue(n));function jo(e,t){return e===t?0:e>t?1:-1}function Rt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function $u(e,t){const n=e.split(Ao).filter(Boolean),l=t.split(Ao).filter(Boolean);for(;n.length&&l.length;){const o=n.shift(),r=l.shift(),s=parseInt(o,10),u=parseInt(r,10),a=[s,u].sort();if(isNaN(a[0])){if(o>r)return 1;if(r>o)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 cn={alphanumeric:Wm,alphanumericCaseSensitive:Xm,text:Ym,textCaseSensitive:Qm,datetime:Km,basic:Jm},Zm={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Qe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>({getAutoSortingFn:()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!1;for(const o of n){const r=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return cn.datetime;if(typeof r=="string"&&(l=!0,r.split(Ao).length>1))return cn.alphanumeric}return l?cn.text:cn.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 Sl(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:cn[e.columnDef.sortingFn]},toggleSorting:(n,l)=>{const o=e.getNextSortingOrder(),r=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=r?n:o==="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"&&(r||o||(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,o;const r=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==r&&((l=t.options.enableSortingRemoval)==null||l)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":r},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(o=>o.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(o=>o.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())})},e_={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Qe("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:oe(()=>[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:oe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,l,o)=>[...n,...l,...o],{key:!1,debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})}),createTable:e=>{const t=(n,l)=>oe(()=>[l(),l().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o: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((o,r)=>({...o,[r.id]:n||!(r.getCanHide!=null&&r.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)}}}},Cs=[Rm,e_,Bm,xm,Dm,Zm,Hm,Fm,jm,Um,Mm];function t_(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:Cs};const l=n._features.reduce((c,d)=>Object.assign(c,d.getDefaultOptions==null?void 0:d.getDefaultOptions(n)),{}),o=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:Cs,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=$t(c,n.options);n.options=o(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:oe(()=>[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:oe(()=>[n._getColumnDefs()],c=>{const d=function(g,p,m){return m===void 0&&(m=0),g.map(_=>{const v=Am(n,_,m,p),w=_;return v.columns=w.columns?d(w.columns,v,m+1):[],v})};return d(c)},{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),getAllFlatColumns:oe(()=>[n.getAllColumns()],c=>c.flatMap(d=>d.getFlatColumns()),{key:!1,debug:()=>{var c;return(c=n.options.debugAll)!=null?c:n.options.debugColumns}}),_getAllFlatColumnsById:oe(()=>[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:oe(()=>[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 n_(e,t,n,l){const o=()=>{var s;return(s=r.getValue())!=null?s:e.options.renderFallbackValue},r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:o,getContext:oe(()=>[e,n,t,r],(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(r,s.createCell==null?void 0:s.createCell(r,n,t,e))},{}),r}const xo=(e,t,n,l,o,r,s)=>{let u={id:t,index:l,original:n,depth:o,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:r??[],getLeafRows:()=>$m(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:oe(()=>[e.getAllLeafColumns()],a=>a.map(f=>n_(e,u,f,f.id)),{key:!1,debug:()=>{var a;return(a=e.options.debugAll)!=null?a:e.options.debugRows}}),_getAllCellsByColumnId:oe(()=>[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 $s(){return e=>oe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(o,r,s){r===void 0&&(r=0);const u=[];for(let f=0;f{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function Au(e,t,n){return n.options.filterFromLeafRows?o_(e,t,n):i_(e,t,n)}function o_(e,t,n){var l;const o=[],r={},s=(l=n.options.maxLeafRowFilterDepth)!=null?l:100,u=function(a,f){f===void 0&&(f=0);const c=[];for(let g=0;goe(()=>[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 _=m.getFilterFn();_&&o.push({id:g.id,filterFn:_,resolvedValue:(p=_.resolveFilterValue==null?void 0:_.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;r.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(r.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 Rs(){return(e,t)=>oe(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,l,o)=>{if(!n.rows.length||!(l!=null&&l.length)&&!o)return n;const r=[...l.map(u=>u.id).filter(u=>u!==t),o?"__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=>oe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const l=e.getState().sorting,o=[],r=l.filter(a=>{var f;return(f=e.getColumn(a.id))==null?void 0:f.getCanSort()}),s={};r.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{var d;o.push(c),(d=c.subRows)!=null&&d.length&&(c.subRows=u(c.subRows))}),f};return{rows:u(n.rows),flatRows:o,rowsById:n.rowsById}},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function r_(e){const t=[],n=l=>{var o;t.push(l),(o=l.subRows)!=null&&o.length&&l.getIsExpanded()&&l.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Es(e){return t=>oe(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,l)=>{if(!l.rows.length)return l;const{pageSize:o,pageIndex:r}=n;let{rows:s,flatRows:u,rowsById:a}=l;const f=o*r,c=f+o;s=s.slice(f,c);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:u,rowsById:a}:d=r_({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 s_(e){let t;return{c(){t=H(e[0])},l(n){t=ju(n,e[0])},m(n,l){zu(n,t,l)},p(n,[l]){l&1&&K(t,n[0])},i:U,o:U,d(n){n&&P(t)}}}function a_(e,t,n){let{content:l}=t;return e.$$set=o=>{"content"in o&&n(0,l=o.content)},[l]}class u_ extends ce{constructor(t){super(),de(this,t,a_,s_,fe,{content:0})}}const f_=fa((e,t,n,l)=>`${af(t.content)}`);var c_=typeof document>"u"?f_:u_;function d_(e,t,n){let l,o;return l=new t({props:n,$$inline:!0}),{c(){ne(l.$$.fragment)},l(r){ff(l.$$.fragment,r)},m(r,s){ee(l,r,s),o=!0},p:U,i(r){o||(V(l.$$.fragment,r),o=!0)},o(r){z(l.$$.fragment,r),o=!1},d(r){te(l,r)}}}function h_(e,t){return class extends ce{constructor(l){super(),de(this,l,null,o=>d_(o,e,t),fe,{},void 0)}}}function g_(e,t){return fa((l,o,r,s)=>`${uf(e,"TableComponent").$$render(l,t,{},{})}`)}const Ro=typeof window>"u"?g_:h_;function p_(e){return typeof e=="object"&&typeof e.$$render=="function"&&typeof e.render=="function"}function m_(e){var t,n;let l="__SVELTE_HMR"in window;return e.prototype instanceof ce||l&&((t=e.name)==null?void 0:t.startsWith("Proxy<"))&&((n=e.name)==null?void 0:n.endsWith(">"))}function Fs(e){return typeof document>"u"?p_(e):m_(e)}function Ds(e){return Ro(c_,{content:e})}function Cl(e,t){if(!e)return null;if(Fs(e))return Ro(e,t);if(typeof e=="function"){const n=e(t);return n==null?null:Fs(n)?Ro(n,t):Ds(n)}return Ds(e)}function Is(e){let t;"subscribe"in e?t=e:t=to(e);let n={state:{},onStateChange:()=>{},renderFallbackValue:null,...Fu(t)},l=t_(n),o=De(l.initialState),r=df([o,t],u=>u);return to(l,function(a){const f=r.subscribe(c=>{let[d,g]=c;l.setOptions(p=>({...p,...g,state:{...d,...g.state},onStateChange:m=>{m instanceof Function?o.update(m):o.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 Ru={À:"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"},__=Object.keys(Ru).join("|"),v_=new RegExp(__,"g");function b_(e){return e.replace(v_,t=>Ru[t])}/** + * @name match-sorter + * @license MIT license. + * @copyright (c) 2099 Kent C. Dodds + * @author Kent C. Dodds (https://kentcdodds.com) + */const Le={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function w_(e,t,n){var l;if(n=n||{},n.threshold=(l=n.threshold)!=null?l:Le.MATCHES,!n.accessors){const s=Ns(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const o=C_(e,n.accessors),r={rankedValue:e,rank:Le.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s=Le.MATCHES?a=f:a>c&&(a=c),a=Math.min(a,c),a>=d&&a>r.rank&&(r.rank=a,r.passed=!0,r.accessorIndex=s,r.accessorThreshold=d,r.rankedValue=u.itemValue)}return r}function Ns(e,t,n){return e=Ps(e,n),t=Ps(t,n),t.length>e.length?Le.NO_MATCH:e===t?Le.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Le.EQUAL:e.startsWith(t)?Le.STARTS_WITH:e.includes(` ${t}`)?Le.WORD_STARTS_WITH:e.includes(t)?Le.CONTAINS:t.length===1?Le.NO_MATCH:y_(e).includes(t)?Le.ACRONYM:k_(e,t))}function y_(e){let t="";return e.split(" ").forEach(l=>{l.split("-").forEach(r=>{t+=r.substr(0,1)})}),t}function k_(e,t){let n=0,l=0;function o(a,f,c){for(let d=c,g=f.length;d-1))return Le.NO_MATCH}const u=l-s;return r(u)}function Ps(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=b_(e)),e}function S_(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 C_(e,t){const n=[];for(let l=0,o=t.length;l{te(m,1)}),ye()}c?(n=At(c,d()),ne(n.$$.fragment),V(n.$$.fragment,1),ee(n,t,l)):n=null}},i(g){u||(n&&V(n.$$.fragment,g),u=!0)},o(g){n&&z(n.$$.fragment,g),u=!1},d(g){g&&P(t),n&&te(n),a=!1,f()}}}function qs(e){let t,n,l=!e[26].isPlaceholder&&A_(e);return{c(){t=R("th"),l&&l.c(),h(t,"colspan",e[26].colSpan),h(t,"class","svelte-16fb3tv")},m(o,r){T(o,t,r),l&&l.m(t,null),n=!0},p(o,r){o[26].isPlaceholder||l.p(o,r)},i(o){n||(V(l),n=!0)},o(o){z(l),n=!1},d(o){o&&P(t),l&&l.d()}}}function Hs(e){let t,n,l,o=e[23].headers,r=[];for(let u=0;uz(r[u],1,1,()=>{r[u]=null});return{c(){t=R("tr");for(let u=0;u{te(f,1)}),ye()}r?(l=At(r,s()),ne(l.$$.fragment),V(l.$$.fragment,1),ee(l,n,null)):l=null}},i(u){o||(l&&V(l.$$.fragment,u),o=!0)},o(u){l&&z(l.$$.fragment,u),o=!1},d(u){u&&P(n),l&&te(l)}}}function Bs(e){let t,n=[],l=new Map,o,r,s=e[17].getVisibleCells();const u=a=>a[20].id;for(let a=0;a",pe,W,Q,X,Y,le=e[5],he=[];for(let ie=0;iez(he[ie],1,1,()=>{he[ie]=null});let Et=e[1].getRowModel().rows,$e=[];for(let ie=0;iez($e[ie],1,1,()=>{$e[ie]=null});return{c(){t=R("div"),n=R("input"),l=N(),o=R("div"),r=R("table"),s=R("thead");for(let ie=0;ie(r(),r=$l(w,$=>n(1,o=$)),w);ue(e,kl,$=>n(8,l=$)),e.$$.on_destroy.push(()=>r());const u=($,F,S,A)=>{if(console.log("yessir"),Array.isArray(S))return S.length===0?!0:S.includes($.getValue(F));typeof S=="number"&&(S=String(S));const k=w_($.getValue(F),S);return A({itemRank:k}),k.passed},a=l_(),f=[a.accessor("file",{header:"File",cell:$=>$.getValue(),footer:$=>$.column.id}),a.accessor("size",{header:"Size",cell:$=>ro($.getValue()),footer:$=>$.column.id}),a.accessor("type",{header:"Type",cell:$=>$.getValue(),footer:$=>$.column.id})];let c="",d=De({data:l,columns:f,getCoreRowModel:$s(),getSortedRowModel:Ms(),getFilteredRowModel:As(),globalFilterFn:u,getFacetedRowModel:Rs(),getPaginationRowModel:Es(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0});function g($){n(6,c=$),d.update(F=>({...F,state:{...F.state,globalFilter:$}}))}function p($){d.update(F=>{var S;return{...F,state:{...F.state,pagination:{...(S=F.state)==null?void 0:S.pagination,pageIndex:$}}}})}let m;function _($){clearTimeout(m),m=setTimeout(()=>{const F=$.target;g(F.value)},100)}function v($){const F=$.target;p(parseInt(F.value)-1)}let w=Is(d);s();let y=o.getHeaderGroups();const C=()=>p(o.getState().pagination.pageIndex-1),M=()=>p(o.getState().pagination.pageIndex+1);return e.$$.update=()=>{e.$$.dirty&448&&(n(7,d={data:l,columns:f,getCoreRowModel:$s(),getSortedRowModel:Ms(),getFilteredRowModel:As(),globalFilterFn:u,getFacetedRowModel:Rs(),getPaginationRowModel:Es(),state:{globalFilter:c,pagination:{pageSize:7,pageIndex:0}},enableGlobalFilter:!0}),s(n(0,w=Is(De(d)))))},[w,o,p,_,v,y,c,d,l,C,M]}class F_ extends ce{constructor(t){super(),de(this,t,E_,R_,fe,{})}}function js(e){let t,n;return{c(){t=R("p"),n=H(e[3])},m(l,o){T(l,t,o),b(t,n)},p(l,o){o&8&&K(n,l[3])},d(l){l&&P(t)}}}function xs(e){let t;return{c(){t=R("p"),t.textContent="Data Successfully indexed!"},m(n,l){T(n,t,l)},d(n){n&&P(t)}}}function Us(e){let t,n;return t=new F_({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function D_(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_,v,w,y,C,M,$,F,S,A=e[2]&&!e[1]&&js(e),k=e[1]&&xs();C=new Sm({});let E=e[0]&&Us();return{c(){t=R("div"),n=R("div"),l=R("div"),o=R("div"),r=R("h4"),r.textContent="Upload Data",s=N(),u=R("br"),a=N(),f=R("form"),c=R("input"),d=N(),A&&A.c(),g=N(),k&&k.c(),p=N(),m=R("p"),m.textContent="These are the files your model will use as context.",_=N(),v=R("p"),v.innerHTML="Currently pdf, txt, and md are supported.",w=N(),y=R("div"),ne(C.$$.fragment),M=N(),E&&E.c(),h(c,"type","file"),c.multiple=!0,h(o,"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,o),b(o,r),b(o,s),b(o,u),b(o,a),b(o,f),b(f,c),b(o,d),A&&A.m(o,null),b(o,g),k&&k.m(o,null),b(o,p),b(o,m),b(o,_),b(o,v),b(t,w),b(t,y),ee(C,y,null),b(y,M),E&&E.m(y,null),$=!0,F||(S=x(c,"change",e[4]),F=!0)},p(I,[D]){I[2]&&!I[1]?A?A.p(I,D):(A=js(I),A.c(),A.m(o,g)):A&&(A.d(1),A=null),I[1]?k||(k=xs(),k.c(),k.m(o,p)):k&&(k.d(1),k=null),I[0]?E?D&1&&V(E,1):(E=Us(),E.c(),V(E,1),E.m(y,null)):E&&(we(),z(E,1,1,()=>{E=null}),ye())},i(I){$||(V(C.$$.fragment,I),V(E),$=!0)},o(I){z(C.$$.fragment,I),z(E),$=!1},d(I){I&&P(t),A&&A.d(),k&&k.d(),te(C),E&&E.d(),F=!1,S()}}}function I_(e,t,n){let l,o,r;ue(e,vs,m=>n(6,o=m)),ue(e,kl,m=>n(7,r=m));let s=[],u=!1,a=!1;async function f(m){n(0,s=m.target.files);const _=new FormData;for(let v=0;v({file:w.name,size:w.size,type:w.type}));Pe(kl,r=[...v],r)}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 _=await(await fetch("/retrieval/vector_db/get")).json();console.log("embeddingData",_),Pe(vs,o=_,o)}ft(()=>{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 N_ extends ce{constructor(t){super(),de(this,t,I_,D_,fe,{})}}function P_(e){let t,n,l,o,r,s,u,a,f,c,d,g,p,m,_,v,w,y,C,M,$,F,S,A,k,E,I;return r=new Xa({}),a=new Ya({}),d=new Ba({}),m=new xa({props:{feedback:"Bad"}}),w=new Wa({}),M=new Ua({}),E=new ja({}),{c(){t=R("div"),n=R("div"),l=R("div"),o=R("div"),ne(r.$$.fragment),s=N(),u=R("div"),ne(a.$$.fragment),f=N(),c=R("div"),ne(d.$$.fragment),g=N(),p=R("div"),ne(m.$$.fragment),_=N(),v=R("div"),ne(w.$$.fragment),y=N(),C=R("div"),ne(M.$$.fragment),$=N(),F=R("div"),S=R("div"),S.innerHTML=`
+
`,A=N(),k=R("div"),ne(E.$$.fragment),h(o,"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(v,"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(k,"class","right-table svelte-14znspc"),h(F,"class","feedback-right svelte-14znspc"),h(t,"class","feedback-container svelte-14znspc")},m(D,L){T(D,t,L),b(t,n),b(n,l),b(l,o),ee(r,o,null),b(l,s),b(l,u),ee(a,u,null),b(n,f),b(n,c),ee(d,c,null),b(n,g),b(n,p),ee(m,p,null),b(n,_),b(n,v),ee(w,v,null),b(n,y),b(n,C),ee(M,C,null),b(t,$),b(t,F),b(F,S),b(F,A),b(F,k),ee(E,k,null),I=!0},p:U,i(D){I||(V(r.$$.fragment,D),V(a.$$.fragment,D),V(d.$$.fragment,D),V(m.$$.fragment,D),V(w.$$.fragment,D),V(M.$$.fragment,D),V(E.$$.fragment,D),I=!0)},o(D){z(r.$$.fragment,D),z(a.$$.fragment,D),z(d.$$.fragment,D),z(m.$$.fragment,D),z(w.$$.fragment,D),z(M.$$.fragment,D),z(E.$$.fragment,D),I=!1},d(D){D&&P(t),te(r),te(a),te(d),te(m),te(w),te(M),te(E)}}}function T_(e,t,n){let l;ue(e,Rn,r=>n(0,l=r)),ft(()=>{console.log("FEEDBACK on mount"),o()});async function o(){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]}));Pe(Rn,l=[...a],l)}return[]}class O_ extends ce{constructor(t){super(),de(this,t,T_,P_,fe,{})}}function V_(e){let t,n;return t=new Qa({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function z_(e){let t,n;return t=new O_({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function L_(e){let t,n;return t=new Qa({}),{c(){ne(t.$$.fragment)},m(l,o){ee(t,l,o),n=!0},i(l){n||(V(t.$$.fragment,l),n=!0)},o(l){z(t.$$.fragment,l),n=!1},d(l){te(t,l)}}}function q_(e){let t,n,l,o;const r=[L_,z_,V_],s=[];function u(a,f){return a[0]==="vote"?0:a[0]==="rag"?1:2}return t=u(e),n=s[t]=r[t](e),{c(){n.c(),l=Se()},m(a,f){s[t].m(a,f),T(a,l,f),o=!0},p(a,[f]){let c=t;t=u(a),t!==c&&(we(),z(s[c],1,1,()=>{s[c]=null}),ye(),n=s[t],n||(n=s[t]=r[t](a),n.c()),V(n,1),n.m(l.parentNode,l))},i(a){o||(V(n),o=!0)},o(a){z(n),o=!1},d(a){s[t].d(a),a&&P(l)}}}function H_(e,t,n){let{feedback:l}=t;return e.$$set=o=>{"feedback"in o&&n(0,l=o.feedback)},[l]}class G_ extends ce{constructor(t){super(),de(this,t,H_,q_,fe,{feedback:0})}}function Ws(e,t,n){const l=e.slice();return l[7]=t[n],l}function Xs(e){let t,n=e[0],l=[];for(let o=0;o{te(c,1)}),ye()}r?(t=At(r,s()),ne(t.$$.fragment),V(t.$$.fragment,1),ee(t,n.parentNode,n)):t=null}else r&&t.$set(f)},i(u){l||(t&&V(t.$$.fragment,u),l=!0)},o(u){t&&z(t.$$.fragment,u),l=!1},d(u){u&&P(n),t&&te(t,u)}}}function B_(e){let t,n,l,o=e[0].length>1&&Xs(e),r=e[1]&&Qs(e);return{c(){o&&o.c(),t=N(),r&&r.c(),n=Se()},m(s,u){o&&o.m(s,u),T(s,t,u),r&&r.m(s,u),T(s,n,u),l=!0},p(s,[u]){s[0].length>1?o?o.p(s,u):(o=Xs(s),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null),s[1]?r?(r.p(s,u),u&2&&V(r,1)):(r=Qs(s),r.c(),V(r,1),r.m(n.parentNode,n)):r&&(we(),z(r,1,1,()=>{r=null}),ye())},i(s){l||(V(r),l=!0)},o(s){z(r),l=!1},d(s){o&&o.d(s),s&&P(t),r&&r.d(s),s&&P(n)}}}function j_(e,t,n){let l,o;const r=De([]);ue(e,r,c=>n(0,l=c));const s=De(null);ue(e,s,c=>n(1,o=c));const u={Chatbot:Xd,Dropdown:Kd,Feedback:G_,Compare:kp,CompareDashboard:qp,RetrievalQA:N_},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=>{r.set(c),s.set(c[0])}).catch(c=>{console.log("Fetch request failed",c)}),[l,o,r,s,u,a,c=>a(c)]}class x_ extends ce{constructor(t){super(),de(this,t,j_,B_,fe,{})}}new x_({target:document.getElementById("app")}); diff --git a/pykoi/frontend/dist/index.html b/pykoi/frontend/dist/index.html index d5f0e40..dd1cc11 100644 --- a/pykoi/frontend/dist/index.html +++ b/pykoi/frontend/dist/index.html @@ -5,8 +5,8 @@ Vite + Svelte - - + +