1"use strict";(self.webpackChunkstudentfrontend=self.webpackChunkstudentfrontend||[]).push([[212],{212:function(e,t,a){a.r(t),a.d(t,{default:function(){return oe}});var n=a(524);const o={class:"documentchat-search-area"},s=["for"],r=["id","placeholder","disabled"],l={key:0,class:"documentchat-suggestions"},i=["onMousedown"],c={class:"documentchat-suggestion-term"},d=["disabled"],u={key:0,class:"documentchat-filters"},m={class:"documentchat-filters-row"},h={class:"documentchat-filter-field"},g={class:"documentchat-filter-field"},p=["value"],y={class:"documentchat-filter-field"},f=["value"],v={class:"documentchat-filter-field"},k=["value"],N={class:"documentchat-filter-field"},E=["value"],S={key:0,class:"documentchat-results-wrapper"},V={key:0,class:"documentchat-typing"},B={key:1,class:"documentchat-results-count"},C={class:"documentchat-main"},b={class:"documentchat-results"},T={class:"documentchat-eval-header"},w={class:"documentchat-eval-meta"},x=["innerHTML"],L={key:1,class:"documentchat-typing"},D={class:"documentchat-eval-actions"},M=["onClick"],I=["onClick"],F=["href"],O={key:0,class:"documentchat-pagination"},P=["disabled"],Q={class:"documentchat-pagination-info"},A=["disabled"],U={class:"documentchat-chat-panel"},q={key:0,class:"documentchat-quick-questions"},K=["onClick"],j={key:0,class:"documentchat-typing documentchat-typing--inline"},H={class:"documentchat-messages",ref:"messagesContainer"},$={class:"documentchat-message-content"},R=["innerHTML"],z={key:1},_={key:0,class:"documentchat-citations"},J=["href"],W={key:0,class:"documentchat-message documentchat-message--assistant"},G={class:"documentchat-message-content"},X=["innerHTML"],Y={key:1,class:"documentchat-typing"},Z={key:1,class:"documentchat-error",role:"alert"},ee=["disabled"],te=["disabled"],ae={key:1,class:"documentchat-error",role:"alert"};var ne={name:"EvaluationChat",props:{chatApiUrl:{type:String,required:!0},systemPrompt:{type:String,default:""},noResultMessage:{type:String,default:""},placeholderText:{type:String,default:"Sök kursutvärderingar..."},maxOutputTokens:{type:Number,default:800},lang:{type:String,default:"sv"},showFilters:{type:Boolean,default:!1},indexName:{type:String,default:""}},data(){return{inputId:"documentchat-input-"+Math.random().toString(36).substring(2,9),searchQuery:"",searchLoading:!1,searchError:null,results:[],totalCount:0,currentPage:1,pageSize:20,filterCourseCode:"",filterTerm:"",filterFaculty:"",filterLevel:"",filterStudyType:"",termOptions:[],facultyOptions:[],levelOptions:[],studyTypeOptions:[],chatMessages:[],chatInput:"",chatLoading:!1,chatError:null,streamingContent:"",aiQuestions:[],aiQuestionsLoading:!1,suggestions:[],showSuggestions:!1,highlightedIndex:-1,suggestTimer:null,quickQuestions:["Punkta upp en sammanfattning av alla kurser","Hur skiljer sig kurserna mot varandra? Svara i tabellform"]}},computed:{evaluationApiBaseUrl(){return this.chatApiUrl+"/Evaluation"},allQuickQuestions(){return this.quickQuestions.concat(this.aiQuestions)},hasActiveFilter(){return""!==this.filterCourseCode.trim()||""!==this.filterTerm||""!==this.filterFaculty||""!==this.filterLevel||""!==this.filterStudyType},activeFilters(){var e={};return this.filterCourseCode.trim()&&(e.coursecode=this.filterCourseCode.trim().toUpperCase()),this.filterTerm&&(e.term=this.filterTerm),this.filterFaculty&&(e.faculty=this.filterFaculty),this.filterLevel&&(e.level=this.filterLevel),this.filterStudyType&&(e.studytype=this.filterStudyType),e},totalPages(){return Math.ceil(this.totalCount/this.pageSize)},resultDocumentIds(){return this.results.map(function(e){return e.documentId})}},mounted(){this.showFilters&&this.loadFilterOptions()},methods:{async loadFilterOptions(){try{var e=this.evaluationApiBaseUrl+"/Filters"+(this.indexName?"?indexName="+encodeURIComponent(this.indexName):""),t=await fetch(e);if(t.ok){var a=await t.json();this.termOptions=a.term||[],this.facultyOptions=a.faculty||[],this.levelOptions=a.level||[],this.studyTypeOptions=a.studytype||[]}}catch(e){console.error("Failed to load filter options:",e)}},onSearchInput(){clearTimeout(this.suggestTimer);var e=this,t=this.searchQuery.trim();if(t.length<2)return this.suggestions=[],void(this.showSuggestions=!1);this.suggestTimer=setTimeout(function(){e.fetchSuggestions(t)},120)},async fetchSuggestions(e){try{var t=this.evaluationApiBaseUrl+"/Suggest?q="+encodeURIComponent(e)+(this.indexName?"&indexName="+encodeURIComponent(this.indexName):""),a=await fetch(t);a.ok&&(this.suggestions=await a.json(),this.highlightedIndex=-1,this.showSuggestions=this.suggestions.length>0)}catch(e){console.error("Suggest failed:",e)}},selectSuggestion(e){this.searchQuery=e.courseCode+" "+e.courseName,this.suggestions=[],this.showSuggestions=!1,this.performSearch(1)},hideSuggestionsDelayed(){var e=this;setTimeout(function(){e.showSuggestions=!1},150)},highlightNext(){this.highlightedIndex<this.suggestions.length-1&&this.highlightedIndex++},highlightPrev(){this.highlightedIndex>0&&this.highlightedIndex--},onEnterKey(e){this.showSuggestions&&this.highlightedIndex>=0&&(e.preventDefault(),this.selectSuggestion(this.suggestions[this.highlightedIndex]))},async performSearch(e){this.showSuggestions=!1,this.suggestions=[];var t=this.searchQuery.trim();if(t||this.hasActiveFilter){"number"!=typeof e&&(e=1),this.currentPage=e,this.searchLoading=!0,this.searchError=null;try{var a={query:t,filters:this.hasActiveFilter?this.activeFilters:void 0,page:this.currentPage,pageSize:this.pageSize,indexName:this.indexName||void 0},n=await fetch(this.evaluationApiBaseUrl+"/Search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!n.ok)throw new Error("Servern svarade med status "+n.status);var o=await n.json();this.totalCount=o.totalCount||0,this.results=(o.results||[]).map(function(e){return Object.assign({},e,{summary:"",summaryLoading:!1,_cachedSummary:""})}),o.facets&&(this.termOptions=o.facets.term||this.termOptions,this.facultyOptions=o.facets.faculty||this.facultyOptions,this.levelOptions=o.facets.level||this.levelOptions,this.studyTypeOptions=o.facets.studytype||this.studyTypeOptions),this.chatMessages=[],this.chatError=null,this.aiQuestions=[],this.results.length>0&&this.fetchAiQuestions()}catch(e){this.searchError="Sökningen misslyckades. Försök igen.",console.error("Search error:",e)}finally{this.searchLoading=!1}}},goToPage(e){this.performSearch(e)},askQuickQuestion(e){this.chatInput=e,this.sendChatMessage()},async fetchAiQuestions(){this.aiQuestionsLoading=!0;try{var e=this.results.map(function(e){return e.documentId}),t=await fetch(this.evaluationApiBaseUrl+"/SuggestQuestions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentIds:e,indexName:this.indexName||void 0})});t.ok&&(this.aiQuestions=await t.json())}catch(e){console.error("AI question suggestions failed:",e)}finally{this.aiQuestionsLoading=!1}},async sendChatMessage(){var e=this.chatInput.trim();if(e){this.chatMessages.push({role:"user",content:e}),this.chatInput="",this.chatLoading=!0,this.streamingContent="",this.chatError=null,this.scrollToBottom();var t=this.chatMessages.filter(function(e){return"user"===e.role||"assistant"===e.role&&e.content}).slice(0,-1).map(function(e){return{role:e.role,content:e.content}}),a={question:e,documentIds:this.resultDocumentIds,conversationHistory:t,systemPrompt:this.systemPrompt||void 0,maxOutputTokens:this.maxOutputTokens,indexName:this.indexName||void 0};try{var n=await fetch(this.evaluationApiBaseUrl+"/Chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!n.ok)throw new Error("Servern svarade med status "+n.status);for(var o=n.body.getReader(),s=new TextDecoder,r="",l=[];;){var i=await o.read();if(i.done)break;var c=(r+=s.decode(i.value,{stream:!0})).split("\n");r=c.pop();for(var d=0;d<c.length;d++){var u=c[d];if(u.startsWith("data: ")){var m=u.substring(6).trim();if(m)try{var h=JSON.parse(m);"content"===h.type?(this.streamingContent+=h.text,this.scrollToBottom()):"citations"===h.type&&(l=h.citations||[])}catch(e){}}}}this.chatMessages.push({role:"assistant",content:this.streamingContent,citations:l})}catch(e){this.chatError="Något gick fel. Försök igen.",console.error("Chat error:",e)}finally{this.chatLoading=!1,this.streamingContent="",this.scrollToBottom()}}},async loadSummary(e){if(e._cachedSummary)e.summary=e._cachedSummary;else{e.summaryLoading=!0,e.summary="";try{var t=await fetch(this.evaluationApiBaseUrl+"/Summary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentId:e.documentId,indexName:this.indexName||void 0,systemPrompt:this.systemPrompt||void 0})});if(!t.ok)return void(e.summary="Kunde inte ladda sammanfattning.");for(var a=t.body.getReader(),n=new TextDecoder,o="";;){var s=await a.read();if(s.done)break;var r=(o+=n.decode(s.value,{stream:!0})).split("\n");o=r.pop();for(var l=0;l<r.length;l++){var i=r[l];if(i.startsWith("data: ")){var c=i.substring(6).trim();if(c)try{var d=JSON.parse(c);"content"===d.type&&(e.summary+=d.text,this.scrollToBottom())}catch(e){}}}}e._cachedSummary=e.summary}catch(t){e.summary="Något gick fel vid laddning av sammanfattning.",console.error("LoadSummary error:",t)}
1finally{e.summaryLoading=!1}}},formatMessage(e){if(!e)return"";var t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>")).replace(/((?:^\|.+\|$\n?)+)/gm,function(e){var t=e.trim().split("\n").filter(function(e){return e.trim()});if(t.length<2)return e;for(var a='<table class="documentchat-table">',n=0;n<t.length;n++){var o=t[n].trim();if(!/^\|[\s\-:]+\|$/.test(o.replace(/\|/g,function(e,t,a){return a[t-1],e}))){var s=o.split("|").filter(function(e,t,a){return t>0&&t<a.length-1}),r=0===n?"th":"td";a+="<tr>";for(var l=0;l<s.length;l++)a+="<"+r+">"+s[l].trim()+"</"+r+">";a+="</tr>"}}return a+"</table>"})).replace(/^[\-\*]\s+(.+)$/gm,"<li>$1</li>")).replace(/((?:<li>.+<\/li>\n?)+)/g,"<ul>$1</ul>")).replace(/^\d+\.\s+(.+)$/gm,"<li>$1</li>")).replace(/\n/g,"<br>")).replace(/<\/li><br><li>/g,"</li><li>")).replace(/<ul><br>/g,"<ul>")).replace(/<br><\/ul>/g,"</ul>")).replace(/<\/tr><br><tr>/g,"</tr><tr>")).replace(/<table([^>]*)><br>/g,"<table$1>")).replace(/<br><\/table>/g,"</table>")},scrollToBottom(){var e=this;this.$nextTick(function(){var t=e.$refs.messagesContainer;t&&(t.scrollTop=t.scrollHeight)})}}},oe=(0,a(488).A)(ne,[["render",function(e,t,a,ne,oe,se){return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["documentchat",{"documentchat--has-results":oe.results.length>0}])},[(0,n.createCommentVNode)(" SEARCH AREA "),(0,n.createElementVNode)("div",o,[(0,n.createElementVNode)("form",{class:"documentchat-inputarea",onSubmit:t[8]||(t[8]=(0,n.withModifiers)((...e)=>se.performSearch&&se.performSearch(...e),["prevent"]))},[(0,n.createElementVNode)("label",{for:oe.inputId,class:"visually-hidden"},(0,n.toDisplayString)(a.placeholderText),9,s),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["documentchat-autocomplete-wrapper",{"is-open":oe.showSuggestions&&oe.suggestions.length>0}])},[(0,n.withDirectives)((0,n.createElementVNode)("input",{id:oe.inputId,"onUpdate:modelValue":t[0]||(t[0]=e=>oe.searchQuery=e),type:"text",class:"form-control",placeholder:a.placeholderText,disabled:oe.searchLoading,autocomplete:"off",onInput:t[1]||(t[1]=(...e)=>se.onSearchInput&&se.onSearchInput(...e)),onFocus:t[2]||(t[2]=e=>oe.showSuggestions=oe.suggestions.length>0),onBlur:t[3]||(t[3]=(...e)=>se.hideSuggestionsDelayed&&se.hideSuggestionsDelayed(...e)),onKeydown:[t[4]||(t[4]=(0,n.withKeys)((0,n.withModifiers)((...e)=>se.highlightNext&&se.highlightNext(...e),["prevent"]),["down"])),t[5]||(t[5]=(0,n.withKeys)((0,n.withModifiers)((...e)=>se.highlightPrev&&se.highlightPrev(...e),["prevent"]),["up"])),t[6]||(t[6]=(0,n.withKeys)((...e)=>se.onEnterKey&&se.onEnterKey(...e),["enter"])),t[7]||(t[7]=(0,n.withKeys)(e=>oe.showSuggestions=!1,["escape"]))]},null,40,r),[[n.vModelText,oe.searchQuery]]),oe.showSuggestions&&oe.suggestions.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("ul",l,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.suggestions,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("li",{key:t,class:(0,n.normalizeClass)({"is-highlighted":t===oe.highlightedIndex}),onMousedown:(0,n.withModifiers)(t=>se.selectSuggestion(e),["prevent"])},[(0,n.createElementVNode)("strong",null,(0,n.toDisplayString)(e.courseCode),1),(0,n.createTextVNode)(" â "+(0,n.toDisplayString)(e.courseName)+" ",1),(0,n.createElementVNode)("span",c,(0,n.toDisplayString)(e.term),1)],42,i))),128))])):(0,n.createCommentVNode)("v-if",!0)],2),(0,n.createElementVNode)("button",{type:"submit",class:"btn btn-primary",disabled:oe.searchLoading||!oe.searchQuery.trim()&&!se.hasActiveFilter}," Sök ",8,d)],32),(0,n.createCommentVNode)(" Filter panel "),a.showFilters?((0,n.openBlock)(),(0,n.createElementBlock)("div",u,[(0,n.createElementVNode)("div",m,[(0,n.createElementVNode)("div",h,[t[19]||(t[19]=(0,n.createElementVNode)("label",{for:"filter-coursecode"},"Kurskod",-1)),(0,n.withDirectives)((0,n.createElementVNode)("input",{id:"filter-coursecode","onUpdate:modelValue":t[9]||(t[9]=e=>oe.filterCourseCode=e),type:"text",class:"form-control form-control-sm",placeholder:"T.ex. TKG001"},null,512),[[n.vModelText,oe.filterCourseCode]])]),(0,n.createElementVNode)("div",g,[t[21]||(t[21]=(0,n.createElementVNode)("label",{for:"filter-term"},"Termin",-1)),(0,n.withDirectives)((0,n.createElementVNode)("select",{id:"filter-term","onUpdate:modelValue":t[10]||(t[10]=e=>oe.filterTerm=e),class:"form-control form-control-sm"},[t[20]||(t[20]=(0,n.createElementVNode)("option",{value:""},"Alla",-1)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.termOptions,e=>((0,n.openBlock)(),(0,n.createElementBlock)("option",{key:e,value:e},(0,n.toDisplayString)(e),9,p))),128))],512),[[n.vModelSelect,oe.filterTerm]])]),(0,n.createElementVNode)("div",y,[t[23]||(t[23]=(0,n.createElementVNode)("label",{for:"filter-faculty"},"Institution",-1)),(0,n.withDirectives)((0,n.createElementVNode)("select",{id:"filter-faculty","onUpdate:modelValue":t[11]||(t[11]=e=>oe.filterFaculty=e),class:"form-control form-control-sm"},[t[22]||(t[22]=(0,n.createElementVNode)("option",{value:""},"Alla",-1)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.facultyOptions,e=>((0,n.openBlock)(),(0,n.createElementBlock)("option",{key:e,value:e},(0,n.toDisplayString)(e),9,f))),128))],512),[[n.vModelSelect,oe.filterFaculty]])]),(0,n.createElementVNode)("div",v,[t[25]||(t[25]=(0,n.createElementVNode)("label",{for:"filter-level"},"NivÃ¥",-1)),(0,n.withDirectives)((0,n.createElementVNode)("select",{id:"filter-level","onUpdate:modelValue":t[12]||(t[12]=e=>oe.filterLevel=e),class:"form-control form-control-sm"},[t[24]||(t[24]=(0,n.createElementVNode)("option",{value:""},"Alla",-1)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.levelOptions,e=>((0,n.openBlock)(),(0,n.createElementBlock)("option",{key:e,value:e},(0,n.toDisplayString)(e),9,k))),128))],512),[[n.vModelSelect,oe.filterLevel]])]),(0,n.createElementVNode)("div",N,[t[27]||(t[27]=(0,n.createElementVNode)("label",{for:"filter-studytype"},"Studieform",-1)),(0,n.withDirectives)((0,n.createElementVNode)("select",{id:"filter-studytype","onUpdate:modelValue":t[13]||(t[13]=e=>oe.filterStudyType=e),class:"form-control form-control-sm"},[t[26]||(t[26]=(0,n.createElementVNode)("option",{value:""},"Alla",-1)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.studyTypeOptions,e=>((0,n.openBlock)(),(0,n.createElementBlock)("option",{key:e,value:e},(0,n.toDisplayString)(e),9,E))),128))],512),[[n.vModelSelect,oe.filterStudyType]])])])])):(0,n.createCommentVNode)("v-if",!0)]),(0,n.createCommentVNode)(" MAIN CONTENT: results list
1+ chat panel side by side "),oe.results.length>0||oe.searchLoading?((0,n.openBlock)(),(0,n.createElementBlock)("div",S,[oe.searchLoading&&0===oe.results.length?((0,n.openBlock)(),(0,n.createElementBlock)("div",V,[...t[28]||(t[28]=[(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1)])])):(0,n.createCommentVNode)("v-if",!0),oe.totalCount>0?((0,n.openBlock)(),(0,n.createElementBlock)("p",B,(0,n.toDisplayString)(oe.totalCount)+" träffar",1)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",C,[(0,n.createCommentVNode)(" RESULTS LIST "),(0,n.createElementVNode)("div",b,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.results,e=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.documentId,class:"documentchat-eval-card"},[(0,n.createElementVNode)("div",T,[(0,n.createElementVNode)("strong",null,(0,n.toDisplayString)(e.courseCode),1),(0,n.createTextVNode)(" â "+(0,n.toDisplayString)(e.courseName)+" ",1),(0,n.createElementVNode)("span",w,[(0,n.createTextVNode)((0,n.toDisplayString)(e.term)+" · "+(0,n.toDisplayString)(e.faculty),1),e.studyLocation?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createTextVNode)(" · "+(0,n.toDisplayString)(e.studyLocation),1)],64)):(0,n.createCommentVNode)("v-if",!0),e.studyType?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createTextVNode)(" · "+(0,n.toDisplayString)(e.studyType),1)],64)):(0,n.createCommentVNode)("v-if",!0)])]),e.summary?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"documentchat-eval-summary",innerHTML:se.formatMessage(e.summary)},null,8,x)):(0,n.createCommentVNode)("v-if",!0),e.summaryLoading?((0,n.openBlock)(),(0,n.createElementBlock)("div",L,[...t[29]||(t[29]=[(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1)])])):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",D,[e.summary||e.summaryLoading?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)("button",{key:0,type:"button",class:"documentchat-eval-btn",onClick:t=>se.loadSummary(e)},"â¶ Visa sammanfattning",8,M)),e.summary?((0,n.openBlock)(),(0,n.createElementBlock)("button",{key:1,type:"button",class:"documentchat-eval-btn",onClick:t=>e.summary=""},"â¼ Dölj sammanfattning",8,I)):(0,n.createCommentVNode)("v-if",!0),e.url?((0,n.openBlock)(),(0,n.createElementBlock)("a",{key:2,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"documentchat-eval-link"},"Ãppna PDF â",8,F)):(0,n.createCommentVNode)("v-if",!0)])]))),128)),(0,n.createCommentVNode)(" Pagination "),oe.totalCount>oe.pageSize?((0,n.openBlock)(),(0,n.createElementBlock)("div",O,[(0,n.createElementVNode)("button",{type:"button",class:"btn btn-outline-secondary btn-sm",disabled:oe.currentPage<=1||oe.searchLoading,onClick:t[14]||(t[14]=e=>se.goToPage(oe.currentPage-1))},"â FöregÃ¥ende",8,P),(0,n.createElementVNode)("span",Q,"Sida "+(0,n.toDisplayString)(oe.currentPage)+" av "+(0,n.toDisplayString)(se.totalPages),1),(0,n.createElementVNode)("button",{type:"button",class:"btn btn-outline-secondary btn-sm",disabled:oe.currentPage>=se.totalPages||oe.searchLoading,onClick:t[15]||(t[15]=e=>se.goToPage(oe.currentPage+1))},"Nästa â",8,A)])):(0,n.createCommentVNode)("v-if",!0)]),(0,n.createCommentVNode)(" CHAT PANEL "),(0,n.createElementVNode)("div",U,[t[35]||(t[35]=(0,n.createElementVNode)("h3",{class:"documentchat-chat-title"},"Ställ frÃ¥gor om resultaten",-1)),0!==oe.chatMessages.length||oe.chatLoading?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",q,[t[31]||(t[31]=(0,n.createElementVNode)("p",{class:"documentchat-quick-questions-label"},"Förslag pÃ¥ frÃ¥gor:",-1)),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(se.allQuickQuestions,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("button",{key:t,type:"button",class:"documentchat-quick-btn",onClick:t=>se.askQuickQuestion(e)},(0,n.toDisplayString)(e),9,K))),128)),oe.aiQuestionsLoading?((0,n.openBlock)(),(0,n.createElementBlock)("span",j,[...t[30]||(t[30]=[(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1)])])):(0,n.createCommentVNode)("v-if",!0)])),(0,n.createElementVNode)("div",H,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.chatMessages,(e,a)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:a,class:(0,n.normalizeClass)(["documentchat-message","documentchat-message--"+e.role])},[(0,n.createElementVNode)("div",$,["assistant"===e.role?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,innerHTML:se.formatMessage(e.content)},null,8,R)):((0,n.openBlock)(),(0,n.createElementBlock)("span",z,(0,n.toDisplayString)(e.content),1))]),e.citations&&e.citations.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("div",_,[t[32]||(t[32]=(0,n.createElementVNode)("p",{class:"documentchat-citations-title"},"Källor:",-1)),(0,n.createElementVNode)("ul",null,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.citations,e=>((0,n.openBlock)(),(0,n.createElementBlock)("li",{key:e.index},[(0,n.createElementVNode)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer"},[(0,n.createTextVNode)(" ["+(0,n.toDisplayString)(e.index)+"] ",1),e.courseCode?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createTextVNode)((0,n.toDisplayString)(e.courseCode)+" "+(0,n.toDisplayString)(e.term)+" â",1)],64)):(0,n.createCommentVNode)("v-if",!0),(0,n.createTextVNode)(" "+(0,n.toDisplayString)(e.title),
11)],8,J)]))),128))])])):(0,n.createCommentVNode)("v-if",!0)],2))),128)),(0,n.createCommentVNode)(" Streaming "),oe.chatLoading?((0,n.openBlock)(),(0,n.createElementBlock)("div",W,[(0,n.createElementVNode)("div",G,[oe.streamingContent?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,innerHTML:se.formatMessage(oe.streamingContent)},null,8,X)):((0,n.openBlock)(),(0,n.createElementBlock)("span",Y,[...t[33]||(t[33]=[(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1),(0,n.createElementVNode)("span",null,null,-1)])]))])])):(0,n.createCommentVNode)("v-if",!0)],512),oe.chatError?((0,n.openBlock)(),(0,n.createElementBlock)("div",Z,(0,n.toDisplayString)(oe.chatError),1)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("form",{class:"documentchat-inputarea",onSubmit:t[17]||(t[17]=(0,n.withModifiers)((...e)=>se.sendChatMessage&&se.sendChatMessage(...e),["prevent"]))},[t[34]||(t[34]=(0,n.createElementVNode)("label",{for:"chat-input",class:"visually-hidden"},"Ställ en fråga om resultaten",-1)),(0,n.withDirectives)((0,n.createElementVNode)("input",{id:"chat-input","onUpdate:modelValue":t[16]||(t[16]=e=>oe.chatInput=e),type:"text",class:"form-control",placeholder:"Ställ en fråga om kursutvärderingarna...",disabled:oe.chatLoading,autocomplete:"off"},null,8,ee),[[n.vModelText,oe.chatInput]]),(0,n.createElementVNode)("button",{type:"submit",class:"btn btn-primary",disabled:oe.chatLoading||!oe.chatInput.trim()}," Fråga ",8,te)],32),oe.chatMessages.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("button",{key:2,type:"button",class:"btn btn-outline-secondary btn-sm documentchat-clear",onClick:t[18]||(t[18]=e=>{oe.chatMessages=[],oe.chatError=null})}," Rensa chatt ")):(0,n.createCommentVNode)("v-if",!0)])])])):(0,n.createCommentVNode)("v-if",!0),oe.searchError?((0,n.openBlock)(),(0,n.createElementBlock)("div",ae,(0,n.toDisplayString)(oe.searchError),1)):(0,n.createCommentVNode)("v-if",!0)],2)}],["__scopeId","data-v-f3cb6898"]])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.