sd-webui-infinite-image-bro.../vue/dist/assets/TopicSearch-cf50d85d.js

4 lines
22 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{ay as pe,P as ie,bK as Ne,d as Z,G as g,a as O,c as i,Z as ue,_ as Oe,cA as de,r as D,cB as Ge,bC as Te,cC as Je,b7 as Ae,h as A,u as Fe,be as Ue,cb as Qe,bc as Ve,ca as Ke,cw as Ye,a1 as Xe,J as He,B as E,m as we,o as Ze,bk as et,U as P,V as M,W as o,Y as m,a2 as Q,a3 as z,X as J,$ as B,cp as tt,a4 as H,a9 as at,a8 as st,cD as nt,cE as rt,cF as ot,z as le,ck as it,cG as lt,cH as ct,R as te,ak as ut,aj as dt,aO as pt,ah as vt,T as ft,aP as gt,aQ as ht,cI as mt,a0 as _t}from"./index-8b1d4076.js";/* empty css */import{S as yt}from"./index-2ee82e1b.js";import{_ as St}from"./index-fd0b9b75.js";/* empty css */import{_ as kt}from"./index-404f2353.js";var je=pe("normal","exception","active","success"),bt=pe("line","circle","dashboard"),Ct=pe("default","small"),se=function(){return{prefixCls:String,type:ie.oneOf(bt),percent:Number,format:{type:Function},status:ie.oneOf(je),showInfo:{type:Boolean,default:void 0},strokeWidth:Number,strokeLinecap:String,strokeColor:{type:[String,Object],default:void 0},trailColor:String,width:Number,success:{type:Object,default:function(){return{}}},gapDegree:Number,gapPosition:String,size:ie.oneOf(Ct),steps:Number,successPercent:Number,title:String}};function K(u){return!u||u<0?0:u>100?100:u}function ae(u){var e=u.success,r=u.successPercent,s=r;return e&&"progress"in e&&(Ne(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),s=e.progress),e&&"percent"in e&&(s=e.percent),s}var Pt=["from","to","direction"],wt=function(){return O(O({},se()),{},{prefixCls:String,direction:{type:String}})},xt=function(e){var r=[];return Object.keys(e).forEach(function(s){var l=parseFloat(s.replace(/%/g,""));isNaN(l)||r.push({key:l,value:e[s]})}),r=r.sort(function(s,l){return s.key-l.key}),r.map(function(s){var l=s.key,f=s.value;return"".concat(f," ").concat(l,"%")}).join(", ")},$t=function(e,r){var s=e.from,l=s===void 0?de.blue:s,f=e.to,c=f===void 0?de.blue:f,h=e.direction,k=h===void 0?r==="rtl"?"to left":"to right":h,p=Oe(e,Pt);if(Object.keys(p).length!==0){var v=xt(p);return{backgroundImage:"linear-gradient(".concat(k,", ").concat(v,")")}}return{backgroundImage:"linear-gradient(".concat(k,", ").concat(l,", ").concat(c,")")}};const Dt=Z({compatConfig:{MODE:3},name:"Line",props:wt(),setup:function(e,r){var s=r.slots,l=g(function(){var p=e.strokeColor,v=e.direction;return p&&typeof p!="string"?$t(p,v):{background:p}}),f=g(function(){return e.trailColor?{backgroundColor:e.trailColor}:void 0}),c=g(function(){var p=e.percent,v=e.strokeWidth,d=e.strokeLinecap,n=e.size;return O({width:"".concat(K(p),"%"),height:"".concat(v||(n==="small"?6:8),"px"),borderRadius:d==="square"?0:""},l.value)}),h=g(function(){return ae(e)}),k=g(function(){var p=e.strokeWidth,v=e.size,d=e.strokeLinecap,n=e.success;return{width:"".concat(K(h.value),"%"),height:"".concat(p||(v==="small"?6:8),"px"),borderRadius:d==="square"?0:"",backgroundColor:n==null?void 0:n.strokeColor}});return function(){var p;return i(ue,null,[i("div",{class:"".concat(e.prefixCls,"-outer")},[i("div",{class:"".concat(e.prefixCls,"-inner"),style:f.value},[i("div",{class:"".concat(e.prefixCls,"-bg"),style:c.value},null),h.value!==void 0?i("div",{class:"".concat(e.prefixCls,"-success-bg"),style:k.value},null):null])]),(p=s.default)===null||p===void 0?void 0:p.call(s)])}}});var It={percent:0,prefixCls:"vc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1},Nt=function(e){var r=D(null);return Ge(function(){var s=Date.now(),l=!1;e.value.forEach(function(f){var c=(f==null?void 0:f.$el)||f;if(c){l=!0;var h=c.style;h.transitionDuration=".3s, .3s, .3s, .06s",r.value&&s-r.value<100&&(h.transitionDuration="0s, 0s")}}),l&&(r.value=Date.now())}),e},Ot={gapDegree:Number,gapPosition:{type:String},percent:{type:[Array,Number]},prefixCls:String,strokeColor:{type:[Object,String,Array]},strokeLinecap:{type:String},strokeWidth:Number,trailColor:String,trailWidth:Number,transition:String},Tt=["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","strokeColor"],xe=0;function $e(u){return+u.replace("%","")}function De(u){return Array.isArray(u)?u:[u]}function Ie(u,e,r,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,f=arguments.length>5?arguments[5]:void 0,c=50-s/2,h=0,k=-c,p=0,v=-2*c;switch(f){case"left":h=-c,k=0,p=2*c,v=0;break;case"right":h=c,k=0,p=-2*c,v=0;break;case"bottom":k=c,v=2*c;break}var d="M 50,50 m ".concat(h,",").concat(k,`
a `).concat(c,",").concat(c," 0 1 1 ").concat(p,",").concat(-v,`
a `).concat(c,",").concat(c," 0 1 1 ").concat(-p,",").concat(v),n=Math.PI*2*c,S={stroke:r,strokeDasharray:"".concat(e/100*(n-l),"px ").concat(n,"px"),strokeDashoffset:"-".concat(l/2+u/100*(n-l),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"};return{pathString:d,pathStyle:S}}const jt=Z({compatConfig:{MODE:3},name:"VCCircle",props:Te(Ot,It),setup:function(e){xe+=1;var r=D(xe),s=g(function(){return De(e.percent)}),l=g(function(){return De(e.strokeColor)}),f=Je(),c=Ae(f,2),h=c[0],k=c[1];Nt(k);var p=function(){var d=e.prefixCls,n=e.strokeWidth,S=e.strokeLinecap,x=e.gapDegree,y=e.gapPosition,T=0;return s.value.map(function(I,b){var j=l.value[b]||l.value[l.value.length-1],L=Object.prototype.toString.call(j)==="[object Object]"?"url(#".concat(d,"-gradient-").concat(r.value,")"):"",$=Ie(T,I,j,n,x,y),U=$.pathString,q=$.pathStyle;T+=I;var F={key:b,d:U,stroke:L,"stroke-linecap":S,"stroke-width":n,opacity:I===0?0:1,"fill-opacity":"0",class:"".concat(d,"-circle-path"),style:q};return i("path",O({ref:h(b)},F),null)})};return function(){var v=e.prefixCls,d=e.strokeWidth,n=e.trailWidth,S=e.gapDegree,x=e.gapPosition,y=e.trailColor,T=e.strokeLinecap;e.strokeColor;var I=Oe(e,Tt),b=Ie(0,100,y,d,S,x),j=b.pathString,L=b.pathStyle;delete I.percent;var $=l.value.find(function(q){return Object.prototype.toString.call(q)==="[object Object]"}),U={d:j,stroke:y,"stroke-linecap":T,"stroke-width":n||d,"fill-opacity":"0",class:"".concat(v,"-circle-trail"),style:L};return i("svg",O({class:"".concat(v,"-circle"),viewBox:"0 0 100 100"},I),[$&&i("defs",null,[i("linearGradient",{id:"".concat(v,"-gradient-").concat(r.value),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},[Object.keys($).sort(function(q,F){return $e(q)-$e(F)}).map(function(q,F){return i("stop",{key:F,offset:q,"stop-color":$[q]},null)})])]),i("path",U,null),p().reverse()])}}});function Lt(u){var e=u.percent,r=u.success,s=u.successPercent,l=K(ae({success:r,successPercent:s}));return[l,K(K(e)-l)]}function Wt(u){var e=u.success,r=e===void 0?{}:e,s=u.strokeColor,l=r.strokeColor;return[l||de.green,s||null]}const zt=Z({compatConfig:{MODE:3},name:"Circle",inheritAttrs:!1,props:se(),setup:function(e,r){var s=r.slots,l=g(function(){if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),f=g(function(){var n=e.width||120;return{width:typeof n=="number"?"".concat(n,"px"):n,height:typeof n=="number"?"".concat(n,"px"):n,fontSize:"".concat(n*.15+6,"px")}}),c=g(function(){return e.strokeWidth||6}),h=g(function(){return e.gapPosition||e.type==="dashboard"&&"bottom"||"top"}),k=g(function(){return Lt(e)}),p=g(function(){return Object.prototype.toString.call(e.strokeColor)==="[object Object]"}),v=g(function(){return Wt({success:e.success,strokeColor:e.strokeColor})}),d=g(function(){var n;return n={},A(n,"".concat(e.prefixCls,"-inner"),!0),A(n,"".concat(e.prefixCls,"-circle-gradient"),p.value),n});return function(){var n;return i("div",{class:d.value,style:f.value},[i(jt,{percent:k.value,strokeWidth:c.value,trailWidth:c.value,strokeColor:v.value,strokeLinecap:e.strokeLinecap,trailColor:e.trailColor,prefixCls:e.prefixCls,gapDegree:l.value,gapPosition:h.value},null),(n=s.default)===null||n===void 0?void 0:n.call(s)])}}});var Rt=function(){return O(O({},se()),{},{steps:Number,size:{type:String},strokeColor:String,trailColor:String})};const Et=Z({compatConfig:{MODE:3},name:"Steps",props:Rt(),setup:function(e,r){var s=r.slots,l=g(function(){return Math.round(e.steps*((e.percent||0)/100))}),f=g(function(){return e.size==="small"?2:14}),c=g(function(){for(var h=e.steps,k=e.strokeWidth,p=k===void 0?8:k,v=e.strokeColor,d=e.trailColor,n=e.prefixCls,S=[],x=0;x<h;x+=1){var y,T=(y={},A(y,"".concat(n,"-steps-item"),!0),A(y,"".concat(n,"-steps-item-active"),x<=l.value-1),y);S.push(i("div",{key:x,class:T,style:{backgroundColor:x<=l.value-1?v:d,width:"".concat(f.value,"px"),height:"".concat(p,"px")}},null))}return S});return function(){var h;return i("div",{class:"".concat(e.prefixCls,"-steps-outer")},[c.value,(h=s.default)===null||h===void 0?void 0:h.call(s)])}}}),qt=Z({compatConfig:{MODE:3},name:"AProgress",props:Te(se(),{type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",strokeLinecap:"round"}),slots:["format"],setup:function(e,r){var s=r.slots,l=Fe("progress",e),f=l.prefixCls,c=l.direction;Ne(e.successPercent==null,"Progress","`successPercent` is deprecated. Please use `success.percent` instead.");var h=g(function(){var d,n=e.type,S=e.showInfo,x=e.size,y=f.value;return d={},A(d,y,!0),A(d,"".concat(y,"-").concat(n==="dashboard"&&"circle"||n),!0),A(d,"".concat(y,"-show-info"),S),A(d,"".concat(y,"-").concat(x),x),A(d,"".concat(y,"-rtl"),c.value==="rtl"),d}),k=g(function(){var d=e.percent,n=d===void 0?0:d,S=ae(e);return parseInt(S!==void 0?S.toString():n.toString(),10)}),p=g(function(){var d=e.status;return je.indexOf(d)<0&&k.value>=100?"success":d||"normal"}),v=function(){var n=e.showInfo,S=e.format,x=e.type,y=e.percent,T=e.title,I=ae(e);if(!n)return null;var b,j=S||(s==null?void 0:s.format)||function($){return"".concat($,"%")},L=x==="line";return S||s!=null&&s.format||p.value!=="exception"&&p.value!=="success"?b=j(K(y),K(I)):p.value==="exception"?b=L?i(Ue,null,null):i(Qe,null,null):p.value==="success"&&(b=L?i(Ve,null,null):i(Ke,null,null)),i("span",{class:"".concat(f.value,"-text"),title:T===void 0&&typeof b=="string"?b:void 0},[b])};return function(){var d=e.type,n=e.steps,S=e.strokeColor,x=e.title,y=v(),T;d==="line"?T=n?i(Et,O(O({},e),{},{strokeColor:typeof S=="string"?S:void 0,prefixCls:f.value,steps:n}),{default:function(){return[y]}}):i(Dt,O(O({},e),{},{prefixCls:f.value}),{default:function(){return[y]}}):(d==="circle"||d==="dashboard")&&(T=i(zt,O(O({},e),{},{prefixCls:f.value}),{default:function(){return[y]}}));var I=O(O({},h.value),{},A({},"".concat(f.value,"-status-").concat(p.value),!0));return i("div",{class:I,title:x},[T])}}}),Mt=Ye(qt);const G=u=>(gt("data-v-aa6199a2"),u=u(),ht(),u),Bt={class:"topic-search"},Gt={class:"toolbar"},Jt={class:"left"},At={class:"title"},Ft=G(()=>o("span",{class:"icon"},"🧠",-1)),Ut={class:"right"},Qt={key:0,style:{opacity:"0.75"}},Vt={class:"label"},Kt={class:"label"},Yt={style:{display:"grid",gap:"6px"}},Xt=G(()=>o("span",{style:{"margin-right":"6px"}},"🔑",-1)),Ht={key:0},Zt=G(()=>o("span",{style:{"margin-right":"6px"}},"🧩",-1)),ea=G(()=>o("span",{style:{"margin-right":"6px"}},"🐍",-1)),ta={style:{opacity:"0.85"}},aa=G(()=>o("span",{style:{"margin-right":"6px"}},"💻",-1)),sa={style:{display:"flex","align-items":"center",gap:"10px","flex-wrap":"wrap"}},na={style:{opacity:"0.85"}},ra={key:3,style:{margin:"10px 0 0 0"}},oa={key:0,style:{"margin-top":"10px"}},ia={key:1,class:"grid"},la=["onClick"],ca={class:"card-top"},ua={class:"card-title line-clamp-1"},da={class:"card-count"},pa={class:"card-desc line-clamp-2"},va={key:2,class:"empty"},fa={class:"guide"},ga={class:"guide-row"},ha=G(()=>o("span",{class:"guide-icon"},"🗂️",-1)),ma={class:"guide-text"},_a={class:"guide-row"},ya=G(()=>o("span",{class:"guide-icon"},"🧠",-1)),Sa={class:"guide-text"},ka={class:"guide-row"},ba=G(()=>o("span",{class:"guide-icon"},"🔎",-1)),Ca={class:"guide-text"},Pa={class:"guide-row"},wa=G(()=>o("span",{class:"guide-icon"},"✨",-1)),xa={class:"guide-text"},$a={class:"guide-row"},Da=G(()=>o("span",{class:"guide-icon"},"🚀",-1)),Ia={class:"guide-text"},Na={class:"guide-hint"},Oa=G(()=>o("span",{class:"guide-icon"},"💡",-1)),Ta={key:0,class:"guide-text"},ja={key:1,class:"guide-text"},La="iib_topic_search_hide_requirements_v1",ce="topic_search_scope",Wa=Z({__name:"TopicSearch",props:{tabIdx:{},paneIdx:{}},setup(u){const e=u,r=Xe(),s=D(!1),l=D(.9),f=D(2),c=D(null),h=D(null),k=He(La,!0),p=()=>{k.value=!1},v=D(null),d=D("");let n=null;const S=g(()=>{var a;const t=(a=v.value)==null?void 0:a.status;return t==="queued"||t==="running"}),x=g(()=>{var a;const t=String(((a=v.value)==null?void 0:a.stage)||"");return!t||t==="queued"||t==="init"?E("topicSearchJobQueued"):t==="embedding"?E("topicSearchJobStageEmbedding"):t==="clustering"?E("topicSearchJobStageClustering"):t==="titling"?E("topicSearchJobStageTitling"):t==="done"?E("topicSearchJobStageDone"):t==="error"?E("topicSearchJobStageError"):`${E("topicSearchJobStage")}: ${t}`}),y=g(()=>{var R;const t=(R=v.value)==null?void 0:R.progress;if(!t)return 0;const a=Number(t.to_embed??0),_=Number(t.embedded_done??0);if(a<=0)return 0;const C=Math.floor(_/a*100);return Math.max(0,Math.min(100,C))}),T=g(()=>{var a,_,C,R;const t=(a=v.value)==null?void 0:a.progress;if(!t)return"";if(((_=v.value)==null?void 0:_.stage)==="embedding"){const N=Number(t.embedded_done??0),W=Number(t.to_embed??0),re=Number(t.scanned??0),oe=String(t.folder??"");return E("topicSearchJobEmbeddingDesc",[N,W,re,oe])}if(((C=v.value)==null?void 0:C.stage)==="clustering"){const N=Number(t.items_done??0),W=Number(t.items_total??0);return E("topicSearchJobClusteringDesc",[N,W])}if(((R=v.value)==null?void 0:R.stage)==="titling"){const N=Number(t.clusters_done??0),W=Number(t.clusters_total??0);return E("topicSearchJobTitlingDesc",[N,W])}return""}),I=D(""),b=D(!1),j=D(null),L=D(!1),$=D([]),U=D(!1),q=D(!1);let F=null,ve="";const Le=g(()=>(r.quickMovePaths??[]).filter(a=>{const _=String((a==null?void 0:a.key)??"");return((a==null?void 0:a.types)??[]).includes("preset")&&["cwd","home","desktop"].includes(_)}).map(a=>String((a==null?void 0:a.dir)??"")).filter(Boolean));we(Le,t=>{t!=null&&t.length&&($.value=($.value??[]).filter(a=>!t.includes(a)))},{immediate:!0});const We=g(()=>(r.quickMovePaths??[]).filter(a=>{const _=String((a==null?void 0:a.key)??"");return!(((a==null?void 0:a.types)??[]).includes("preset")&&["cwd","home","desktop"].includes(_))}).map(a=>({value:a.dir,label:a.zh||a.dir}))),V=g(()=>($.value??[]).filter(Boolean).length),Y=g(()=>($.value??[]).filter(Boolean)),fe=g(()=>{var t;return((t=c.value)==null?void 0:t.clusters)??[]}),ze=async()=>{var _,C,R;if(U.value)return;try{const N=await nt();r.conf=N}catch{}const t=((_=r.conf)==null?void 0:_.app_fe_setting)||{},a=(C=t==null?void 0:t[ce])==null?void 0:C.folder_paths;Array.isArray(a)&&a.length&&!((R=$.value)!=null&&R.length)&&($.value=a.map(N=>String(N)).filter(Boolean)),U.value=!0},ge=async()=>{var a,_;if((a=r.conf)!=null&&a.is_readonly||!U.value)return;const t={folder_paths:Y.value,updated_at:Date.now()};await rt(ce,t),(_=r.conf)!=null&&_.app_fe_setting&&(r.conf.app_fe_setting[ce]=t)},Re=()=>{var a;if((a=r.conf)!=null&&a.is_readonly||!U.value)return;const t=JSON.stringify(Y.value);t!==ve&&(F&&clearTimeout(F),F=setTimeout(async()=>{q.value=!0;try{await ge(),ve=t}finally{q.value=!1}},500))},ee=()=>{n&&(clearInterval(n),n=null)},he=async()=>{const t=d.value;if(!t)return;const a=await mt(t);v.value=a,a.status==="done"?(ee(),s.value=!1,a.result&&(c.value=a.result),h.value=null):a.status==="error"&&(ee(),s.value=!1,le.error(a.error||E("topicSearchJobFailed")))},Ee=async()=>{if(V.value)try{const t=await ot({threshold:l.value,min_cluster_size:f.value,lang:r.lang,folder_paths:Y.value});h.value=t,t.cache_hit&&t.result&&(c.value=t.result)}catch{}},ne=async()=>{var t;if(!((t=r.conf)!=null&&t.is_readonly)){if(!V.value){le.warning(E("topicSearchNeedScope")),L.value=!0;return}ee(),s.value=!0,v.value=null,d.value="";try{await it();const a=await lt({threshold:l.value,min_cluster_size:f.value,lang:r.lang,folder_paths:Y.value});d.value=a.job_id,await he(),n=setInterval(()=>{he()},800)}catch(a){throw s.value=!1,a}}},me=async()=>{const t=(I.value||"").trim();if(t){if(!V.value){le.warning(E("topicSearchNeedScope")),L.value=!0;return}b.value=!0;try{j.value=await ct({query:t,top_k:80,ensure_embed:!0,folder_paths:Y.value}),_e()}finally{b.value=!1}}},_e=()=>{var R;const t=(((R=j.value)==null?void 0:R.results)??[]).map(N=>N.path).filter(Boolean);if(!t.length)return;const a=`Query: ${I.value.trim()}${t.length}`,_={type:"topic-search-matched-image-grid",name:a,key:Date.now()+te(),id:te(),title:a,paths:t},C=r.tabList[e.tabIdx];C.panes.push(_),C.key=_.key},qe=t=>{const a={type:"topic-search-matched-image-grid",name:`${t.title}${t.size}`,key:Date.now()+te(),id:te(),title:t.title,paths:t.paths},_=r.tabList[e.tabIdx];_.panes.push(a),_.key=a.key};return Ze(()=>{(async()=>(await ze(),V.value&&await Ee()))()}),et(()=>{ee()}),we(()=>Y.value,()=>{Re()},{deep:!0}),(t,a)=>{var ye,Se,ke,be,Ce,Pe;const _=kt,C=ut,R=dt,N=St,W=pt,re=Mt,oe=yt,Me=vt,Be=ft;return P(),M("div",Bt,[o("div",Gt,[o("div",Jt,[o("div",At,[Ft,o("span",null,m(t.$t("topicSearchTitleExperimental")),1)]),c.value?(P(),Q(_,{key:0,color:"blue"},{default:z(()=>[J("共 "+m(c.value.count)+" 张",1)]),_:1})):B("",!0),c.value?(P(),Q(_,{key:1,color:"geekblue"},{default:z(()=>[J("主题 "+m(c.value.clusters.length),1)]),_:1})):B("",!0),c.value?(P(),Q(_,{key:2,color:"default"},{default:z(()=>[J("噪声 "+m(c.value.noise.length),1)]),_:1})):B("",!0)]),o("div",Ut,[i(C,{onClick:a[0]||(a[0]=w=>L.value=!0)},{default:z(()=>[J(m(t.$t("topicSearchScope"))+" ",1),V.value?(P(),M("span",Qt,""+m(V.value)+"",1)):B("",!0)]),_:1}),i(R,{value:I.value,"onUpdate:value":a[1]||(a[1]=w=>I.value=w),style:{width:"min(420px, 72vw)"},placeholder:t.$t("topicSearchQueryPlaceholder"),disabled:b.value,onKeydown:tt(me,["enter"]),"allow-clear":""},null,8,["value","placeholder","disabled","onKeydown"]),i(C,{loading:b.value,onClick:me},{default:z(()=>[J(m(t.$t("search")),1)]),_:1},8,["loading"]),(Se=(ye=j.value)==null?void 0:ye.results)!=null&&Se.length?(P(),Q(C,{key:0,onClick:_e},{default:z(()=>[J(m(t.$t("topicSearchOpenResults")),1)]),_:1})):B("",!0),o("span",Vt,m(t.$t("topicSearchThreshold")),1),i(N,{value:l.value,"onUpdate:value":a[2]||(a[2]=w=>l.value=w),min:.5,max:.99,step:.01},null,8,["value"]),o("span",Kt,m(t.$t("topicSearchMinClusterSize")),1),i(N,{value:f.value,"onUpdate:value":a[3]||(a[3]=w=>f.value=w),min:1,max:50,step:1},null,8,["value"]),i(C,{type:"primary",ghost:"",loading:s.value,disabled:(ke=H(r).conf)==null?void 0:ke.is_readonly,onClick:ne},{default:z(()=>[J(m(t.$t("refresh")),1)]),_:1},8,["loading","disabled"])])]),(be=H(r).conf)!=null&&be.is_readonly?(P(),Q(W,{key:0,type:"warning",message:t.$t("readonlyModeSettingPageDesc"),style:{margin:"12px 0"},"show-icon":""},null,8,["message"])):B("",!0),H(k)?(P(),Q(W,{key:1,type:"info","show-icon":"",closable:"",style:{margin:"10px 0 0 0"},message:t.$t("topicSearchRequirementsTitle"),onClose:p},{description:z(()=>[o("div",Yt,[o("div",null,[Xt,o("span",null,m(t.$t("topicSearchRequirementsOpenai")),1)]),H(at)?(P(),M("div",Ht,[Zt,o("span",null,m(t.$t("topicSearchRequirementsDepsDesktop")),1)])):(P(),M(ue,{key:1},[o("div",null,[ea,o("span",null,m(t.$t("topicSearchRequirementsDepsPython")),1)]),o("div",ta,[aa,o("span",null,m(t.$t("topicSearchRequirementsInstallCmd")),1)])],64))])]),_:1},8,["message"])):B("",!0),(Ce=h.value)!=null&&Ce.cache_hit&&((Pe=h.value)!=null&&Pe.stale)?(P(),Q(W,{key:2,type:"warning","show-icon":"",style:{margin:"10px 0 0 0"},message:t.$t("topicSearchCacheStale")},{description:z(()=>{var w;return[o("div",sa,[o("span",na,m(t.$t("topicSearchCacheStaleDesc")),1),i(C,{size:"small",loading:s.value||S.value,disabled:(w=H(r).conf)==null?void 0:w.is_readonly,onClick:ne},{default:z(()=>[J(m(t.$t("topicSearchCacheUpdate")),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["message"])):B("",!0),S.value?(P(),M("div",ra,[i(W,{type:"info","show-icon":"",message:x.value,description:T.value},null,8,["message","description"]),i(re,{percent:y.value,size:"small",style:{"margin-top":"8px"}},null,8,["percent"])])):B("",!0),i(oe,{spinning:s.value},{default:z(()=>{var w;return[j.value?(P(),M("div",oa,[i(W,{type:"info",message:t.$t("topicSearchRecallMsg",[j.value.results.length,j.value.count,j.value.top_k]),"show-icon":""},null,8,["message"])])):B("",!0),fe.value.length?(P(),M("div",ia,[(P(!0),M(ue,null,st(fe.value,X=>(P(),M("div",{class:"card",key:X.id,onClick:za=>qe(X)},[o("div",ca,[o("div",ua,m(X.title),1),o("div",da,m(X.size),1)]),o("div",pa,m(X.sample_prompt),1)],8,la))),128))])):(P(),M("div",va,[i(W,{type:"info","show-icon":"",message:t.$t("topicSearchGuideTitle"),style:{"margin-bottom":"10px"}},null,8,["message"]),o("div",fa,[o("div",ga,[ha,o("span",ma,m(t.$t("topicSearchGuideStep1")),1),i(C,{size:"small",onClick:a[4]||(a[4]=X=>L.value=!0)},{default:z(()=>[J(m(t.$t("topicSearchScope")),1)]),_:1})]),o("div",_a,[ya,o("span",Sa,m(t.$t("topicSearchGuideStep2")),1),i(C,{size:"small",loading:s.value,disabled:(w=H(r).conf)==null?void 0:w.is_readonly,onClick:ne},{default:z(()=>[J(m(t.$t("refresh")),1)]),_:1},8,["loading","disabled"])]),o("div",ka,[ba,o("span",Ca,m(t.$t("topicSearchGuideStep3")),1)]),o("div",Pa,[wa,o("span",xa,m(t.$t("topicSearchGuideAdvantage1")),1)]),o("div",$a,[Da,o("span",Ia,m(t.$t("topicSearchGuideAdvantage2")),1)]),o("div",Na,[Oa,V.value?(P(),M("span",ja,m(t.$t("topicSearchGuideEmptyReasonNoTopics")),1)):(P(),M("span",Ta,m(t.$t("topicSearchGuideEmptyReasonNoScope")),1))])])]))]}),_:1},8,["spinning"]),i(Be,{visible:L.value,"onUpdate:visible":a[6]||(a[6]=w=>L.value=w),title:t.$t("topicSearchScopeModalTitle"),"mask-closable":!0,onOk:a[7]||(a[7]=()=>{L.value=!1,ge()})},{default:z(()=>[i(W,{type:"info","show-icon":"",message:t.$t("topicSearchScopeTip"),style:{"margin-bottom":"10px"}},null,8,["message"]),q.value?(P(),Q(W,{key:0,type:"info","show-icon":"",message:t.$t("topicSearchSavingToBackend"),style:{"margin-bottom":"10px"}},null,8,["message"])):B("",!0),i(Me,{value:$.value,"onUpdate:value":a[5]||(a[5]=w=>$.value=w),mode:"multiple",style:{width:"100%"},options:We.value,placeholder:t.$t("topicSearchScopePlaceholder"),"max-tag-count":3,getPopupContainer:w=>w.parentElement||w,"allow-clear":""},null,8,["value","options","placeholder","getPopupContainer"])]),_:1},8,["visible","title"])])}}});const Ja=_t(Wa,[["__scopeId","data-v-aa6199a2"]]);export{Ja as default};