PageSourceSearch

https://whol-openwebui.hf.space/_app/immutable/nodes/13.DIfvdpEL.js

js whol-openwebui.hf.space collected 2026-10-03 17:31:03 UTC 534,137 bytes, 142 lines download raw bytes

1import{s as Ol,D as sl,E as nl,a as p,d as c,f as u,i as M,g as r,n as st,e as _,t as B,k as N,c as h,b as H,o as $,S as Wt,u as pe,z as ds,h as j,H as ml,j as qt,p as Ul,q as rs,y as Ye,B as Q,O as Cl,N as Ft,A as Fe,l as xt,G as Gl,Q as Ll,T as Ho,U as Go,C as ln,P as wl,F as Ss,R as Os,r as Ko,v as Yo,w as jo,x as Wo,V as sn}from"../chunks/vexCXLX9.js";import{S as Sl,i as Pl,t as G,g as ht,a as W,c as pt,f as qe,b as ce,d as de,m as _e,e as he}from"../chunks/Cdll-xsj.js";import{t as Je,m as Lr}from"../chunks/DT5uOxbm.js";import{c as fs,J as Fo,b as Ln,K as qo,a as nn,m as Kl,u as rn,L as Zo,M as tn}from"../chunks/DFca5BX5.js";import{d as Xo,f as Jo,u as zo,h as Qo,i as xo,g as ns,j as eu,k as tu,l as lu,m as su,n as nu,o as ru,a as Xs,p as au,q as iu}from"../chunks/DzKkOKN6.js";import{f as wo,A as Kn}from"../chunks/CoGXDCUN.js";import{d as ou}from"../chunks/DiHjA_aT.js";import{l as uu}from"../chunks/BNS59-Sv.js";import{i as fu,e as cu,S as _l,g as du,s as _u,a as hu,b as pu,c as vu,M as To,A as Cn,d as mu,f as gu,h as Eu,j as bu,k as Iu,l as wu,m as Tu,C as Au}from"../chunks/C_X2gkFr.js";import Cr from"../chunks/CF4_YkFU.js";import{d as ku,e as Du,f as Nu,h as $u,i as Ru,j as Ou}from"../chunks/CRverxmV.js";import{S as vl}from"../chunks/DBcgpmMt.js";import{T as Gt}from"../chunks/Rtszqwrj.js";import{c as Su,T as Un,v as Pu,s as hn}from"../chunks/BXo7R043.js";import{e as Dt,u as Ao,o as ko}from"../chunks/DNXpXRYa.js";import{S as Ps}from"../chunks/Cmi_MrK3.js";import{g as Vu,a as yu,b as Lu,u as Cu}from"../chunks/RAW76W5z.js";import{g as Uu,a as Mu,b as Bu,u as Ur,c as Hu,v as Mr,E as Gu}from"../chunks/D65mcrr6.js";import{T as Js}from"../chunks/Dok_iF0y.js";import{b as Ku,e as Yu,u as ju,c as Br,t as Wu}from"../chunks/C3YwVKtZ.js";import{S as Fu}from"../chunks/DjtyHjFA.js";import{M as qu}from"../chunks/CnlKcy1M.js";import{C as Ys}from"../chunks/CzvQehHf.js";import{C as Mn}from"../chunks/B5WJB5_d.js";import{M as Bn}from"../chunks/DbfJTM1S.js";import{S as Zu}from"../chunks/C0-Qcoum.js";import{E as Xu}from"../chunks/Da5sXaJp.js";import{C as Do}from"../chunks/D8_ibWhm.js";import{C as Ju}from"../chunks/Cux5bsOp.js";import{p as Hr,d as Gr,c as Kr,a as zu,u as Qu,b as xu,e as No,f as ef}from"../chunks/Bwjs81GA.js";import"../chunks/BFK-koEx.js";import"../chunks/CyFe254w.js";import{D as tf,M as Yr}from"../chunks/B2UduZ6H.js";import{b as lf}from"../chunks/CgO5y2dz.js";import{f as sf}from"../chunks/g5t9vw8M.js";import{E as nf}from"../chunks/BbEqRSGc.js";import{g as rf,a as af,u as of}from"../chunks/C-pQywFn.js";import{P as pn}from"../chunks/Cmfly5_1.js";import"../chunks/CGwCSIWv.js";import{g as $o,u as uf,a as Ro,b as ff,c as cf,r as df,d as _f}from"../chunks/B4MjpnpM.js";import{i as hf}from"../chunks/CFF-1hou.js";import{d as pf}from"../chunks/BOCOWNI7.js";import{a as vf,b as mf}from"../chunks/CK-jGpxl.js";import{A as gf}from"../chunks/oaqQgLHu.js";function Ef(l){let e,t;return{c(){e=sl("svg"),t=sl("path"),this.h()},l(s){e=nl(s,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var n=p(e);t=nl(n,"path",{d:!0}),p(t).forEach(c),n.forEach(c),this.h()},h(){u(t,"d","M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32L19.513 8.2Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 24 24"),u(e,"fill","currentColor"),u(e,"class",l[0])},m(s,n){M(s,e,n),r(e,t)},p(s,[n]){n&1&&u(e,"class",s[0])},i:st,o:st,d(s){s&&c(e)}}}function bf(l,e,t){let{className:s="w-4 h-4"}=e,{strokeWidth:n="1.5"}=e;return l.$$set=i=>{"className"in i&&t(0,s=i.className),"strokeWidth"in i&&t(1,n=i.strokeWidth)},[s,n]}class If extends Sl{constructor(e){super(),Pl(this,e,bf,Ef,Ol,{className:0,strokeWidth:1})}}function jr(l){let e,t,s,n='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3Z"></path><path fill-rule="evenodd" d="M13 6H3v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V6ZM8.75 7.75a.75.75 0 0 0-1.5 0v2.69L6.
103 9.22a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5a.75.75 0 1 0-1.06-1.06l-1.22 1.22V7.75Z" clip-rule="evenodd"></path></svg>',i,a,f=l[1].t("Download Database")+"",o,d,E,m,v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3Z"></path><path fill-rule="evenodd" d="M13 6H3v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V6ZM8.75 7.75a.75.75 0 0 0-1.5 0v2.69L6.03 9.22a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5a.75.75 0 1 0-1.06-1.06l-1.22 1.22V7.75Z" clip-rule="evenodd"></path></svg>',g,b,w=l[1].t("Export All Chats (All Users)")+"",A,I,k;return{c(){e=_("div"),t=_("button"),s=_("div"),s.innerHTML=n,i=N(),a=_("div"),o=B(f),d=N(),E=_("button"),m=_("div"),m.innerHTML=v,g=N(),b=_("div"),A=B(w),this.h()},l(T){e=h(T,"DIV",{class:!0});var R=p(e);t=h(R,"BUTTON",{class:!0,type:!0});var O=p(t);s=h(O,"DIV",{class:!0,"data-svelte-h":!0}),Wt(s)!=="svelte-1n29mwa"&&(s.innerHTML=n),i=$(O),a=h(O,"DIV",{class:!0});var y=p(a);o=H(y,f),y.forEach(c),O.forEach(c),R.forEach(c),d=$(T),E=h(T,"BUTTON",{class:!0});var L=p(E);m=h(L,"DIV",{class:!0,"data-svelte-h":!0}),Wt(m)!=="svelte-1l0oz0g"&&(m.innerHTML=v),g=$(L),b=h(L,"DIV",{class:!0});var P=p(b);A=H(P,w),P.forEach(c),L.forEach(c),this.h()},h(){u(s,"class","self-center mr-3"),u(a,"class","self-center text-sm font-medium"),u(t,"class","flex rounded-md py-1.5 px-3 w-full hover:bg-gray-200 dark:hover:bg-gray-800 transition"),u(t,"type","button"),u(e,"class","flex w-full justify-between"),u(m,"class","self-center mr-3"),u(b,"class","self-center text-sm font-medium"),u(E,"class","flex rounded-md py-2 px-3 w-full hover:bg-gray-200 dark:hover:bg-gray-800 transition")},m(T,R){M(T,e,R),r(e,t),r(t,s),r(t,i),r(t,a),r(a,o),M(T,d,R),M(T,E,R),r(E,m),r(E,g),r(E,b),r(b,A),I||(k=[pe(t,"click",l[9]),pe(E,"click",l[10])],I=!0)},p(T,R){R&2&&f!==(f=T[1].t("Download Database")+"")&&j(o,f),R&2&&w!==(w=T[1].t("Export All Chats (All Users)")+"")&&j(A,w)},d(T){T&&(c(e),c(d),c(E)),I=!1,ml(k)}}}function wf(l){var U;let e,t,s,n,i=l[1].t("Database")+"",a,f,o,d,E,m,v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3Z"></path><path fill-rule="evenodd" d="M13 6H3v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V6ZM8.75 7.75a.75.75 0 0 0-1.5 0v2.69L6.03 9.22a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5a.75.75 0 1 0-1.06-1.06l-1.22 1.22V7.75Z" clip-rule="evenodd"></path></svg>',g,b,w=l[1].t("Import Config from JSON File")+"",A,I,k,T,R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3Z"></path><path fill-rule="evenodd" d="M13 6H3v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V6ZM8.75 7.75a.75.75 0 0 0-1.5 0v2.69L6.03 9.22a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5a.75.75 0 1 0-1.06-1.06l-1.22 1.22V7.75Z" clip-rule="evenodd"></path></svg>',O,y,L=l[1].t("Export Config to JSON File")+"",P,D,S,K,Y,C,V=(((U=l[2])==null?void 0:U.features.enable_admin_export)??!0)&&jr(l);return{c(){e=_("form"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("input"),d=N(),E=_("button"),m=_("div"),m.innerHTML=v,g=N(),b=_("div"),A=B(w),I=N(),k=_("button"),T=_("div"),T.innerHTML=R,O=N(),y=_("div"),P=B(L),D=N(),S=_("hr"),K=N(),V&&V.c(),this.h()},l(F){e=h(F,"FORM",{class:!0});var X=p(e);t=h(X,"DIV",{class:!0});var Z=p(t);s=h(Z,"DIV",{});var J=p(s);n=h(J,"DIV",{class:!0});var ie=p(n);a=H(ie,i),ie.forEach(c),f=$(J),o=h(J,"INPUT",{id:!0,type:!0,accept:!0}),d=$(J),E=h(J,"BUTTON",{type:!0,class:!0});var fe=p(E);m=h(fe,"DIV",{class:!0,"data-svelte-h":!0}),Wt(m)!=="svelte-uk5zsu"&&(m.innerHTML=v),g=$(fe),b=h(fe,"DIV",{class:!0});var le=p(b);A=H(le,w),le.forEach(c),fe.forEach(c),I=$(J),k=h(J,"BUTTON",{type:!0,class:!0});var x=p(k);T=h(x,"DIV",{class:!0,"data-svelte-h":!0}),Wt(T)!=="svelte-uk5zsu"&&(T.innerHTML=R),O=$(x),y=h(x,"DIV",{class:!0});var oe=p(y);P=H(oe,L),oe.forEach(c),x.forEach(c),D=$(J),S=h(J,"HR",{class:!0}
1),K=$(J),V&&V.l(J),J.forEach(c),Z.forEach(c),X.forEach(c),this.h()},h(){u(n,"class","mb-2 text-sm font-medium"),u(o,"id","config-json-input"),o.hidden=!0,u(o,"type","file"),u(o,"accept",".json"),u(m,"class","self-center mr-3"),u(b,"class","self-center text-sm font-medium"),u(E,"type","button"),u(E,"class","flex rounded-md py-2 px-3 w-full hover:bg-gray-200 dark:hover:bg-gray-800 transition"),u(T,"class","self-center mr-3"),u(y,"class","self-center text-sm font-medium"),u(k,"type","button"),u(k,"class","flex rounded-md py-2 px-3 w-full hover:bg-gray-200 dark:hover:bg-gray-800 transition"),u(S,"class","border-gray-100 dark:border-gray-850 my-1"),u(t,"class","space-y-3 overflow-y-scroll scrollbar-hidden h-full"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(F,X){M(F,e,X),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),r(s,d),r(s,E),r(E,m),r(E,g),r(E,b),r(b,A),r(s,I),r(s,k),r(k,T),r(k,O),r(k,y),r(y,P),r(s,D),r(s,S),r(s,K),V&&V.m(s,null),Y||(C=[pe(o,"change",l[6]),pe(E,"click",l[7]),pe(k,"click",l[8]),pe(e,"submit",ds(l[11]))],Y=!0)},p(F,[X]){var Z;X&2&&i!==(i=F[1].t("Database")+"")&&j(a,i),X&2&&w!==(w=F[1].t("Import Config from JSON File")+"")&&j(A,w),X&2&&L!==(L=F[1].t("Export Config to JSON File")+"")&&j(P,L),((Z=F[2])==null?void 0:Z.features.enable_admin_export)??!0?V?V.p(F,X):(V=jr(F),V.c(),V.m(s,null)):V&&(V.d(1),V=null)},i:st,o:st,d(F){F&&c(e),V&&V.d(),Y=!1,ml(C)}}}function Tf(l,e,t){let s,n;qt(l,fs,w=>t(2,n=w));const{saveAs:i}=wo,a=Ul("i18n");qt(l,a,w=>t(1,s=w));let{saveHandler:f}=e;const o=async()=>{let w=new Blob([JSON.stringify(await uu(localStorage.token))],{type:"application/json"});i(w,`all-chats-export-${Date.now()}.json`)};rs(async()=>{});const d=w=>{const A=w.target.files[0],I=new FileReader;I.onload=async k=>{await fu(localStorage.token,JSON.parse(k.target.result)).catch(R=>{Je.error(`${R}`)})&&Je.success("Config imported successfully"),k.target.value=null},I.readAsText(A)},E=async()=>{document.getElementById("config-json-input").click()},m=async()=>{const w=await cu(localStorage.token),A=new Blob([JSON.stringify(w)],{type:"application/json"});i(A,`config-${Date.now()}.json`)},v=()=>{ou(localStorage.token).catch(w=>{Je.error(`${w}`)})},g=()=>{o()},b=async()=>{f()};return l.$$set=w=>{"saveHandler"in w&&t(0,f=w.saveHandler)},[f,s,n,i,a,o,d,E,m,v,g,b]}class Af extends Sl{constructor(e){super(),Pl(this,e,Tf,wf,Ol,{saveHandler:0})}}function Wr(l){var xn;let e,t,s,n=l[6].t("General")+"",i,a,f,o,d,E,m,v=l[6].t("Version")+"",g,b,w,A,I,k,T,R,O=(l[0]===null?l[6].t("Checking for updates..."):l[0]?`(v${l[1].latest} ${l[6].t("available!")})`:l[6].t("(latest)"))+"",y,L,P,D,S,K=l[6].t("See what's new")+"",Y,C,V,U=l[6].t("Check for updates")+"",F,X,Z,J,ie,fe,le=l[6].t("Help")+"",x,oe,se,te=l[6].t("Discover how to use Open WebUI and seek support from the community.")+"",ae,Te,ve,q=l[6].t("Documentation")+"",ne,Ie,be,z='<div class="flex space-x-1"><a href="https://discord.gg/5rJgQTnV4s" target="_blank"><img alt="Discord" src="https://img.shields.io/badge/Discord-Open_WebUI-blue?logo=discord&amp;logoColor=white"/></a> <a href="https://twitter.com/OpenWebUI" target="_blank"><img alt="X (formerly Twitter) Follow" src="https://img.shields.io/twitter/follow/OpenWebUI"/></a> <a href="https://github.com/open-webui/open-webui" target="_blank"><img alt="Github Repo" src="https://img.shields.io/github/stars/open-webui/open-webui?style=social&amp;label=Star us on Github"/></a></div>',ke,Ue,we,Ae,Re,ue=l[6].t("License")+"",Ee,Me,Ge,ee,me,ge=l[6].t("Authentication")+"",Ne,
1ye,ze,Ce,Le,Ke,re=l[6].t("Default User Role")+"",$e,ut,ft,ct,Be,Ve=l[6].t("pending")+"",je,Rt,Ot=l[6].t("user")+"",_t,Et,At=l[6].t("admin")+"",Tt,Ut,rt,bt,lt=l[6].t("Enable New Sign Ups")+"",He,at,Vt,Qe,yt,wt,vt,It=l[6].t("Show Admin Details in Account Pending Overlay")+"",el,Kt,Lt,ol,Tl,Se,De,Pe=l[6].t("Enable API Key")+"",kt,We,it,Mt,xe,mt,Bt,Ze,nt,Yt=l[6].t("JWT Expiration")+"",tl,Qt,al,St,Zt,Xt,hl=l[6].t("Valid time units:")+"",cl,Jt,zt,Nt=l[6].t("'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.")+"",Al,Rl,dl,Pt,gl,ot,$t=l[6].t("LDAP")+"",dt,kl,rl,$l,ul,pl,_s,Il,ll,ts=l[6].t("Features")+"",Dl,Nl,ls,El,Vl,il,et=l[6].t("Enable Community Sharing")+"",gt,yl,Oe,tt,fl,jt,Yl,Ml=l[6].t("Enable Message Rating")+"",Wl,Fl,Bl,as,hs,ss,Ct,ql=l[6].t("Channels")+"",As,cs,gs=l[6].t("Beta")+"",Is,ks,Ls,zl,Cs,Ds,Zl,ps,Es=l[6].t("User Webhooks")+"",ws,Us,Ql,Ms,Ns,Hl,xl,vs,bs=l[6].t("WebUI URL")+"",Ts,Bs,ms,is,Hs,jl,Vs=l[6].t("Enter the public URL of your WebUI. This URL will be used to generate links in the notifications.")+"",js,zs,$s,Gs,Ks,an=l[6].t("Webhook URL")+"",vn,Hn,Qs,ys,bl,Gn,Yn;k=new Gt({props:{content:Fo,$$slots:{default:[kf]},$$scope:{ctx:l}}});function jn(Xe,Ht){var os;return(os=Xe[7])!=null&&os.license_metadata?Nf:Df}let mn=jn(l),Rs=mn(l);function Po(Xe){l[15](Xe)}let Wn={};l[2].ENABLE_SIGNUP!==void 0&&(Wn.state=l[2].ENABLE_SIGNUP),Vt=new vl({props:Wn}),Ye.push(()=>qe(Vt,"state",Po));function Vo(Xe){l[16](Xe)}let Fn={};l[2].SHOW_ADMIN_DETAILS!==void 0&&(Fn.state=l[2].SHOW_ADMIN_DETAILS),Lt=new vl({props:Fn}),Ye.push(()=>qe(Lt,"state",Vo));function yo(Xe){l[17](Xe)}let qn={};l[2].ENABLE_API_KEY!==void 0&&(qn.state=l[2].ENABLE_API_KEY),it=new vl({props:qn}),Ye.push(()=>qe(it,"state",yo));let Xl=((xn=l[2])==null?void 0:xn.ENABLE_API_KEY)&&qr(l);function Lo(Xe){l[21](Xe)}let Zn={};l[4]!==void 0&&(Zn.state=l[4]),$l=new vl({props:Zn}),Ye.push(()=>qe($l,"state",Lo)),$l.$on("change",l[22]);let Jl=l[4]&&Xr(l);function Co(Xe){l[35](Xe)}let Xn={};l[2].ENABLE_COMMUNITY_SHARING!==void 0&&(Xn.state=l[2].ENABLE_COMMUNITY_SHARING),Oe=new vl({props:Xn}),Ye.push(()=>qe(Oe,"state",Co));function Uo(Xe){l[36](Xe)}let Jn={};l[2].ENABLE_MESSAGE_RATING!==void 0&&(Jn.state=l[2].ENABLE_MESSAGE_RATING),Bl=new vl({props:Jn}),Ye.push(()=>qe(Bl,"state",Uo));function Mo(Xe){l[37](Xe)}let zn={};l[2].ENABLE_CHANNELS!==void 0&&(zn.state=l[2].ENABLE_CHANNELS),zl=new vl({props:zn}),Ye.push(()=>qe(zl,"state",Mo));function Bo(Xe){l[38](Xe)}let Qn={};return l[2].ENABLE_USER_WEBHOOKS!==void 0&&(Qn.state=l[2].ENABLE_USER_WEBHOOKS),Ql=new vl({props:Qn}),Ye.push(()=>qe(Ql,"state",Bo)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("hr"),o=N(),d=_("div"),E=_("div"),m=_("div"),g=B(v),b=N(),w=_("div"),A=_("div"),I=_("div"),ce(k.$$.fragment),T=N(),R=_("a"),y=B(O),P=N(),D=_("button"),S=_("div"),Y=B(K),C=N(),V=_("button"),F=B(U),X=N(),Z=_("div"),J=_("div"),ie=_("div"),fe=_("div"),x=B(le),oe=N(),se=_("div"),ae=B(te),Te=N(),ve=_("a"),ne=B(q),Ie=N(),be=_("div"),be.innerHTML=z,ke=N(),Ue=_("div"),we=_("div"),Ae=_("div"),Re=_("div"),Ee=B(ue),Me=N(),Rs.c(),Ge=N(),ee=_("div"),me=_("div"),Ne=B(ge),ye=N(),ze=_("hr"),Ce=N(),Le=_("div"),Ke=_("div"),$e=B(re),ut=N(),ft=_("div"),ct=_("select"),Be=_("option"),je=B(Ve),Rt=_("option"),_t=B(Ot),Et=_("option"),Tt=B(At),Ut=N(),rt=_("div"),bt=_("div"),He=B(lt),at=N(),ce(Vt.$$.fragment),yt=N(),wt=_("div"),vt=_("div"),el=B(It),Kt=N(),ce(Lt.$$.fragment),Tl=N(),Se=_("div"),De=_("div"),kt=B(Pe),We=N(),ce(it.$$.fragment),xe=N(),Xl&&Xl.c(),mt=N(),Bt=_("div"),Ze=_("div"),nt=_("div"),tl=B(Yt),Qt=N(),al=_("div"),St=_("input"),Zt=N(),Xt=_("div"),cl=B(hl),Jt=N(),zt=_("span"),Al=B(Nt),Rl=N(),dl=_("div"),Pt=_("div"),gl=_("div"),ot=_("div"),dt=B($t),kl=N(),rl=_("div"),ce($l.$$.fragment),pl=N(),Jl&&Jl.c(),_s=N(),Il=_("div"),ll=_("div"),Dl=B(ts),Nl=N(),ls=_("hr"),El=N(),Vl=_("div"),il=_("div"),gt=B(et),yl=N(),ce(Oe.$$.fragment),fl=N(),jt=_("div"),Yl=_("div"),Wl=B(Ml),Fl=N(),ce(Bl.$$.fragment),hs=N(),ss=_("div"),Ct=_("div"),As=B(ql),cs=B(" ("),Is=B(gs),ks=B(")"),Ls=N(),ce(zl.$$.fragment),Ds=N(),Zl=_("div"),ps=_("div"),ws=B(Es),Us=N(),ce(Ql.$$.fragment),Ns=N(),Hl=_("div"),xl=_("div"),vs=_("div"),Ts=B(bs),Bs=N(),ms=_("div"),is=_("input"),Hs=N(),jl=_("div"),js=B(Vs),zs=N(),$s=_("div"),Gs=_("div"),Ks=_("div"),vn=B(an),Hn=N(),Qs=_("div"),ys=_("input"),this.h()},l(Xe){e=h(Xe,"DIV",{class:!0});var Ht=p(e);t=h(Ht,"DIV",{class:!0});var os=p(t);s=h(os,"DIV",{class:!0});var on=p(s);i=H(on,n),on.forEach(c),a=$(os),f=h(os,"HR",{class:!0}),o=$(os),d=h(os,"DIV",{class:!0});var Ws=p(d);E=h(Ws,"DIV",{class:!0});var un=p(E);m=h(un,"DIV",{});var fn=p(m);
1g=H(fn,v),fn.forEach(c),un.forEach(c),b=$(Ws),w=h(Ws,"DIV",{class:!0});var Fs=p(w);A=h(Fs,"DIV",{class:!0});var qs=p(A);I=h(qs,"DIV",{class:!0});var Zs=p(I);de(k.$$.fragment,Zs),T=$(Zs),R=h(Zs,"A",{href:!0,target:!0});var cn=p(R);y=H(cn,O),cn.forEach(c),Zs.forEach(c),P=$(qs),D=h(qs,"BUTTON",{class:!0,type:!0});var dn=p(D);S=h(dn,"DIV",{});var er=p(S);Y=H(er,K),er.forEach(c),dn.forEach(c),qs.forEach(c),C=$(Fs),V=h(Fs,"BUTTON",{class:!0,type:!0});var tr=p(V);F=H(tr,U),tr.forEach(c),Fs.forEach(c),Ws.forEach(c),X=$(os),Z=h(os,"DIV",{class:!0});var gn=p(Z);J=h(gn,"DIV",{class:!0});var En=p(J);ie=h(En,"DIV",{class:!0});var bn=p(ie);fe=h(bn,"DIV",{class:!0});var lr=p(fe);x=H(lr,le),lr.forEach(c),oe=$(bn),se=h(bn,"DIV",{class:!0});var sr=p(se);ae=H(sr,te),sr.forEach(c),bn.forEach(c),Te=$(En),ve=h(En,"A",{class:!0,href:!0,target:!0});var nr=p(ve);ne=H(nr,q),nr.forEach(c),En.forEach(c),Ie=$(gn),be=h(gn,"DIV",{class:!0,"data-svelte-h":!0}),Wt(be)!=="svelte-e1ltkf"&&(be.innerHTML=z),gn.forEach(c),ke=$(os),Ue=h(os,"DIV",{class:!0});var rr=p(Ue);we=h(rr,"DIV",{class:!0});var ar=p(we);Ae=h(ar,"DIV",{class:!0});var In=p(Ae);Re=h(In,"DIV",{class:!0});var ir=p(Re);Ee=H(ir,ue),ir.forEach(c),Me=$(In),Rs.l(In),In.forEach(c),ar.forEach(c),rr.forEach(c),os.forEach(c),Ge=$(Ht),ee=h(Ht,"DIV",{class:!0});var es=p(ee);me=h(es,"DIV",{class:!0});var or=p(me);Ne=H(or,ge),or.forEach(c),ye=$(es),ze=h(es,"HR",{class:!0}),Ce=$(es),Le=h(es,"DIV",{class:!0});var wn=p(Le);Ke=h(wn,"DIV",{class:!0});var ur=p(Ke);$e=H(ur,re),ur.forEach(c),ut=$(wn),ft=h(wn,"DIV",{class:!0});var fr=p(ft);ct=h(fr,"SELECT",{class:!0,placeholder:!0});var Tn=p(ct);Be=h(Tn,"OPTION",{});var cr=p(Be);je=H(cr,Ve),cr.forEach(c),Rt=h(Tn,"OPTION",{});var dr=p(Rt);_t=H(dr,Ot),dr.forEach(c),Et=h(Tn,"OPTION",{});var _r=p(Et);Tt=H(_r,At),_r.forEach(c),Tn.forEach(c),fr.forEach(c),wn.forEach(c),Ut=$(es),rt=h(es,"DIV",{class:!0});var An=p(rt);bt=h(An,"DIV",{class:!0});var hr=p(bt);He=H(hr,lt),hr.forEach(c),at=$(An),de(Vt.$$.fragment,An),An.forEach(c),yt=$(es),wt=h(es,"DIV",{class:!0});var kn=p(wt);vt=h(kn,"DIV",{class:!0});var pr=p(vt);el=H(pr,It),pr.forEach(c),Kt=$(kn),de(Lt.$$.fragment,kn),kn.forEach(c),Tl=$(es),Se=h(es,"DIV",{class:!0});var Dn=p(Se);De=h(Dn,"DIV",{class:!0});var vr=p(De);kt=H(vr,Pe),vr.forEach(c),We=$(Dn),de(it.$$.fragment,Dn),Dn.forEach(c),xe=$(es),Xl&&Xl.l(es),mt=$(es),Bt=h(es,"DIV",{class:!0});var xs=p(Bt);Ze=h(xs,"DIV",{class:!0});var mr=p(Ze);nt=h(mr,"DIV",{class:!0});var gr=p(nt);tl=H(gr,Yt),gr.forEach(c),mr.forEach(c),Qt=$(xs),al=h(xs,"DIV",{class:!0});var Er=p(al);St=h(Er,"INPUT",{class:!0,type:!0,placeholder:!0}),Er.forEach(c),Zt=$(xs),Xt=h(xs,"DIV",{class:!0});var Nn=p(Xt);cl=H(Nn,hl),Jt=$(Nn),zt=h(Nn,"SPAN",{class:!0});var br=p(zt);Al=H(br,Nt),br.forEach(c),Nn.forEach(c),xs.forEach(c),Rl=$(es),dl=h(es,"DIV",{class:!0});var Ir=p(dl);Pt=h(Ir,"DIV",{class:!0});var $n=p(Pt);gl=h($n,"DIV",{class:!0});var Rn=p(gl);ot=h(Rn,"DIV",{class:!0});var wr=p(ot);dt=H(wr,$t),wr.forEach(c),kl=$(Rn),rl=h(Rn,"DIV",{class:!0});var Tr=p(rl);de($l.$$.fragment,Tr),Tr.forEach(c),Rn.forEach(c),pl=$($n),Jl&&Jl.l($n),$n.forEach(c),Ir.forEach(c),es.forEach(c),_s=$(Ht),Il=h(Ht,"DIV",{class:!0});var us=p(Il);ll=h(us,"DIV",{class:!0});var Ar=p(ll);Dl=H(Ar,ts),Ar.forEach(c),Nl=$(us),ls=h(us,"HR",{class:!0}),El=$(us),Vl=h(us,"DIV",{class:!0});var On=p(Vl);il=h(On,"DIV",{class:!0});var kr=p(il);gt=H(kr,et),kr.forEach(c),yl=$(On),de(Oe.$$.fragment,On),On.forEach(c),fl=$(us),jt=h(us,"DIV",{class:!0});var Sn=p(jt);Yl=h(Sn,"DIV",{class:!0});var Dr=p(Yl);
1Wl=H(Dr,Ml),Dr.forEach(c),Fl=$(Sn),de(Bl.$$.fragment,Sn),Sn.forEach(c),hs=$(us),ss=h(us,"DIV",{class:!0});var Pn=p(ss);Ct=h(Pn,"DIV",{class:!0});var _n=p(Ct);As=H(_n,ql),cs=H(_n," ("),Is=H(_n,gs),ks=H(_n,")"),_n.forEach(c),Ls=$(Pn),de(zl.$$.fragment,Pn),Pn.forEach(c),Ds=$(us),Zl=h(us,"DIV",{class:!0});var Vn=p(Zl);ps=h(Vn,"DIV",{class:!0});var Nr=p(ps);ws=H(Nr,Es),Nr.forEach(c),Us=$(Vn),de(Ql.$$.fragment,Vn),Vn.forEach(c),Ns=$(us),Hl=h(us,"DIV",{class:!0});var en=p(Hl);xl=h(en,"DIV",{class:!0});var $r=p(xl);vs=h($r,"DIV",{class:!0});var Rr=p(vs);Ts=H(Rr,bs),Rr.forEach(c),$r.forEach(c),Bs=$(en),ms=h(en,"DIV",{class:!0});var Or=p(ms);is=h(Or,"INPUT",{class:!0,type:!0,placeholder:!0}),Or.forEach(c),Hs=$(en),jl=h(en,"DIV",{class:!0});var Sr=p(jl);js=H(Sr,Vs),Sr.forEach(c),en.forEach(c),zs=$(us),$s=h(us,"DIV",{class:!0});var yn=p($s);Gs=h(yn,"DIV",{class:!0});var Pr=p(Gs);Ks=h(Pr,"DIV",{class:!0});var Vr=p(Ks);vn=H(Vr,an),Vr.forEach(c),Pr.forEach(c),Hn=$(yn),Qs=h(yn,"DIV",{class:!0});var yr=p(Qs);ys=h(yr,"INPUT",{class:!0,type:!0,placeholder:!0}),yr.forEach(c),yn.forEach(c),us.forEach(c),Ht.forEach(c),this.h()},h(){u(s,"class","mb-2.5 text-base font-medium"),u(f,"class","border-gray-100 dark:border-gray-850 my-2"),u(E,"class","mb-1 text-xs font-medium flex space-x-2 items-center"),u(R,"href",L="https://github.com/open-webui/open-webui/releases/tag/v"+l[1].latest),u(R,"target","_blank"),u(I,"class","flex gap-1"),u(D,"class","underline flex items-center space-x-1 text-xs text-gray-500 dark:text-gray-500"),u(D,"type","button"),u(A,"class","flex flex-col text-xs text-gray-700 dark:text-gray-200"),u(V,"class","text-xs px-3 py-1.5 bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 transition rounded-lg font-medium"),u(V,"type","button"),u(w,"class","flex w-full justify-between items-center"),u(d,"class","mb-2.5"),u(fe,"class",""),u(se,"class","text-xs text-gray-500"),u(ie,"class","text-xs pr-2"),u(ve,"class","flex-shrink-0 text-xs font-medium underline"),u(ve,"href","https://docs.openwebui.com/"),u(ve,"target","_blank"),u(J,"class","flex w-full justify-between items-center"),u(be,"class","mt-1"),u(Z,"class","mb-2.5"),u(Re,"class",""),u(Ae,"class","text-xs pr-2"),u(we,"class","flex w-full justify-between items-center"),u(Ue,"class","mb-2.5"),u(t,"class","mb-3.5"),u(me,"class","mb-2.5 text-base font-medium"),u(ze,"class","border-gray-100 dark:border-gray-850 my-2"),u(Ke,"class","self-center text-xs font-medium"),Be.__value="pending",Q(Be,Be.__value),Rt.__value="user",Q(Rt,Rt.__value),Et.__value="admin",Q(Et,Et.__value),u(ct,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"),u(ct,"placeholder","Select a role"),l[2].DEFAULT_USER_ROLE===void 0&&Cl(()=>l[14].call(ct)),u(ft,"class","flex items-center relative"),u(Le,"class","mb-2.5 flex w-full justify-between"),u(bt,"class","self-center text-xs font-medium"),u(rt,"class","mb-2.5 flex w-full justify-between pr-2"),u(vt,"class","self-center text-xs font-medium"),u(wt,"class","mb-2.5 flex w-full items-center justify-between pr-2"),u(De,"class","self-center text-xs font-medium"),u(Se,"class","mb-2.5 flex w-full justify-between pr-2"),u(nt,"class","self-center text-xs font-medium"),u(Ze,"class","flex w-full justify-between"),u(St,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(St,"type","text"),u(St,"placeholder",'e.g.) "30m","1h", "10d". '),u(al,"class","flex mt-2 space-x-2"),u(zt,"class","text-gray-300 font-medium"),u(Xt,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(Bt,"class","mb-2.5 w-full justify-between"),u(ot,"class","font-medium"),u(rl,"class","mt-1"),u(gl,"class","flex justify-between items-center text-sm"),u(Pt,"class","mt-2 space-y-2 pr-1.5"),u(dl,"class","space-y-3"),u(ee,"class","mb-3"),u(ll,"class","mb-2.5 text-base font-medium"),u(ls,"class","border-gray-100 dark:border-gray-850 my-2"),u(il,"class","self-center text-xs font-medium"),u(Vl,"class","mb-2.5 flex w-full items-center justify-between pr-2"),u(Yl,"class","self-center text-xs font-medium"),u(jt,"class","mb-2.5 flex w-full items-center justify-between pr-2"),u(Ct,"class","self-center text-xs font-medium"),u(ss,"class","mb-2.5 flex w-full items-center justify-between pr-2"),u(ps,"class","self-center text-xs font-medium"),u(Zl,"class","mb-2.5 flex w-full items-center justify-between pr-2"),u(vs,"class","self-center text-xs font-medium"),u(xl,"class","flex w-full justify-between"),u(is,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(is,"type","text"),u(is,"placeholder",'e.g.) "http://localhost:3000"'),u(ms,"class","flex mt-2 space-x-2"),u(jl,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(Hl,"class","mb-2.5 w-full justify-between"),u(Ks,"class","self-center text-xs font-medium"),u(Gs,"class","flex w-full justify-between"),u(ys,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(ys,"type","text"),u(ys,"placeholder","https://example.com/webhook"),u(Qs,"class","flex mt-2 space-x-2"),u($s,"class","w-full justify-between"),u(Il,"class","mb-3"),u(e,"class","")},m(Xe,Ht){M(Xe,e,Ht),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(t,o),r(t,d),r(d,E),r(E,m),r(m,g),r(d,b),r(d,w),r(w,A),r(A,I),_e(k,I,null),r(I,T),r(I,R),r(R,y),r(A,P),r(A,D),r(D,S),r(S,Y),r(w,C),r(w,V),r(V,F),r(t,X),r(t,Z),r(Z,J),r(J,ie),r(ie,fe),r(fe,x),r(ie,oe),r(ie,se),r(se,ae),r(J,Te),r(J,ve),r(ve,ne),r(Z,Ie),r(Z,be),r(t,ke),r(t,Ue),r(Ue,we),r(we,Ae),r(Ae,Re),r(Re,Ee),r(Ae,Me),Rs.m(Ae,null),r(e,Ge),r(e,ee),r(ee,me),r(me,Ne),r(ee,ye),r(ee,ze),r(ee,Ce),r(ee,Le),r(Le,Ke),r(Ke,$e),r(Le,ut),r(Le,ft),r(ft,ct),r(ct,Be),r(Be,je),r(ct,Rt),r(Rt,_t),r(ct,Et),r(Et,Tt),Ft(ct,l[2].DEFAULT_USER_ROLE,!0),r(ee,Ut),r(ee,rt),r(rt,bt),r(bt,He),r(rt,at),_e(Vt,rt,null),r(ee,yt),r(ee,wt),r(wt,vt),r(vt,el),r(wt,Kt),_e(Lt,wt,null),r(ee,Tl),r(ee,Se),r(Se,De),r(De,kt),r(Se,We),_e(it,Se,null),r(ee,xe),Xl&&Xl.m(ee,null),r(ee,mt),r(ee,Bt),r(Bt,Ze),r(Ze,nt),r(nt,tl),r(Bt,Qt),r(Bt,al),r(al,St),Q(St,l[2].JWT_EXPIRES_IN),r(Bt,Zt),r(Bt,Xt),r(Xt,cl),r(Xt,Jt),r(Xt,zt),r(zt,Al),r(ee,Rl),r(ee,dl),r(dl,Pt),r(Pt,gl),r(gl,ot),r(ot,dt),r(gl,kl),r(gl,rl),_e($l,rl,null),r(Pt,pl),Jl&&Jl.m(Pt,null),r(e,_s),r(e,Il),r(Il,ll),r(ll,Dl),r(Il,Nl),r(Il,ls),r(Il,El),r(Il,Vl),r(Vl,il),r(il,gt),r(Vl,yl),_e(Oe,Vl,null),r(Il,fl),r(Il,jt),r(jt,Yl),r(Yl,Wl),r(jt,Fl),_e(Bl,jt,null),r(Il,hs),r(Il,ss),r(ss,Ct),r(Ct,As),r(Ct,cs),r(Ct,Is),r(Ct,ks),r(ss,Ls),_e(zl,ss,null),r(Il,Ds),r(Il,Zl),r(Zl,ps),r(ps,ws),r(Zl,Us),_e(Ql,Zl,null),r(Il,Ns),r(Il,Hl),r(Hl,xl),r(xl,vs),r(vs,Ts),r(Hl,Bs),r(Hl,ms),r(ms,is),Q(is,l[2].WEBUI_URL),r(Hl,Hs),r(Hl,jl),r(jl,js),r(Il,zs),r(Il,$s),r($s,Gs),r(Gs,Ks),r(Ks,vn),r($s,Hn),r($s,Qs),r(Qs,ys),Q(ys,l[3]),bl=!0,Gn||(Yn=[pe(D,"click",l[12]),pe(V,"click",l[13]),pe(ct,"change",l[14]),pe(St,"input",l[20]),pe(is,"input",l[39]),pe(ys,"input",l[40])],Gn=!0)},p(Xe,Ht){var dn;(!bl||Ht[0]&64)&&n!==(n=Xe[6].t("General")+"")&&j(i,n),(!bl||Ht[0]&64)&&v!==(v=Xe[6].t("Version")+"")&&j(g,v);const os={};Ht[1]&4096&&(os.$$scope={dirty:Ht,ctx:Xe}),k.$set(os),(!bl||Ht[0]&67)&&O!==(O=(Xe[0]===null?Xe[6].t("Checking for updates..."):Xe[0]?`(v${Xe[1].latest} ${Xe[6].t("available!")})`:Xe[6].t("(latest)"))+"")&&j(y,O),(!bl||Ht[0]&2&&L!==(L="https://github.com/open-webui/open-webui/releases/tag/v"+Xe[1].latest))&&u(R,"href",L),(!bl||Ht[0]&64)&&K!==(K=Xe[6].t("See what's new")+"")&&j(Y,K),(!bl||Ht[0]&64)&&U!==(U=Xe[6].t("Check for updates")+"")&&j(F,U),(!bl||Ht[0]&64)&&le!==(le=Xe[6].t("Help")+"")&&j(x,le),(!bl||Ht[0]&64)&&te!==(te=Xe[6].t("Discover how to use Open WebUI and seek support from the community.")+"")&&j(ae,te),(!bl||Ht[0]&64)&&q!==(q=Xe[6].t("Documentation")+"")&&j(ne,q),(!bl||Ht[0]&64)&&ue!==(ue=Xe[6].t("License")+"")&&j(Ee,ue),mn===(mn=jn(Xe))&&Rs?Rs.p(Xe,Ht):(Rs.d(1),Rs=mn(Xe),Rs&&(Rs.c(),Rs.m(Ae,null))),(!bl||Ht[0]&64)&&ge!==(ge=Xe[6].t("Authentication")+"")&&j(Ne,ge),(!bl||Ht[0]&64)&&re!==(re=Xe[6].t("Default User Role")+"")&&j($e,re),(!bl||Ht[0]&64)&&Ve!==(Ve=Xe[6].t("pending")+"")&&j(je,Ve),(!bl||Ht[0]&64)&&Ot!==(Ot=Xe[6].t("user")+"")&&j(_t,Ot),(!bl||Ht[0]&64)&&At!==(At=Xe[6].t("admin")+"")&&j(Tt,At),Ht[0]&4&&Ft(ct,Xe[2].DEFAULT_USER_ROLE),(!bl||Ht[0]&64)&&lt!==(lt=Xe[6].t("Enable New Sign Ups")+"")&&j(He,lt);const on={};!Qe&&Ht[0]&4&&(Qe=!0,on.state=Xe[2].ENABLE_SIGNUP,Fe(()=>Qe=!1)),Vt.$set(on),(!bl||Ht[0]&64)&&It!==(It=Xe[6].t("Show Admin Details in Account Pending Overlay")+"")&&j(el,It);const Ws={};!ol&&Ht[0]&4&&(ol=!0,Ws.state=Xe[2].SHOW_ADMIN_DETAILS,Fe(()=>ol=!1)),Lt.$set(Ws),(!bl||Ht[0]&64)&&Pe!==(Pe=Xe[6].t("Enable API Key")+"")&&j(kt,Pe);const un={};!Mt&&Ht[0]&4&&(Mt=!0,un.state=Xe[2].ENABLE_API_KEY,Fe(()=>Mt=!1)),it.$set(un),(dn=Xe[2])!=null&&dn.ENABLE_API_KEY?Xl?(Xl.p(Xe,Ht),Ht[0]&4&&G(Xl,1)):(Xl=qr(Xe),Xl.c(),G(Xl,1),Xl.m(ee,mt)):Xl&&(ht(),W(Xl,1,1,()=>{Xl=null}),pt()),(!bl||Ht[0]&64)&&Yt!==(Yt=Xe[6].t("JWT Expiration")+"")&&j(tl,Yt),Ht[0]&4&&St.value!==Xe[2].JWT_EXPIRES_IN&&Q(St,Xe[2].JWT_EXPIRES_IN),(!bl||Ht[0]&64)&&hl!==(hl=Xe[6].t("Valid time units:")+"")&&j(cl,hl),(!bl||Ht[0]&64)&&Nt!==(Nt=Xe[6].t("'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.")+"")&&j(Al,Nt),(!bl||Ht[0]&64)&&$t!==($t=Xe[6].t("LDAP")+"")&&j(dt,$t);const fn={};!ul&&Ht[0]&16&&(ul=!0,fn.state=Xe[4],Fe(()=>ul=!1)),$l.$set(fn),Xe[4]?Jl?(Jl.p(Xe,Ht),Ht[0]&16&&G(Jl,1)):(Jl=Xr(Xe),Jl.c(),G(Jl,1),Jl.m(Pt,null)):Jl&&(ht(),W(Jl,1,1,()=>{Jl=null}),pt()),(!bl||Ht[0]&64)&&ts!==(ts=Xe[6].t("Features")+"")&&j(Dl,ts),(!bl||Ht[0]&64)&&et!==(et=Xe[6].t("Enable Community Sharing")+"")&&j(gt,et);const Fs={};!tt&&Ht[0]&4&&(tt=!0,Fs.state=Xe[2].ENABLE_COMMUNITY_SHARING,Fe(()=>tt=!1)),Oe.$set(Fs),(!bl||Ht[0]&64)&&Ml!==(Ml=Xe[6].t("Enable Message Rating")+"")&&j(Wl,Ml);const qs={};!as&&Ht[0]&4&&(as=!0,qs.state=Xe[2].ENABLE_MESSAGE_RATING,Fe(()=>as=!1)),Bl.$set(qs),(!bl||Ht[0]&64)&&ql!==(ql=Xe[6].t("Channels")+"")&&j(As,ql),(!bl||Ht[0]&64)&&gs!==(gs=Xe[6].t("Beta")+"")&&j(Is,gs);const Zs={};!Cs&&Ht[0]&4&&(Cs=!0,Zs.state=Xe[2].ENABLE_CHANNELS,Fe(()=>Cs=!1)),zl.$set(Zs),(!bl||Ht[0]&64)&&Es!==(Es=Xe[6].t("User Webhooks")+"")&&j(ws,Es);const cn={};!Ms&&Ht[0]&4&&(Ms=!0,cn.state=Xe[2].ENABLE_USER_WEBHOOKS,Fe(()=>Ms=!1)),Ql.$set(cn),(!bl||Ht[0]&64)&&bs!==(bs=Xe[6].t("WebUI URL")+"")&&j(Ts,bs),Ht[0]&4&&is.value!==Xe[2].WEBUI_URL&&Q(is,Xe[2].WEBUI_URL),(!bl||Ht[0]&64)&&Vs!==(Vs=Xe[6].t("Enter the public URL of your WebUI. This URL will be used to generate links in the notifications.")+"")&&j(js,Vs),(!bl||Ht[0]&64)&&an!==(an=Xe[6].t("Webhook URL")+"")&&j(vn,an),Ht[0]&8&&ys.value!==Xe[3]&&Q(ys,Xe[3])},i(Xe){bl||(G(k.$$.fragment,Xe),G(Vt.$$.fragment,Xe),G(Lt.$$.fragment,Xe),G(it.$$.fragment,Xe),G(Xl),G($l.$$.fragment,Xe),G(Jl),G(Oe.$$.fragment,Xe),G(Bl.$$.fragment,Xe),G(zl.$$.fragment,Xe),G(Ql.$$.fragment,Xe),bl=!0)},o(Xe){W(k.$$.fragment,Xe),W(Vt.$$.fragment,Xe),W(Lt.$$.fragment,Xe),W(it.$$.fragment,Xe),W(Xl),W($l.$$.fragment,Xe),W(Jl),W(Oe.$$.fragment,Xe),W(Bl.$$.fragment,Xe),W(zl.$$.fragment,Xe),W(Ql.$$.fragment,Xe),bl=!1},d(Xe){Xe&&c(e),he(k),Rs.d(),he(Vt),he(Lt),he(it),Xl&&Xl.d(),he($l),Jl&&Jl.d(),he(Oe),he(Bl),he(zl),he(Ql),Gn=!1,ml(Yn)}}}function kf(l){let e,t;return{c(){e=B("v"),t=B(Ln)},l(s){e=H(s,"v"),t=H(s,Ln)},m(s,n){M(s,e,n),M(s,t,n)}
1,p:st,d(s){s&&(c(e),c(t))}}}function Df(l){let e,t,s=l[6].t("Upgrade to a licensed plan for enhanced capabilities, including custom theming and branding, and dedicated support.")+"",n;return{c(){e=_("a"),t=_("span"),n=B(s),this.h()},l(i){e=h(i,"A",{class:!0,href:!0,target:!0});var a=p(e);t=h(a,"SPAN",{class:!0});var f=p(t);n=H(f,s),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","text-gray-500"),u(e,"class","text-xs hover:underline"),u(e,"href","https://docs.openwebui.com/enterprise"),u(e,"target","_blank")},m(i,a){M(i,e,a),r(e,t),r(t,n)},p(i,a){a[0]&64&&s!==(s=i[6].t("Upgrade to a licensed plan for enhanced capabilities, including custom theming and branding, and dedicated support.")+"")&&j(n,s)},d(i){i&&c(e)}}}function Nf(l){var k,T,R,O,y,L,P,D;let e,t,s=((T=(k=l[7])==null?void 0:k.license_metadata)==null?void 0:T.type)+"",n,i,a,f,o=((O=(R=l[7])==null?void 0:R.license_metadata)==null?void 0:O.organization_name)+"",d,E,m,v=(((L=(y=l[7])==null?void 0:y.license_metadata)==null?void 0:L.seats)??"Unlimited")+"",g,b,w,A,I=((D=(P=l[7])==null?void 0:P.license_metadata)==null?void 0:D.html)&&Fr(l);return{c(){e=_("a"),t=_("span"),n=B(s),i=B(`
2											license`),a=B(`
3										registered to
4										`),f=_("span"),d=B(o),E=B(`
5										for
6										`),m=_("span"),g=B(v),b=B(" users."),w=N(),I&&I.c(),A=xt(),this.h()},l(S){e=h(S,"A",{href:!0,target:!0,class:!0});var K=p(e);t=h(K,"SPAN",{class:!0});var Y=p(t);n=H(Y,s),i=H(Y,`
7											license`),Y.forEach(c),a=H(K,`
8										registered to
9										`),f=h(K,"SPAN",{class:!0});var C=p(f);d=H(C,o),C.forEach(c),E=H(K,`
10										for
11										`),m=h(K,"SPAN",{class:!0});var V=p(m);g=H(V,v),b=H(V," users."),V.forEach(c),K.forEach(c),w=$(S),I&&I.l(S),A=xt(),this.h()},h(){u(t,"class","capitalize text-black dark:text-white"),u(f,"class","capitalize text-black dark:text-white"),u(m,"class","font-medium text-black dark:text-white"),u(e,"href","https://docs.openwebui.com/enterprise"),u(e,"target","_blank"),u(e,"class","text-gray-500 mt-0.5")},m(S,K){M(S,e,K),r(e,t),r(t,n),r(t,i),r(e,a),r(e,f),r(f,d),r(e,E),r(e,m),r(m,g),r(m,b),M(S,w,K),I&&I.m(S,K),M(S,A,K)},p(S,K){var Y,C,V,U,F,X,Z,J;K[0]&128&&s!==(s=((C=(Y=S[7])==null?void 0:Y.license_metadata)==null?void 0:C.type)+"")&&j(n,s),K[0]&128&&o!==(o=((U=(V=S[7])==null?void 0:V.license_metadata)==null?void 0:U.organization_name)+"")&&j(d,o),K[0]&128&&v!==(v=(((X=(F=S[7])==null?void 0:F.license_metadata)==null?void 0:X.seats)??"Unlimited")+"")&&j(g,v),(J=(Z=S[7])==null?void 0:Z.license_metadata)!=null&&J.html?I?I.p(S,K):(I=Fr(S),I.c(),I.m(A.parentNode,A)):I&&(I.d(1),I=null)},d(S){S&&(c(e),c(w),c(A)),I&&I.d(S)}}}function Fr(l){var n,i;let e,t,s=Cr.sanitize((i=(n=l[7])==null?void 0:n.license_metadata)==null?void 0:i.html)+"";return{c(){e=_("div"),t=new Ho(!1),this.h()},l(a){e=h(a,"DIV",{class:!0});var f=p(e);t=Go(f,!1),f.forEach(c),this.h()},h(){t.a=null,u(e,"class","mt-0.5")},m(a,f){M(a,e,f),t.m(s,e)},p(a,f){var o,d;f[0]&128&&s!==(s=Cr.sanitize((d=(o=a[7])==null?void 0:o.license_metadata)==null?void 0:d.html)+"")&&t.p(s)},d(a){a&&c(e)}}}function qr(l){var b;let e,t,s=l[6].t("API Key Endpoint Restrictions")+"",n,i,a,f,o,d,E;function m(w){l[18](w)}let v={};l[2].ENABLE_API_KEY_ENDPOINT_RESTRICTIONS!==void 0&&(v.state=l[2].ENABLE_API_KEY_ENDPOINT_RESTRICTIONS),a=new vl({props:v}),Ye.push(()=>qe(a,"state",m));let g=((b=l[2])==null?void 0:b.ENABLE_API_KEY_ENDPOINT_RESTRICTIONS)&&Zr(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),o=N(),g&&g.c(),d=xt(),this.h()},l(w){e=h(w,"DIV",{class:!0});var A=p(e);t=h(A,"DIV",{class:!0});var I=p(t);n=H(I,s),I.forEach(c),i=$(A),de(a.$$.fragment,A),A.forEach(c),o=$(w),g&&g.l(w),d=xt(),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(e,"class","mb-2.5 flex w-full justify-between pr-2")},m(w,A){M(w,e,A),r(e,t),r(t,n),r(e,i),_e(a,e,null),M(w,o,A),g&&g.m
11(w,A),M(w,d,A),E=!0},p(w,A){var k;(!E||A[0]&64)&&s!==(s=w[6].t("API Key Endpoint Restrictions")+"")&&j(n,s);const I={};!f&&A[0]&4&&(f=!0,I.state=w[2].ENABLE_API_KEY_ENDPOINT_RESTRICTIONS,Fe(()=>f=!1)),a.$set(I),(k=w[2])!=null&&k.ENABLE_API_KEY_ENDPOINT_RESTRICTIONS?g?g.p(w,A):(g=Zr(w),g.c(),g.m(d.parentNode,d)):g&&(g.d(1),g=null)},i(w){E||(G(a.$$.fragment,w),E=!0)},o(w){W(a.$$.fragment,w),E=!1},d(w){w&&(c(e),c(o),c(d)),he(a),g&&g.d(w)}}}function Zr(l){let e,t,s=l[6].t("Allowed Endpoints")+"",n,i,a,f,o,d,E=l[6].t("To learn more about available endpoints, visit our documentation.")+"",m,v,g;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("input"),f=N(),o=_("div"),d=_("a"),m=B(E),this.h()},l(b){e=h(b,"DIV",{class:!0});var w=p(e);t=h(w,"DIV",{class:!0});var A=p(t);n=H(A,s),A.forEach(c),i=$(w),a=h(w,"INPUT",{class:!0,type:!0,placeholder:!0}),f=$(w),o=h(w,"DIV",{class:!0});var I=p(o);d=h(I,"A",{href:!0,target:!0,class:!0});var k=p(d);m=H(k,E),k.forEach(c),I.forEach(c),w.forEach(c),this.h()},h(){u(t,"class","text-xs font-medium"),u(a,"class","w-full mt-1 rounded-lg text-sm dark:text-gray-300 bg-transparent outline-hidden"),u(a,"type","text"),u(a,"placeholder","e.g.) /api/v1/messages, /api/v1/channels"),u(d,"href","https://docs.openwebui.com/getting-started/api-endpoints"),u(d,"target","_blank"),u(d,"class","text-gray-300 font-medium underline"),u(o,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(e,"class","flex w-full flex-col pr-2")},m(b,w){M(b,e,w),r(e,t),r(t,n),r(e,i),r(e,a),Q(a,l[2].API_KEY_ALLOWED_ENDPOINTS),r(e,f),r(e,o),r(o,d),r(d,m),v||(g=pe(a,"input",l[19]),v=!0)},p(b,w){w[0]&64&&s!==(s=b[6].t("Allowed Endpoints")+"")&&j(n,s),w[0]&4&&a.value!==b[2].API_KEY_ALLOWED_ENDPOINTS&&Q(a,b[2].API_KEY_ALLOWED_ENDPOINTS),w[0]&64&&E!==(E=b[6].t("To learn more about available endpoints, visit our documentation.")+"")&&j(m,E)},d(b){b&&c(e),v=!1,g()}}}function Xr(l){let e,t,s,n,i=l[6].t("Label")+"",a,f,o,d,E,m,v,g,b,w,A=l[6].t("Host")+"",I,k,T,R,O,y,L,P=l[6].t("Port")+"",D,S,K,Y,C,V,U,F=l[6].t("Application DN")+"",X,Z,J,ie,fe,le,x=l[6].t("Application DN Password")+"",oe,se,te,ae,Te,ve,q,ne,Ie=l[6].t("Attribute for Mail")+"",be,z,ke,Ue,we,Ae,Re,ue=l[6].t("Attribute for Username")+"",Ee,Me,Ge,ee,me,ge,Ne,ye=l[6].t("Search Base")+"",ze,Ce,Le,Ke,re,$e,ut,ft=l[6].t("Search Filters")+"",ct,Be,Ve,je,Rt,Ot,_t,Et=l[6].t("Click here for filter guides.")+"",At,Tt,Ut,rt,bt,lt=l[6].t("TLS")+"",He,at,Vt,Qe,yt,wt,vt,It,el;K=new Gt({props:{placement:"top-start",content:l[6].t("Default to 389 or 636 if TLS is enabled"),className:"w-full",$$slots:{default:[$f]},$$scope:{ctx:l}}}),J=new Gt({props:{content:l[6].t("The Application Account DN you bind with for search"),placement:"top-start",$$slots:{default:[Rf]},$$scope:{ctx:l}}});function Kt(De){l[27](De)}let Lt={placeholder:l[6].t("Enter Application DN Password")};l[5].app_dn_password!==void 0&&(Lt.value=l[5].app_dn_password),te=new _l({props:Lt}),Ye.push(()=>qe(te,"value",Kt)),ke=new Gt({props:{content:l[6].t("The LDAP attribute that maps to the mail that users use to sign in."),placement:"top-start",$$slots:{default:[Of]},$$scope:{ctx:l}}}),Ge=new Gt({props:{content:l[6].t("The LDAP attribute that maps to the username that users use to sign in."),placement:"top-start",$$slots:{default:[Sf]},$$scope:{ctx:l}}}),Le=new Gt({props:{content:l[6].t("The base to search for users"),placement:"top-start",$$slots:{default:[Pf]},$$scope:{ctx:l}}});function ol(De){l[32](De)}let Tl={};l[5].use_tls!==void 0&&(Tl.state=l[5].use_tls),Qe=new vl({props:Tl}),Ye.push(()=>qe(Qe,"state",ol));let Se=l[5].use_tls&&Jr(l);return{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("input"),E=N(),m=_("div"),v=N(),g=_("div"),b=_("div"),w=_("div"),I=B(A),k=N(),T=_("input"),O=N(),y=_("div"),L=_("div"),D=B(P),S=N(),ce(K.$$.fragment),Y=N(),C=_("div"),V=_("div"),U=_("div"),X=B(F),Z=N(),ce(J.$$.fragment),ie=N(),fe=_("div"),le=_("div"),oe=B(x),se=N(),ce(te.$$.fragment),Te=N(),ve=_("div"),q=_("div"),ne=_("div"),be=B(Ie),z=N(),ce(ke.$$.fragment),Ue=N(),we=_("div"),Ae=_("div"),Re=_("div"),Ee=B(ue),Me=N(),ce(Ge.$$.fragment),ee=N(),me=_("div"),ge=_("div"),Ne=_("div"),ze=B(ye),Ce=N(),ce(Le.$$.fragment),Ke=N(),re=_("div"),$e=_("div"),ut=_("div"),ct=B(ft),Be=N(),Ve=_("input"),Rt=N(),Ot=_("div"),_t=_("a"),At=B(Et),Tt=N(),Ut=_("div"),rt=_("div"),bt=_("div"),He=B(lt),at=N(),Vt=_("div"),ce(Qe.$$.fragment),wt=N(),Se&&Se.c(),this.h()},l(De){e=h(De,"DIV",{class:!0});var Pe=p(e);t=h(Pe,"DIV",{class:!0});var kt=p(t);s=h(kt,"DIV",{class:!0});var We=p(s);n=h(We,"DIV",{class:!0});var it=p(n);a=H(it,i),it.forEach(c),f=$(We),o=h(We,"INPUT",{class:!0,placeholder:!0}),We.forEach(c),E=$(kt),m=h(kt,"DIV",{class:!0}),p(m).forEach(c),kt.forEach(c),v=$(Pe),g=h(Pe,"DIV",{class:!0});var Mt=p(g);b=h(Mt,"DIV",{class:!0});var xe=p(b);w=h(xe,"DIV",{class:!0});var mt=p(w);I=H(mt,A),mt.forEach(c),k=$(xe),T=h(xe,"INPUT",{class:!0,placeholder:!0}),xe.forEach(c),O=$(Mt),y=h(Mt,"DIV",{class:!0});var Bt=p(y);L=h(Bt,"DIV",{class:!0});var Ze=p(L);
11D=H(Ze,P),Ze.forEach(c),S=$(Bt),de(K.$$.fragment,Bt),Bt.forEach(c),Mt.forEach(c),Y=$(Pe),C=h(Pe,"DIV",{class:!0});var nt=p(C);V=h(nt,"DIV",{class:!0});var Yt=p(V);U=h(Yt,"DIV",{class:!0});var tl=p(U);X=H(tl,F),tl.forEach(c),Z=$(Yt),de(J.$$.fragment,Yt),Yt.forEach(c),ie=$(nt),fe=h(nt,"DIV",{class:!0});var Qt=p(fe);le=h(Qt,"DIV",{class:!0});var al=p(le);oe=H(al,x),al.forEach(c),se=$(Qt),de(te.$$.fragment,Qt),Qt.forEach(c),nt.forEach(c),Te=$(Pe),ve=h(Pe,"DIV",{class:!0});var St=p(ve);q=h(St,"DIV",{class:!0});var Zt=p(q);ne=h(Zt,"DIV",{class:!0});var Xt=p(ne);be=H(Xt,Ie),Xt.forEach(c),z=$(Zt),de(ke.$$.fragment,Zt),Zt.forEach(c),St.forEach(c),Ue=$(Pe),we=h(Pe,"DIV",{class:!0});var hl=p(we);Ae=h(hl,"DIV",{class:!0});var cl=p(Ae);Re=h(cl,"DIV",{class:!0});var Jt=p(Re);Ee=H(Jt,ue),Jt.forEach(c),Me=$(cl),de(Ge.$$.fragment,cl),cl.forEach(c),hl.forEach(c),ee=$(Pe),me=h(Pe,"DIV",{class:!0});var zt=p(me);ge=h(zt,"DIV",{class:!0});var Nt=p(ge);Ne=h(Nt,"DIV",{class:!0});var Al=p(Ne);ze=H(Al,ye),Al.forEach(c),Ce=$(Nt),de(Le.$$.fragment,Nt),Nt.forEach(c),zt.forEach(c),Ke=$(Pe),re=h(Pe,"DIV",{class:!0});var Rl=p(re);$e=h(Rl,"DIV",{class:!0});var dl=p($e);ut=h(dl,"DIV",{class:!0});var Pt=p(ut);ct=H(Pt,ft),Pt.forEach(c),Be=$(dl),Ve=h(dl,"INPUT",{class:!0,placeholder:!0}),dl.forEach(c),Rl.forEach(c),Rt=$(Pe),Ot=h(Pe,"DIV",{class:!0});var gl=p(Ot);_t=h(gl,"A",{class:!0,href:!0,target:!0});var ot=p(_t);At=H(ot,Et),ot.forEach(c),gl.forEach(c),Tt=$(Pe),Ut=h(Pe,"DIV",{});var $t=p(Ut);rt=h($t,"DIV",{class:!0});var dt=p(rt);bt=h(dt,"DIV",{class:!0});var kl=p(bt);He=H(kl,lt),kl.forEach(c),at=$(dt),Vt=h(dt,"DIV",{class:!0});var rl=p(Vt);de(Qe.$$.fragment,rl),rl.forEach(c),dt.forEach(c),wt=$($t),Se&&Se.l($t),$t.forEach(c),Pe.forEach(c),this.h()},h(){u(n,"class","self-center text-xs font-medium min-w-fit mb-1"),u(o,"class","w-full bg-transparent outline-hidden py-0.5"),o.required=!0,u(o,"placeholder",d=l[6].t("Enter server label")),u(s,"class","w-full"),u(m,"class","w-full"),u(t,"class","flex w-full gap-2"),u(w,"class","self-center text-xs font-medium min-w-fit mb-1"),u(T,"class","w-full bg-transparent outline-hidden py-0.5"),T.required=!0,u(T,"placeholder",R=l[6].t("Enter server host")),u(b,"class","w-full"),u(L,"class","self-center text-xs font-medium min-w-fit mb-1"),u(y,"class","w-full"),u(g,"class","flex w-full gap-2"),u(U,"class","self-center text-xs font-medium min-w-fit mb-1"),u(V,"class","w-full"),u(le,"class","self-center text-xs font-medium min-w-fit mb-1"),u(fe,"class","w-full"),u(C,"class","flex w-full gap-2"),u(ne,"class","self-center text-xs font-medium min-w-fit mb-1"),u(q,"class","w-full"),u(ve,"class","flex w-full gap-2"),u(Re,"class","self-center text-xs font-medium min-w-fit mb-1"),u(Ae,"class","w-full"),u(we,"class","flex w-full gap-2"),u(Ne,"class","self-center text-xs font-medium min-w-fit mb-1"),u(ge,"class","w-full"),u(me,"class","flex w-full gap-2"),u(ut,"class","self-center text-xs font-medium min-w-fit mb-1"),u(Ve,"class","w-full bg-transparent outline-hidden py-0.5"),u(Ve,"placeholder",je=l[6].t("Example: (&(objectClass=inetOrgPerson)(uid=%s))")),u($e,"class","w-full"),u(re,"class","flex w-full gap-2"),u(_t,"class","text-gray-300 font-medium underline"),u(_t,"href","https://ldap.com/ldap-filters/"),u(_t,"target","_blank"),u(Ot,"class","text-xs text-gray-400 dark:text-gray-500"),u(bt,"class","font-medium"),u(Vt,"class","mt-1"),u(rt,"class","flex justify-between items-center text-sm"),u(e,"class","flex flex-col gap-1")},m(De,Pe){M(De,e,Pe),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),Q(o,l[5].label),r(t,E),r(t,m),r(e,v),r(e,g),r(g,b),r(b,w),r(w,I),r(b,k),r(b,T),Q(T,l[5].host),r(g,O),r(g,y),r(y,L),r(L,D),r(y,S),_e(K,y,null),r(e,Y),r(e,C),r(C,V),r(V,U),r(U,X),r(V,Z),_e(J,V,null),r(C,ie),r(C,fe),r(fe,le),r(le,oe),r(fe,se),_e(te,fe,null),r(e,Te),r(e,ve),r(ve,q),r(q,ne),r(ne,be),r(q,z),_e(ke,q,null),r(e,Ue),r(e,we),r(we,Ae),r(Ae,Re),r(Re,Ee),r(Ae,Me),_e(Ge,Ae,null),r(e,ee),r(e,me),r(me,ge),r(ge,Ne),r(Ne,ze),r(ge,Ce),_e(Le,ge,null),r(e,Ke),r(e,re),r(re,$e),r($e,ut),r(ut,ct),r($e,Be),r($e,Ve),Q(Ve,l[5].search_filters),r(e,Rt),r(e,Ot),r(Ot,_t),r(_t,At),r(e,Tt),r(e,Ut),r(Ut,rt),r(rt,bt),r(bt,He),r(rt,at),r(rt,Vt),_e(Qe,Vt,null),r(Ut,wt),Se&&Se.m(Ut,null),vt=!0,It||(el=[pe(o,"input",l[23]),pe(T,"input",l[24]),pe(Ve,"input",l[31])],It=!0)},p(De,Pe){(!vt||Pe[0]&64)&&i!==(i=De[6].t("Label")+"")&&j(a,i),(!vt||Pe[0]&64&&d!==(d=De[6].t("Enter server label")))&&u(o,"placeholder",d),Pe[0]&32&&o.value!==De[5].label&&Q(o,De[5].label),(!vt||Pe[0]&64)&&A!==(A=De[6].t("Host")+"")&&j(I,A),(!vt||Pe[0]&64&&R!==(R=De[6].t("Enter server host")))&&u(T,"placeholder",R),Pe[0]&32&&T.value!==De[5].host&&Q(T,De[5].host),(!vt||Pe[0]&64)&&P!==(P=De[6].t("Port")+"")&&j(D,P);const kt={};Pe[0]&64&&(kt.content=De[6].t("Default to 389 or 636 if TLS is enabled")),Pe[0]&96|Pe[1]&4096&&(kt.$$scope={dirty:Pe,ctx:De}),K.$set(kt),(!vt||Pe[0]&64)&&F!==(F=De[6].t("Application DN")+"")&&j(X,F);const We={};Pe[0]&64&&(We.content=De[6].t("The Application Account DN you bind with for search")),Pe[0]&96|Pe[1]&4096&&(We.$$scope={dirty:Pe,ctx:De}),J.$set(We),(!vt||Pe[0]&64)&&x!==(x=De[6].t("Application DN Password")+"")&&j(oe,x);const it={};Pe[0]&64&&(it.placeholder=De[6].t("Enter Application DN Password")),!ae&&Pe[0]&32&&(ae=!0,it.value=De[5].app_dn_password,Fe(()=>ae=!1)),te.$set(it),(!vt||Pe[0]&64)&&Ie!==(Ie=De[6].t("Attribute for Mail")+"")&&j(be,Ie);const Mt={};Pe[0]&64&&(Mt.content=De[6].t("The LDAP attribute that maps to the mail that users use to sign in.")),Pe[0]&96|Pe[1]&4096&&(Mt.$$scope={dirty:Pe,ctx:De}),ke.$set(Mt),(!vt||Pe[0]&64)&&ue!==(ue=De[6].t("Attribute for Username")+"")&&j(Ee,ue);const xe={};Pe[0]&64&&(xe.content=De[6].t("The LDAP attribute that maps to the username that users use to sign in.")),Pe[0]&96|Pe[1]&4096&&(xe.$$scope={dirty:Pe,ctx:De}),Ge.$set(xe),(!vt||Pe[0]&64)&&ye!==(ye=De[6].t("Search Base")+"")&&j(ze,ye);const mt={};Pe[0]&64&&(mt.content=De[6].t("The base to search for users")),Pe[0]&96|Pe[1]&4096&&(mt.$$scope={dirty:Pe,ctx:De}),Le.$set(mt),(!vt||Pe[0]&64)&&ft!==(ft=De[6].t("Search Filters")+"")&&j(ct,ft),(!vt||Pe[0]&64&&je!==(je=De[6].t("Example: (&(objectClass=inetOrgPerson)(uid=%s))")))&&u(Ve,"placeholder",je),Pe[0]&32&&Ve.value!==De[5].search_filters&&Q(Ve,De[5].search_filters),(!vt||Pe[0]&64)&&Et!==(Et=De[6].t("Click here for filter guides.")+"")&&j(At,Et),(!vt||Pe[0]&64)&&lt!==(lt=De[6].t("TLS")+"")&&j(He,lt);const Bt={};!yt&&Pe[0]&32&&(yt=!0,Bt.state=De[5].use_tls,Fe(()=>yt=!1)),Qe.$set(Bt),De[5].use_tls?Se?(Se.p(De,Pe),Pe[0]&32&&G(Se,1)):(Se=Jr(De),Se.c(),G(Se,1),Se.m(Ut,null)):Se&&(ht(),W(Se,1,1,()=>{Se=null}),pt())},i(De){vt||(G(K.$$.fragment,De),G(J.$$.fragment,De),G(te.$$.fragment,De),G(ke.$$.fragment,De),G(Ge.$$.fragment,De),G(Le.$$.fragment,De),G(Qe.$$.fragment,De),G(Se),vt=!0)},o(De){W(K.$$.fragment,De),W(J.$$.fragment,De),W(te.$$.fragment,De),W(ke.$$.fragment,De),W(Ge.$$.fragment,De),W(Le.$$.fragment,De),W(Qe.$$.fragment,De),W(Se),vt=!1},d(De){De&&c(e),he(K),he(J),he(te),he(ke),he(Ge),he(Le),he(Qe),Se&&Se.d(),It=!1,ml(el)}}}function $f(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,type:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),u(e,"type","number"),u(e,"placeholder",t=l[6].t("Enter server port"))},m(i,a){M(i,e,a),Q(e,l[5].port),s||(n=pe(e,"input",l[25]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Enter server port"))&&u(e,"placeholder",t),a[0]&32&&Gl(e.value)!==i[5].port&&Q(e,i[5].port)},d(i){i&&c(e),s=!1,n()}}}function Rf(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),e.required=!0,u(e,"placeholder",t=l[6].t("Enter Application DN"))},m(i,a){M(i,e,a),Q(e,l[5].app_dn),s||(n=pe(e,"input",l[26]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Enter Application DN"))&&u(e,"placeholder",t),a[0]&32&&e.value!==i[5].app_dn&&Q(e,i[5].app_dn)},d(i){i&&c(e),s=!1,n()}}}function Of(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),e.required=!0,u(e,"placeholder",t=l[6].t("Example: mail"))},m(i,a){M(i,e,a),Q(e,l[5].attribute_for_mail),s||(n=pe(e,"input",l[28]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Example: mail"))&&u(e,"placeholder",t),a[0]&32&&e.value!==i[5].attribute_for_mail&&Q(e,i[5].attribute_for_mail)},d(i){i&&c(e),s=!1,n()}}}function Sf(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),e.required=!0,u(e,"placeholder",t=l[6].t("Example: sAMAccountName or uid or userPrincipalName"))},m(i,a){M(i,e,a),Q(e,l[5].attribute_for_username),s||(n=pe(e,"input",l[29]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Example: sAMAccountName or uid or userPrincipalName"))&&u(e,"placeholder",t),a[0]&32&&e.value!==i[5].attribute_for_username&&Q(e,i[5].attribute_for_username)},d(i){i&&c(e),s=!1,n()}}}function Pf(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),e.required=!0,u(e,"placeholder",t=l[6].t("Example: ou=users,dc=foo,dc=example"))},m(i,a){M(i,e,a),Q(e,l[5].search_base),s||(n=pe(e,"input",l[30]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Example: ou=users,dc=foo,dc=example"))&&u(e,"placeholder",t),a[0]&32&&e.value!==i[5].search_base&&Q(e,i[5].search_base)},d(i){i&&c(e),s=!1,n()}}}function Jr(l){let e,t,s,n=l[6].t("Certificate Path")+"",i,a,f,o,d,E,m,v,g=l[6].t("Ciphers")+"",b,w,A,I,k,T,R,O;
11return A=new Gt({props:{content:l[6].t("Default to ALL"),placement:"top-start",$$slots:{default:[Vf]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("input"),d=N(),E=_("div"),m=_("div"),v=_("div"),b=B(g),w=N(),ce(A.$$.fragment),I=N(),k=_("div"),this.h()},l(y){e=h(y,"DIV",{class:!0});var L=p(e);t=h(L,"DIV",{class:!0});var P=p(t);s=h(P,"DIV",{class:!0});var D=p(s);i=H(D,n),D.forEach(c),a=$(P),f=h(P,"INPUT",{class:!0,placeholder:!0}),P.forEach(c),L.forEach(c),d=$(y),E=h(y,"DIV",{class:!0});var S=p(E);m=h(S,"DIV",{class:!0});var K=p(m);v=h(K,"DIV",{class:!0});var Y=p(v);b=H(Y,g),Y.forEach(c),w=$(K),de(A.$$.fragment,K),K.forEach(c),I=$(S),k=h(S,"DIV",{class:!0}),p(k).forEach(c),S.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium min-w-fit mb-1 mt-1"),u(f,"class","w-full bg-transparent outline-hidden py-0.5"),u(f,"placeholder",o=l[6].t("Enter certificate path")),u(t,"class","w-full"),u(e,"class","flex w-full gap-2"),u(v,"class","self-center text-xs font-medium min-w-fit mb-1"),u(m,"class","w-full"),u(k,"class","w-full"),u(E,"class","flex w-full gap-2")},m(y,L){M(y,e,L),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),Q(f,l[5].certificate_path),M(y,d,L),M(y,E,L),r(E,m),r(m,v),r(v,b),r(m,w),_e(A,m,null),r(E,I),r(E,k),T=!0,R||(O=pe(f,"input",l[33]),R=!0)},p(y,L){(!T||L[0]&64)&&n!==(n=y[6].t("Certificate Path")+"")&&j(i,n),(!T||L[0]&64&&o!==(o=y[6].t("Enter certificate path")))&&u(f,"placeholder",o),L[0]&32&&f.value!==y[5].certificate_path&&Q(f,y[5].certificate_path),(!T||L[0]&64)&&g!==(g=y[6].t("Ciphers")+"")&&j(b,g);const P={};L[0]&64&&(P.content=y[6].t("Default to ALL")),L[0]&96|L[1]&4096&&(P.$$scope={dirty:L,ctx:y}),A.$set(P)},i(y){T||(G(A.$$.fragment,y),T=!0)},o(y){W(A.$$.fragment,y),T=!1},d(y){y&&(c(e),c(d),c(E)),he(A),R=!1,O()}}}function Vf(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full bg-transparent outline-hidden py-0.5"),u(e,"placeholder",t=l[6].t("Example: ALL"))},m(i,a){M(i,e,a),Q(e,l[5].ciphers),s||(n=pe(e,"input",l[34]),s=!0)},p(i,a){a[0]&64&&t!==(t=i[6].t("Example: ALL"))&&u(e,"placeholder",t),a[0]&32&&e.value!==i[5].ciphers&&Q(e,i[5].ciphers)},d(i){i&&c(e),s=!1,n()}}}function yf(l){let e,t,s,n,i,a=l[6].t("Save")+"",f,o,d,E,m=l[2]!==null&&Wr(l);return{c(){e=_("form"),t=_("div"),m&&m.c(),s=N(),n=_("div"),i=_("button"),f=B(a),this.h()},l(v){e=h(v,"FORM",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);m&&m.l(b),b.forEach(c),s=$(g),n=h(g,"DIV",{class:!0});var w=p(n);i=h(w,"BUTTON",{class:!0,type:!0});var A=p(i);f=H(A,a),A.forEach(c),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","mt-0.5 space-y-3 overflow-y-scroll scrollbar-hidden h-full"),u(i,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(i,"type","submit"),u(n,"class","flex justify-end pt-3 text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(v,g){M(v,e,g),r(e,t),m&&m.m(t,null),r(e,s),r(e,n),r(n,i),r(i,f),o=!0,d||(E=pe(e,"submit",ds(l[41])),d=!0)},p(v,g){v[2]!==null?m?(m.p(v,g),g[0]&4&&G(m,1)):(m=Wr(v),m.c(),G(m,1),m.m(t,null)):m&&(ht(),W(m,1,1,()=>{m=null}),pt()),(!o||g[0]&64)&&a!==(a=v[6].t("Save")+"")&&j(f,a)},i(v){o||(G(m),o=!0)},o(v){W(m),o=!1},d(v){v&&c(e),m&&m.d(),d=!1,E()}}}function Lf(l,e,t){let s,n;qt(l,fs,q=>t(7,n=q));const i=Ul("i18n");qt(l,i,q=>t(6,s=q));let{saveHandler:a}=e,f=null,o={current:"",latest:""},d=null,E="",m=!1,v={label:"",host:"",port:"",attribute_for_mail:"mail",attribute_for_username:"uid",app_dn:"",app_dn_password:"",search_base:"",search_filters:"",use_tls:!1,certificate_path:"",ciphers:""};const g=async()=>{t(0,f=null),t(1,o=await Jo(localStorage.token).catch(q=>({current:Ln,latest:Ln}))),console.log(o),t(0,f=Su(o.latest,o.current)),console.log(f)},b=async()=>{if(!m)return;await Ou(localStorage.token,v).catch(ne=>(Je.error(`${ne}`),null))&&Je.success(s.t("LDAP server updated"))},w=async()=>{t(3,E=await zo(localStorage.token,E));const q=await $u(localStorage.token,d);await b(),q?a():Je.error(i.t("Failed to update settings"))};rs(async()=>{g(),await Promise.all([(async()=>{t(2,d=await ku(localStorage.token))})(),(async()=>{t(3,E=await Xo(localStorage.token))})(),(async()=>{t(5,v=await Du(localStorage.token))})()]);const q=await Nu(localStorage.token);t(4,m=q.ENABLE_LDAP)});const A=()=>{qo.set(!0)},I=()=>{g()};function k(){d.DEFAULT_USER_ROLE=Ll(this),t(2,d)}function T(q){l.$$.not_equal(d.ENABLE_SIGNUP,q)&&(d.ENABLE_SIGNUP=q,t(2,d))}function R(q){l.$$.not_equal(d.SHOW_ADMIN_DETAILS,q)&&(d.SHOW_ADMIN_DETAILS=q,t(2,d))}function O(q){l.$$.not_equal(d.ENABLE_API_KEY,q)&&(d.ENABLE_API_KEY=q,t(2,d))}function y(q){l.$$.not_equal(d.ENABLE_API_KEY_ENDPOINT_RESTRICTIONS,q)&&(d.ENABLE_API_KEY_ENDPOINT_RESTRICTIONS=q,t(2,d))}function L(){d.API_KEY_ALLOWED_ENDPOINTS=this.value,t(2,d)}function P(){d.JWT_EXPIRES_IN=this.value,t(2,d)}function D(q){m=q,t(4,m)}const S=async()=>{Ru(localStorage.token,m)};function K(){v.label=this.value,t(5,v)}function Y(){v.host=this.value,t(5,v)}function C(){v.port=Gl(this.value),t(5,v)}function V(){v.app_dn=this.value,t(5,v)}function U(q){l.$$.not_equal(v.app_dn_password,q)&&(v.app_dn_password=q,t(5,v))}function F(){v.attribute_for_mail=this.value,t(5,v)}function X(){v.attribute_for_username=this.value,t(5,v)}function Z(){v.search_base=this.value,t(5,v)}function J(){v.search_filters=this.value,t(5,v)}function ie(q){l.$$.not_equal(v.use_tls,q)&&(v.use_tls=q,t(5,v))}function fe(){v.certificate_path=this.value,t(5,v)}function le(){v.ciphers=this.value,t(5,v)}function x(q){l.$$.not_equal(d.ENABLE_COMMUNITY_SHARING,q)&&(d.ENABLE_COMMUNITY_SHARING=q,t(2,d))}function oe(q){l.$$.not_equal(d.ENABLE_MESSAGE_RATING,q)&&(d.ENABLE_MESSAGE_RATING=q,t(2,d))}function se(q){l.$$.not_equal(d.ENABLE_CHANNELS,q)&&(d.ENABLE_CHANNELS=q,t(2,d))}function te(q){l.$$.not_equal(d.ENABLE_USER_WEBHOOKS,q)&&(d.ENABLE_USER_WEBHOOKS=q,t(2,d))}function ae(){d.WEBUI_URL=this.value,t(2,d)}function Te(){E=this.value,t(3,E)}const ve=async()=>{w()};return l.$$set=q=>{"saveHandler"in q&&t(11,a=q.saveHandler)},[f,o,d,E,m,v,s,n,i,g,w,a,A,I,k,T,R,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve]}class Cf extends Sl{constructor(e){super(),Pl(this,e,Lf,yf,Ol,{saveHandler:11},null,[-1,-1])}}function zr(l,e,t){const s=l.slice();return s[36]=e[t],s[37]=e,s[38]=t,s}function Qr(l,e,t){const s=l.slice();return s[39]=e[t],s}function xr(l,e,t){const s=l.slice();return s[42]=e[t],s[38]=t,s}function ea(l,e,t){const s=l.slice();return s[10]=e[t],s[38]=t,s}function Uf(l){let e,t,s,n;return s=new Ps({props:{className:"size-6"}}),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);de(s.$$.fragment,f),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","my-auto"),u(e,"class","flex justify-center h-full")},m(i,a){M(i,e,a),r(e,t),_e(s,t,null),n=!0},p:st,i(i){n||(G(s.$$.fragment,i),n=!0)},o(i){W(s.$$.fragment,i),n=!1},d(i){i&&c(e),he(s)}}}function Mf(l){let e,t,s=l[9].t("Manage Pipelines")+"",n,i,a,f,o,d;const E=[Hf,Bf],m=[];function v(g,b){return g[3].length>0?0:1}return a=v(l),f=m[a]=E[a](l),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),f.c(),o=xt(),this.h()},l(g){e=h(g,"DIV",{class:!0});var b=p(e);t=h(b,"DIV",{class:!0});var w=p(t);
11n=H(w,s),w.forEach(c),b.forEach(c),i=$(g),f.l(g),o=xt(),this.h()},h(){u(t,"class","self-center text-sm font-semibold"),u(e,"class","flex w-full justify-between mb-2")},m(g,b){M(g,e,b),r(e,t),r(t,n),M(g,i,b),m[a].m(g,b),M(g,o,b),d=!0},p(g,b){(!d||b[0]&512)&&s!==(s=g[9].t("Manage Pipelines")+"")&&j(n,s);let w=a;a=v(g),a===w?m[a].p(g,b):(ht(),W(m[w],1,1,()=>{m[w]=null}),pt(),f=m[a],f?f.p(g,b):(f=m[a]=E[a](g),f.c()),G(f,1),f.m(o.parentNode,o))},i(g){d||(G(f),d=!0)},o(g){W(f),d=!1},d(g){g&&(c(e),c(i),c(o)),m[a].d(g)}}}function Bf(l){let e,t=l[9].t("Pipelines Not Detected")+"",s;return{c(){e=_("div"),s=B(t)},l(n){e=h(n,"DIV",{});var i=p(e);s=H(i,t),i.forEach(c)},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&512&&t!==(t=n[9].t("Pipelines Not Detected")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function Hf(l){let e,t,s,n,i,a=l[9].t("Select a pipeline url")+"",f,o,d,E,m,v=l[9].t("Upload Pipeline")+"",g,b,w,A,I,k,T,R,O,y,L,P,D=l[9].t("Install from Github URL")+"",S,K,Y,C,V,U,F,X,Z,J,ie=`<span class="font-semibold dark:text-gray-200">Warning:</span> Pipelines are a plugin
12						system with arbitrary code execution —
13						<span class="font-medium dark:text-gray-400">don&#39;t fetch random pipelines from sources you don&#39;t trust.</span>`,fe,le,x,oe,se,te,ae,Te,ve,q=Dt(l[3]),ne=[];for(let ee=0;ee<q.length;ee+=1)ne[ee]=ta(ea(l,q,ee));function Ie(ee,me){return ee[2]?Kf:Gf}let be=Ie(l),z=be(l);function ke(ee,me){return ee[1]?jf:Yf}let Ue=ke(l),we=Ue(l);function Ae(ee,me){return ee[0]?Ff:Wf}let Re=Ae(l),ue=Re(l);const Ee=[Zf,qf],Me=[];function Ge(ee,me){return ee[10]!==null?0:1}return oe=Ge(l),se=Me[oe]=Ee[oe](l),{c(){e=_("div"),t=_("div"),s=_("div"),n=_("select"),i=_("option"),f=B(a);for(let ee=0;ee<ne.length;ee+=1)ne[ee].c();d=N(),E=_("div"),m=_("div"),g=B(v),b=N(),w=_("div"),A=_("div"),I=_("input"),k=N(),T=_("button"),z.c(),R=N(),O=_("button"),we.c(),y=N(),L=_("div"),P=_("div"),S=B(D),K=N(),Y=_("div"),C=_("div"),V=_("input"),F=N(),X=_("button"),ue.c(),Z=N(),J=_("div"),J.innerHTML=ie,fe=N(),le=_("hr"),x=N(),se.c(),te=xt(),this.h()},l(ee){e=h(ee,"DIV",{class:!0});var me=p(e);t=h(me,"DIV",{class:!0});var ge=p(t);s=h(ge,"DIV",{class:!0});var Ne=p(s);n=h(Ne,"SELECT",{class:!0,placeholder:!0});var ye=p(n);i=h(ye,"OPTION",{class:!0});var ze=p(i);f=H(ze,a),ze.forEach(c);for(let Rt=0;Rt<ne.length;Rt+=1)ne[Rt].l(ye);ye.forEach(c),Ne.forEach(c),ge.forEach(c),me.forEach(c),d=$(ee),E=h(ee,"DIV",{class:!0});var Ce=p(E);m=h(Ce,"DIV",{class:!0});var Le=p(m);g=H(Le,v),Le.forEach(c),b=$(Ce),w=h(Ce,"DIV",{class:!0});var Ke=p(w);A=h(Ke,"DIV",{class:!0});var re=p(A);I=h(re,"INPUT",{id:!0,type:!0,accept:!0}),k=$(re),T=h(re,"BUTTON",{class:!0,type:!0});var $e=p(T);z.l($e),$e.forEach(c),re.forEach(c),R=$(Ke),O=h(Ke,"BUTTON",{class:!0,type:!0});var ut=p(O);we.l(ut),ut.forEach(c),Ke.forEach(c),Ce.forEach(c),y=$(ee),L=h(ee,"DIV",{class:!0});var ft=p(L);P=h(ft,"DIV",{class:!0});var ct=p(P);S=H(ct,D),ct.forEach(c),K=$(ft),Y=h(ft,"DIV",{class:!0});var Be=p(Y);C=h(Be,"DIV",{class:!0});var Ve=p(C);V=h(Ve,"INPUT",{class:!0,placeholder:!0}),Ve.forEach(c),F=$(Be),X=h(Be,"BUTTON",{class:!0,type:!0});var je=p(X);ue.l(je),je.forEach(c),Be.forEach(c),Z=$(ft),J=h(ft,"DIV",{class:!0,"data-svelte-h":!0}),Wt(J)!=="svelte-ob7r3n"&&(J.innerHTML=ie),ft.forEach(c),fe=$(ee),le=h(ee,"HR",{class:!0}),x=$(ee),se.l(ee),te=xt(),this.h()},h(){i.__value="",Q(i,i.__value),i.selected=!0,i.disabled=!0,u(i,"class","bg-gray-100 dark:bg-gray-700"),u(n,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(n,"placeholder",o=l[9].t("Select a pipeline url")),l[4]===void 0&&Cl(()=>l[19].call(n)),u(s,"class","flex-1"),u(t,"class","flex gap-2"),u(e,"class","space-y-1"),u(m,"class","mb-2 text-sm font-medium"),u(I,"id","pipelines-upload-input"),u(I,"type","file"),u(I,"accept",".py"),I.hidden=!0,u(T,"class","w-full text-sm font-medium py-2 bg-transparent hover:bg-gray-100 border border-dashed dark:border-gray-850 dark:hover:bg-gray-850 text-center rounded-xl"),u(T,"type","button"),u(A,"class","flex-1 mr-2"),u(O,"class","px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dar
13k:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),O.disabled=l[1],u(O,"type","button"),u(w,"class","flex w-full"),u(E,"class","my-2"),u(P,"class","mb-2 text-sm font-medium"),u(V,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(V,"placeholder",U=l[9].t("Enter Github Raw URL")),u(C,"class","flex-1 mr-2"),u(X,"class","px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),X.disabled=l[0],u(X,"type","button"),u(Y,"class","flex w-full"),u(J,"class","mt-2 text-xs text-gray-500"),u(L,"class","my-2"),u(le,"class","border-gray-100 dark:border-gray-850 my-3 w-full")},m(ee,me){M(ee,e,me),r(e,t),r(t,s),r(s,n),r(n,i),r(i,f);for(let ge=0;ge<ne.length;ge+=1)ne[ge]&&ne[ge].m(n,null);Ft(n,l[4],!0),M(ee,d,me),M(ee,E,me),r(E,m),r(m,g),r(E,b),r(E,w),r(w,A),r(A,I),r(A,k),r(A,T),z.m(T,null),r(w,R),r(w,O),we.m(O,null),M(ee,y,me),M(ee,L,me),r(L,P),r(P,S),r(L,K),r(L,Y),r(Y,C),r(C,V),Q(V,l[8]),r(Y,F),r(Y,X),ue.m(X,null),r(L,Z),r(L,J),M(ee,fe,me),M(ee,le,me),M(ee,x,me),Me[oe].m(ee,me),M(ee,te,me),ae=!0,Te||(ve=[pe(n,"change",l[19]),pe(n,"change",l[20]),pe(I,"change",l[21]),pe(T,"click",l[22]),pe(O,"click",l[23]),pe(V,"input",l[24]),pe(X,"click",l[25])],Te=!0)},p(ee,me){if((!ae||me[0]&512)&&a!==(a=ee[9].t("Select a pipeline url")+"")&&j(f,a),me[0]&8){q=Dt(ee[3]);let Ne;for(Ne=0;Ne<q.length;Ne+=1){const ye=ea(ee,q,Ne);ne[Ne]?ne[Ne].p(ye,me):(ne[Ne]=ta(ye),ne[Ne].c(),ne[Ne].m(n,null))}for(;Ne<ne.length;Ne+=1)ne[Ne].d(1);ne.length=q.length}(!ae||me[0]&512&&o!==(o=ee[9].t("Select a pipeline url")))&&u(n,"placeholder",o),me[0]&24&&Ft(n,ee[4]),(!ae||me[0]&512)&&v!==(v=ee[9].t("Upload Pipeline")+"")&&j(g,v),be===(be=Ie(ee))&&z?z.p(ee,me):(z.d(1),z=be(ee),z&&(z.c(),z.m(T,null))),Ue!==(Ue=ke(ee))&&(we.d(1),we=Ue(ee),we&&(we.c(),we.m(O,null))),(!ae||me[0]&2)&&(O.disabled=ee[1]),(!ae||me[0]&512)&&D!==(D=ee[9].t("Install from Github URL")+"")&&j(S,D),(!ae||me[0]&512&&U!==(U=ee[9].t("Enter Github Raw URL")))&&u(V,"placeholder",U),me[0]&256&&V.value!==ee[8]&&Q(V,ee[8]),Re!==(Re=Ae(ee))&&(ue.d(1),ue=Re(ee),ue&&(ue.c(),ue.m(X,null))),(!ae||me[0]&1)&&(X.disabled=ee[0]);let ge=oe;oe=Ge(ee),oe===ge?Me[oe].p(ee,me):(ht(),W(Me[ge],1,1,()=>{Me[ge]=null}),pt(),se=Me[oe],se?se.p(ee,me):(se=Me[oe]=Ee[oe](ee),se.c()),G(se,1),se.m(te.parentNode,te))},i(ee){ae||(G(se),ae=!0)},o(ee){W(se),ae=!1},d(ee){ee&&(c(e),c(d),c(E),c(y),c(L),c(fe),c(le),c(x),c(te)),wl(ne,ee),z.d(),we.d(),ue.d(),Me[oe].d(ee),Te=!1,ml(ve)}}}function ta(l){let e,t=l[10].url+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{class:!0});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[10].idx.toString(),Q(e,e.__value),u(e,"class","bg-gray-100 dark:bg-gray-700")},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&8&&t!==(t=i[10].url+"")&&j(s,t),a[0]&8&&n!==(n=i[10].idx.toString())&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function Gf(l){let e=l[9].t("Click here to select a py file.")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&512&&e!==(e=s[9].t("Click here to select a py file.")+"")&&j(t,e)},d(s){s&&c(t)}}}function Kf(l){let e=l[2].length>0?`${l[2].length}`:"",t,s;return{c(){t=B(e),s=B(" pipeline(s) selected.")},l(n){t=H(n,e),s=H(n," pipeline(s) selected.")},m(n,i){M(n,t,i),M(n,s,i)},p(n,i){i[0]&4&&e!==(e=n[2].length>0?`${n[2].length}`:"")&&j(t,e)},d(n){n&&(c(t),c(s))}}}function Yf(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
13),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M7.25 10.25a.75.75 0 0 0 1.5 0V4.56l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06l2.22-2.22v5.69Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","size-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function jf(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
14												transform-origin: center;
15												animation: spinner_AtaB 0.75s infinite linear;
16											}
17
18											@keyframes spinner_AtaB {
19												100% {
20													transform: rotate(360deg);
21												}
22											}
23										</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1x85grn"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function Wf(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
23),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function Ff(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
24												transform-origin: center;
25												animation: spinner_AtaB 0.75s infinite linear;
26											}
27
28											@keyframes spinner_AtaB {
29												100% {
30													transform: rotate(360deg);
31												}
32											}
33										</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1x85grn"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function qf(l){let e,t,s,n;return s=new Ps({props:{className:"size-4"}}),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);de(s.$$.fragment,f),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","my-auto"),u(e,"class","flex justify-center")},m(i,a){M(i,e,a),r(e,t),_e(s,t,null),n=!0},p:st,i(i){n||(G(s.$$.fragment,i),n=!0)},o(i){W(s.$$.fragment,i),n=!1},d(i){i&&c(e),he(s)}}}function Zf(l){let e,t,s,n;const i=[Jf,Xf],a=[];function f(o,d){return o[10].length>0?0:o[10].length===0?1:-1}return~(e=f(l))&&(t=a[e]=i[e](l)),{c(){t&&t.c(),s=xt()},l(o){t&&t.l(o),s=xt()},m(o,d){~e&&a[e].m(o,d),M(o,s,d),n=!0},p(o,d){let E=e;e=f(o),e===E?~e&&a[e].p(o,d):(t&&(ht(),W(a[E],1,1,()=>{a[E]=null}),pt()),~e?(t=a[e],t?t.p(o,d):(t=a[e]=i[e](o),t.c()),G(t,1),t.m(s.parentNode,s)):t=null)},i(o){n||(G(t),n=!0)},o(o){W(t),n=!1},d(o){o&&c(s),~e&&a[e].d(o)}}}function Xf(l){let e,t="Pipelines Not Detected";return{c(){e=_("div"),e.textContent=t},l(s){e=h(s,"DIV",{"data-svelte-h":!0}),Wt(e)!=="svelte-nrqgpw"&&(e.textContent=t)},m(s,n){M(s,e,n)},p:st,i:st,o:st,d(s){s&&c(e)}}}function Jf(l){let e,t,s=l[9].t("Pipelines Valves")+"",n,i,a,f,o,d,E,m,v=l[10].length>0&&la(l);const g=[Qf,zf],b=[];function w(A,I){return A[10][A[7]].valves?0:1}return d=w(l),E=b[d]=g[d](l),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),v&&v.c(),f=N(),o=_("div"),E.c(),this.h()},l(A){e=h(A,"DIV",{class:!0});var I=p(e);t=h(I,"DIV",{class:!0});var k=p(t);n=H(k,s),k.forEach(c),I.forEach(c),i=$(A),a=h(A,"DIV",{class:!0});var T=p(a);v&&v.l(T),f=$(T),o=h(T,"DIV",{class:!0});var R=p(o);E.l(R),R.forEach(c),T.forEach(c),this.h()},h(){u(t,"class","self-center text-sm font-semibold"),u(e,"class","flex w-full justify-between mb-2"),u(o,"class","space-y-1"),u(a,"class","space-y-1")},m(A,I){M(A,e,I),r(e,t),r(t,n),M(A,i,I),M(A,a,I),v&&v.m(a,null),r(a,f),r(a,o),b[d].m(o,null),m=!0},p(A,I){(!m||I[0]&512)&&s!==(s=A[9].t("Pipelines Valves")+"")&&j(n,s),A[10].length>0?v?v.p(A,I):(v=la(A),v.c(),v.m(a,f)):v&&(v.d(1),v=null);let k=d;d=w(A),d===k?b[d].p(A,I):(ht(),W(b[k],1,1,()=>{b[k]=null}),pt(),E=b[d],E?E.p(A,I):(E=b[d]=g[d](A),E.c()),G(E,1),E.m(o,null))},i(A){m||(G(E),m=!0)},o(A){W(E),m=!1},d(A){A&&(c(e),c(i),c(a)),v&&v.d(),b[d].d()}}}function la(l){let e,t,s,n,i,a,f='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0
33a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd"></path></svg>',o,d,E=Dt(l[10]),m=[];for(let v=0;v<E.length;v+=1)m[v]=sa(xr(l,E,v));return{c(){e=_("div"),t=_("div"),s=_("select");for(let v=0;v<m.length;v+=1)m[v].c();i=N(),a=_("button"),a.innerHTML=f,this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);s=h(b,"SELECT",{class:!0,placeholder:!0});var w=p(s);for(let A=0;A<m.length;A+=1)m[A].l(w);w.forEach(c),b.forEach(c),i=$(g),a=h(g,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(a)!=="svelte-121ij38"&&(a.innerHTML=f),g.forEach(c),this.h()},h(){u(s,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(s,"placeholder",n=l[9].t("Select a pipeline")),l[7]===void 0&&Cl(()=>l[26].call(s)),u(t,"class","flex-1"),u(a,"class","px-2.5 bg-gray-100 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),u(a,"type","button"),u(e,"class","flex gap-2")},m(v,g){M(v,e,g),r(e,t),r(t,s);for(let b=0;b<m.length;b+=1)m[b]&&m[b].m(s,null);Ft(s,l[7],!0),r(e,i),r(e,a),o||(d=[pe(s,"change",l[26]),pe(s,"change",l[27]),pe(a,"click",l[28])],o=!0)},p(v,g){if(g[0]&1024){E=Dt(v[10]);let b;for(b=0;b<E.length;b+=1){const w=xr(v,E,b);m[b]?m[b].p(w,g):(m[b]=sa(w),m[b].c(),m[b].m(s,null))}for(;b<m.length;b+=1)m[b].d(1);m.length=E.length}g[0]&512&&n!==(n=v[9].t("Select a pipeline"))&&u(s,"placeholder",n),g[0]&128&&Ft(s,v[7])},d(v){v&&c(e),wl(m,v),o=!1,ml(d)}}}function sa(l){let e,t=l[42].name+"",s,n,i=(l[42].type??"pipe")+"",a,f;return{c(){e=_("option"),s=B(t),n=B(" ("),a=B(i),f=B(")"),this.h()},l(o){e=h(o,"OPTION",{class:!0});var d=p(e);s=H(d,t),n=H(d," ("),a=H(d,i),f=H(d,")"),d.forEach(c),this.h()},h(){e.__value=l[38],Q(e,e.__value),u(e,"class","bg-gray-100 dark:bg-gray-700")},m(o,d){M(o,e,d),r(e,s),r(e,n),r(e,a),r(e,f)},p(o,d){d[0]&1024&&t!==(t=o[42].name+"")&&j(s,t),d[0]&1024&&i!==(i=(o[42].type??"pipe")+"")&&j(a,i)},d(o){o&&c(e)}}}function zf(l){let e,t="No valves";return{c(){e=_("div"),e.textContent=t},l(s){e=h(s,"DIV",{"data-svelte-h":!0}),Wt(e)!=="svelte-gfhjqw"&&(e.textContent=t)},m(s,n){M(s,e,n)},p:st,i:st,o:st,d(s){s&&c(e)}}}function Qf(l){let e,t,s,n;const i=[ec,xf],a=[];function f(o,d){return o[5]?0:1}return e=f(l),t=a[e]=i[e](l),{c(){t.c(),s=xt()},l(o){t.l(o),s=xt()},m(o,d){a[e].m(o,d),M(o,s,d),n=!0},p(o,d){let E=e;e=f(o),e===E?a[e].p(o,d):(ht(),W(a[E],1,1,()=>{a[E]=null}),pt(),t=a[e],t?t.p(o,d):(t=a[e]=i[e](o),t.c()),G(t,1),t.m(s.parentNode,s))},i(o){n||(G(t),n=!0)},o(o){W(t),n=!1},d(o){o&&c(s),a[e].d(o)}}}function xf(l){let e,t;return e=new Ps({props:{className:"size-5"}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function ec(l){let e,t,s=Dt(Object.keys(l[6].properties)),n=[];for(let a=0;a<s.length;a+=1)n[a]=aa(zr(l,s,a));const i=a=>W(n[a],1,1,()=>{n[a]=null});return{c(){for(let a=0;a<n.length;a+=1)n[a].c();e=xt()},l(a){for(let f=0;f<n.length;f+=1)n[f].l(a);e=xt()},m(a,f){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(a,f);M(a,e,f),t=!0},p(a,f){if(f[0]&608){s=Dt(Object.keys(a[6].properties));let o;for(o=0;o<s.length;o+=1){const d=zr(a,s,o);n[o]?(n[o].p(d,f),G(n[o],1)):(n[o]=aa(d),n[o].c(),G(n[o],1),n[o].m(e.parentNode,e))}for(ht(),o=s.length;o<n.length;o+=1)i(o);pt()}},i(a){if(!t){for(let f=0;f<s.length;f+=1)G(n[f]);t=!0}},o(a){n=n.filter(Boolean);for(let f=0;f<n.length;f+=1)W(n[f]);t=!1},d(a){a&&c(e),wl(n,a)}}}function tc(l){let e,t=l[9].t("Custom")+"",s;return{c(){e=_("span"),s=B(t),this.h()},l(n){e=h(n,"SPAN",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","ml-2 self-center")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&512&&t!==(t=n[9].t("Custom")+"")&&j(s,t)},d(n){n&&c(e)}}}function lc(l){let e,t=l[9].t("None")+"",s;return{c(){e=_("span"),s=B(t),this.h()},l(n){e=h(n,"SPAN",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","ml-2 self-center")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&512&&t!==(t=n[9].t("None")+"")&&j(s,t)},d(n){n&&c(e)}}}function na(l){let e,t,s,n,i;
33const a=[rc,nc,sc],f=[];function o(d,E){var m,v;return((m=d[6].properties[d[36]])==null?void 0:m.enum)??null?0:(((v=d[6].properties[d[36]])==null?void 0:v.type)??null)==="boolean"?1:2}return s=o(l),n=f[s]=a[s](l),{c(){e=_("div"),t=_("div"),n.c(),this.h()},l(d){e=h(d,"DIV",{class:!0});var E=p(e);t=h(E,"DIV",{class:!0});var m=p(t);n.l(m),m.forEach(c),E.forEach(c),this.h()},h(){u(t,"class","flex-1"),u(e,"class","flex mt-0.5 mb-1.5 space-x-2")},m(d,E){M(d,e,E),r(e,t),f[s].m(t,null),i=!0},p(d,E){let m=s;s=o(d),s===m?f[s].p(d,E):(ht(),W(f[m],1,1,()=>{f[m]=null}),pt(),n=f[s],n?n.p(d,E):(n=f[s]=a[s](d),n.c()),G(n,1),n.m(t,null))},i(d){i||(G(n),i=!0)},o(d){W(n),i=!1},d(d){d&&c(e),f[s].d()}}}function sc(l){let e,t,s,n;function i(){l[32].call(e,l[36])}return{c(){e=_("input"),this.h()},l(a){e=h(a,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),this.h()},h(){u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"type","text"),u(e,"placeholder",t=l[6].properties[l[36]].title),u(e,"autocomplete","off"),e.required=!0},m(a,f){M(a,e,f),Q(e,l[5][l[36]]),s||(n=pe(e,"input",i),s=!0)},p(a,f){l=a,f[0]&64&&t!==(t=l[6].properties[l[36]].title)&&u(e,"placeholder",t),f[0]&96&&e.value!==l[5][l[36]]&&Q(e,l[5][l[36]])},i:st,o:st,d(a){a&&c(e),s=!1,n()}}}function nc(l){let e,t,s=l[5][l[36]]?"Enabled":"Disabled",n,i,a,f,o,d;function E(v){l[31](v,l[36])}let m={};return l[5][l[36]]!==void 0&&(m.state=l[5][l[36]]),f=new vl({props:m}),Ye.push(()=>qe(f,"state",E)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);n=H(b,s),b.forEach(c),i=$(g),a=h(g,"DIV",{class:!0});var w=p(a);de(f.$$.fragment,w),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","text-xs text-gray-500"),u(a,"class","pr-2"),u(e,"class","flex justify-between items-center")},m(v,g){M(v,e,g),r(e,t),r(t,n),r(e,i),r(e,a),_e(f,a,null),d=!0},p(v,g){l=v,(!d||g[0]&96)&&s!==(s=l[5][l[36]]?"Enabled":"Disabled")&&j(n,s);const b={};!o&&g[0]&96&&(o=!0,b.state=l[5][l[36]],Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function rc(l){let e,t,s,n=Dt(l[6].properties[l[36]].enum),i=[];for(let f=0;f<n.length;f+=1)i[f]=ra(Qr(l,n,f));function a(){l[30].call(e,l[36])}return{c(){e=_("select");for(let f=0;f<i.length;f+=1)i[f].c();this.h()},l(f){e=h(f,"SELECT",{class:!0});var o=p(e);for(let d=0;d<i.length;d+=1)i[d].l(o);o.forEach(c),this.h()},h(){u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),l[5][l[36]]===void 0&&Cl(a)},m(f,o){M(f,e,o);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(e,null);Ft(e,l[5][l[36]],!0),t||(s=pe(e,"change",a),t=!0)},p(f,o){if(l=f,o[0]&96){n=Dt(l[6].properties[l[36]].enum);let d;for(d=0;d<n.length;d+=1){const E=Qr(l,n,d);i[d]?i[d].p(E,o):(i[d]=ra(E),i[d].c(),i[d].m(e,null))}for(;d<i.length;d+=1)i[d].d(1);i.length=n.length}o[0]&96&&Ft(e,l[5][l[36]])},i:st,o:st,d(f){f&&c(e),wl(i,f),t=!1,s()}}}function ra(l){let e,t=l[39]+"",s,n,i,a;return{c(){e=_("option"),s=B(t),n=N(),this.h()},l(f){e=h(f,"OPTION",{});var o=p(e);s=H(o,t),n=$(o),o.forEach(c),this.h()},h(){e.__value=i=l[39],Q(e,e.__value),e.selected=a=l[39]===l[5][l[36]]},m(f,o){M(f,e,o),r(e,s),r(e,n)},p(f,o){o[0]&64&&t!==(t=f[39]+"")&&j(s,t),o[0]&64&&i!==(i=f[39])&&(e.__value=i,Q(e,e.__value)),o[0]&96&&a!==(a=f[39]===f[5][f[36]])&&(e.selected=a)},d(f){f&&c(e)}}}function aa(l){let e,t,s,n=l[6].properties[l[36]].title+"",i,a,f,o,d,E,m,v;function g(k,T){return(k[5][k[36]]??null)===null?lc:tc}let b=g(l),w=b(l);function A(){return l[29](l[36])}let I=(l[5][l[36]]??null)!==null&&na(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("button"),w.c(),o=N(),I&&I.c(),d=N(),this.h()},l(k){e=h(k,"DIV",{class:!0});var T=p(e);t=h(T,"DIV",{class:!0});var R=p(t);s=h(R,"DIV",{class:!0});var O=p(s);i=H(O,n),O.forEach(c),a=$(R),f=h(R,"BUTTON",{class:!0,type:!0});var y=p(f);w.l(y),y.forEach(c),R.forEach(c),o=$(T),I&&I.l(T),d=$(T),T.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium"),u(f,"class","p-1 px-3 text-xs flex rounded-sm transition"),u(f,"type","button"),u(t,"class","flex w-full justify-between"),u(e,"class","py-0.5 w-full justify-between")},m(k,T){M(k,e,T),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),w.m(f,null),r(e,o),I&&I.m(e,null),r(e,d),E=!0,m||(v=pe(f,"click",A),m=!0)},p(k,T){l=k,(!E||T[0]&64)&&n!==(n=l[6].properties[l[36]].title+"")&&j(i,n),b===(b=g(l))&&w?w.p(l,T):(w.d(1),w=b(l),w&&(w.c(),w.m(f,null))),(l[5][l[36]]??null)!==null?I?(I.p(l,T),T[0]&96&&G(I,1)):(I=na(l),I.c(),G(I,1),I.m(e,d)):I&&(ht(),W(I,1,1,()=>{I=null}),pt())}
33,i(k){E||(G(I),E=!0)},o(k){W(I),E=!1},d(k){k&&c(e),w.d(),I&&I.d(),m=!1,v()}}}function ia(l){let e,t,s=l[9].t("Save")+"",n;return{c(){e=_("div"),t=_("button"),n=B(s),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"BUTTON",{class:!0,type:!0});var f=p(t);n=H(f,s),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(t,"type","submit"),u(e,"class","flex justify-end pt-3 text-sm font-medium")},m(i,a){M(i,e,a),r(e,t),r(t,n)},p(i,a){a[0]&512&&s!==(s=i[9].t("Save")+"")&&j(n,s)},d(i){i&&c(e)}}}function ac(l){let e,t,s,n,i,a,f,o;const d=[Mf,Uf],E=[];function m(g,b){return g[3]!==null?0:1}s=m(l),n=E[s]=d[s](l);let v=l[3]!==null&&l[3].length>0&&ia(l);return{c(){e=_("form"),t=_("div"),n.c(),i=N(),v&&v.c(),this.h()},l(g){e=h(g,"FORM",{class:!0});var b=p(e);t=h(b,"DIV",{class:!0});var w=p(t);n.l(w),w.forEach(c),i=$(b),v&&v.l(b),b.forEach(c),this.h()},h(){u(t,"class","overflow-y-scroll scrollbar-hidden h-full"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(g,b){M(g,e,b),r(e,t),E[s].m(t,null),r(e,i),v&&v.m(e,null),a=!0,f||(o=pe(e,"submit",ds(l[33])),f=!0)},p(g,b){let w=s;s=m(g),s===w?E[s].p(g,b):(ht(),W(E[w],1,1,()=>{E[w]=null}),pt(),n=E[s],n?n.p(g,b):(n=E[s]=d[s](g),n.c()),G(n,1),n.m(t,null)),g[3]!==null&&g[3].length>0?v?v.p(g,b):(v=ia(g),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(g){a||(G(n),a=!0)},o(g){W(n),a=!1},d(g){g&&c(e),E[s].d(),v&&v.d(),f=!1,o()}}}function ic(l,e,t){let s,n,i;qt(l,nn,x=>t(34,s=x)),qt(l,fs,x=>t(35,n=x));const a=Ul("i18n");qt(l,a,x=>t(9,i=x));let{saveHandler:f}=e,o=!1,d=!1,E,m=null,v="",g=null,b=null,w=null,A=null,I="";const k=async()=>{var oe,se;const x=g[A];if(x&&((x==null?void 0:x.valves)??!1)){for(const ae in w.properties)((oe=w.properties[ae])==null?void 0:oe.type)==="array"&&t(5,b[ae]=b[ae].split(",").map(Te=>Te.trim()),b);await xo(localStorage.token,x.id,b,v).catch(ae=>{Je.error(`${ae}`)})&&(Je.success(i.t("Valves updated successfully")),R(),Kl.set(await ns(localStorage.token,((se=n==null?void 0:n.features)==null?void 0:se.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null))),f())}else Je.error(i.t("No valves to update"))},T=async x=>{var oe;t(5,b=null),t(6,w=null),t(6,w=await eu(localStorage.token,g[x].id,v)),t(5,b=await tu(localStorage.token,g[x].id,v));for(const se in w.properties)((oe=w.properties[se])==null?void 0:oe.type)==="array"&&t(5,b[se]=b[se].join(","),b)},R=async()=>{t(10,g=null),t(5,b=null),t(6,w=null),m.length>0?(console.log(v),t(10,g=await lu(localStorage.token,v)),g.length>0&&(t(7,A=0),await T(A))):t(10,g=[])},O=async()=>{var oe;t(0,o=!0),await su(localStorage.token,I,v).catch(se=>(Je.error(`${se}`),null))&&(Je.success(i.t("Pipeline downloaded successfully")),R(),Kl.set(await ns(localStorage.token,((oe=n==null?void 0:n.features)==null?void 0:oe.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null)))),t(0,o=!1)},y=async()=>{var oe;if(t(1,d=!0),E&&E.length!==0){const se=E[0];console.log(se),await ru(localStorage.token,se,v).catch(ae=>(console.log(ae),Je.error("Something went wrong :/"),null))&&(Je.success(i.t("Pipeline downloaded successfully")),R(),Kl.set(await ns(localStorage.token,((oe=n==null?void 0:n.features)==null?void 0:oe.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null))))}else Je.error(i.t("No file selected"));t(2,E=null);const x=document.getElementById("pipelines-upload-input");x&&(x.value=null),t(1,d=!1)},L=async()=>{var oe;await nu(localStorage.token,g[A].id,v).catch(se=>(Je.error(`${se}`),null))&&(Je.success(i.t("Pipeline deleted successfully")),R(),Kl.set(await ns(localStorage.token,((oe=n==null?void 0:n.features)==null?void 0:oe.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null))))};rs(async()=>{t(3,m=await Qo(localStorage.token)),console.log(m),m.length>0&&t(4,v=m[0].idx.toString()),await R()});function P(){v=Ll(this),t(4,v),t(3,m)}const D=async()=>{await ln(),await R()};function S(){E=this.files,t(2,E)}const K=()=>{var x;(x=document.getElementById("pipelines-upload-input"))==null||x.click()},Y=()=>{y()};function C(){I=this.value,t(8,I)}const V=()=>{O()};function U(){A=Ll(this),t(7,A)}const F=async()=>{await ln(),await T(A)},X=()=>{L()},Z=x=>{t(5,b[x]=(b[x]??null)===null?"":null,b)};function J(x){b[x]=Ll(this),t(5,b),t(6,w)}function ie(x,oe){l.$$.not_equal(b[oe],x)&&(b[oe]=x,t(5,b))}function fe(x){b[x]=this.value,t(5,b),t(6,w)}const le=async()=>{k()};return l.$$set=x=>{"saveHandler"in x&&t(18,f=x.saveHandler)},[o,d,E,m,v,b,w,A,I,i,g,a,k,T,R,O,y,L,f,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le]}class oc extends Sl{constructor(e){super(),Pl(this,e,ic,ac,Ol,{saveHandler:18},null,[-1,-1])}}function oa(l,e,t){const s=l.slice();return s[59]=e[t],s}function ua(l,e,t){const s=l.slice();return s[62]=e[t],s}function fa(l,e,t){const s=l.slice();return s[65]=e[t],s}function ca(l,e,t){const s=l.slice();return s[62]=e[t],s}function da(l,e,t){const s=l.slice();return s[65]=e[t],s}function _a(l,e,t){const s=l.slice();return s[62]=e[t],s}function ha(l,e,t){const s=l.slice();return s[62]=e[t],s}function uc(l){let e,t,s=l[21].t("STT Model")+"",n,i,a,f,o,d,E,m,v,g,b=l[21].t("Open WebUI uses faster-whisper internally.")+"",w,A,I,k=l[21].t("Click here to learn more about faster-whisper and see the available models.")+"",T,R,O;function y(D,S){return D[18]?hc:_c}let L=y(l),P=L(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),E=N(),m=_("button"),P.c(),v=N(),g=_("div"),w=B(b),A=N(),I=_("a"),T=B(k),this.h()},l(D){e=h(D,"DIV",{});var S=p(e);t=h(S,"DIV",{class:!0});var K=p(t);
33n=H(K,s),K.forEach(c),i=$(S),a=h(S,"DIV",{class:!0});var Y=p(a);f=h(Y,"DIV",{class:!0});var C=p(f);o=h(C,"INPUT",{class:!0,placeholder:!0}),C.forEach(c),E=$(Y),m=h(Y,"BUTTON",{class:!0});var V=p(m);P.l(V),V.forEach(c),Y.forEach(c),v=$(S),g=h(S,"DIV",{class:!0});var U=p(g);w=H(U,b),A=$(U),I=h(U,"A",{class:!0,href:!0,target:!0});var F=p(I);T=H(F,k),F.forEach(c),U.forEach(c),S.forEach(c),this.h()},h(){u(t,"class","mb-1.5 text-sm font-medium"),u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(o,"placeholder",d=l[21].t("Set whisper model")),u(f,"class","flex-1 mr-2"),u(m,"class","px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),m.disabled=l[18],u(a,"class","flex w-full"),u(I,"class","hover:underline dark:text-gray-200 text-gray-800"),u(I,"href","https://github.com/SYSTRAN/faster-whisper"),u(I,"target","_blank"),u(g,"class","mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500")},m(D,S){M(D,e,S),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[13]),r(a,E),r(a,m),P.m(m,null),r(e,v),r(e,g),r(g,w),r(g,A),r(g,I),r(I,T),R||(O=[pe(o,"input",l[38]),pe(m,"click",l[39])],R=!0)},p(D,S){S[0]&2097152&&s!==(s=D[21].t("STT Model")+"")&&j(n,s),S[0]&2097152&&d!==(d=D[21].t("Set whisper model"))&&u(o,"placeholder",d),S[0]&8192&&o.value!==D[13]&&Q(o,D[13]),L!==(L=y(D))&&(P.d(1),P=L(D),P&&(P.c(),P.m(m,null))),S[0]&262144&&(m.disabled=D[18]),S[0]&2097152&&b!==(b=D[21].t("Open WebUI uses faster-whisper internally.")+"")&&j(w,b),S[0]&2097152&&k!==(k=D[21].t("Click here to learn more about faster-whisper and see the available models.")+"")&&j(T,k)},i:st,o:st,d(D){D&&c(e),P.d(),R=!1,ml(O)}}}function fc(l){let e,t,s,n,i,a,f,o,d,E,m,v,g=l[21].t("Language Locales")+"",b,w,A,I,k,T,R,O,y;function L(D){l[35](D)}let P={placeholder:l[21].t("API Key"),required:!0};return l[14]!==void 0&&(P.value=l[14]),s=new _l({props:P}),Ye.push(()=>qe(s,"value",L)),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),i=N(),a=_("input"),o=N(),d=_("hr"),E=N(),m=_("div"),v=_("div"),b=B(g),w=N(),A=_("div"),I=_("div"),k=_("input"),this.h()},l(D){e=h(D,"DIV",{});var S=p(e);t=h(S,"DIV",{class:!0});var K=p(t);de(s.$$.fragment,K),i=$(K),a=h(K,"INPUT",{class:!0,placeholder:!0}),K.forEach(c),o=$(S),d=h(S,"HR",{class:!0}),E=$(S),m=h(S,"DIV",{});var Y=p(m);v=h(Y,"DIV",{class:!0});var C=p(v);b=H(C,g),C.forEach(c),w=$(Y),A=h(Y,"DIV",{class:!0});var V=p(A);I=h(V,"DIV",{class:!0});var U=p(I);k=h(U,"INPUT",{class:!0,placeholder:!0}),U.forEach(c),V.forEach(c),Y.forEach(c),S.forEach(c),this.h()},h(){u(a,"class","flex-1 w-full rounded-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(a,"placeholder",f=l[21].t("Azure Region")),a.required=!0,u(t,"class","mt-1 flex gap-2 mb-1"),u(d,"class","border-gray-100 dark:border-gray-850 my-2"),u(v,"class","mb-1.5 text-sm font-medium"),u(k,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(k,"placeholder",T=l[21].t("e.g., en-US,ja-JP (leave blank for auto-detect)")),u(I,"class","flex-1"),u(A,"class","flex w-full")},m(D,S){M(D,e,S),r(e,t),_e(s,t,null),r(t,i),r(t,a),Q(a,l[15]),r(e,o),r(e,d),r(e,E),r(e,m),r(m,v),r(v,b),r(m,w),r(m,A),r(A,I),r(I,k),Q(k,l[16]),R=!0,O||(y=[pe(a,"input",l[36]),pe(k,"input",l[37])],O=!0)},p(D,S){const K={};S[0]&2097152&&(K.placeholder=D[21].t("API Key")),!n&&S[0]&16384&&(n=!0,K.value=D[14],Fe(()=>n=!1)),s.$set(K),(!R||S[0]&2097152&&f!==(f=D[21].t("Azure Region")))&&u(a,"placeholder",f),S[0]&32768&&a.value!==D[15]&&Q(a,D[15]),(!R||S[0]&2097152)&&g!==(g=D[21].t("Language Locales")+"")&&j(b,g),(!R||S[0]&2097152&&T!==(T=D[21].t("e.g., en-US,ja-JP (leave blank for auto-detect)")))&&u(k,"placeholder",T),S[0]&65536&&k.value!==D[16]&&Q(k,D[16])},i(D){R||(G(s.$$.fragment,D),R=!0)},o(D){W(s.$$.fragment,D),R=!1},d(D){D&&c(e),he(s),O=!1,ml(y)}}}function cc(l){let e,t,s,n,i,a,f,o,d,E=l[21].t("STT Model")+"",m,v,g,b,w,A,I,k=l[21].t("Leave model field empty to use the default model.")+"",T,R,O,y=l[21].t("Click here to see available models.")+"",L,P,D,S;function K(C){l[33](C)}let Y={placeholder:l[21].t("API Key")};return l[17]!==void 0&&(Y.value=l[17]),s=new _l({props:Y}),Ye.push(()=>qe(s,"value",K)),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),i=N(),a=_("hr"),f=N(),o=_("div"),d=_("div"),m=B(E),v=N(),g=_("div"),b=_("div"),w=_("input"),A=N(),I=_("div"),T=B(k),R=N(),O=_("a"),L=B(y),this.h()},l(C){e=h(C,"DIV",{});var V=p(e);t=h(V,"DIV",{class:!0});var U=p(t);
33de(s.$$.fragment,U),U.forEach(c),V.forEach(c),i=$(C),a=h(C,"HR",{class:!0}),f=$(C),o=h(C,"DIV",{});var F=p(o);d=h(F,"DIV",{class:!0});var X=p(d);m=H(X,E),X.forEach(c),v=$(F),g=h(F,"DIV",{class:!0});var Z=p(g);b=h(Z,"DIV",{class:!0});var J=p(b);w=h(J,"INPUT",{class:!0,placeholder:!0}),J.forEach(c),Z.forEach(c),A=$(F),I=h(F,"DIV",{class:!0});var ie=p(I);T=H(ie,k),R=$(ie),O=h(ie,"A",{class:!0,href:!0,target:!0});var fe=p(O);L=H(fe,y),fe.forEach(c),ie.forEach(c),F.forEach(c),this.h()},h(){u(t,"class","mt-1 flex gap-2 mb-1"),u(a,"class","border-gray-100 dark:border-gray-850 my-2"),u(d,"class","mb-1.5 text-sm font-medium"),u(w,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(w,"placeholder","Select a model (optional)"),u(b,"class","flex-1"),u(g,"class","flex w-full"),u(O,"class","hover:underline dark:text-gray-200 text-gray-800"),u(O,"href","https://developers.deepgram.com/docs/models"),u(O,"target","_blank"),u(I,"class","mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500")},m(C,V){M(C,e,V),r(e,t),_e(s,t,null),M(C,i,V),M(C,a,V),M(C,f,V),M(C,o,V),r(o,d),r(d,m),r(o,v),r(o,g),r(g,b),r(b,w),Q(w,l[12]),r(o,A),r(o,I),r(I,T),r(I,R),r(I,O),r(O,L),P=!0,D||(S=pe(w,"input",l[34]),D=!0)},p(C,V){const U={};V[0]&2097152&&(U.placeholder=C[21].t("API Key")),!n&&V[0]&131072&&(n=!0,U.value=C[17],Fe(()=>n=!1)),s.$set(U),(!P||V[0]&2097152)&&E!==(E=C[21].t("STT Model")+"")&&j(m,E),V[0]&4096&&w.value!==C[12]&&Q(w,C[12]),(!P||V[0]&2097152)&&k!==(k=C[21].t("Leave model field empty to use the default model.")+"")&&j(T,k),(!P||V[0]&2097152)&&y!==(y=C[21].t("Click here to see available models.")+"")&&j(L,y)},i(C){P||(G(s.$$.fragment,C),P=!0)},o(C){W(s.$$.fragment,C),P=!1},d(C){C&&(c(e),c(i),c(a),c(f),c(o)),he(s),D=!1,S()}}}function dc(l){let e,t,s,n,i,a,f,o,d,E,m,v,g=l[21].t("STT Model")+"",b,w,A,I,k,T,R,O,y,L,P;function D(K){l[31](K)}let S={placeholder:l[21].t("API Key")};return l[10]!==void 0&&(S.value=l[10]),a=new _l({props:S}),Ye.push(()=>qe(a,"value",D)),{c(){e=_("div"),t=_("div"),s=_("input"),i=N(),ce(a.$$.fragment),o=N(),d=_("hr"),E=N(),m=_("div"),v=_("div"),b=B(g),w=N(),A=_("div"),I=_("div"),k=_("input"),T=N(),R=_("datalist"),O=_("option"),this.h()},l(K){e=h(K,"DIV",{});var Y=p(e);t=h(Y,"DIV",{class:!0});var C=p(t);s=h(C,"INPUT",{class:!0,placeholder:!0}),i=$(C),de(a.$$.fragment,C),C.forEach(c),Y.forEach(c),o=$(K),d=h(K,"HR",{class:!0}),E=$(K),m=h(K,"DIV",{});var V=p(m);v=h(V,"DIV",{class:!0});var U=p(v);b=H(U,g),U.forEach(c),w=$(V),A=h(V,"DIV",{class:!0});var F=p(A);I=h(F,"DIV",{class:!0});var X=p(I);k=h(X,"INPUT",{list:!0,class:!0,placeholder:!0}),T=$(X),R=h(X,"DATALIST",{id:!0});var Z=p(R);O=h(Z,"OPTION",{}),p(O).forEach(c),Z.forEach(c),X.forEach(c),F.forEach(c),V.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full bg-transparent outline-hidden"),u(s,"placeholder",n=l[21].t("API Base URL")),s.required=!0,u(t,"class","mt-1 flex gap-2 mb-1"),u(d,"class","border-gray-100 dark:border-gray-850 my-2"),u(v,"class","mb-1.5 text-sm font-medium"),u(k,"list","model-list"),u(k,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(k,"placeholder","Select a model"),O.__value="whisper-1",Q(O,O.__value),u(R,"id","model-list"),u(I,"class","flex-1"),u(A,"class","flex w-full")},m(K,Y){M(K,e,Y),r(e,t),r(t,s),Q(s,l[9]),r(t,i),_e(a,t,null),M(K,o,Y),M(K,d,Y),M(K,E,Y),M(K,m,Y),r(m,v),r(v,b),r(m,w),r(m,A),r(A,I),r(I,k),Q(k,l[12]),r(I,T),r(I,R),r(R,O),y=!0,L||(P=[pe(s,"input",l[30]),pe(k,"input",l[32])],L=!0)},p(K,Y){(!y||Y[0]&2097152&&n!==(n=K[21].t("API Base URL")))&&u(s,"placeholder",n),Y[0]&512&&s.value!==K[9]&&Q(s,K[9]);const C={};Y[0]&2097152&&(C.placeholder=K[21].t("API Key")),!f&&Y[0]&1024&&(f=!0,C.value=K[10],Fe(()=>f=!1)),a.$set(C),(!y||Y[0]&2097152)&&g!==(g=K[21].t("STT Model")+"")&&j(b,g),Y[0]&4096&&k.value!==K[12]&&Q(k,K[12])},i(K){y||(G(a.$$.fragment,K),y=!0)},o(K){W(a.$$.fragment,K),y=!1},d(K){K&&(c(e),c(o),c(d),c(E),c(m)),he(a),L=!1,ml(P)}}}function _c(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
33),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function hc(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
34													transform-origin: center;
35													animation: spinner_AtaB 0.75s infinite linear;
36												}
37
38												@keyframes spinner_AtaB {
39													100% {
40														transform: rotate(360deg);
41													}
42												}
43											</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1rv6pho"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function pc(l){let e,t,s,n,i,a,f,o,d;return{c(){e=_("div"),t=_("div"),s=_("input"),i=N(),a=_("input"),this.h()},l(E){e=h(E,"DIV",{});var m=p(e);t=h(m,"DIV",{class:!0});var v=p(t);s=h(v,"INPUT",{class:!0,placeholder:!0}),i=$(v),a=h(v,"INPUT",{class:!0,placeholder:!0}),v.forEach(c),m.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full rounded-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(s,"placeholder",n=l[21].t("API Key")),s.required=!0,u(a,"class","flex-1 w-full rounded-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(a,"placeholder",f=l[21].t("Azure Region")),a.required=!0,u(t,"class","mt-1 flex gap-2 mb-1")},m(E,m){M(E,e,m),r(e,t),r(t,s),Q(s,l[2]),r(t,i),r(t,a),Q(a,l[7]),o||(d=[pe(s,"input",l[45]),pe(a,"input",l[46])],o=!0)},p(E,m){m[0]&2097152&&n!==(n=E[21].t("API Key"))&&u(s,"placeholder",n),m[0]&4&&s.value!==E[2]&&Q(s,E[2]),m[0]&2097152&&f!==(f=E[21].t("Azure Region"))&&u(a,"placeholder",f),m[0]&128&&a.value!==E[7]&&Q(a,E[7])},i:st,o:st,d(E){E&&c(e),o=!1,ml(d)}}}function vc(l){let e,t,s,n,i,a;return{c(){e=_("div"),t=_("div"),s=_("input"),this.h()},l(f){e=h(f,"DIV",{});var o=p(e);t=h(o,"DIV",{class:!0});var d=p(t);s=h(d,"INPUT",{class:!0,placeholder:!0}),d.forEach(c),o.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full rounded-lg py-2 pl-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(s,"placeholder",n=l[21].t("API Key")),s.required=!0,u(t,"class","mt-1 flex gap-2 mb-1")},m(f,o){M(f,e,o),r(e,t),r(t,s),Q(s,l[2]),i||(a=pe(s,"input",l[44]),i=!0)},p(f,o){o[0]&2097152&&n!==(n=f[21].t("API Key"))&&u(s,"placeholder",n),o[0]&4&&s.value!==f[2]&&Q(s,f[2])},i:st,o:st,d(f){f&&c(e),i=!1,a()}}}function mc(l){let e,t,s,n,i,a,f,o,d,E;function m(g){l[43](g)}let v={placeholder:l[21].t("API Key")};return l[1]!==void 0&&(v.value=l[1]),a=new _l({props:v}),Ye.push(()=>qe(a,"value",m)),{c(){e=_("div"),t=_("div"),s=_("input"),i=N(),ce(a.$$.fragment),this.h()},l(g){e=h(g,"DIV",{});var b=p(e);t=h(b,"DIV",{class:!0});var w=p(t);s=h(w,"INPUT",{class:!0,placeholder:!0}),i=$(w),de(a.$$.fragment,w),w.forEach(c),b.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full bg-transparent outline-hidden"),u(s,"placeholder",n=l[21].t("API Base URL")),s.required=!0,u(t,"class","mt-1 flex gap-2 mb-1")},m(g,b){M(g,e,b),r(e,t),r(t,s),Q(s,l[0]),r(t,i),_e(a,t,null),o=!0,d||(E=pe(s,"input",l[42]),d=!0)},p(g,b){(!o||b[0]&2097152&&n!==(n=g[21].t("API Base URL")))&&u(s,"placeholder",n),b[0]&1&&s.value!==g[0]&&Q(s,g[0]);const w={};b[0]&2097152&&(w.placeholder=g[21].t("API Key")),!f&&b[0]&2&&(f=!0,w.value=g[1],Fe(()=>f=!1)),a.$set(w)},i(g){o||(G(a.$$.fragment,g),o=!0)},o(g){W(a.$$.fragment,g),o=!1}
43,d(g){g&&c(e),he(a),d=!1,E()}}}function gc(l){let e,t,s,n=l[21].t("TTS Voice")+"",i,a,f,o,d,E,m,v,g,b,w=l[21].t("Output format")+"",A,I,k,T,R=l[21].t("Available list")+"",O,y,L,P,D,S,K,Y=Dt(l[19]),C=[];for(let V=0;V<Y.length;V+=1)C[V]=pa(ua(l,Y,V));return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),E=N(),m=_("datalist");for(let V=0;V<C.length;V+=1)C[V].c();v=N(),g=_("div"),b=_("div"),A=B(w),I=N(),k=_("a"),T=_("small"),O=B(R),y=N(),L=_("div"),P=_("div"),D=_("input"),this.h()},l(V){e=h(V,"DIV",{class:!0});var U=p(e);t=h(U,"DIV",{class:!0});var F=p(t);s=h(F,"DIV",{class:!0});var X=p(s);i=H(X,n),X.forEach(c),a=$(F),f=h(F,"DIV",{class:!0});var Z=p(f);o=h(Z,"DIV",{class:!0});var J=p(o);d=h(J,"INPUT",{list:!0,class:!0,placeholder:!0}),E=$(J),m=h(J,"DATALIST",{id:!0});var ie=p(m);for(let ae=0;ae<C.length;ae+=1)C[ae].l(ie);ie.forEach(c),J.forEach(c),Z.forEach(c),F.forEach(c),v=$(U),g=h(U,"DIV",{class:!0});var fe=p(g);b=h(fe,"DIV",{class:!0});var le=p(b);A=H(le,w),I=$(le),k=h(le,"A",{href:!0,target:!0});var x=p(k);T=h(x,"SMALL",{});var oe=p(T);O=H(oe,R),oe.forEach(c),x.forEach(c),le.forEach(c),y=$(fe),L=h(fe,"DIV",{class:!0});var se=p(L);P=h(se,"DIV",{class:!0});var te=p(P);D=h(te,"INPUT",{list:!0,class:!0,placeholder:!0}),te.forEach(c),se.forEach(c),fe.forEach(c),U.forEach(c),this.h()},h(){u(s,"class","mb-1.5 text-sm font-medium"),u(d,"list","voice-list"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"placeholder","Select a voice"),u(m,"id","voice-list"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(t,"class","w-full"),u(k,"href","https://learn.microsoft.com/en-us/azure/ai-services/speech-service/rest-text-to-speech?tabs=streaming#audio-outputs"),u(k,"target","_blank"),u(b,"class","mb-1.5 text-sm font-medium"),u(D,"list","tts-model-list"),u(D,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(D,"placeholder","Select a output format"),u(P,"class","flex-1"),u(L,"class","flex w-full"),u(g,"class","w-full"),u(e,"class","flex gap-2")},m(V,U){M(V,e,U),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[5]),r(o,E),r(o,m);for(let F=0;F<C.length;F+=1)C[F]&&C[F].m(m,null);r(e,v),r(e,g),r(g,b),r(b,A),r(b,I),r(b,k),r(k,T),r(T,O),r(g,y),r(g,L),r(L,P),r(P,D),Q(D,l[8]),S||(K=[pe(d,"input",l[53]),pe(D,"input",l[54])],S=!0)},p(V,U){if(U[0]&2097152&&n!==(n=V[21].t("TTS Voice")+"")&&j(i,n),U[0]&524320&&d.value!==V[5]&&Q(d,V[5]),U[0]&524288){Y=Dt(V[19]);let F;for(F=0;F<Y.length;F+=1){const X=ua(V,Y,F);C[F]?C[F].p(X,U):(C[F]=pa(X),C[F].c(),C[F].m(m,null))}for(;F<C.length;F+=1)C[F].d(1);C.length=Y.length}U[0]&2097152&&w!==(w=V[21].t("Output format")+"")&&j(A,w),U[0]&2097152&&R!==(R=V[21].t("Available list")+"")&&j(O,R),U[0]&256&&D.value!==V[8]&&Q(D,V[8])},d(V){V&&c(e),wl(C,V),S=!1,ml(K)}}}function Ec(l){let e,t,s,n=l[21].t("TTS Voice")+"",i,a,f,o,d,E,m,v,g,b,w=l[21].t("TTS Model")+"",A,I,k,T,R,O,y,L,P,D=Dt(l[19]),S=[];for(let C=0;C<D.length;C+=1)S[C]=va(ca(l,D,C));let K=Dt(l[20]),Y=[];for(let C=0;C<K.length;C+=1)Y[C]=ma(fa(l,K,C));return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),E=N(),m=_("datalist");for(let C=0;C<S.length;C+=1)S[C].c();v=N(),g=_("div"),b=_("div"),A=B(w),I=N(),k=_("div"),T=_("div"),R=_("input"),O=N(),y=_("datalist");for(let C=0;C<Y.length;C+=1)Y[C].c();this.h()},l(C){e=h(C,"DIV",{class:!0});var V=p(e);t=h(V,"DIV",{class:!0});var U=p(t);s=h(U,"DIV",{class:!0});var F=p(s);i=H(F,n),F.forEach(c),a=$(U),f=h(U,"DIV",{class:!0});var X=p(f);o=h(X,"DIV",{class:!0});var Z=p(o);d=h(Z,"INPUT",{list:!0,class:!0,placeholder:!0}),E=$(Z),m=h(Z,"DATALIST",{id:!0});var J=p(m);for(let se=0;se<S.length;se+=1)S[se].l(J);J.forEach(c),Z.forEach(c),X.forEach(c),U.forEach(c),v=$(V),g=h(V,"DIV",{class:!0});var ie=p(g);b=h(ie,"DIV",{class:!0});var fe=p(b);A=H(fe,w),fe.forEach(c),I=$(ie),k=h(ie,"DIV",{class:!0});var le=p(k);T=h(le,"DIV",{class:!0});var x=p(T);R=h(x,"INPUT",{list:!0,class:!0,placeholder:!0}),O=$(x),y=h(x,"DATALIST",{id:!0});var oe=p(y);for(let se=0;se<Y.length;se+=1)Y[se].l(oe);
43oe.forEach(c),x.forEach(c),le.forEach(c),ie.forEach(c),V.forEach(c),this.h()},h(){u(s,"class","mb-1.5 text-sm font-medium"),u(d,"list","voice-list"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"placeholder","Select a voice"),u(m,"id","voice-list"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(t,"class","w-full"),u(b,"class","mb-1.5 text-sm font-medium"),u(R,"list","tts-model-list"),u(R,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(R,"placeholder","Select a model"),u(y,"id","tts-model-list"),u(T,"class","flex-1"),u(k,"class","flex w-full"),u(g,"class","w-full"),u(e,"class","flex gap-2")},m(C,V){M(C,e,V),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[5]),r(o,E),r(o,m);for(let U=0;U<S.length;U+=1)S[U]&&S[U].m(m,null);r(e,v),r(e,g),r(g,b),r(b,A),r(g,I),r(g,k),r(k,T),r(T,R),Q(R,l[4]),r(T,O),r(T,y);for(let U=0;U<Y.length;U+=1)Y[U]&&Y[U].m(y,null);L||(P=[pe(d,"input",l[51]),pe(R,"input",l[52])],L=!0)},p(C,V){if(V[0]&2097152&&n!==(n=C[21].t("TTS Voice")+"")&&j(i,n),V[0]&524320&&d.value!==C[5]&&Q(d,C[5]),V[0]&524288){D=Dt(C[19]);let U;for(U=0;U<D.length;U+=1){const F=ca(C,D,U);S[U]?S[U].p(F,V):(S[U]=va(F),S[U].c(),S[U].m(m,null))}for(;U<S.length;U+=1)S[U].d(1);S.length=D.length}if(V[0]&2097152&&w!==(w=C[21].t("TTS Model")+"")&&j(A,w),V[0]&16&&R.value!==C[4]&&Q(R,C[4]),V[0]&1048576){K=Dt(C[20]);let U;for(U=0;U<K.length;U+=1){const F=fa(C,K,U);Y[U]?Y[U].p(F,V):(Y[U]=ma(F),Y[U].c(),Y[U].m(y,null))}for(;U<Y.length;U+=1)Y[U].d(1);Y.length=K.length}},d(C){C&&c(e),wl(S,C),wl(Y,C),L=!1,ml(P)}}}function bc(l){let e,t,s,n=l[21].t("TTS Voice")+"",i,a,f,o,d,E,m,v,g,b,w=l[21].t("TTS Model")+"",A,I,k,T,R,O,y,L,P,D=Dt(l[19]),S=[];for(let C=0;C<D.length;C+=1)S[C]=ga(_a(l,D,C));let K=Dt(l[20]),Y=[];for(let C=0;C<K.length;C+=1)Y[C]=Ea(da(l,K,C));return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),E=N(),m=_("datalist");for(let C=0;C<S.length;C+=1)S[C].c();v=N(),g=_("div"),b=_("div"),A=B(w),I=N(),k=_("div"),T=_("div"),R=_("input"),O=N(),y=_("datalist");for(let C=0;C<Y.length;C+=1)Y[C].c();this.h()},l(C){e=h(C,"DIV",{class:!0});var V=p(e);t=h(V,"DIV",{class:!0});var U=p(t);s=h(U,"DIV",{class:!0});var F=p(s);i=H(F,n),F.forEach(c),a=$(U),f=h(U,"DIV",{class:!0});var X=p(f);o=h(X,"DIV",{class:!0});var Z=p(o);d=h(Z,"INPUT",{list:!0,class:!0,placeholder:!0}),E=$(Z),m=h(Z,"DATALIST",{id:!0});var J=p(m);for(let se=0;se<S.length;se+=1)S[se].l(J);J.forEach(c),Z.forEach(c),X.forEach(c),U.forEach(c),v=$(V),g=h(V,"DIV",{class:!0});var ie=p(g);b=h(ie,"DIV",{class:!0});var fe=p(b);A=H(fe,w),fe.forEach(c),I=$(ie),k=h(ie,"DIV",{class:!0});var le=p(k);T=h(le,"DIV",{class:!0});var x=p(T);R=h(x,"INPUT",{list:!0,class:!0,placeholder:!0}),O=$(x),y=h(x,"DATALIST",{id:!0});var oe=p(y);for(let se=0;se<Y.length;se+=1)Y[se].l(oe);oe.forEach(c),x.forEach(c),le.forEach(c),ie.forEach(c),V.forEach(c),this.h()},h(){u(s,"class","mb-1.5 text-sm font-medium"),u(d,"list","voice-list"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"placeholder","Select a voice"),u(m,"id","voice-list"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(t,"class","w-full"),u(b,"class","mb-1.5 text-sm font-medium"),u(R,"list","tts-model-list"),u(R,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(R,"placeholder","Select a model"),u(y,"id","tts-model-list"),u(T,"class","flex-1"),u(k,"class","flex w-full"),u(g,"class","w-full"),u(e,"class","flex gap-2")},m(C,V){M(C,e,V),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[5]),r(o,E),r(o,m);for(let U=0;U<S.length;U+=1)S[U]&&S[U].m(m,null);r(e,v),r(e,g),r(g,b),r(b,A),r(g,I),r(g,k),r(k,T),r(T,R),Q(R,l[4]),r(T,O),r(T,y);for(let U=0;U<Y.length;U+=1)Y[U]&&Y[U].m(y,null);L||(P=[pe(d,"input",l[49]),pe(R,"input",l[50])],L=!0)},p(C,V){if(V[0]&2097152&&n!==(n=C[21].t("TTS Voice")+"")&&j(i,n),V[0]&524320&&d.value!==C[5]&&Q(d,C[5]),V[0]&524288){D=Dt(C[19]);let U;for(U=0;U<D.length;U+=1){const F=_a(C,D,U);S[U]?S[U].p(F,V):(S[U]=ga(F),S[U].c(),S[U].m(m,null))}for(;U<S.length;U+=1)S[U].d(1);S.length=D.length}if(V[0]&2097152&&w!==(w=C[21].t("TTS Model")+"")&&j(A,w),V[0]&16&&R.value!==C[4]&&Q(R,C[4]),V[0]&1048576){K=Dt(C[20]);let U;for(U=0;U<K.length;U+=1){const F=da(C,K,U);Y[U]?Y[U].p(F,V):(Y[U]=Ea(F),Y[U].c(),Y[U].m(y,null))}for(;U<Y.length;U+=1)Y[U].d(1);Y.length=K.length}},d(C){C&&c(e),wl(S,C),wl(Y,C),L=!1,ml(P)}}}function Ic(l){let e,t,s=l[21].t("TTS Model")+"",n,i,a,f,o,d,E,m,v,g,b=l[21].t("Open WebUI uses SpeechT5 and CMU Arctic speaker embeddings.")+"",w,A,I,k=l[21].t("click here",{name:"SpeechT5"})+"",T,R,O,y,L=l[21].t("click here")+"",P,D,S,K;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),d=N(),E=_("datalist"),m=_("option"),v=N(),g=_("div"),w=B(b),A=B(`
44
45							To learn more about SpeechT5,
46
47							`),I=_("a"),T=B(k),R=B("."),O=B(`
48							To see the available CMU Arctic speaker embeddings,
49							`),y=_("a"),P=B(L),D=B("."),this.h()},l(Y){e=h(Y,"DIV",{});
49var C=p(e);t=h(C,"DIV",{class:!0});var V=p(t);n=H(V,s),V.forEach(c),i=$(C),a=h(C,"DIV",{class:!0});var U=p(a);f=h(U,"DIV",{class:!0});var F=p(f);o=h(F,"INPUT",{list:!0,class:!0,placeholder:!0}),d=$(F),E=h(F,"DATALIST",{id:!0});var X=p(E);m=h(X,"OPTION",{}),p(m).forEach(c),X.forEach(c),F.forEach(c),U.forEach(c),v=$(C),g=h(C,"DIV",{class:!0});var Z=p(g);w=H(Z,b),A=H(Z,`
50
51							To learn more about SpeechT5,
52
53							`),I=h(Z,"A",{class:!0,href:!0,target:!0});var J=p(I);T=H(J,k),R=H(J,"."),J.forEach(c),O=H(Z,`
54							To see the available CMU Arctic speaker embeddings,
55							`),y=h(Z,"A",{class:!0,href:!0,target:!0});var ie=p(y);P=H(ie,L),D=H(ie,"."),ie.forEach(c),Z.forEach(c),C.forEach(c),this.h()},h(){u(t,"class","mb-1.5 text-sm font-medium"),u(o,"list","model-list"),u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(o,"placeholder","CMU ARCTIC speaker embedding name"),m.__value="tts-1",Q(m,m.__value),u(E,"id","model-list"),u(f,"class","flex-1"),u(a,"class","flex w-full"),u(I,"class","hover:underline dark:text-gray-200 text-gray-800"),u(I,"href","https://github.com/microsoft/SpeechT5"),u(I,"target","_blank"),u(y,"class","hover:underline dark:text-gray-200 text-gray-800"),u(y,"href","https://huggingface.co/datasets/Matthijs/cmu-arctic-xvectors"),u(y,"target","_blank"),u(g,"class","mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500")},m(Y,C){M(Y,e,C),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[4]),r(f,d),r(f,E),r(E,m),r(e,v),r(e,g),r(g,w),r(g,A),r(g,I),r(I,T),r(I,R),r(g,O),r(g,y),r(y,P),r(y,D),S||(K=pe(o,"input",l[48]),S=!0)},p(Y,C){C[0]&2097152&&s!==(s=Y[21].t("TTS Model")+"")&&j(n,s),C[0]&16&&o.value!==Y[4]&&Q(o,Y[4]),C[0]&2097152&&b!==(b=Y[21].t("Open WebUI uses SpeechT5 and CMU Arctic speaker embeddings.")+"")&&j(w,b),C[0]&2097152&&k!==(k=Y[21].t("click here",{name:"SpeechT5"})+"")&&j(T,k),C[0]&2097152&&L!==(L=Y[21].t("click here")+"")&&j(P,L)},d(Y){Y&&c(e),S=!1,K()}}}function wc(l){let e,t,s=l[21].t("TTS Voice")+"",n,i,a,f,o,d,E=l[21].t("Default")+"",m,v,g,b,w=Dt(l[19]),A=[];for(let I=0;I<w.length;I+=1)A[I]=ba(ha(l,w,I));return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("select"),d=_("option"),m=B(E);for(let I=0;I<A.length;I+=1)A[I].c();this.h()},l(I){e=h(I,"DIV",{});var k=p(e);t=h(k,"DIV",{class:!0});var T=p(t);n=H(T,s),T.forEach(c),i=$(k),a=h(k,"DIV",{class:!0});var R=p(a);f=h(R,"DIV",{class:!0});var O=p(f);o=h(O,"SELECT",{class:!0});var y=p(o);d=h(y,"OPTION",{});var L=p(d);m=H(L,E),L.forEach(c);for(let P=0;P<A.length;P+=1)A[P].l(y);y.forEach(c),O.forEach(c),R.forEach(c),k.forEach(c),this.h()},h(){u(t,"class","mb-1.5 text-sm font-medium"),d.__value="",Q(d,d.__value),d.selected=v=l[5]!=="",u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),l[5]===void 0&&Cl(()=>l[47].call(o)),u(f,"class","flex-1"),u(a,"class","flex w-full")},m(I,k){M(I,e,k),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(o,d),r(d,m);for(let T=0;T<A.length;T+=1)A[T]&&A[T].m(o,null);Ft(o,l[5],!0),g||(b=pe(o,"change",l[47]),g=!0)},p(I,k){if(k[0]&2097152&&s!==(s=I[21].t("TTS Voice")+"")&&j(n,s),k[0]&2097152&&E!==(E=I[21].t("Default")+"")&&j(m,E),k[0]&524320&&v!==(v=I[5]!=="")&&(d.selected=v),k[0]&524320){w=Dt(I[19]);let T;for(T=0;T<w.length;T+=1){const R=ha(I,w,T);A[T]?A[T].p(R,k):(A[T]=ba(R),A[T].c(),A[T].m(o,null))}for(;T<A.length;T+=1)A[T].d(1);A.length=w.length}k[0]&524320&&Ft(o,I[5])},d(I){I&&c(e),wl(A,I),g=!1,b()}}}function pa(l){let e,t=l[62].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[62].id,Q(e,e.__value)},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&524288&&t!==(t=i[62].name+"")&&j(s,t),a[0]&524288&&n!==(n=i[62].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function va(l){let e,t=l[62].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[62].id,Q(e,e.__value)},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&524288&&t!==(t=i[62].name+"")&&j(s,t),a[0]&524288&&n!==(n=i[62].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function ma(l){let e,t;return{c(){e=_("option"),this.h()},l(s){e=h(s,"OPTION",{class:!0}),p(e).forEach(c),this.h()},h(){e.__value=t=l[65].id,Q(e,e.__value),u(e,"class","bg-gray-50 dark:bg-gray-700")},m(s,n){M(s,e,n)},p(s,n){n[0]&1048576&&t!==(t=s[65].id)&&(e.__value=t,Q(e,e.__value))},d(s){s&&c(e)}}}function ga(l){let e,t=l[62].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[62].id,Q(e,e.__value)},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&524288&&t!==(t=i[62].name+"")&&j(s,t),a[0]&524288&&n!==(n=i[62].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function Ea(l){let e,t;return{c(){e=_("option"),this.h()},l(s){e=h(s,"OPTION",{class:!0}),p(e).forEach(c),this.h()},h(){e.__value=t=l[65].id,Q(e,e.__value),u(e,"class","bg-gray-50 dark:bg-gray-700")},m(s,n){M(s,e,n)},p(s,n){n[0]&1048576&&t!==(t=s[65].id)&&(e.__value=t,Q(e,e.__value))},d(s){s&&c(e)}}}function ba(l){let e,t=l[62].name+"",s,n,i;return{c(){e=_("option"),s=B(t),this.h()},l(a){e=h(a,"OPTION",{class:!0});var f=p(e);s=H(f,t),f.forEach(c),this.h()},h(){e.__value=n=l[62].voiceURI,Q(e,e.__value),u(e,"class","bg-gray-100 dark:bg-gray-700"),e.selected=i=l[5]===l[62].voiceURI},m(a,f){M(a,e,f),r(e,s)},p(a,f){f[0]&524288&&t!==(t=a[62].name+"")&&j(s,t),f[0]&524288&&n!==(n=a[
5562].voiceURI)&&(e.__value=n,Q(e,e.__value)),f[0]&524320&&i!==(i=a[5]===a[62].voiceURI)&&(e.selected=i)},d(a){a&&c(e)}}}function Ia(l){let e,t=l[21].t(l[59].charAt(0).toUpperCase()+l[59].slice(1))+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[59],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&2097152&&t!==(t=n[21].t(n[59].charAt(0).toUpperCase()+n[59].slice(1))+"")&&j(s,t)},d(n){n&&c(e)}}}function Tc(l){let e,t,s,n,i,a=l[21].t("STT Settings")+"",f,o,d,E,m=l[21].t("Speech-to-Text Engine")+"",v,g,b,w,A,I=l[21].t("Whisper (Local)")+"",k,T,R="OpenAI",O,y=l[21].t("Web API")+"",L,P,D="Deepgram",S,K="Azure AI Speech",Y,C,V,U,F,X,Z,J,ie=l[21].t("TTS Settings")+"",fe,le,x,oe,se=l[21].t("Text-to-Speech Engine")+"",te,ae,Te,ve,q,ne=l[21].t("Web API")+"",Ie,be,z=l[21].t("Transformers")+"",ke,Ue,we=l[21].t("Local")+"",Ae,Re,ue,Ee=l[21].t("OpenAI")+"",Me,Ge,ee=l[21].t("ElevenLabs")+"",me,ge,Ne=l[21].t("Azure AI Speech")+"",ye,ze,Ce,Le,Ke,re,$e,ut,ft,ct,Be,Ve,je=l[21].t("Response splitting")+"",Rt,Ot,_t,Et,At,Tt,Ut=l[21].t("Control how message text is split for TTS requests. 'Punctuation' splits into sentences, 'paragraphs' splits into paragraphs, and 'none' keeps the message as a single string.")+"",rt,bt,lt,He,at=l[21].t("Save")+"",Vt,Qe,yt,wt;const vt=[dc,cc,fc,uc],It=[];function el(We,it){return We[11]==="openai"?0:We[11]==="deepgram"?1:We[11]==="azure"?2:We[11]===""?3:-1}~(C=el(l))&&(V=It[C]=vt[C](l));const Kt=[mc,vc,pc],Lt=[];function ol(We,it){return We[3]==="openai"?0:We[3]==="elevenlabs"?1:We[3]==="azure"?2:-1}~(Ce=ol(l))&&(Le=Lt[Ce]=Kt[Ce](l));function Tl(We,it){if(We[3]==="")return wc;if(We[3]==="transformers")return Ic;if(We[3]==="openai")return bc;if(We[3]==="elevenlabs")return Ec;if(We[3]==="azure")return gc}let Se=Tl(l),De=Se&&Se(l),Pe=Dt(Object.values(Un)),kt=[];for(let We=0;We<Pe.length;We+=1)kt[We]=Ia(oa(l,Pe,We));return{c(){e=_("form"),t=_("div"),s=_("div"),n=_("div"),i=_("div"),f=B(a),o=N(),d=_("div"),E=_("div"),v=B(m),g=N(),b=_("div"),w=_("select"),A=_("option"),k=B(I),T=_("option"),T.textContent=R,O=_("option"),L=B(y),P=_("option"),P.textContent=D,S=_("option"),S.textContent=K,Y=N(),V&&V.c(),U=N(),F=_("hr"),X=N(),Z=_("div"),J=_("div"),fe=B(ie),le=N(),x=_("div"),oe=_("div"),te=B(se),ae=N(),Te=_("div"),ve=_("select"),q=_("option"),Ie=B(ne),be=_("option"),ke=B(z),Ue=B(" ("),Ae=B(we),Re=B(")"),ue=_("option"),Me=B(Ee),Ge=_("option"),me=B(ee),ge=_("option"),ye=B(Ne),ze=N(),Le&&Le.c(),Ke=N(),re=_("hr"),$e=N(),De&&De.c(),ut=N(),ft=_("hr"),ct=N(),Be=_("div"),Ve=_("div"),Rt=B(je),Ot=N(),_t=_("div"),Et=_("select");for(let We=0;We<kt.length;We+=1)kt[We].c();At=N(),Tt=_("div"),rt=B(Ut),bt=N(),lt=_("div"),He=_("button"),Vt=B(at),this.h()},l(We){e=h(We,"FORM",{class:!0});var it=p(e);t=h(it,"DIV",{class:!0});var Mt=p(t);s=h(Mt,"DIV",{class:!0});var xe=p(s);n=h(xe,"DIV",{});var mt=p(n);i=h(mt,"DIV",{class:!0});var Bt=p(i);f=H(Bt,a),Bt.forEach(c),o=$(mt),d=h(mt,"DIV",{class:!0});var Ze=p(d);E=h(Ze,"DIV",{class:!0});var nt=p(E);v=H(nt,m),nt.forEach(c),g=$(Ze),b=h(Ze,"DIV",{class:!0});var Yt=p(b);w=h(Yt,"SELECT",{class:!0,placeholder:!0});var tl=p(w);A=h(tl,"OPTION",{});var Qt=p(A);k=H(Qt,I),Qt.forEach(c),T=h(tl,"OPTION",{"data-svelte-h":!0}),Wt(T)!=="svelte-bbvrw2"&&(T.textContent=R),O=h(tl,"OPTION",{});var al=p(O);L=H(al,y),al.forEach(c),P=h(tl,"OPTION",{"data-svelte-h":!0}),Wt(P)!=="svelte-htpsvy"&&(P.textContent=D),S=h(tl,"OPTION",{"data-svelte-h":!0}),Wt(S)!=="svelte-1i7rqok"&&(S.textContent=K),tl.forEach(c),Yt.forEach(c),Ze.forEach(c),Y=$(mt),V&&V.l(mt),mt.forEach(c),U=$(xe),F=h(xe,"HR",{class:!0}),X=$(xe),Z=h(xe,"DIV",{});var St=p(Z);J=h(St,"DIV",{class:!0});var Zt=p(J);fe=H(Zt,ie),Zt.forEach(c),le=$(St),x=h(St,"DIV",{class:!0});var Xt=p(x);oe=h(Xt,"DIV",{class:!0});var hl=p(oe);te=H(hl,se),hl.forEach(c),ae=$(Xt),Te=h(Xt,"DIV",{class:!0});var cl=p(Te);ve=h(cl,"SELECT",{class:!0,placeholder:!0});var Jt=p(ve);q=h(Jt,"OPTION",{});var zt=p(q);Ie=H(zt,ne),zt.forEach(c),be=h(Jt,"OPTION",{});var Nt=p(be);ke=H(Nt,z),Ue=H(Nt," ("),Ae=H(Nt,we),Re=H(Nt,")"),Nt.forEach(c),ue=h(Jt,"OPTION",{});var Al=p(ue);Me=H(Al,Ee),Al.forEach(c),Ge=h(Jt,"OPTION",{});var Rl=p(Ge);me=H(Rl,ee),Rl.forEach(c),ge=h(Jt,"OPTION",{});var dl=p(ge);ye=H(dl,Ne),dl.forEach(c),Jt.forEach(c),cl.forEach(c),Xt.forEach(c),ze=$(St),Le&&Le.l(St),Ke=$(St),re=h(St,"HR",{class:!0}),$e=$(St),De&&De.l(St),ut=$(St),ft=h(St,"HR",{class:!0}),ct=$(St),Be=h(St,"DIV",{class:!0});var Pt=p(Be);Ve=h(Pt,"DIV",{class:!0});var gl=p(Ve);Rt=H(gl,je),gl.forEach(c),Ot=$(Pt),_t=h(Pt,"DIV",{class:!0});var ot=p(_t);Et=h(ot,"SELECT",{class:!0,"aria-label":!0});var $t=p(Et);for(let $l=0;$l<kt.length;$l+=1)kt[$l].l($t);$t.forEach(c),ot.forEach(c),Pt.forEach(c),At=$(St),Tt=h(St,"DIV",{class:!0});var dt=p(Tt);rt=H(dt,Ut),dt.forEach(c),St.forEach(c),xe.forEach(c),Mt.forEach(c),bt=$(it),lt=h(it,"DIV",{class:!0});var kl=p(lt);He=h(kl,"BUTTON",{class:!0,type:!0});var rl=p(He);Vt=H(rl,at),rl.forEach(c),kl.forEach(c),it.forEach(c),this.h()},h(){u(i,"class","mb-1 text-sm font-medium"),u(E,"class","self-center text-xs font-medium"),A.__value="",Q(A,A.__value),T.__value="openai",Q(T,T.__value),O.__value="web",Q(O,O.__value),P.__value="deepgram",Q(P,P.__value),S.__value="azure",Q(S,S.__value),u(w,"class","dark:bg-gray-900 cursor-pointer w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(w,"placeholder","Select an engine"),l[11]===void 0&&Cl(()=>l[29].call(w)),u(b,"class","flex items-center relative"),u(d,"class","py-0.5 flex w-full justify-between"),u(F,"class","border-gray-100 dark:border-gray-850"),u(J,"class","mb-1 text-sm font-medium"),u(oe,"class","self-center text-xs font-medium"),q.__value="",Q(q,q.__value),be.__value="transformers",Q(be,be.__value),ue.__value="openai",Q(ue,ue.__value),Ge.__value="elevenlabs",Q(Ge,Ge.__value),ge.__value="azure",Q(ge,ge.__value),u(ve,"class","dark:bg-gray-900 w-fit pr-8 cursor-pointer rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(ve,"placeholder","Select a mode"),l[3]===void 0&&Cl(()=>l[40].call(ve)),u(Te,"class","flex items-center relative"),u(x,"class","py-0.5 flex w-full justify-between"),u(re,"class","border-gray-100 dark:border-gray-850 my-2"),u(ft,"class","border-gray-100 dark:border-gray-850 my-2"),u(Ve,"class","self-center text-xs font-medium"),u(Et,"class","dark:bg-gray-900 w-fit pr-8 cursor-pointer rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(Et,"aria-label","Select how to split message text for TTS requests"),l[6]===void 0&&Cl(()=>l[55].call(Et)),u(_t,"class","flex items-center relative"),u(Be,"class","pt-0.5 flex w-full justify-between"),u(Tt,"class","mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500"),u(s,"class","flex flex-col gap-3"),u(t,"class","space-y-3 overflow-y-scroll scrollbar-hidden h-full"),u(He,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(He,"type","submit"),u(lt,"class","flex justify-end text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(We,it){M(We,e,it),r(e,t),r(t,s),r(s,n),r(n,i),r(i,f),r(n,o),r(n,d),r(d,E),r(E,v),r(d,g),r(d,b),r(b,w),r(w,A),r(A,k),r(w,T),r(w,O),r(O,L),r(w,P),r(w,S),Ft(w,l[11],!0),r(n,Y),~C&&It[C].m(n,null),r(s,U),r(s,F),r(s,X),r(s,Z),r(Z,J),r(J,fe),r(Z,le),r(Z,x),r(x,oe),r(oe,te),r(x,ae),r(x,Te),r(Te,ve),r(ve,q),r(q,Ie),r(ve,be),r(be,ke),r(be,Ue),r(be,Ae),r(be,Re),r(ve,ue),r(ue,Me),r(ve,Ge),r(Ge,me),r(ve,ge),r(ge,ye),Ft(ve,l[3],!0),r(Z,ze),~Ce&&Lt[Ce].m(Z,null),r(Z,Ke),r(Z,re),r(Z,$e),De&&De.m(Z,null),r(Z,ut),r(Z,ft),r(Z,ct),r(Z,Be),r(Be,Ve),r(Ve,Rt),r(Be,Ot),r(Be,_t),r(_t,Et);for(let Mt=0;Mt<kt.length;Mt+=1)kt[Mt]&&kt[Mt].m(Et,null);Ft(Et,l[6],!0),r(Z,At),r(Z,Tt),r(Tt,rt),r(e,bt),r(e,lt),r(lt,He),r(He,Vt),Qe=!0,yt||(wt=[pe(w,"change",l[29]),pe(ve,"change",l[40]),pe(ve,"change",l[41]),pe(Et,"change",l[55]),pe(e,"submit",ds(l[56]))],yt=!0)},p(We,it){(!Qe||it[0]&2097152)&&a!==(a=We[21].t("STT Settings")+"")&&j(f,a),(!Qe||it[0]&2097152)&&m!==(m=We[21].t("Speech-to-Text Engine")+"")&&j(v,m),(!Qe||it[0]&2097152)&&I!==(I=We[21].t("Whisper (Local)")+"")&&j(k,I),(!Qe||it[0]&2097152)&&y!==(y=We[21].t("Web API")+"")&&j(L,y),it[0]&2048&&Ft(w,We[11]);let Mt=C;C=el(We),C===Mt?~C&&It[C].p(We,it):(V&&(ht(),W(It[Mt],1,1,()=>{It[Mt]=null}),pt()),~C?(V=It[C],V?V.p(We,it):(V=It[C]=vt[C](We),V.c()),G(V,1),V.m(n,null)):V=null),(!Qe||it[0]&2097152)&&ie!==(ie=We[21].t("TTS Settings")+"")&&j(fe,ie),(!Qe||it[0]&2097152)&&se!==(se=We[21].t("Text-to-Speech Engine")+"")&&j(te,se),(!Qe||it[0]&2097152)&&ne!==(ne=We[21].t("Web API")+"")&&j(Ie,ne),(!Qe||it[0]&2097152)&&z!==(z=We[21].t("Transformers")+"")&&j(ke,z),(!Qe||it[0]&2097152)&&we!==(we=We[21].t("Local")+"")&&j(Ae,we),(!Qe||it[0]&2097152)&&Ee!==(Ee=We[21].t("OpenAI")+"")&&j(Me,Ee),(!Qe||it[0]&2097152)&&ee!==(ee=We[21].t("ElevenLabs")+"")&&j(me,ee),(!Qe||it[0]&2097152)&&Ne!==(Ne=We[21].t("Azure AI Speech")+"")&&j(ye,Ne),it[0]&8&&Ft(ve,We[3]);let xe=Ce;if(Ce=ol(We),Ce===xe?~Ce&&Lt[Ce].p(We,it):(Le&&(ht(),W(Lt[xe],1,1,()=>{Lt[xe]=null}),pt()),~Ce?(Le=Lt[Ce],Le?Le.p(We,it):(Le=Lt[Ce]=Kt[Ce](We),Le.c()),G(Le,1),Le.m(Z,Ke)):Le=null),Se===(Se=Tl(We))&&De?De.p(We,it):(De&&De.d(1),De=Se&&Se(We),De&&(De.c(),De.m(Z,ut))),(!Qe||it[0]&2097152)&&je!==(je=We[21].t("Response splitting")+"")&&j(Rt,je),it[0]&2097152){Pe=Dt(Object.values(Un));let mt;for(mt=0;mt<Pe.length;mt+=1){const Bt=oa(We,Pe,mt);kt[mt]?kt[mt].p(Bt,it):(kt[mt]=Ia(Bt),kt[mt].c(),kt[mt].m(Et,null))}for(;mt<kt.length;mt+=1)kt[mt].d(1);kt.length=Pe.length}it[0]&64&&Ft(Et,We[6]),(!Qe||it[0]&2097152)&&Ut!==(Ut=We[21].t("Control how message text is split for TTS requests. 'Punctuation' splits into sentences, 'paragraphs' splits into paragraphs, and 'none' keeps the message as a single str
55ing.")+"")&&j(rt,Ut),(!Qe||it[0]&2097152)&&at!==(at=We[21].t("Save")+"")&&j(Vt,at)},i(We){Qe||(G(V),G(Le),Qe=!0)},o(We){W(V),W(Le),Qe=!1},d(We){We&&c(e),~C&&It[C].d(),~Ce&&Lt[Ce].d(),De&&De.d(),wl(kt,We),yt=!1,ml(wt)}}}function Ac(l,e,t){let s,n,i;qt(l,nn,ge=>t(57,n=ge)),qt(l,fs,ge=>t(58,i=ge));const a=Ss(),f=Ul("i18n");qt(l,f,ge=>t(21,s=ge));let{saveHandler:o}=e,d="",E="",m="",v="",g="",b="",w=Un.PUNCTUATION,A="",I="",k="",T="",R="",O="",y="",L="",P="",D="",S="",K=!1,Y=[],C=[];const V=async()=>{var ge;if(v==="")t(20,C=[]);else{const Ne=await yu(localStorage.token,((ge=i==null?void 0:i.features)==null?void 0:ge.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null)).catch(ye=>{Je.error(`${ye}`)});Ne&&(console.log(Ne),t(20,C=Ne.models))}},U=async()=>{if(v===""){const ge=setInterval(()=>{t(19,Y=speechSynthesis.getVoices()),Y.length>0&&(clearInterval(ge),Y.sort((Ne,ye)=>Ne.name.localeCompare(ye.name,s.resolvedLanguage)))},100)}else{const ge=await Lu(localStorage.token).catch(Ne=>{Je.error(`${Ne}`)});ge&&(console.log(ge),t(19,Y=ge.voices),Y.sort((Ne,ye)=>Ne.name.localeCompare(ye.name,s.resolvedLanguage)))}},F=async()=>{await Cu(localStorage.token,{tts:{OPENAI_API_BASE_URL:d,OPENAI_API_KEY:E,API_KEY:m,ENGINE:v,MODEL:g,VOICE:b,SPLIT_ON:w,AZURE_SPEECH_REGION:A,AZURE_SPEECH_OUTPUT_FORMAT:I},stt:{OPENAI_API_BASE_URL:k,OPENAI_API_KEY:T,ENGINE:R,MODEL:O,WHISPER_MODEL:y,DEEPGRAM_API_KEY:S,AZURE_API_KEY:L,AZURE_REGION:P,AZURE_LOCALES:D}})&&(o(),fs.set(await Xs()))},X=async()=>{t(18,K=!0),await F(),t(18,K=!1)};rs(async()=>{const ge=await Vu(localStorage.token);ge&&(console.log(ge),t(0,d=ge.tts.OPENAI_API_BASE_URL),t(1,E=ge.tts.OPENAI_API_KEY),t(2,m=ge.tts.API_KEY),t(3,v=ge.tts.ENGINE),t(4,g=ge.tts.MODEL),t(5,b=ge.tts.VOICE),t(6,w=ge.tts.SPLIT_ON||Un.PUNCTUATION),t(8,I=ge.tts.AZURE_SPEECH_OUTPUT_FORMAT),t(7,A=ge.tts.AZURE_SPEECH_REGION),t(9,k=ge.stt.OPENAI_API_BASE_URL),t(10,T=ge.stt.OPENAI_API_KEY),t(11,R=ge.stt.ENGINE),t(12,O=ge.stt.MODEL),t(13,y=ge.stt.WHISPER_MODEL),t(14,L=ge.stt.AZURE_API_KEY),t(15,P=ge.stt.AZURE_REGION),t(16,D=ge.stt.AZURE_LOCALES),t(17,S=ge.stt.DEEPGRAM_API_KEY)),await U(),await V()});function Z(){R=Ll(this),t(11,R)}function J(){k=this.value,t(9,k)}function ie(ge){T=ge,t(10,T)}function fe(){O=this.value,t(12,O)}function le(ge){S=ge,t(17,S)}function x(){O=this.value,t(12,O)}function oe(ge){L=ge,t(14,L)}function se(){P=this.value,t(15,P)}function te(){D=this.value,t(16,D)}function ae(){y=this.value,t(13,y)}const Te=()=>{X()};function ve(){v=Ll(this),t(3,v)}const q=async ge=>{var Ne;await F(),await U(),await V(),((Ne=ge.target)==null?void 0:Ne.value)==="openai"?(t(5,b="alloy"),t(4,g="tts-1")):(t(5,b=""),t(4,g=""))};function ne(){d=this.value,t(0,d)}function Ie(ge){E=ge,t(1,E)}function be(){m=this.value,t(2,m)}function z(){m=this.value,t(2,m)}function ke(){A=this.value,t(7,A)}function Ue(){b=Ll(this),t(5,b),t(19,Y)}function we(){g=this.value,t(4,g)}function Ae(){b=this.value,t(5,b),t(19,Y)}function Re(){g=this.value,t(4,g)}function ue(){b=this.value,t(5,b),t(19,Y)}function Ee(){g=this.value,t(4,g)}function Me(){b=this.value,t(5,b),t(19,Y)}function Ge(){I=this.value,t(8,I)}function ee(){w=Ll(this),t(6,w)}const me=async()=>{await F(),a("save")};return l.$$set=ge=>{"saveHandler"in ge&&t(28,o=ge.saveHandler)},[d,E,m,v,g,b,w,A,I,k,T,R,O,y,L,P,D,S,K,Y,C,s,a,f,V,U,F,X,o,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne,Ie,be,z,ke,Ue,we,Ae,Re,ue,Ee,Me,Ge,ee,me]}class kc extends Sl{constructor(e){super(),Pl(this,e,Ac,Tc,Ol,{saveHandler:28},null,[-1,-1,-1])}}function wa(l,e,t){const s=l.slice();return s[42]=e[t],s}function Ta(l,e,t){const s=l.slice();return s[51]=e[t],s[52]=e,s[53]=t,s}function Aa(l,e,t){const s=l.slice();return s[45]=e[t],s}function ka(l,e,t){const s=l.slice();return s[48]=e[t],s}function Da(l){var Re;let e,t,s=l[5].t("Image Settings")+"",n,i,a,f,o,d=l[5].t("Image Generation (Experimental)")+"",E,m,v,g,b,w,A,I,k,T=l[5].t("Image Generation Engine")+"",R,O,y,L,P,D=l[5].t("Default (Open AI)")+"",S,K,Y=l[5].t("ComfyUI")+"",C,V,U=l[5].t("Automatic1111")+"",F,
55X,Z=l[5].t("Gemini")+"",J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne;function Ie(ue){l[11](ue)}let be={};l[1].enabled!==void 0&&(be.state=l[1].enabled),g=new vl({props:be}),Ye.push(()=>qe(g,"state",Ie)),g.$on("change",l[12]);let z=l[1].enabled&&Na(l);const ke=[Rc,$c,Nc,Dc],Ue=[];function we(ue,Ee){var Me,Ge,ee,me;return(((Me=ue[1])==null?void 0:Me.engine)??"automatic1111")==="automatic1111"?0:((Ge=ue[1])==null?void 0:Ge.engine)==="comfyui"?1:((ee=ue[1])==null?void 0:ee.engine)==="openai"?2:((me=ue[1])==null?void 0:me.engine)==="gemini"?3:-1}~(se=we(l))&&(te=Ue[se]=ke[se](l));let Ae=((Re=l[1])==null?void 0:Re.enabled)&&Va(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("div"),E=B(d),m=N(),v=_("div"),ce(g.$$.fragment),w=N(),z&&z.c(),A=N(),I=_("div"),k=_("div"),R=B(T),O=N(),y=_("div"),L=_("select"),P=_("option"),S=B(D),K=_("option"),C=B(Y),V=_("option"),F=B(U),X=_("option"),J=B(Z),fe=N(),le=_("hr"),x=N(),oe=_("div"),te&&te.c(),ae=N(),Ae&&Ae.c(),Te=xt(),this.h()},l(ue){e=h(ue,"DIV",{});var Ee=p(e);t=h(Ee,"DIV",{class:!0});var Me=p(t);n=H(Me,s),Me.forEach(c),i=$(Ee),a=h(Ee,"DIV",{});var Ge=p(a);f=h(Ge,"DIV",{class:!0});var ee=p(f);o=h(ee,"DIV",{class:!0});var me=p(o);E=H(me,d),me.forEach(c),m=$(ee),v=h(ee,"DIV",{class:!0});var ge=p(v);de(g.$$.fragment,ge),ge.forEach(c),ee.forEach(c),Ge.forEach(c),w=$(Ee),z&&z.l(Ee),A=$(Ee),I=h(Ee,"DIV",{class:!0});var Ne=p(I);k=h(Ne,"DIV",{class:!0});var ye=p(k);R=H(ye,T),ye.forEach(c),O=$(Ne),y=h(Ne,"DIV",{class:!0});var ze=p(y);L=h(ze,"SELECT",{class:!0,placeholder:!0});var Ce=p(L);P=h(Ce,"OPTION",{});var Le=p(P);S=H(Le,D),Le.forEach(c),K=h(Ce,"OPTION",{});var Ke=p(K);C=H(Ke,Y),Ke.forEach(c),V=h(Ce,"OPTION",{});var re=p(V);F=H(re,U),re.forEach(c),X=h(Ce,"OPTION",{});var $e=p(X);J=H($e,Z),$e.forEach(c),Ce.forEach(c),ze.forEach(c),Ne.forEach(c),Ee.forEach(c),fe=$(ue),le=h(ue,"HR",{class:!0}),x=$(ue),oe=h(ue,"DIV",{class:!0});var ut=p(oe);te&&te.l(ut),ut.forEach(c),ae=$(ue),Ae&&Ae.l(ue),Te=xt(),this.h()},h(){u(t,"class","mb-1 text-sm font-medium"),u(o,"class","self-center text-xs font-medium"),u(v,"class","px-1"),u(f,"class","py-1 flex w-full justify-between"),u(k,"class","self-center text-xs font-medium"),P.__value="openai",Q(P,P.__value),K.__value="comfyui",Q(K,K.__value),V.__value="automatic1111",Q(V,V.__value),X.__value="gemini",Q(X,X.__value),u(L,"class","dark:bg-gray-900 w-fit pr-8 cursor-pointer rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(L,"placeholder",ie=l[5].t("Select Engine")),l[1].engine===void 0&&Cl(()=>l[14].call(L)),u(y,"class","flex items-center relative"),u(I,"class","py-1 flex w-full justify-between"),u(le,"class","border-gray-100 dark:border-gray-850"),u(oe,"class","flex flex-col gap-2")},m(ue,Ee){M(ue,e,Ee),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(o,E),r(f,m),r(f,v),_e(g,v,null),r(e,w),z&&z.m(e,null),r(e,A),r(e,I),r(I,k),r(k,R),r(I,O),r(I,y),r(y,L),r(L,P),r(P,S),r(L,K),r(K,C),r(L,V),r(V,F),r(L,X),r(X,J),Ft(L,l[1].engine,!0),M(ue,fe,Ee),M(ue,le,Ee),M(ue,x,Ee),M(ue,oe,Ee),~se&&Ue[se].m(oe,null),M(ue,ae,Ee),Ae&&Ae.m(ue,Ee),M(ue,Te,Ee),ve=!0,q||(ne=[pe(L,"change",l[14]),pe(L,"change",l[15])],q=!0)},p(ue,Ee){var ee;(!ve||Ee[0]&32)&&s!==(s=ue[5].t("Image Settings")+"")&&j(n,s),(!ve||Ee[0]&32)&&d!==(d=ue[5].t("Image Generation (Experimental)")+"")&&j(E,d);const Me={};!b&&Ee[0]&2&&(b=!0,Me.state=ue[1].enabled,Fe(()=>b=!1)),g.$set(Me),ue[1].enabled?z?(z.p(ue,Ee),Ee[0]&2&&G(z,1)):(z=Na(ue),z.c(),G(z,1),z.m(e,A)):z&&(ht(),W(z,1,1,()=>{z=null}),pt()),(!ve||Ee[0]&32)&&T!==(T=ue[5].t("Image Generation Engine")+"")&&j(R,T),(!ve||Ee[0]&32)&&D!==(D=ue[5].t("Default (Open AI)")+"")&&j(S,D),(!ve||Ee[0]&32)&&Y!==(Y=ue[5].t("ComfyUI")+"")&&j(C,Y),(!ve||Ee[0]&32)&&U!==(U=ue[5].t("Automatic1111")+"")&&j(F,U),(!ve||Ee[0]&32)&&Z!==(Z=ue[5].t("Gemini")+"")&&j(J,Z),(!ve||Ee[0]&32&&ie!==(ie=ue[5].t("Select Engine")))&&u(L,"placeholder",ie),Ee[0]&2&&Ft(L,ue[1].engine);let Ge=se;se=we(ue),se===Ge?~se&&Ue[se].p(ue,Ee):(te&&(ht(),W(Ue[Ge],1,1,()=>{Ue[Ge]=null}),pt()),~se?(te=Ue[se],te?te.p(ue,Ee):(te=Ue[se]=ke[se](ue),te.c()),G(te,1),te.m(oe,null)):te=null),(ee=ue[1])!=null&&ee.enabled?Ae?(Ae.p(ue,Ee),Ee[0]&2&&G(Ae,1)):(Ae=Va(ue),Ae.c(),G(Ae,1),Ae.m(Te.parentNode,Te)):Ae&&(ht(),W(Ae,1,1,()=>{Ae=null}),pt())},i(ue){ve||(G(g.$$.fragment,ue),G(z),G(te),G(Ae),ve=!0)},o(ue){W(g.$$.fragment,ue),W(z),W(te),W(Ae),ve=!1},d(ue){ue&&(c(e),c(fe),c(le),c(x),c(oe),c(ae),c(Te)),he(g),z&&z.d(),~se&&Ue[se].d(),Ae&&Ae.d(ue),q=!1,ml(ne)}}}function Na(l){let e,t,s=l[5].t("Image Prompt Generation")+"",n,i,a,f,o,d;function E(v){l[13](v)}let m={};return l[1].prompt_generation!==void 0&&(m.state=l[1].prompt_generation),f=new vl({props:m}),Ye.push(()=>qe(f,"state",E)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);n=H(b,s),b.forEach(c),i=$(g),a=h(g,"DIV",{class:!0});var w=p(a);
55de(f.$$.fragment,w),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(a,"class","px-1"),u(e,"class","py-1 flex w-full justify-between")},m(v,g){M(v,e,g),r(e,t),r(t,n),r(e,i),r(e,a),_e(f,a,null),d=!0},p(v,g){(!d||g[0]&32)&&s!==(s=v[5].t("Image Prompt Generation")+"")&&j(n,s);const b={};!o&&g[0]&2&&(o=!0,b.state=v[1].prompt_generation,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function Dc(l){let e,t,s=l[5].t("Gemini API Config")+"",n,i,a,f,o,d,E,m,v,g,b;function w(I){l[33](I)}let A={placeholder:l[5].t("API Key")};return l[1].gemini.GEMINI_API_KEY!==void 0&&(A.value=l[1].gemini.GEMINI_API_KEY),E=new _l({props:A}),Ye.push(()=>qe(E,"value",w)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("input"),d=N(),ce(E.$$.fragment),this.h()},l(I){e=h(I,"DIV",{});var k=p(e);t=h(k,"DIV",{class:!0});var T=p(t);n=H(T,s),T.forEach(c),i=$(k),a=h(k,"DIV",{class:!0});var R=p(a);f=h(R,"INPUT",{class:!0,placeholder:!0}),d=$(R),de(E.$$.fragment,R),R.forEach(c),k.forEach(c),this.h()},h(){u(t,"class","mb-1.5 text-sm font-medium"),u(f,"class","flex-1 w-full text-sm bg-transparent outline-none"),u(f,"placeholder",o=l[5].t("API Base URL")),f.required=!0,u(a,"class","flex gap-2 mb-1")},m(I,k){M(I,e,k),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),Q(f,l[1].gemini.GEMINI_API_BASE_URL),r(a,d),_e(E,a,null),v=!0,g||(b=pe(f,"input",l[32]),g=!0)},p(I,k){(!v||k[0]&32)&&s!==(s=I[5].t("Gemini API Config")+"")&&j(n,s),(!v||k[0]&32&&o!==(o=I[5].t("API Base URL")))&&u(f,"placeholder",o),k[0]&2&&f.value!==I[1].gemini.GEMINI_API_BASE_URL&&Q(f,I[1].gemini.GEMINI_API_BASE_URL);const T={};k[0]&32&&(T.placeholder=I[5].t("API Key")),!m&&k[0]&2&&(m=!0,T.value=I[1].gemini.GEMINI_API_KEY,Fe(()=>m=!1)),E.$set(T)},i(I){v||(G(E.$$.fragment,I),v=!0)},o(I){W(E.$$.fragment,I),v=!1},d(I){I&&c(e),he(E),g=!1,b()}}}function Nc(l){let e,t,s=l[5].t("OpenAI API Config")+"",n,i,a,f,o,d,E,m,v,g,b;function w(I){l[31](I)}let A={placeholder:l[5].t("API Key")};return l[1].openai.OPENAI_API_KEY!==void 0&&(A.value=l[1].openai.OPENAI_API_KEY),E=new _l({props:A}),Ye.push(()=>qe(E,"value",w)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("input"),d=N(),ce(E.$$.fragment),this.h()},l(I){e=h(I,"DIV",{});var k=p(e);t=h(k,"DIV",{class:!0});var T=p(t);n=H(T,s),T.forEach(c),i=$(k),a=h(k,"DIV",{class:!0});var R=p(a);f=h(R,"INPUT",{class:!0,placeholder:!0}),d=$(R),de(E.$$.fragment,R),R.forEach(c),k.forEach(c),this.h()},h(){u(t,"class","mb-1.5 text-sm font-medium"),u(f,"class","flex-1 w-full text-sm bg-transparent outline-hidden"),u(f,"placeholder",o=l[5].t("API Base URL")),f.required=!0,u(a,"class","flex gap-2 mb-1")},m(I,k){M(I,e,k),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),Q(f,l[1].openai.OPENAI_API_BASE_URL),r(a,d),_e(E,a,null),v=!0,g||(b=pe(f,"input",l[30]),g=!0)},p(I,k){(!v||k[0]&32)&&s!==(s=I[5].t("OpenAI API Config")+"")&&j(n,s),(!v||k[0]&32&&o!==(o=I[5].t("API Base URL")))&&u(f,"placeholder",o),k[0]&2&&f.value!==I[1].openai.OPENAI_API_BASE_URL&&Q(f,I[1].openai.OPENAI_API_BASE_URL);const T={};k[0]&32&&(T.placeholder=I[5].t("API Key")),!m&&k[0]&2&&(m=!0,T.value=I[1].openai.OPENAI_API_KEY,Fe(()=>m=!1)),E.$set(T)},i(I){v||(G(E.$$.fragment,I),v=!0)},o(I){W(E.$$.fragment,I),v=!1},d(I){I&&c(e),he(E),g=!1,b()}}}function $c(l){let e,t,s=l[5].t("ComfyUI Base URL")+"",n,i,a,f,o,d,E,m,v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z" clip-rule="evenodd"></path></svg>',g,b,w,A=l[5].t("ComfyUI API Key")+"",I,k,T,R,O,y,L,P,D,S=l[5].t("ComfyUI Workflow")+"",K,Y,C,V,U,F,X,Z,J=l[5].t("Click here to upload a workflow.json file.")+"",ie,fe,le,x=l[5].t("Make sure to export a workflow.json file as API format from ComfyUI.")+"",oe,se,te,ae,Te,ve;function q(z){l[24](z)}let ne={placeholder:l[5].t("sk-1234"),required:!1};l[1].comfyui.COMFYUI_API_KEY!==void 0&&(ne.value=l[1].comfyui.COMFYUI_API_KEY),O=new _l({props:ne}),Ye.push(()=>qe(O,"value",q));let Ie=l[1].comfyui.COMFYUI_WORKFLOW&&$a(l),be=l[1].comfyui.COMFYUI_WORKFLOW&&Ra(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),E=N(),m=_("button"),m.innerHTML=v,g=N(),b=_("div"),w=_("div"),I=B(A),k=N(),T=_("div"),R=_("div"),ce(O.$$.fragment),L=N(),P=_("div"),D=_("div"),K=B(S),Y=N(),Ie&&Ie.c(),C=N(),V=_("div"),U=_("div"),F=_("input"),X=N(),Z=_("button"),ie=B(J),fe=N(),le=_("div"),oe=B(x),se=N(),be&&be.c(),te=xt(),this.h()},l(z){e=h(z,"DIV",{class:!0});var ke=p(e);t=h(ke,"DIV",{class:!0});var Ue=p(t);n=H(Ue,s),Ue.forEach(c),i=$(ke),a=h(ke,"DIV",{class:!0});var we=p(a);f=h(we,"DIV",{class:!0});var Ae=p(f);o=h(Ae,"INPUT",{class:!0,placeholder:!0}),Ae.forEach(c),E=$(we),m=h(we,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(m)!=="svelte-6bmm9v"&&(m.innerHTML=v),we.forEach(c),ke.forEach(c),g=$(z),b=h(z,"DIV",{class:!0});var Re=p(b);w=h(Re,"DIV",{class:!0});var ue=p(w);I=H(ue,A),ue.forEach(c),k=$(Re),T=h(Re,"DIV",{class:!0});var Ee=p(T);R=h(Ee,"DIV",{class:!0});var Me=p(R);de(O.$$.fragment,Me),Me.forEach(c),Ee.forEach(c),Re.forEach(c),L=$(z),P=h(z,"DIV",{class:!0});var Ge=p(P);D=h(Ge,"DIV",{class:!0});var ee=p(D);K=H(ee,S),ee.forEach(c),Y=$(Ge),Ie&&Ie.l(Ge),C=$(Ge),V=h(Ge,"DIV",{class:!0});var me=p(V);U=h(me,"DIV",{class:!0});var ge=p(U);F=h(ge,"INPUT",{id:!0,type:!0,accept:!0}),X=$(ge),Z=h(ge,"BUTTON",{class:!0,type:!0});var Ne=p(Z);ie=H(Ne,J),Ne.forEach(c),ge.forEach(c),me.forEach(c),fe=$(Ge),le=h(Ge,"DIV",{class:!0});var ye=p(le);oe=H(ye,x),ye.forEach(c),Ge.forEach(c),se=$(z),be&&be.l(z),te=xt(),this.h()},h(){u(t,"class","mb-2 text-sm font-medium"),u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(o,"placeholder",d=l[5].t("Enter URL (e.g. http://127.0.0.1:7860/)")),u(f,"class","flex-1 mr-2"),u(m,"class","px-2.5 bg-gray-50 hover:bg-gray-100 text-gray-800 dark:bg-gray-850 dar
55k:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),u(m,"type","button"),u(a,"class","flex w-full"),u(e,"class",""),u(w,"class","mb-2 text-sm font-medium"),u(R,"class","flex-1 mr-2"),u(T,"class","flex w-full"),u(b,"class",""),u(D,"class","mb-2 text-sm font-medium"),u(F,"id","upload-comfyui-workflow-input"),F.hidden=!0,u(F,"type","file"),u(F,"accept",".json"),u(Z,"class","w-full text-sm font-medium py-2 bg-transparent hover:bg-gray-100 border border-dashed dark:border-gray-850 dark:hover:bg-gray-850 text-center rounded-xl"),u(Z,"type","button"),u(U,"class","flex-1"),u(V,"class","flex w-full"),u(le,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(P,"class","")},m(z,ke){M(z,e,ke),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[1].comfyui.COMFYUI_BASE_URL),r(a,E),r(a,m),M(z,g,ke),M(z,b,ke),r(b,w),r(w,I),r(b,k),r(b,T),r(T,R),_e(O,R,null),M(z,L,ke),M(z,P,ke),r(P,D),r(D,K),r(P,Y),Ie&&Ie.m(P,null),r(P,C),r(P,V),r(V,U),r(U,F),r(U,X),r(U,Z),r(Z,ie),r(P,fe),r(P,le),r(le,oe),M(z,se,ke),be&&be.m(z,ke),M(z,te,ke),ae=!0,Te||(ve=[pe(o,"input",l[22]),pe(m,"click",l[23]),pe(F,"change",l[26]),pe(Z,"click",l[27])],Te=!0)},p(z,ke){(!ae||ke[0]&32)&&s!==(s=z[5].t("ComfyUI Base URL")+"")&&j(n,s),(!ae||ke[0]&32&&d!==(d=z[5].t("Enter URL (e.g. http://127.0.0.1:7860/)")))&&u(o,"placeholder",d),ke[0]&2&&o.value!==z[1].comfyui.COMFYUI_BASE_URL&&Q(o,z[1].comfyui.COMFYUI_BASE_URL),(!ae||ke[0]&32)&&A!==(A=z[5].t("ComfyUI API Key")+"")&&j(I,A);const Ue={};ke[0]&32&&(Ue.placeholder=z[5].t("sk-1234")),!y&&ke[0]&2&&(y=!0,Ue.value=z[1].comfyui.COMFYUI_API_KEY,Fe(()=>y=!1)),O.$set(Ue),(!ae||ke[0]&32)&&S!==(S=z[5].t("ComfyUI Workflow")+"")&&j(K,S),z[1].comfyui.COMFYUI_WORKFLOW?Ie?Ie.p(z,ke):(Ie=$a(z),Ie.c(),Ie.m(P,C)):Ie&&(Ie.d(1),Ie=null),(!ae||ke[0]&32)&&J!==(J=z[5].t("Click here to upload a workflow.json file.")+"")&&j(ie,J),(!ae||ke[0]&32)&&x!==(x=z[5].t("Make sure to export a workflow.json file as API format from ComfyUI.")+"")&&j(oe,x),z[1].comfyui.COMFYUI_WORKFLOW?be?(be.p(z,ke),ke[0]&2&&G(be,1)):(be=Ra(z),be.c(),G(be,1),be.m(te.parentNode,te)):be&&(ht(),W(be,1,1,()=>{be=null}),pt())},i(z){ae||(G(O.$$.fragment,z),G(be),ae=!0)},o(z){W(O.$$.fragment,z),W(be),ae=!1}
55,d(z){z&&(c(e),c(g),c(b),c(L),c(P),c(se),c(te)),he(O),Ie&&Ie.d(),be&&be.d(z),Te=!1,ml(ve)}}}function Rc(l){let e,t,s=l[5].t("AUTOMATIC1111 Base URL")+"",n,i,a,f,o,d,E,m,v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z" clip-rule="evenodd"></path></svg>',g,b,w=l[5].t("Include `--api` flag when running stable-diffusion-webui")+"",A,I,k,T=l[5].t("(e.g. `sh webui.sh --api`)")+"",R,O,y,L,P=l[5].t("AUTOMATIC1111 Api Auth String")+"",D,S,K,Y,C,V,U=l[5].t("Include `--api-auth` flag when running stable-diffusion-webui")+"",F,X,Z,J=l[5].t("(e.g. `sh webui.sh --api --api-auth username_password`)").replace("_",":")+"",ie,fe,le,x,oe=l[5].t("Set Sampler")+"",se,te,ae,Te,ve,q,ne,Ie,be=l[5].t("Set Scheduler")+"",z,ke,Ue,we,Ae,Re,ue,Ee,Me=l[5].t("Set CFG Scale")+"",Ge,ee,me,ge,Ne,ye,ze,Ce;function Le(re){l[18](re)}let Ke={placeholder:l[5].t("Enter api auth string (e.g. username:password)"),required:!1};return l[1].automatic1111.AUTOMATIC1111_API_AUTH!==void 0&&(Ke.value=l[1].automatic1111.AUTOMATIC1111_API_AUTH),K=new _l({props:Ke}),Ye.push(()=>qe(K,"value",Le)),ve=new Gt({props:{content:l[5].t("Enter Sampler (e.g. Euler a)"),placement:"top-start",$$slots:{default:[Pc]},$$scope:{ctx:l}}}),Ae=new Gt({props:{content:l[5].t("Enter Scheduler (e.g. Karras)"),placement:"top-start",$$slots:{default:[Vc]},$$scope:{ctx:l}}}),Ne=new Gt({props:{content:l[5].t("Enter CFG Scale (e.g. 7.0)"),placement:"top-start",$$slots:{default:[yc]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),E=N(),m=_("button"),m.innerHTML=v,g=N(),b=_("div"),A=B(w),I=N(),k=_("a"),R=B(T),O=N(),y=_("div"),L=_("div"),D=B(P),S=N(),ce(K.$$.fragment),C=N(),V=_("div"),F=B(U),X=N(),Z=_("a"),ie=B(J),fe=N(),le=_("div"),x=_("div"),se=B(oe),te=N(),ae=_("div"),Te=_("div"),ce(ve.$$.fragment),q=N(),ne=_("div"),Ie=_("div"),z=B(be),ke=N(),Ue=_("div"),we=_("div"),ce(Ae.$$.fragment),Re=N(),ue=_("div"),Ee=_("div"),Ge=B(Me),ee=N(),me=_("div"),ge=_("div"),ce(Ne.$$.fragment),this.h()},l(re){e=h(re,"DIV",{});var $e=p(e);t=h($e,"DIV",{class:!0});var ut=p(t);n=H(ut,s),ut.forEach(c),i=$($e),a=h($e,"DIV",{class:!0});var ft=p(a);f=h(ft,"DIV",{class:!0});var ct=p(f);o=h(ct,"INPUT",{class:!0,placeholder:!0}),ct.forEach(c),E=$(ft),m=h(ft,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(m)!=="svelte-6bmm9v"&&(m.innerHTML=v),ft.forEach(c),g=$($e),b=h($e,"DIV",{class:!0});var Be=p(b);A=H(Be,w),I=$(Be),k=h(Be,"A",{class:!0,href:!0,target:!0});var Ve=p(k);R=H(Ve,T),Ve.forEach(c),Be.forEach(c),$e.forEach(c),O=$(re),y=h(re,"DIV",{});var je=p(y);L=h(je,"DIV",{class:!0});var Rt=p(L);D=H(Rt,P),Rt.forEach(c),S=$(je),de(K.$$.fragment,je),C=$(je),V=h(je,"DIV",{class:!0});var Ot=p(V);F=H(Ot,U),X=$(Ot),Z=h(Ot,"A",{class:!0,href:!0,target:!0});var _t=p(Z);ie=H(_t,J),_t.forEach(c),Ot.forEach(c),je.forEach(c),fe=$(re),le=h(re,"DIV",{});var Et=p(le);x=h(Et,"DIV",{class:!0});var At=p(x);se=H(At,oe),At.forEach(c),te=$(Et),ae=h(Et,"DIV",{class:!0});var Tt=p(ae);Te=h(Tt,"DIV",{class:!0});var Ut=p(Te);de(ve.$$.fragment,Ut),Ut.forEach(c),Tt.forEach(c),Et.forEach(c),q=$(re),ne=h(re,"DIV",{});var rt=p(ne);Ie=h(rt,"DIV",{class:!0});var bt=p(Ie);z=H(bt,be),bt.forEach(c),ke=$(rt),Ue=h(rt,"DIV",{class:!0});var lt=p(Ue);we=h(lt,"DIV",{class:!0});var He=p(we);de(Ae.$$.fragment,He),He.forEach(c),lt.forEach(c),rt.forEach(c),Re=$(re),ue=h(re,"DIV",{});var at=p(ue);Ee=h(at,"DIV",{class:!0});var Vt=p(Ee);Ge=H(Vt,Me),Vt.forEach(c),ee=$(at),me=h(at,"DIV",{class:!0});var Qe=p(me);ge=h(Qe,"DIV",{class:!0});var yt=p(ge);de(Ne.$$.fragment,yt),yt.forEach(c),Qe.forEach(c),at.forEach(c),this.h()},h(){u(t,"class","mb-2 text-sm font-medium"),u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(o,"placeholder",d=l[5].t("Enter URL (e.g. http://127.0.0.1:7860/)")),u(f,"class","flex-1 mr-2"),u(m,"class","px-2.5 bg-gray-50 hover:bg-gray-100 text-gray-800 dark:bg-gray-850 dar
55k:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),u(m,"type","button"),u(a,"class","flex w-full"),u(k,"class","text-gray-300 font-medium"),u(k,"href","https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3734"),u(k,"target","_blank"),u(b,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(L,"class","mb-2 text-sm font-medium"),u(Z,"class","text-gray-300 font-medium"),u(Z,"href","https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/13993"),u(Z,"target","_blank"),u(V,"class","mt-2 text-xs text-gray-400 dark:text-gray-500"),u(x,"class","mb-2.5 text-sm font-medium"),u(Te,"class","flex-1 mr-2"),u(ae,"class","flex w-full"),u(Ie,"class","mb-2.5 text-sm font-medium"),u(we,"class","flex-1 mr-2"),u(Ue,"class","flex w-full"),u(Ee,"class","mb-2.5 text-sm font-medium"),u(ge,"class","flex-1 mr-2"),u(me,"class","flex w-full")},m(re,$e){M(re,e,$e),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[1].automatic1111.AUTOMATIC1111_BASE_URL),r(a,E),r(a,m),r(e,g),r(e,b),r(b,A),r(b,I),r(b,k),r(k,R),M(re,O,$e),M(re,y,$e),r(y,L),r(L,D),r(y,S),_e(K,y,null),r(y,C),r(y,V),r(V,F),r(V,X),r(V,Z),r(Z,ie),M(re,fe,$e),M(re,le,$e),r(le,x),r(x,se),r(le,te),r(le,ae),r(ae,Te),_e(ve,Te,null),M(re,q,$e),M(re,ne,$e),r(ne,Ie),r(Ie,z),r(ne,ke),r(ne,Ue),r(Ue,we),_e(Ae,we,null),M(re,Re,$e),M(re,ue,$e),r(ue,Ee),r(Ee,Ge),r(ue,ee),r(ue,me),r(me,ge),_e(Ne,ge,null),ye=!0,ze||(Ce=[pe(o,"input",l[16]),pe(m,"click",l[17])],ze=!0)},p(re,$e){(!ye||$e[0]&32)&&s!==(s=re[5].t("AUTOMATIC1111 Base URL")+"")&&j(n,s),(!ye||$e[0]&32&&d!==(d=re[5].t("Enter URL (e.g. http://127.0.0.1:7860/)")))&&u(o,"placeholder",d),$e[0]&2&&o.value!==re[1].automatic1111.AUTOMATIC1111_BASE_URL&&Q(o,re[1].automatic1111.AUTOMATIC1111_BASE_URL),(!ye||$e[0]&32)&&w!==(w=re[5].t("Include `--api` flag when running stable-diffusion-webui")+"")&&j(A,w),(!ye||$e[0]&32)&&T!==(T=re[5].t("(e.g. `sh webui.sh --api`)")+"")&&j(R,T),(!ye||$e[0]&32)&&P!==(P=re[5].t("AUTOMATIC1111 Api Auth String")+"")&&j(D,P);const ut={};$e[0]&32&&(ut.placeholder=re[5].t("Enter api auth string (e.g. username:password)")),!Y&&$e[0]&2&&(Y=!0,ut.value=re[1].automatic1111.AUTOMATIC1111_API_AUTH,Fe(()=>Y=!1)),K.$set(ut),(!ye||$e[0]&32)&&U!==(U=re[5].t("Include `--api-auth` flag when running stable-diffusion-webui")+"")&&j(F,U),(!ye||$e[0]&32)&&J!==(J=re[5].t("(e.g. `sh webui.sh --api --api-auth username_password`)").replace("_",":")+"")&&j(ie,J),(!ye||$e[0]&32)&&oe!==(oe=re[5].t("Set Sampler")+"")&&j(se,oe);const ft={};$e[0]&32&&(ft.content=re[5].t("Enter Sampler (e.g. Euler a)")),$e[0]&34|$e[1]&8388608&&(ft.$$scope={dirty:$e,ctx:re}),ve.$set(ft),(!ye||$e[0]&32)&&be!==(be=re[5].t("Set Scheduler")+"")&&j(z,be);const ct={};$e[0]&32&&(ct.content=re[5].t("Enter Scheduler (e.g. Karras)")),$e[0]&34|$e[1]&8388608&&(ct.$$scope={dirty:$e,ctx:re}),Ae.$set(ct),(!ye||$e[0]&32)&&Me!==(Me=re[5].t("Set CFG Scale")+"")&&j(Ge,Me);const Be={};$e[0]&32&&(Be.content=re[5].t("Enter CFG Scale (e.g. 7.0)")),$e[0]&34|$e[1]&8388608&&(Be.$$scope={dirty:$e,ctx:re}),Ne.$set(Be)},i(re){ye||(G(K.$$.fragment,re),G(ve.$$.fragment,re),G(Ae.$$.fragment,re),G(Ne.$$.fragment,re),ye=!0)},o(re){W(K.$$.fragment,re),W(ve.$$.fragment,re),W(Ae.$$.fragment,re),W(Ne.$$.fragment,re),ye=!1},d(re){re&&(c(e),c(O),c(y),c(fe),c(le),c(q),c(ne),c(Re),c(ue)),he(K),he(ve),he(Ae),he(Ne),ze=!1,ml(Ce)}}}function $a(l){let e,t,s;return{c(){e=_("textarea"),this.h()},l(n){e=h(n,"TEXTAREA",{class:!0,rows:!0}),p(e).forEach(c),this.h()},h(){u(e,"class","w-full rounded-lg mb-1 py-2 px-4 text-xs bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden disabled:text-gray-600 resize-none"),u(e,"rows","10"),e.required=!0},m(n,i){M(n,e,i),Q(e,l[1].comfyui.COMFYUI_WORKFLOW),t||(s=pe(e,"input",l[25]),t=!0)},p(n,i){i[0]&2&&Q(e,n[1].comfyui.COMFYUI_WORKFLOW)},d(n){n&&c(e),t=!1,s()}}}function Ra(l){let e,t,s=l[5].t("ComfyUI Workflow Nodes")+"",n,i,a,f,o,d=l[5].t("*Prompt node ID(s) are required for image generation")+"",E,m,v=Dt(l[4]),g=[];for(let w=0;w<v.length;w+=1)g[w]=Oa(Ta(l,v,w));const b=w=>W(g[w],1,1,()=>{g[w]=null});return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div");for(let w=0;w<g.length;w+=1)g[w].c();f=N(),o=_("div"),E=B(d),this.h()},l(w){e=h(w,"DIV",{class:!0});var A=p(e);t=h(A,"DIV",{class:!0});var I=p(t);n=H(I,s),I.forEach(c),i=$(A),a=h(A,"DIV",{class:!0});var k=p(a);for(let R=0;R<g.length;R+=1)g[R].l(k);
55k.forEach(c),f=$(A),o=h(A,"DIV",{class:!0});var T=p(o);E=H(T,d),T.forEach(c),A.forEach(c),this.h()},h(){u(t,"class","mb-2 text-sm font-medium"),u(a,"class","text-xs flex flex-col gap-1.5"),u(o,"class","mt-2 text-xs text-right text-gray-400 dark:text-gray-500"),u(e,"class","")},m(w,A){M(w,e,A),r(e,t),r(t,n),r(e,i),r(e,a);for(let I=0;I<g.length;I+=1)g[I]&&g[I].m(a,null);r(e,f),r(e,o),r(o,E),m=!0},p(w,A){if((!m||A[0]&32)&&s!==(s=w[5].t("ComfyUI Workflow Nodes")+"")&&j(n,s),A[0]&16){v=Dt(w[4]);let I;for(I=0;I<v.length;I+=1){const k=Ta(w,v,I);g[I]?(g[I].p(k,A),G(g[I],1)):(g[I]=Oa(k),g[I].c(),G(g[I],1),g[I].m(a,null))}for(ht(),I=v.length;I<g.length;I+=1)b(I);pt()}(!m||A[0]&32)&&d!==(d=w[5].t("*Prompt node ID(s) are required for image generation")+"")&&j(E,d)},i(w){if(!m){for(let A=0;A<v.length;A+=1)G(g[A]);m=!0}},o(w){g=g.filter(Boolean);for(let A=0;A<g.length;A+=1)W(g[A]);m=!1},d(w){w&&c(e),wl(g,w)}}}function Oc(l){let e,t,s;function n(){l[28].call(e,l[52],l[53])}return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","py-1 px-3 w-24 text-xs text-center bg-transparent outline-hidden border-r dark:border-gray-850"),u(e,"placeholder","Key"),e.required=!0},m(i,a){M(i,e,a),Q(e,l[51].key),t||(s=pe(e,"input",n),t=!0)},p(i,a){l=i,a[0]&16&&e.value!==l[51].key&&Q(e,l[51].key)},d(i){i&&c(e),t=!1,s()}}}function Sc(l){let e,t,s;function n(){l[29].call(e,l[52],l[53])}return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full py-1 px-4 rounded-r-lg text-xs bg-transparent outline-hidden"),u(e,"placeholder","Node Ids")},m(i,a){M(i,e,a),Q(e,l[51].node_ids),t||(s=pe(e,"input",n),t=!0)},p(i,a){l=i,a[0]&16&&e.value!==l[51].node_ids&&Q(e,l[51].node_ids)},d(i){i&&c(e),t=!1,s()}}}function Oa(l){let e,t,s,n=l[51].type+"",i,a=l[51].type==="prompt"?"*":"",f,o,d,E,m,v,g,b,w;return E=new Gt({props:{content:"Input Key (e.g. text, unet_name, steps)",$$slots:{default:[Oc]},$$scope:{ctx:l}}}),g=new Gt({props:{content:"Comma separated Node Ids (e.g. 1 or 1,2)",placement:"top-start",$$slots:{default:[Sc]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),f=B(a),o=N(),d=_("div"),ce(E.$$.fragment),m=N(),v=_("div"),ce(g.$$.fragment),b=N(),this.h()},l(A){e=h(A,"DIV",{class:!0});var I=p(e);t=h(I,"DIV",{class:!0});var k=p(t);s=h(k,"DIV",{class:!0});var T=p(s);i=H(T,n),f=H(T,a),T.forEach(c),k.forEach(c),o=$(I),d=h(I,"DIV",{class:!0});var R=p(d);de(E.$$.fragment,R),R.forEach(c),m=$(I),v=h(I,"DIV",{class:!0});var O=p(v);de(g.$$.fragment,O),O.forEach(c),b=$(I),I.forEach(c),this.h()},h(){u(s,"class","capitalize line-clamp-1 font-medium px-3 py-1 w-20 text-center rounded-l-lg bg-green-500/10 text-green-700 dark:text-green-200"),u(t,"class","shrink-0"),u(d,"class",""),u(v,"class","w-full"),u(e,"class","flex w-full items-center border dark:border-gray-850 rounded-lg")},m(A,I){M(A,e,I),r(e,t),r(t,s),r(s,i),r(s,f),r(e,o),r(e,d),_e(E,d,null),r(e,m),r(e,v),_e(g,v,null),r(e,b),w=!0},p(A,I){(!w||I[0]&16)&&n!==(n=A[51].type+"")&&j(i,n),(!w||I[0]&16)&&a!==(a=A[51].type==="prompt"?"*":"")&&j(f,a);const k={};I[0]&16|I[1]&8388608&&(k.$$scope={dirty:I,ctx:A}),E.$set(k);const T={};I[0]&16|I[1]&8388608&&(T.$$scope={dirty:I,ctx:A}),g.$set(T)},i(A){w||(G(E.$$.fragment,A),G(g.$$.fragment,A),w=!0)},o(A){W(E.$$.fragment,A),W(g.$$.fragment,A),w=!1},d(A){A&&c(e),he(E),he(g)}}}function Sa(l){let e,t=l[48]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[48],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function Pc(l){let e,t,s,n,i,a,f=Dt(l[7]??[]),o=[];for(let d=0;d<f.length;d+=1)o[d]=Sa(ka(l,f,d));return{c(){e=_("input"),s=N(),n=_("datalist");for(let d=0;d<o.length;d+=1)o[d].c();this.h()},l(d){e=h(d,"INPUT",{list:!0,class:!0,placeholder:!0}),s=$(d),n=h(d,"DATALIST",{id:!0});var E=p(n);for(let m=0;m<o.length;m+=1)o[m].l(E);E.forEach(c),this.h()},h(){u(e,"list","sampler-list"),u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder",t=l[5].t("Enter Sampler (e.g. Euler a)")),u(n,"id","sampler-list")},m(d,E){M(d,e,E),Q(e,l[1].automatic1111.AUTOMATIC1111_SAMPLER),M(d,s,E),M(d,n,E);for(let m=0;m<o.length;m+=1)o[m]&&o[m].m(n,null);i||(a=pe(e,"input",l[19]),i=!0)},p(d,E){if(E[0]&32&&t!==(t=d[5].t("Enter Sampler (e.g. Euler a)"))&&u(e,"placeholder",t),E[0]&2&&e.value!==d[1].automatic1111.AUTOMATIC1111_SAMPLER&&Q(e,d[1].automatic1111.AUTOMATIC1111_SAMPLER),E[0]&128){f=Dt(d[7]??[]);let m;
55for(m=0;m<f.length;m+=1){const v=ka(d,f,m);o[m]?o[m].p(v,E):(o[m]=Sa(v),o[m].c(),o[m].m(n,null))}for(;m<o.length;m+=1)o[m].d(1);o.length=f.length}},d(d){d&&(c(e),c(s),c(n)),wl(o,d),i=!1,a()}}}function Pa(l){let e,t=l[45]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[45],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function Vc(l){let e,t,s,n,i,a,f=Dt(l[8]??[]),o=[];for(let d=0;d<f.length;d+=1)o[d]=Pa(Aa(l,f,d));return{c(){e=_("input"),s=N(),n=_("datalist");for(let d=0;d<o.length;d+=1)o[d].c();this.h()},l(d){e=h(d,"INPUT",{list:!0,class:!0,placeholder:!0}),s=$(d),n=h(d,"DATALIST",{id:!0});var E=p(n);for(let m=0;m<o.length;m+=1)o[m].l(E);E.forEach(c),this.h()},h(){u(e,"list","scheduler-list"),u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder",t=l[5].t("Enter Scheduler (e.g. Karras)")),u(n,"id","scheduler-list")},m(d,E){M(d,e,E),Q(e,l[1].automatic1111.AUTOMATIC1111_SCHEDULER),M(d,s,E),M(d,n,E);for(let m=0;m<o.length;m+=1)o[m]&&o[m].m(n,null);i||(a=pe(e,"input",l[20]),i=!0)},p(d,E){if(E[0]&32&&t!==(t=d[5].t("Enter Scheduler (e.g. Karras)"))&&u(e,"placeholder",t),E[0]&2&&e.value!==d[1].automatic1111.AUTOMATIC1111_SCHEDULER&&Q(e,d[1].automatic1111.AUTOMATIC1111_SCHEDULER),E[0]&256){f=Dt(d[8]??[]);let m;for(m=0;m<f.length;m+=1){const v=Aa(d,f,m);o[m]?o[m].p(v,E):(o[m]=Pa(v),o[m].c(),o[m].m(n,null))}for(;m<o.length;m+=1)o[m].d(1);o.length=f.length}},d(d){d&&(c(e),c(s),c(n)),wl(o,d),i=!1,a()}}}function yc(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder",t=l[5].t("Enter CFG Scale (e.g. 7.0)"))},m(i,a){M(i,e,a),Q(e,l[1].automatic1111.AUTOMATIC1111_CFG_SCALE),s||(n=pe(e,"input",l[21]),s=!0)},p(i,a){a[0]&32&&t!==(t=i[5].t("Enter CFG Scale (e.g. 7.0)"))&&u(e,"placeholder",t),a[0]&2&&e.value!==i[1].automatic1111.AUTOMATIC1111_CFG_SCALE&&Q(e,i[1].automatic1111.AUTOMATIC1111_CFG_SCALE)},d(i){i&&c(e),s=!1,n()}}}function Va(l){let e,t,s,n,i=l[5].t("Set Default Model")+"",a,f,o,d,E,m,v,g,b,w,A=l[5].t("Set Image Size")+"",I,k,T,R,O,y,L,P,D=l[5].t("Set Steps")+"",S,K,Y,C,V,U;return v=new Gt({props:{content:l[5].t("Enter Model ID"),placement:"top-start",$$slots:{default:[Lc]},$$scope:{ctx:l}}}),O=new Gt({props:{content:l[5].t("Enter Image Size (e.g. 512x512)"),placement:"top-start",$$slots:{default:[Cc]},$$scope:{ctx:l}}}),V=new Gt({props:{content:l[5].t("Enter Number of Steps (e.g. 50)"),placement:"top-start",$$slots:{default:[Uc]},$$scope:{ctx:l}}}),{c(){e=_("hr"),t=N(),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("div"),d=_("div"),E=_("div"),m=_("div"),ce(v.$$.fragment),g=N(),b=_("div"),w=_("div"),I=B(A),k=N(),T=_("div"),R=_("div"),ce(O.$$.fragment),y=N(),L=_("div"),P=_("div"),S=B(D),K=N(),Y=_("div"),C=_("div"),ce(V.$$.fragment),this.h()},l(F){e=h(F,"HR",{class:!0}),t=$(F),s=h(F,"DIV",{});var X=p(s);n=h(X,"DIV",{class:!0});var Z=p(n);a=H(Z,i),Z.forEach(c),f=$(X),o=h(X,"DIV",{class:!0});var J=p(o);d=h(J,"DIV",{class:!0});var ie=p(d);E=h(ie,"DIV",{class:!0});var fe=p(E);m=h(fe,"DIV",{class:!0});var le=p(m);de(v.$$.fragment,le),le.forEach(c),fe.forEach(c),ie.forEach(c),J.forEach(c),X.forEach(c),g=$(F),b=h(F,"DIV",{});var x=p(b);w=h(x,"DIV",{class:!0});var oe=p(w);I=H(oe,A),oe.forEach(c),k=$(x),T=h(x,"DIV",{class:!0});var se=p(T);R=h(se,"DIV",{class:!0});var te=p(R);de(O.$$.fragment,te),te.forEach(c),se.forEach(c),x.forEach(c),y=$(F),L=h(F,"DIV",{});var ae=p(L);P=h(ae,"DIV",{class:!0});var Te=p(P);S=H(Te,D),Te.forEach(c),K=$(ae),Y=h(ae,"DIV",{class:!0});var ve=p(Y);C=h(ve,"DIV",{class:!0});var q=p(C);de(V.$$.fragment,q),q.forEach(c),ve.forEach(c),ae.forEach(c),this.h()},h(){u(e,"class","border-gray-100 dark:border-gray-850"),u(n,"class","mb-2.5 text-sm font-medium"),u(m,"class","flex-1"),u(E,"class","flex w-full"),u(d,"class","flex-1 mr-2"),u(o,"class","flex w-full"),u(w,"class","mb-2.5 text-sm font-medium"),u(R,"class","flex-1 mr-2"),u(T,"class","flex w-full"),u(P,"class","mb-2.5 text-sm font-medium"),u(C,"class","flex-1 mr-2"),u(Y,"class","flex w-full")}
55,m(F,X){M(F,e,X),M(F,t,X),M(F,s,X),r(s,n),r(n,a),r(s,f),r(s,o),r(o,d),r(d,E),r(E,m),_e(v,m,null),M(F,g,X),M(F,b,X),r(b,w),r(w,I),r(b,k),r(b,T),r(T,R),_e(O,R,null),M(F,y,X),M(F,L,X),r(L,P),r(P,S),r(L,K),r(L,Y),r(Y,C),_e(V,C,null),U=!0},p(F,X){(!U||X[0]&32)&&i!==(i=F[5].t("Set Default Model")+"")&&j(a,i);const Z={};X[0]&32&&(Z.content=F[5].t("Enter Model ID")),X[0]&12|X[1]&8388608&&(Z.$$scope={dirty:X,ctx:F}),v.$set(Z),(!U||X[0]&32)&&A!==(A=F[5].t("Set Image Size")+"")&&j(I,A);const J={};X[0]&32&&(J.content=F[5].t("Enter Image Size (e.g. 512x512)")),X[0]&36|X[1]&8388608&&(J.$$scope={dirty:X,ctx:F}),O.$set(J),(!U||X[0]&32)&&D!==(D=F[5].t("Set Steps")+"")&&j(S,D);const ie={};X[0]&32&&(ie.content=F[5].t("Enter Number of Steps (e.g. 50)")),X[0]&36|X[1]&8388608&&(ie.$$scope={dirty:X,ctx:F}),V.$set(ie)},i(F){U||(G(v.$$.fragment,F),G(O.$$.fragment,F),G(V.$$.fragment,F),U=!0)},o(F){W(v.$$.fragment,F),W(O.$$.fragment,F),W(V.$$.fragment,F),U=!1},d(F){F&&(c(e),c(t),c(s),c(g),c(b),c(y),c(L)),he(v),he(O),he(V)}}}function ya(l){let e,t=l[42].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[42].id,Q(e,e.__value)},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&8&&t!==(t=i[42].name+"")&&j(s,t),a[0]&8&&n!==(n=i[42].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function Lc(l){let e,t,s,n,i,a=Dt(l[3]??[]),f=[];for(let o=0;o<a.length;o+=1)f[o]=ya(wa(l,a,o));return{c(){e=_("input"),t=N(),s=_("datalist");for(let o=0;o<f.length;o+=1)f[o].c();this.h()},l(o){e=h(o,"INPUT",{list:!0,class:!0,placeholder:!0}),t=$(o),s=h(o,"DATALIST",{id:!0});var d=p(s);for(let E=0;E<f.length;E+=1)f[E].l(d);d.forEach(c),this.h()},h(){u(e,"list","model-list"),u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder","Select a model"),e.required=!0,u(s,"id","model-list")},m(o,d){M(o,e,d),Q(e,l[2].MODEL),M(o,t,d),M(o,s,d);for(let E=0;E<f.length;E+=1)f[E]&&f[E].m(s,null);n||(i=pe(e,"input",l[34]),n=!0)},p(o,d){if(d[0]&4&&e.value!==o[2].MODEL&&Q(e,o[2].MODEL),d[0]&8){a=Dt(o[3]??[]);let E;for(E=0;E<a.length;E+=1){const m=wa(o,a,E);f[E]?f[E].p(m,d):(f[E]=ya(m),f[E].c(),f[E].m(s,null))}for(;E<f.length;E+=1)f[E].d(1);f.length=a.length}},d(o){o&&(c(e),c(t),c(s)),wl(f,o),n=!1,i()}}}function Cc(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder",t=l[5].t("Enter Image Size (e.g. 512x512)")),e.required=!0},m(i,a){M(i,e,a),Q(e,l[2].IMAGE_SIZE),s||(n=pe(e,"input",l[35]),s=!0)},p(i,a){a[0]&32&&t!==(t=i[5].t("Enter Image Size (e.g. 512x512)"))&&u(e,"placeholder",t),a[0]&4&&e.value!==i[2].IMAGE_SIZE&&Q(e,i[2].IMAGE_SIZE)},d(i){i&&c(e),s=!1,n()}}}function Uc(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(e,"placeholder",t=l[5].t("Enter Number of Steps (e.g. 50)")),e.required=!0},m(i,a){M(i,e,a),Q(e,l[2].IMAGE_STEPS),s||(n=pe(e,"input",l[36]),s=!0)},p(i,a){a[0]&32&&t!==(t=i[5].t("Enter Number of Steps (e.g. 50)"))&&u(e,"placeholder",t),a[0]&4&&e.value!==i[2].IMAGE_STEPS&&Q(e,i[2].IMAGE_STEPS)},d(i){i&&c(e),s=!1,n()}}}function La(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
56								transform-origin: center;
57								animation: spinner_AtaB 0.75s infinite linear;
58							}
59							@keyframes spinner_AtaB {
60								100% {
61									transform: rotate(360deg);
62								}
63							}
64						</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1hiv40m"&&(e.innerHTML=t),this.h()},h(){u(e,"class","ml-2 self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function Mc(l){let e,t,s,n,i,a=l[5].t("Save")+"",f,o,d,E,m,v,g=l[1]&&l[2]&&Da(l),b=l[0]&&La();return{c(){e=_("form"),t=_("div"),g&&g.c(),s=N(),n=_("div"),i=_("button"),f=B(a),o=N(),b&&b.c(),this.h()},l(w){e=h(w,"FORM",{class:!0});var A=p(e);t=h(A,"DIV",{class:!0});var I=p(t);g&&g.l(I),I.forEach(c),s=$(A),n=h(A,"DIV",{class:!0});var k=p(n);i=h(k,"BUTTON",{class:!0,type:!0});var T=p(i);
64f=H(T,a),o=$(T),b&&b.l(T),T.forEach(c),k.forEach(c),A.forEach(c),this.h()},h(){u(t,"class","space-y-3 overflow-y-scroll scrollbar-hidden pr-2"),u(i,"class",d="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(l[0]?" cursor-not-allowed":"")),u(i,"type","submit"),i.disabled=l[0],u(n,"class","flex justify-end pt-3 text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(w,A){M(w,e,A),r(e,t),g&&g.m(t,null),r(e,s),r(e,n),r(n,i),r(i,f),r(i,o),b&&b.m(i,null),E=!0,m||(v=pe(e,"submit",ds(l[37])),m=!0)},p(w,A){w[1]&&w[2]?g?(g.p(w,A),A[0]&6&&G(g,1)):(g=Da(w),g.c(),G(g,1),g.m(t,null)):g&&(ht(),W(g,1,1,()=>{g=null}),pt()),(!E||A[0]&32)&&a!==(a=w[5].t("Save")+"")&&j(f,a),w[0]?b||(b=La(),b.c(),b.m(i,null)):b&&(b.d(1),b=null),(!E||A[0]&1&&d!==(d="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(w[0]?" cursor-not-allowed":"")))&&u(i,"class",d),(!E||A[0]&1)&&(i.disabled=w[0])},i(w){E||(G(g),E=!0)},o(w){W(g),E=!1},d(w){w&&c(e),g&&g.d(),b&&b.d(),m=!1,v()}}}function Bc(l,e,t){let s,n;qt(l,rn,ve=>t(38,s=ve));const i=Ss(),a=Ul("i18n");qt(l,a,ve=>t(5,n=ve));let f=!1,o=null,d=null,E=null,m=["DPM++ 2M","DPM++ SDE","DPM++ 2M SDE","DPM++ 2M SDE Heun","DPM++ 2S a","DPM++ 3M SDE","Euler a","Euler","LMS","Heun","DPM2","DPM2 a","DPM fast","DPM adaptive","Restart","DDIM","DDIM CFG++","PLMS","UniPC"],v=["Automatic","Uniform","Karras","Exponential","Polyexponential","SGM Uniform","KL Optimal","Align Your Steps","Simple","Normal","DDIM","Beta"],g=[{type:"prompt",key:"text",node_ids:""},{type:"model",key:"ckpt_name",node_ids:""},{type:"width",key:"width",node_ids:""},{type:"height",key:"height",node_ids:""},{type:"steps",key:"steps",node_ids:""},{type:"seed",key:"seed",node_ids:""}];const b=async()=>{t(3,E=await Bu(localStorage.token).catch(ve=>(Je.error(`${ve}`),null)))},w=async()=>{const ve=await Ur(localStorage.token,o).catch(q=>(Je.error(`${q}`),null)).catch(q=>(Je.error(`${q}`),null));ve&&t(1,o=ve),o.enabled&&(fs.set(await Xs()),b())},A=ve=>{try{const q=JSON.parse(ve);if(q&&typeof q=="object")return!0}catch{}return!1},I=async()=>{var ve,q;if(t(0,f=!0),(ve=o==null?void 0:o.comfyui)!=null&&ve.COMFYUI_WORKFLOW&&!A(o.comfyui.COMFYUI_WORKFLOW)){Je.error("Invalid JSON format for ComfyUI Workflow."),t(0,f=!1);return}(q=o==null?void 0:o.comfyui)!=null&&q.COMFYUI_WORKFLOW&&t(1,o.comfyui.COMFYUI_WORKFLOW_NODES=g.map(ne=>({type:ne.type,key:ne.key,node_ids:ne.node_ids.trim()===""?[]:ne.node_ids.split(",").map(Ie=>Ie.trim())})),o),await Ur(localStorage.token,o).catch(ne=>(Je.error(`${ne}`),t(0,f=!1),null)),await Hu(localStorage.token,d).catch(ne=>(Je.error(`${ne}`),t(0,f=!1),null)),b(),i("save"),t(0,f=!1)};rs(async()=>{if((s==null?void 0:s.role)==="admin"){const ve=await Uu(localStorage.token).catch(ne=>(Je.error(`${ne}`),null));if(ve&&t(1,o=ve),o.enabled&&b(),o.comfyui.COMFYUI_WORKFLOW)try{t(1,o.comfyui.COMFYUI_WORKFLOW=JSON.stringify(JSON.parse(o.comfyui.COMFYUI_WORKFLOW),null,2),o)}catch(ne){console.log(ne)}t(4,g=g.map(ne=>{const Ie=o.comfyui.COMFYUI_WORKFLOW_NODES.find(be=>be.type===ne.type)??ne;return console.log(Ie),{type:Ie.type,key:Ie.key,node_ids:typeof Ie.node_ids=="str
64ing"?Ie.node_ids:Ie.node_ids.join(",")}}));const q=await Mu(localStorage.token).catch(ne=>(Je.error(`${ne}`),null));q&&t(2,d=q)}});function k(ve){l.$$.not_equal(o.enabled,ve)&&(o.enabled=ve,t(1,o))}const T=ve=>{ve.detail&&(o.engine==="automatic1111"&&o.automatic1111.AUTOMATIC1111_BASE_URL===""?(Je.error(n.t("AUTOMATIC1111 Base URL is required.")),t(1,o.enabled=!1,o)):o.engine==="comfyui"&&o.comfyui.COMFYUI_BASE_URL===""?(Je.error(n.t("ComfyUI Base URL is required.")),t(1,o.enabled=!1,o)):o.engine==="openai"&&o.openai.OPENAI_API_KEY===""?(Je.error(n.t("OpenAI API Key is required.")),t(1,o.enabled=!1,o)):o.engine==="gemini"&&o.gemini.GEMINI_API_KEY===""&&(Je.error(n.t("Gemini API Key is required.")),t(1,o.enabled=!1,o))),w()};function R(ve){l.$$.not_equal(o.prompt_generation,ve)&&(o.prompt_generation=ve,t(1,o))}function O(){o.engine=Ll(this),t(1,o)}const y=async()=>{w()};function L(){o.automatic1111.AUTOMATIC1111_BASE_URL=this.value,t(1,o)}const P=async()=>{await w(),await Mr(localStorage.token).catch(q=>(Je.error(`${q}`),null))&&Je.success(n.t("Server connection verified"))};function D(ve){l.$$.not_equal(o.automatic1111.AUTOMATIC1111_API_AUTH,ve)&&(o.automatic1111.AUTOMATIC1111_API_AUTH=ve,t(1,o))}function S(){o.automatic1111.AUTOMATIC1111_SAMPLER=this.value,t(1,o)}function K(){o.automatic1111.AUTOMATIC1111_SCHEDULER=this.value,t(1,o)}function Y(){o.automatic1111.AUTOMATIC1111_CFG_SCALE=this.value,t(1,o)}function C(){o.comfyui.COMFYUI_BASE_URL=this.value,t(1,o)}const V=async()=>{await w(),await Mr(localStorage.token).catch(q=>(Je.error(`${q}`),null))&&Je.success(n.t("Server connection verified"))};function U(ve){l.$$.not_equal(o.comfyui.COMFYUI_API_KEY,ve)&&(o.comfyui.COMFYUI_API_KEY=ve,t(1,o))}function F(){o.comfyui.COMFYUI_WORKFLOW=this.value,t(1,o)}const X=ve=>{const q=ve.target.files[0],ne=new FileReader;ne.onload=Ie=>{t(1,o.comfyui.COMFYUI_WORKFLOW=Ie.target.result,o),Ie.target.value=null},ne.readAsText(q)},Z=()=>{var ve;(ve=document.getElementById("upload-comfyui-workflow-input"))==null||ve.click()};function J(ve,q){ve[q].key=this.value,t(4,g)}function ie(ve,q){ve[q].node_ids=this.value,t(4,g)}function fe(){o.openai.OPENAI_API_BASE_URL=this.value,t(1,o)}function le(ve){l.$$.not_equal(o.openai.OPENAI_API_KEY,ve)&&(o.openai.OPENAI_API_KEY=ve,t(1,o))}function x(){o.gemini.GEMINI_API_BASE_URL=this.value,t(1,o)}function oe(ve){l.$$.not_equal(o.gemini.GEMINI_API_KEY,ve)&&(o.gemini.GEMINI_API_KEY=ve,t(1,o))}function se(){d.MODEL=this.value,t(2,d)}function te(){d.IMAGE_SIZE=this.value,t(2,d)}function ae(){d.IMAGE_STEPS=this.value,t(2,d)}return[f,o,d,E,g,n,a,m,v,w,I,k,T,R,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,async()=>{I()}]}class Hc extends Sl{constructor(e){super(),Pl(this,e,Bc,Mc,Ol,{},null,[-1,-1])}}function Ca(l,e,t){const s=l.slice();return s[35]=e[t],s[36]=e,s[37]=t,s}function Ua(l,e,t){const s=l.slice();return s[38]=e[t],s[39]=e,s[40]=t,s}function Ma(l,e,t){const s=l.slice();return s[41]=e[t],s}function Ba(l,e,t){const s=l.slice();return s[41]=e[t],s}function Ha(l){var yl;let e,t,s,n,i=l[3].t("Tasks")+"",a,f,o,d,E,m,v=l[3].t("Set Task Model")+"",g,b,w,A,I,k,T,R=l[3].t("Local Models")+"",O,y,L,P,D=l[3].t("Current Model")+"",S,K,Y,C,V,U=l[3].t("External Models")+"",F,X,Z,J,ie=l[3].t("Current Model")+"",fe,le,x,oe,se,te=l[3].t("Title Generation")+"",ae,Te,ve,q,ne,Ie,be,z,ke=l[3].t("Tags Generation")+"",Ue,we,Ae,Re,ue,Ee,Me,Ge,ee=l[3].t("Retrieval Query Generation")+"",me,ge,Ne,ye,ze,Ce,Le,Ke=l[3].t("Web Search Query Generation")+"",re,$e,ut,ft,ct,Be,Ve,je=l[3].t("Query Generation Prompt")+"",Rt,Ot,_t,Et,At,Tt,Ut=l[3].t("Autocomplete Generation")+"",rt,bt,lt,He,at,Vt,Qe,yt=l[3].t("Image Prompt Generation Prompt")+"",wt,vt,It,el,Kt,Lt,ol=l[3].t("Tools Function Calling Prompt")+"",Tl,Se,De,Pe,kt,We,it=l[3].t("UI")+"",Mt,xe,mt,Bt,Ze,nt,Yt,tl=l[3].t("Banners")+"",Qt,al,St,Zt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"></path></svg>',Xt,hl,cl,Jt,zt,Nt,Al,Rl=l[3].t("Save")+"",dl,Pt,gl,ot;w=new Gt({props:{content:l[3].t("A task model is used when performing tasks such as generating titles for chats and web search queries"),$$
64slots:{default:[Gc]},$$scope:{ctx:l}}});let $t=Dt(l[4].filter(za)),dt=[];for(let Oe=0;Oe<$t.length;Oe+=1)dt[Oe]=Ga(Ba(l,$t,Oe));let kl=Dt(l[4]),rl=[];for(let Oe=0;Oe<kl.length;Oe+=1)rl[Oe]=Ka(Ma(l,kl,Oe));function $l(Oe){l[11](Oe)}let ul={};l[0].ENABLE_TITLE_GENERATION!==void 0&&(ul.state=l[0].ENABLE_TITLE_GENERATION),ve=new vl({props:ul}),Ye.push(()=>qe(ve,"state",$l));let pl=l[0].ENABLE_TITLE_GENERATION&&Ya(l);function _s(Oe){l[13](Oe)}let Il={};l[0].ENABLE_TAGS_GENERATION!==void 0&&(Il.state=l[0].ENABLE_TAGS_GENERATION),Ae=new vl({props:Il}),Ye.push(()=>qe(Ae,"state",_s));let ll=l[0].ENABLE_TAGS_GENERATION&&ja(l);function ts(Oe){l[15](Oe)}let Dl={};l[0].ENABLE_RETRIEVAL_QUERY_GENERATION!==void 0&&(Dl.state=l[0].ENABLE_RETRIEVAL_QUERY_GENERATION),Ne=new vl({props:Dl}),Ye.push(()=>qe(Ne,"state",ts));function Nl(Oe){l[16](Oe)}let ls={};l[0].ENABLE_SEARCH_QUERY_GENERATION!==void 0&&(ls.state=l[0].ENABLE_SEARCH_QUERY_GENERATION),ut=new vl({props:ls}),Ye.push(()=>qe(ut,"state",Nl)),_t=new Gt({props:{content:l[3].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[jc]},$$scope:{ctx:l}}}),lt=new Gt({props:{content:l[3].t("Enable autocomplete generation for chat messages"),$$slots:{default:[Wc]},$$scope:{ctx:l}}});let El=l[0].ENABLE_AUTOCOMPLETE_GENERATION&&Wa(l);It=new Gt({props:{content:l[3].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[qc]},$$scope:{ctx:l}}}),De=new Gt({props:{content:l[3].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[Zc]},$$scope:{ctx:l}}});let Vl=Dt(l[2]),il=[];for(let Oe=0;Oe<Vl.length;Oe+=1)il[Oe]=qa(Ua(l,Vl,Oe));const et=Oe=>W(il[Oe],1,1,()=>{il[Oe]=null});let gt=((yl=l[5])==null?void 0:yl.role)==="admin"&&Za(l);return{c(){e=_("form"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("hr"),d=N(),E=_("div"),m=_("div"),g=B(v),b=N(),ce(w.$$.fragment),A=N(),I=_("div"),k=_("div"),T=_("div"),O=B(R),y=N(),L=_("select"),P=_("option"),S=B(D);for(let Oe=0;Oe<dt.length;Oe+=1)dt[Oe].c();Y=N(),C=_("div"),V=_("div"),F=B(U),X=N(),Z=_("select"),J=_("option"),fe=B(ie);for(let Oe=0;Oe<rl.length;Oe+=1)rl[Oe].c();x=N(),oe=_("div"),se=_("div"),ae=B(te),Te=N(),ce(ve.$$.fragment),ne=N(),pl&&pl.c(),Ie=N(),be=_("div"),z=_("div"),Ue=B(ke),we=N(),ce(Ae.$$.fragment),ue=N(),ll&&ll.c(),Ee=N(),Me=_("div"),Ge=_("div"),me=B(ee),ge=N(),ce(Ne.$$.fragment),ze=N(),Ce=_("div"),Le=_("div"),re=B(Ke),$e=N(),ce(ut.$$.fragment),ct=N(),Be=_("div"),Ve=_("div"),Rt=B(je),Ot=N(),ce(_t.$$.fragment),Et=N(),At=_("div"),Tt=_("div"),rt=B(Ut),bt=N(),ce(lt.$$.fragment),He=N(),El&&El.c(),at=N(),Vt=_("div"),Qe=_("div"),wt=B(yt),vt=N(),ce(It.$$.fragment),el=N(),Kt=_("div"),Lt=_("div"),Tl=B(ol),Se=N(),ce(De.$$.fragment),Pe=N(),kt=_("div"),We=_("div"),Mt=B(it),xe=N(),mt=_("hr"),Bt=N(),Ze=_("div"),nt=_("div"),Yt=_("div"),Qt=B(tl),al=N(),St=_("button"),St.innerHTML=Zt,Xt=N(),hl=_("div");for(let Oe=0;Oe<il.length;Oe+=1)il[Oe].c();Jt=N(),gt&&gt.c(),zt=N(),Nt=_("div"),Al=_("button"),dl=B(Rl),this.h()},l(Oe){e=h(Oe,"FORM",{class:!0});var tt=p(e);t=h(tt,"DIV",{class:!0});var fl=p(t);s=h(fl,"DIV",{class:!0});var jt=p(s);n=h(jt,"DIV",{class:!0});var Yl=p(n);a=H(Yl,i),Yl.forEach(c),f=$(jt),o=h(jt,"HR",{class:!0}),d=$(jt),E=h(jt,"DIV",{class:!0});var Ml=p(E);m=h(Ml,"DIV",{class:!0});var Wl=p(m);g=H(Wl,v),Wl.forEach(c),b=$(Ml),de(w.$$.fragment,Ml),Ml.forEach(c),A=$(jt),I=h(jt,"DIV",{class:!0});var Fl=p(I);k=h(Fl,"DIV",{class:!0});var Bl=p(k);T=h(Bl,"DIV",{class:!0});var as=p(T);O=H(as,R),as.forEach(c),y=$(Bl),L=h(Bl,"SELECT",{class:!0,placeholder:!0});var hs=p(L);P=h(hs,"OPTION",{});var ss=p(P);S=H(ss,D),ss.forEach(c);for(let jl=0;jl<dt.length;jl+=1)dt[jl].l(hs);hs.forEach(c),Bl.forEach(c),Y=$(Fl),C=h(Fl,"DIV",{class:!0});var Ct=p(C);V=h(Ct,"DIV",{class:!0});var ql=p(V);F=H(ql,U),ql.forEach(c),X=$(Ct),Z=h(Ct,"SELECT",{class:!0,placeholder:!0});var As=p(Z);J=h(As,"OPTION",{});var cs=p(J);fe=H(cs,ie),cs.forEach(c);for(let jl=0;jl<rl.length;jl+=1)rl[jl].l(As);As.forEach(c),Ct.forEach(c),Fl.forEach(c),x=$(jt),oe=h(jt,"DIV",{class:!0});var gs=p(oe);se=h(gs,"DIV",{class:!0});var Is=p(se);ae=H(Is,te),Is.forEach(c),Te=$(gs),de(ve.$$.fragment,gs),gs.forEac
64h(c),ne=$(jt),pl&&pl.l(jt),Ie=$(jt),be=h(jt,"DIV",{class:!0});var ks=p(be);z=h(ks,"DIV",{class:!0});var Ls=p(z);Ue=H(Ls,ke),Ls.forEach(c),we=$(ks),de(Ae.$$.fragment,ks),ks.forEach(c),ue=$(jt),ll&&ll.l(jt),Ee=$(jt),Me=h(jt,"DIV",{class:!0});var zl=p(Me);Ge=h(zl,"DIV",{class:!0});var Cs=p(Ge);me=H(Cs,ee),Cs.forEach(c),ge=$(zl),de(Ne.$$.fragment,zl),zl.forEach(c),ze=$(jt),Ce=h(jt,"DIV",{class:!0});var Ds=p(Ce);Le=h(Ds,"DIV",{class:!0});var Zl=p(Le);re=H(Zl,Ke),Zl.forEach(c),$e=$(Ds),de(ut.$$.fragment,Ds),Ds.forEach(c),ct=$(jt),Be=h(jt,"DIV",{class:!0});var ps=p(Be);Ve=h(ps,"DIV",{class:!0});var Es=p(Ve);Rt=H(Es,je),Es.forEach(c),Ot=$(ps),de(_t.$$.fragment,ps),ps.forEach(c),Et=$(jt),At=h(jt,"DIV",{class:!0});var ws=p(At);Tt=h(ws,"DIV",{class:!0});var Us=p(Tt);rt=H(Us,Ut),Us.forEach(c),bt=$(ws),de(lt.$$.fragment,ws),ws.forEach(c),He=$(jt),El&&El.l(jt),at=$(jt),Vt=h(jt,"DIV",{class:!0});var Ql=p(Vt);Qe=h(Ql,"DIV",{class:!0});var Ms=p(Qe);wt=H(Ms,yt),Ms.forEach(c),vt=$(Ql),de(It.$$.fragment,Ql),Ql.forEach(c),el=$(jt),Kt=h(jt,"DIV",{class:!0});var Ns=p(Kt);Lt=h(Ns,"DIV",{class:!0});var Hl=p(Lt);Tl=H(Hl,ol),Hl.forEach(c),Se=$(Ns),de(De.$$.fragment,Ns),Ns.forEach(c),jt.forEach(c),Pe=$(fl),kt=h(fl,"DIV",{class:!0});var xl=p(kt);We=h(xl,"DIV",{class:!0});var vs=p(We);Mt=H(vs,it),vs.forEach(c),xe=$(xl),mt=h(xl,"HR",{class:!0}),Bt=$(xl),Ze=h(xl,"DIV",{class:!0});var bs=p(Ze);nt=h(bs,"DIV",{class:!0});var Ts=p(nt);Yt=h(Ts,"DIV",{class:!0});var Bs=p(Yt);Qt=H(Bs,tl),Bs.forEach(c),al=$(Ts),St=h(Ts,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(St)!=="svelte-62xclb"&&(St.innerHTML=Zt),Ts.forEach(c),Xt=$(bs),hl=h(bs,"DIV",{class:!0});var ms=p(hl);for(let jl=0;jl<il.length;jl+=1)il[jl].l(ms);ms.forEach(c),bs.forEach(c),Jt=$(xl),gt&&gt.l(xl),xl.forEach(c),fl.forEach(c),zt=$(tt),Nt=h(tt,"DIV",{class:!0});var is=p(Nt);Al=h(is,"BUTTON",{class:!0,type:!0});var Hs=p(Al);dl=H(Hs,Rl),Hs.forEach(c),is.forEach(c),tt.forEach(c),this.h()},h(){u(n,"class","mb-2.5 text-base font-medium"),u(o,"class","border-gray-100 dark:border-gray-850 my-2"),u(m,"class","text-xs mr-1"),u(E,"class","mb-1 font-medium flex items-center"),u(T,"class","text-xs mb-1"),P.__value="",Q(P,P.__value),P.selected=!0,u(L,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(L,"placeholder",K=l[3].t("Select a model")),l[0].TASK_MODEL===void 0&&Cl(()=>l[9].call(L)),u(k,"class","flex-1"),u(V,"class","text-xs mb-1"),J.__value="",Q(J,J.__value),J.selected=!0,u(Z,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(Z,"placeholder",le=l[3].t("Select a model")),l[0].TASK_MODEL_EXTERNAL===void 0&&Cl(()=>l[10].call(Z)),u(C,"class","flex-1"),u(I,"class","mb-2.5 flex w-full gap-2"),u(se,"class","self-center text-xs font-medium"),u(oe,"class","mb-2.5 flex w-full items-center justify-between"),u(z,"class","self-center text-xs font-medium"),u(be,"class","mb-2.5 flex w-full items-center justify-between"),u(Ge,"class","self-center text-xs font-medium"),u(Me,"class","mb-2.5 flex w-full items-center justify-between"),u(Le,"class","self-center text-xs font-medium"),u(Ce,"class","mb-2.5 flex w-full items-center justify-between"),u(Ve,"class","mb-1 text-xs font-medium"),u(Be,"class","mb-2.5"),u(Tt,"class","self-center text-xs font-medium"),u(At,"class","mb-2.5 flex w-full items-center justify-between"),u(Qe,"class","mb-1 text-xs font-medium"),u(Vt,"class","mb-2.5"),u(Lt,"class","mb-1 text-xs font-medium"),u(Kt,"class","mb-2.5"),u(s,"class","mb-3.5"),u(We,"class","mb-2.5 text-base font-medium"),u(mt,"class","border-gray-100 dark:border-gray-850 my-2"),u(Yt,"class","self-center text-sm font-semibold"),u(St,"class","p-1 px-3 text-xs flex rounded-sm transition"),u(St,"type","button"),u(nt,"class","mb-2.5 flex w-full justify-between"),u(hl,"class","flex flex-col space-y-1"),u(Ze,"class",cl=l[2].length>0?" mb-3":""),u(kt,"class","mb-3.5"),u(t,"class","overflow-y-scroll scrollbar-hidden h-full pr-1.5"),u(Al,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(Al,"type","submit"),u(Nt,"class","flex justify-end text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(Oe,tt){M(Oe,e,tt),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),r(s,d),r(s,E),r(E,m),r(m,g),r(E,b),_e(w,E,null),r(s,A),r(s,I),r(I,k),r(k,T),r(T,O),r(k,y),r(k,L),r(L,P),r(P,S);for(let fl=0;fl<dt.length;fl+=1)dt[fl]&&dt[fl].m(L,null);Ft(L,l[0].TASK_MODEL,!0),r(I,Y),r(I,C),r(C,V),r(V,F),r(C,X),r(C,Z),r(Z,J),r(J,fe);for(let fl=0;fl<rl.length;fl+=1)rl[fl]&&rl[fl].m(Z,null);
64Ft(Z,l[0].TASK_MODEL_EXTERNAL,!0),r(s,x),r(s,oe),r(oe,se),r(se,ae),r(oe,Te),_e(ve,oe,null),r(s,ne),pl&&pl.m(s,null),r(s,Ie),r(s,be),r(be,z),r(z,Ue),r(be,we),_e(Ae,be,null),r(s,ue),ll&&ll.m(s,null),r(s,Ee),r(s,Me),r(Me,Ge),r(Ge,me),r(Me,ge),_e(Ne,Me,null),r(s,ze),r(s,Ce),r(Ce,Le),r(Le,re),r(Ce,$e),_e(ut,Ce,null),r(s,ct),r(s,Be),r(Be,Ve),r(Ve,Rt),r(Be,Ot),_e(_t,Be,null),r(s,Et),r(s,At),r(At,Tt),r(Tt,rt),r(At,bt),_e(lt,At,null),r(s,He),El&&El.m(s,null),r(s,at),r(s,Vt),r(Vt,Qe),r(Qe,wt),r(Vt,vt),_e(It,Vt,null),r(s,el),r(s,Kt),r(Kt,Lt),r(Lt,Tl),r(Kt,Se),_e(De,Kt,null),r(t,Pe),r(t,kt),r(kt,We),r(We,Mt),r(kt,xe),r(kt,mt),r(kt,Bt),r(kt,Ze),r(Ze,nt),r(nt,Yt),r(Yt,Qt),r(nt,al),r(nt,St),r(Ze,Xt),r(Ze,hl);for(let fl=0;fl<il.length;fl+=1)il[fl]&&il[fl].m(hl,null);r(kt,Jt),gt&&gt.m(kt,null),r(e,zt),r(e,Nt),r(Nt,Al),r(Al,dl),Pt=!0,gl||(ot=[pe(L,"change",l[9]),pe(Z,"change",l[10]),pe(St,"click",l[22]),pe(e,"submit",ds(l[32]))],gl=!0)},p(Oe,tt){var ss;(!Pt||tt[0]&8)&&i!==(i=Oe[3].t("Tasks")+"")&&j(a,i),(!Pt||tt[0]&8)&&v!==(v=Oe[3].t("Set Task Model")+"")&&j(g,v);const fl={};if(tt[0]&8&&(fl.content=Oe[3].t("A task model is used when performing tasks such as generating titles for chats and web search queries")),tt[1]&32768&&(fl.$$scope={dirty:tt,ctx:Oe}),w.$set(fl),(!Pt||tt[0]&8)&&R!==(R=Oe[3].t("Local Models")+"")&&j(O,R),(!Pt||tt[0]&8)&&D!==(D=Oe[3].t("Current Model")+"")&&j(S,D),tt[0]&16){$t=Dt(Oe[4].filter(za));let Ct;for(Ct=0;Ct<$t.length;Ct+=1){const ql=Ba(Oe,$t,Ct);dt[Ct]?dt[Ct].p(ql,tt):(dt[Ct]=Ga(ql),dt[Ct].c(),dt[Ct].m(L,null))}for(;Ct<dt.length;Ct+=1)dt[Ct].d(1);dt.length=$t.length}if((!Pt||tt[0]&8&&K!==(K=Oe[3].t("Select a model")))&&u(L,"placeholder",K),tt[0]&17&&Ft(L,Oe[0].TASK_MODEL),(!Pt||tt[0]&8)&&U!==(U=Oe[3].t("External Models")+"")&&j(F,U),(!Pt||tt[0]&8)&&ie!==(ie=Oe[3].t("Current Model")+"")&&j(fe,ie),tt[0]&16){kl=Dt(Oe[4]);let Ct;for(Ct=0;Ct<kl.length;Ct+=1){const ql=Ma(Oe,kl,Ct);rl[Ct]?rl[Ct].p(ql,tt):(rl[Ct]=Ka(ql),rl[Ct].c(),rl[Ct].m(Z,null))}for(;Ct<rl.length;Ct+=1)rl[Ct].d(1);rl.length=kl.length}(!Pt||tt[0]&8&&le!==(le=Oe[3].t("Select a model")))&&u(Z,"placeholder",le),tt[0]&17&&Ft(Z,Oe[0].TASK_MODEL_EXTERNAL),(!Pt||tt[0]&8)&&te!==(te=Oe[3].t("Title Generation")+"")&&j(ae,te);const jt={};!q&&tt[0]&1&&(q=!0,jt.state=Oe[0].ENABLE_TITLE_GENERATION,Fe(()=>q=!1)),ve.$set(jt),Oe[0].ENABLE_TITLE_GENERATION?pl?(pl.p(Oe,tt),tt[0]&1&&G(pl,1)):(pl=Ya(Oe),pl.c(),G(pl,1),pl.m(s,Ie)):pl&&(ht(),W(pl,1,1,()=>{pl=null}),pt()),(!Pt||tt[0]&8)&&ke!==(ke=Oe[3].t("Tags Generation")+"")&&j(Ue,ke);const Yl={};!Re&&tt[0]&1&&(Re=!0,Yl.state=Oe[0].ENABLE_TAGS_GENERATION,Fe(()=>Re=!1)),Ae.$set(Yl),Oe[0].ENABLE_TAGS_GENERATION?ll?(ll.p(Oe,tt),tt[0]&1&&G(ll,1)):(ll=ja(Oe),ll.c(),G(ll,1),ll.m(s,Ee)):ll&&(ht(),W(ll,1,1,()=>{ll=null}),pt()),(!Pt||tt[0]&8)&&ee!==(ee=Oe[3].t("Retrieval Query Generation")+"")&&j(me,ee);const Ml={};!ye&&tt[0]&1&&(ye=!0,Ml.state=Oe[0].ENABLE_RETRIEVAL_QUERY_GENERATION,Fe(()=>ye=!1)),Ne.$set(Ml),(!Pt||tt[0]&8)&&Ke!==(Ke=Oe[3].t("Web Search Query Generation")+"")&&j(re,Ke);const Wl={};!ft&&tt[0]&1&&(ft=!0,Wl.state=Oe[0].ENABLE_SEARCH_QUERY_GENERATION,Fe(()=>ft=!1)),ut.$set(Wl),(!Pt||tt[0]&8)&&je!==(je=Oe[3].t("Query Generation Prompt")+"")&&j(Rt,je);const Fl={};tt[0]&8&&(Fl.content=Oe[3].t("Leave empty to use the default prompt, or enter a custom prompt")),tt[0]&9|tt[1]&32768&&(Fl.$$scope={dirty:tt,ctx:Oe}),_t.$set(Fl),(!Pt||tt[0]&8)&&Ut!==(Ut=Oe[3].t("Autocomplete Generation")+"")&&j(rt,Ut);const Bl={};tt[0]&8&&(Bl.content=Oe[3].t("Enable autocomplete generation for chat messages")),tt[0]&1|tt[1]&32768&&(Bl.$$scope={dirty:tt,ctx:Oe}),lt.$set(Bl),Oe[0].ENABLE_AUTOCOMPLETE_GENERATION?El?(El.p(Oe,tt),tt[0]&1&&G(El,1)):(El=Wa(Oe),El.c(),G(El,1),El.m(s,at)):El&&(ht(),W(El,1,1,()=>{El=null}),pt()),(!Pt||tt[0]&8)&&yt!==(yt=Oe[3].t("Image Prompt Generation Prompt")+"")&&j(wt,yt);const as={};tt[0]&8&&(as.content=Oe[3].t("Leave empty to use the default prompt, or enter a custom prompt")),tt[0]&9|tt[1]&32768&&(as.$$scope={dirty:tt,ctx:Oe}),It.$set(as),(!Pt||tt[0]&8)&&ol!==(ol=Oe[3].t("Tools Function Calling Prompt")+"")&&j(Tl,ol);const hs={};if(tt[0]&8&&(hs.content=Oe[3].t("Leave empty to use the default prompt, or enter a custom prompt")),tt[0]&9|tt[1]&32768&&(hs.$$scope={dirty:tt,ctx:Oe}
64),De.$set(hs),(!Pt||tt[0]&8)&&it!==(it=Oe[3].t("UI")+"")&&j(Mt,it),(!Pt||tt[0]&8)&&tl!==(tl=Oe[3].t("Banners")+"")&&j(Qt,tl),tt[0]&12){Vl=Dt(Oe[2]);let Ct;for(Ct=0;Ct<Vl.length;Ct+=1){const ql=Ua(Oe,Vl,Ct);il[Ct]?(il[Ct].p(ql,tt),G(il[Ct],1)):(il[Ct]=qa(ql),il[Ct].c(),G(il[Ct],1),il[Ct].m(hl,null))}for(ht(),Ct=Vl.length;Ct<il.length;Ct+=1)et(Ct);pt()}(!Pt||tt[0]&4&&cl!==(cl=Oe[2].length>0?" mb-3":""))&&u(Ze,"class",cl),((ss=Oe[5])==null?void 0:ss.role)==="admin"?gt?gt.p(Oe,tt):(gt=Za(Oe),gt.c(),gt.m(kt,null)):gt&&(gt.d(1),gt=null),(!Pt||tt[0]&8)&&Rl!==(Rl=Oe[3].t("Save")+"")&&j(dl,Rl)},i(Oe){if(!Pt){G(w.$$.fragment,Oe),G(ve.$$.fragment,Oe),G(pl),G(Ae.$$.fragment,Oe),G(ll),G(Ne.$$.fragment,Oe),G(ut.$$.fragment,Oe),G(_t.$$.fragment,Oe),G(lt.$$.fragment,Oe),G(El),G(It.$$.fragment,Oe),G(De.$$.fragment,Oe);for(let tt=0;tt<Vl.length;tt+=1)G(il[tt]);Pt=!0}},o(Oe){W(w.$$.fragment,Oe),W(ve.$$.fragment,Oe),W(pl),W(Ae.$$.fragment,Oe),W(ll),W(Ne.$$.fragment,Oe),W(ut.$$.fragment,Oe),W(_t.$$.fragment,Oe),W(lt.$$.fragment,Oe),W(El),W(It.$$.fragment,Oe),W(De.$$.fragment,Oe),il=il.filter(Boolean);for(let tt=0;tt<il.length;tt+=1)W(il[tt]);Pt=!1},d(Oe){Oe&&c(e),he(w),wl(dt,Oe),wl(rl,Oe),he(ve),pl&&pl.d(),he(Ae),ll&&ll.d(),he(Ne),he(ut),he(_t),he(lt),El&&El.d(),he(It),he(De),wl(il,Oe),gt&&gt.d(),gl=!1,ml(ot)}}}function Gc(l){let e,t;return{c(){e=sl("svg"),t=sl("path"),this.h()},l(s){e=nl(s,"svg",{xmlns:!0,fill:!0,viewBox:!0,"stroke-width":!0,stroke:!0,class:!0});var n=p(e);t=nl(n,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}),p(t).forEach(c),n.forEach(c),this.h()},h(){u(t,"stroke-linecap","round"),u(t,"stroke-linejoin","round"),u(t,"d","m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","size-3.5")},m(s,n){M(s,e,n),r(e,t)},p:st,d(s){s&&c(e)}}}function Ga(l){let e,t=l[41].name+"",s,n,i;return{c(){e=_("option"),s=B(t),n=N(),this.h()},l(a){e=h(a,"OPTION",{class:!0});var f=p(e);s=H(f,t),n=$(f),f.forEach(c),this.h()},h(){e.__value=i=l[41].id,Q(e,e.__value),u(e,"class","bg-gray-100 dark:bg-gray-700")},m(a,f){M(a,e,f),r(e,s),r(e,n)},p(a,f){f[0]&16&&t!==(t=a[41].name+"")&&j(s,t),f[0]&16&&i!==(i=a[41].id)&&(e.__value=i,Q(e,e.__value))},d(a){a&&c(e)}}}function Ka(l){let e,t=l[41].name+"",s,n,i;return{c(){e=_("option"),s=B(t),n=N(),this.h()},l(a){e=h(a,"OPTION",{class:!0});var f=p(e);s=H(f,t),n=$(f),f.forEach(c),this.h()},h(){e.__value=i=l[41].id,Q(e,e.__value),u(e,"class","bg-gray-100 dark:bg-gray-700")},m(a,f){M(a,e,f),r(e,s),r(e,n)},p(a,f){f[0]&16&&t!==(t=a[41].name+"")&&j(s,t),f[0]&16&&i!==(i=a[41].id)&&(e.__value=i,Q(e,e.__value))},d(a){a&&c(e)}}}function Ya(l){let e,t,s=l[3].t("Title Generation Prompt")+"",n,i,a,f;return a=new Gt({props:{content:l[3].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[Kc]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),this.h()},l(o){e=h(o,"DIV",{class:!0});var d=p(e);t=h(d,"DIV",{class:!0});var E=p(t);n=H(E,s),E.forEach(c),i=$(d),de(a.$$.fragment,d),d.forEach(c),this.h()},h(){u(t,"class","mb-1 text-xs font-medium"),u(e,"class","mb-2.5")},m(o,d){M(o,e,d),r(e,t),r(t,n),r(e,i),_e(a,e,null),f=!0},p(o,d){(!f||d[0]&8)&&s!==(s=o[3].t("Title Generation Prompt")+"")&&j(n,s);const E={};d[0]&8&&(E.content=o[3].t("Leave empty to use the default prompt, or enter a custom prompt")),d[0]&9|d[1]&32768&&(E.$$scope={dirty:d,ctx:o}),a.$set(E)},i(o){f||(G(a.$$.fragment,o),f=!0)},o(o){W(a.$$.fragment,o),f=!1},d(o){o&&c(e),he(a)}}}function Kc(l){let e,t,s;function n(a){l[12](a)}let i={placeholder:l[3].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[0].TITLE_GENERATION_PROMPT_TEMPLATE!==void 0&&(i.value=l[0].TITLE_GENERATION_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&8&&(o.placeholder=a[3].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&1&&(t=!0,o.value=a[0].TITLE_GENERATION_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function ja(l){let e,t,s=l[3].t("Tags Generation Prompt")+"",n,i,a,f;return a=new Gt({props:{content:l[3].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[Yc]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),this.h()},l(o){e=h(o,"DIV",{class:!0});var d=p(e);t=h(d,"DIV",{class:!0});var E=p(t);
64n=H(E,s),E.forEach(c),i=$(d),de(a.$$.fragment,d),d.forEach(c),this.h()},h(){u(t,"class","mb-1 text-xs font-medium"),u(e,"class","mb-2.5")},m(o,d){M(o,e,d),r(e,t),r(t,n),r(e,i),_e(a,e,null),f=!0},p(o,d){(!f||d[0]&8)&&s!==(s=o[3].t("Tags Generation Prompt")+"")&&j(n,s);const E={};d[0]&8&&(E.content=o[3].t("Leave empty to use the default prompt, or enter a custom prompt")),d[0]&9|d[1]&32768&&(E.$$scope={dirty:d,ctx:o}),a.$set(E)},i(o){f||(G(a.$$.fragment,o),f=!0)},o(o){W(a.$$.fragment,o),f=!1},d(o){o&&c(e),he(a)}}}function Yc(l){let e,t,s;function n(a){l[14](a)}let i={placeholder:l[3].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[0].TAGS_GENERATION_PROMPT_TEMPLATE!==void 0&&(i.value=l[0].TAGS_GENERATION_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&8&&(o.placeholder=a[3].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&1&&(t=!0,o.value=a[0].TAGS_GENERATION_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function jc(l){let e,t,s;function n(a){l[17](a)}let i={placeholder:l[3].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[0].QUERY_GENERATION_PROMPT_TEMPLATE!==void 0&&(i.value=l[0].QUERY_GENERATION_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&8&&(o.placeholder=a[3].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&1&&(t=!0,o.value=a[0].QUERY_GENERATION_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Wc(l){let e,t,s;function n(a){l[18](a)}let i={};return l[0].ENABLE_AUTOCOMPLETE_GENERATION!==void 0&&(i.state=l[0].ENABLE_AUTOCOMPLETE_GENERATION),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f[0]&1&&(t=!0,o.state=a[0].ENABLE_AUTOCOMPLETE_GENERATION,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Wa(l){let e,t,s=l[3].t("Autocomplete Generation Input Max Length")+"",n,i,a,f;return a=new Gt({props:{content:l[3].t("Character limit for autocomplete generation input"),placement:"top-start",$$slots:{default:[Fc]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),this.h()},l(o){e=h(o,"DIV",{class:!0});var d=p(e);t=h(d,"DIV",{class:!0});var E=p(t);n=H(E,s),E.forEach(c),i=$(d),de(a.$$.fragment,d),d.forEach(c),this.h()},h(){u(t,"class","mb-1 text-xs font-medium"),u(e,"class","mb-2.5")},m(o,d){M(o,e,d),r(e,t),r(t,n),r(e,i),_e(a,e,null),f=!0},p(o,d){(!f||d[0]&8)&&s!==(s=o[3].t("Autocomplete Generation Input Max Length")+"")&&j(n,s);const E={};d[0]&8&&(E.content=o[3].t("Character limit for autocomplete generation input")),d[0]&9|d[1]&32768&&(E.$$scope={dirty:d,ctx:o}),a.$set(E)},i(o){f||(G(a.$$.fragment,o),f=!0)},o(o){W(a.$$.fragment,o),f=!1},d(o){o&&c(e),he(a)}}}function Fc(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(e,"class","w-full outline-hidden bg-transparent"),u(e,"placeholder",t=l[3].t("-1 for no limit, or a positive integer for a specific limit"))},m(i,a){M(i,e,a),Q(e,l[0].AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH),s||(n=pe(e,"input",l[19]),s=!0)},p(i,a){a[0]&8&&t!==(t=i[3].t("-1 for no limit, or a positive integer for a specific limit"))&&u(e,"placeholder",t),a[0]&17&&e.value!==i[0].AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH&&Q(e,i[0].AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH)},d(i){i&&c(e),s=!1,n()}}}function qc(l){let e,t,s;function n(a){l[20](a)}let i={placeholder:l[3].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[0].IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE!==void 0&&(i.value=l[0].IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&8&&(o.placeholder=a[3].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&1&&(t=!0,o.value=a[0].IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Zc(l){let e,t,s;function n(a){l[21](a)}let i={placeholder:l[3].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[0].TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE!==void 0&&(i.value=l[0].TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&8&&(o.placeholder=a[3].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&1&&(t=!0,o.value=a[0].TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Fa(l){let e,t=l[3].t("Type")+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{class:!0});var i=p(e);
64s=H(i,t),i.forEach(c),this.h()},h(){e.__value="",Q(e,e.__value),e.selected=!0,e.disabled=!0,u(e,"class","text-gray-900")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8&&t!==(t=n[3].t("Type")+"")&&j(s,t)},d(n){n&&c(e)}}}function Xc(l){let e,t,s;function n(a){l[25](a,l[38])}let i={};return l[38].dismissible!==void 0&&(i.state=l[38].dismissible),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){l=a;const o={};!t&&f[0]&4&&(t=!0,o.state=l[38].dismissible,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function qa(l){let e,t,s,n,i=l[3].t("Info")+"",a,f,o=l[3].t("Warning")+"",d,E,m=l[3].t("Error")+"",v,g,b=l[3].t("Success")+"",w,A,I,k,T,R,O,y,L,P='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',D,S,K,Y,C=l[38].type==""&&Fa(l);function V(){l[23].call(s,l[39],l[40])}function U(){l[24].call(I,l[39],l[40])}O=new Gt({props:{content:l[3].t("Dismissible"),className:"flex h-fit items-center",$$slots:{default:[Xc]},$$scope:{ctx:l}}});function F(){return l[26](l[40])}return{c(){e=_("div"),t=_("div"),s=_("select"),C&&C.c(),n=_("option"),a=B(i),f=_("option"),d=B(o),E=_("option"),v=B(m),g=_("option"),w=B(b),A=N(),I=_("input"),T=N(),R=_("div"),ce(O.$$.fragment),y=N(),L=_("button"),L.innerHTML=P,D=N(),this.h()},l(X){e=h(X,"DIV",{class:!0});var Z=p(e);t=h(Z,"DIV",{class:!0});var J=p(t);s=h(J,"SELECT",{class:!0});var ie=p(s);C&&C.l(ie),n=h(ie,"OPTION",{class:!0});var fe=p(n);a=H(fe,i),fe.forEach(c),f=h(ie,"OPTION",{class:!0});var le=p(f);d=H(le,o),le.forEach(c),E=h(ie,"OPTION",{class:!0});var x=p(E);v=H(x,m),x.forEach(c),g=h(ie,"OPTION",{class:!0});var oe=p(g);w=H(oe,b),oe.forEach(c),ie.forEach(c),A=$(J),I=h(J,"INPUT",{class:!0,placeholder:!0}),T=$(J),R=h(J,"DIV",{class:!0});var se=p(R);de(O.$$.fragment,se),se.forEach(c),J.forEach(c),y=$(Z),L=h(Z,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(L)!=="svelte-xxjdq8"&&(L.innerHTML=P),D=$(Z),Z.forEach(c),this.h()},h(){n.__value="info",Q(n,n.__value),u(n,"class","text-gray-900"),f.__value="warning",Q(f,f.__value),u(f,"class","text-gray-900"),E.__value="error",Q(E,E.__value),u(E,"class","text-gray-900"),g.__value="success",Q(g,g.__value),u(g,"class","text-gray-900"),u(s,"class","w-fit capitalize rounded-xl py-2 px-4 text-xs bg-transparent outline-hidden"),s.required=!0,l[38].type===void 0&&Cl(V),u(I,"class","pr-5 py-1.5 text-xs w-full bg-transparent outline-hidden"),u(I,"placeholder",k=l[3].t("Content")),u(R,"class","relative top-1.5 -left-2"),u(t,"class","flex flex-row flex-1 border rounded-xl border-gray-100 dark:border-gray-850"),u(L,"class","px-2"),u(L,"type","button"),u(e,"class","flex justify-between")},m(X,Z){M(X,e,Z),r(e,t),r(t,s),C&&C.m(s,null),r(s,n),r(n,a),r(s,f),r(f,d),r(s,E),r(E,v),r(s,g),r(g,w),Ft(s,l[38].type,!0),r(t,A),r(t,I),Q(I,l[38].content),r(t,T),r(t,R),_e(O,R,null),r(e,y),r(e,L),r(e,D),S=!0,K||(Y=[pe(s,"change",V),pe(I,"input",U),pe(L,"click",F)],K=!0)},p(X,Z){l=X,l[38].type==""?C?C.p(l,Z):(C=Fa(l),C.c(),C.m(s,n)):C&&(C.d(1),C=null),(!S||Z[0]&8)&&i!==(i=l[3].t("Info")+"")&&j(a,i),(!S||Z[0]&8)&&o!==(o=l[3].t("Warning")+"")&&j(d,o),(!S||Z[0]&8)&&m!==(m=l[3].t("Error")+"")&&j(v,m),(!S||Z[0]&8)&&b!==(b=l[3].t("Success")+"")&&j(w,b),Z[0]&4&&Ft(s,l[38].type),(!S||Z[0]&8&&k!==(k=l[3].t("Content")))&&u(I,"placeholder",k),Z[0]&4&&I.value!==l[38].content&&Q(I,l[38].content);const J={};Z[0]&8&&(J.content=l[3].t("Dismissible")),Z[0]&4|Z[1]&32768&&(J.$$scope={dirty:Z,ctx:l}),O.$set(J)},i(X){S||(G(O.$$.fragment,X),S=!0)},o(X){W(O.$$.fragment,X),S=!1},d(X){X&&c(e),C&&C.d(),he(O),K=!1,ml(Y)}}}function Za(l){let e,t,s,n=l[3].t("Default Prompt Suggestions")+"",i,a,f,o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M10.75 4.75a.75.75 0 00-1.5 0v4.5h-4.5a.75.75 0 000 1.5h4.5v4.5a.75.75 0 001.5 0v-4.5h4.5a.75.75 0 000-1.5h-4.5v-4.5z"></path></svg>',d,E,m,v,g,b=Dt(l[1]),w=[];for(let I=0;I<b.length;I+=1)w[I]=Xa(Ca(l,b,I));let A=l[1].length>0&&Ja(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("button"),f.innerHTML=o,d=N(),E=_("div");for(let I=0;I<w.length;I+=1)w[I].c();m=N(),A&&A.c(),this.h()},l(I){e=h(I,"DIV",{class:!0});var k=p(e);t=h(k,"DIV",{class:!0});var T=p(t);s=h(T,"DIV",{class:!0});var R=p(s);i=H(R,n),R.forEach(c),a=$(T),f=h(T,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(f)!=="svelte-huk1q2"&&(f.innerHTML=o),T.forEach(c),d=$(k),E=h(k,"DIV",{class:!0});var O=p(E);for(let y=0;y<w.length;y+=1)w[y].l(O);
64O.forEach(c),m=$(k),A&&A.l(k),k.forEach(c),this.h()},h(){u(s,"class","self-center text-sm font-semibold"),u(f,"class","p-1 px-3 text-xs flex rounded-sm transition"),u(f,"type","button"),u(t,"class","flex w-full justify-between mb-2"),u(E,"class","grid lg:grid-cols-2 flex-col gap-1.5"),u(e,"class","space-y-3")},m(I,k){M(I,e,k),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(e,d),r(e,E);for(let T=0;T<w.length;T+=1)w[T]&&w[T].m(E,null);r(e,m),A&&A.m(e,null),v||(g=pe(f,"click",l[27]),v=!0)},p(I,k){if(k[0]&8&&n!==(n=I[3].t("Default Prompt Suggestions")+"")&&j(i,n),k[0]&10){b=Dt(I[1]);let T;for(T=0;T<b.length;T+=1){const R=Ca(I,b,T);w[T]?w[T].p(R,k):(w[T]=Xa(R),w[T].c(),w[T].m(E,null))}for(;T<w.length;T+=1)w[T].d(1);w.length=b.length}I[1].length>0?A?A.p(I,k):(A=Ja(I),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},d(I){I&&c(e),wl(w,I),A&&A.d(),v=!1,g()}}}function Xa(l){let e,t,s,n,i,a,f,o,d,E,m,v,g,b='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',w,A,I;function k(){l[28].call(n,l[36],l[37])}function T(){l[29].call(f,l[36],l[37])}function R(){l[30].call(E,l[36],l[37])}function O(){return l[31](l[37])}return{c(){e=_("div"),t=_("div"),s=_("div"),n=_("input"),a=N(),f=_("input"),d=N(),E=_("textarea"),v=N(),g=_("button"),g.innerHTML=b,w=N(),this.h()},l(y){e=h(y,"DIV",{class:!0});var L=p(e);t=h(L,"DIV",{class:!0});var P=p(t);s=h(P,"DIV",{class:!0});var D=p(s);n=h(D,"INPUT",{class:!0,placeholder:!0}),a=$(D),f=h(D,"INPUT",{class:!0,placeholder:!0}),D.forEach(c),d=$(P),E=h(P,"TEXTAREA",{class:!0,placeholder:!0,rows:!0}),p(E).forEach(c),P.forEach(c),v=$(L),g=h(L,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(g)!=="svelte-nde82b"&&(g.innerHTML=b),w=$(L),L.forEach(c),this.h()},h(){u(n,"class","px-3 py-1.5 text-xs w-full bg-transparent outline-hidden border-r border-gray-100 dark:border-gray-850"),u(n,"placeholder",i=l[3].t("Title (e.g. Tell me a fun fact)")),u(f,"class","px-3 py-1.5 text-xs w-full bg-transparent outline-hidden border-r border-gray-100 dark:border-gray-850"),u(f,"placeholder",o=l[3].t("Subtitle (e.g. about the Roman Empire)")),u(s,"class","flex border-b border-gray-100 dark:border-gray-850 w-full"),u(E,"class","px-3 py-1.5 text-xs w-full bg-transparent outline-hidden border-r border-gray-100 dark:border-gray-850 resize-none"),u(E,"placeholder",m=l[3].t("Prompt (e.g. Tell me a fun fact about the Roman Empire)")),u(E,"rows","3"),u(t,"class","flex flex-col flex-1 pl-1"),u(g,"class","px-3"),u(g,"type","button"),u(e,"class","flex border border-gray-100 dark:border-none dark:bg-gray-850 rounded-xl py-1.5")},m(y,L){M(y,e,L),r(e,t),r(t,s),r(s,n),Q(n,l[35].title[0]),r(s,a),r(s,f),Q(f,l[35].title[1]),r(t,d),r(t,E),Q(E,l[35].content),r(e,v),r(e,g),r(e,w),A||(I=[pe(n,"input",k),pe(f,"input",T),pe(E,"input",R),pe(g,"click",O)],A=!0)},p(y,L){l=y,L[0]&8&&i!==(i=l[3].t("Title (e.g. Tell me a fun fact)"))&&u(n,"placeholder",i),L[0]&2&&n.value!==l[35].title[0]&&Q(n,l[35].title[0]),L[0]&8&&o!==(o=l[3].t("Subtitle (e.g. about the Roman Empire)"))&&u(f,"placeholder",o),L[0]&2&&f.value!==l[35].title[1]&&Q(f,l[35].title[1]),L[0]&8&&m!==(m=l[3].t("Prompt (e.g. Tell me a fun fact about the Roman Empire)"))&&u(E,"placeholder",m),L[0]&2&&Q(E,l[35].content)},d(y){y&&c(e),A=!1,ml(I)}}}function Ja(l){let e,t=l[3].t("Adjusting these settings will apply changes universally to all users.")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-xs text-left w-full mt-2")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8&&t!==(t=n[3].t("Adjusting these settings will apply changes universally to all users.")+"")&&j(s,t)},d(n){n&&c(e)}}}function Jc(l){let e,t,s=l[0]&&Ha(l);return{c(){s&&s.c(),e=xt()},l(n){s&&s.l(n),e=xt()},m(n,i){s&&s.m(n,i),M(n,e,i),t=!0},p(n,i){n[0]?s?(s.p(n,i),i[0]&1&&G(s,1)):(s=Ha(n),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(ht(),W(s,1,1,()=>{s=null}),pt())},i(n){t||(G(s),t=!0)},o(n){W(s),t=!1},d(n){n&&c(e),s&&s.d(n)}}}const za=l=>l.owned_by==="ollama";function zc(l,e,t){let s,n,i,a;qt(l,fs,le=>t(33,s=le)),qt(l,Kl,le=>
64t(4,i=le)),qt(l,rn,le=>t(5,a=le));const f=Ss(),o=Ul("i18n");qt(l,o,le=>t(3,n=le));let d={TASK_MODEL:"",TASK_MODEL_EXTERNAL:"",ENABLE_TITLE_GENERATION:!0,TITLE_GENERATION_PROMPT_TEMPLATE:"",IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE:"",ENABLE_AUTOCOMPLETE_GENERATION:!0,AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH:-1,TAGS_GENERATION_PROMPT_TEMPLATE:"",ENABLE_TAGS_GENERATION:!0,ENABLE_SEARCH_QUERY_GENERATION:!0,ENABLE_RETRIEVAL_QUERY_GENERATION:!0,QUERY_GENERATION_PROMPT_TEMPLATE:"",TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE:""},E=[],m=[];const v=async()=>{t(0,d=await iu(localStorage.token,d)),t(1,E=await _u(localStorage.token,E)),await g(),await fs.set(await Xs())};rs(async()=>{t(0,d=await au(localStorage.token)),t(1,E=(s==null?void 0:s.default_prompt_suggestions)??[]),t(2,m=await du(localStorage.token))});const g=async()=>{Zo.set(await hu(localStorage.token,m))};function b(){d.TASK_MODEL=Ll(this),t(0,d)}function w(){d.TASK_MODEL_EXTERNAL=Ll(this),t(0,d)}function A(le){l.$$.not_equal(d.ENABLE_TITLE_GENERATION,le)&&(d.ENABLE_TITLE_GENERATION=le,t(0,d))}function I(le){l.$$.not_equal(d.TITLE_GENERATION_PROMPT_TEMPLATE,le)&&(d.TITLE_GENERATION_PROMPT_TEMPLATE=le,t(0,d))}function k(le){l.$$.not_equal(d.ENABLE_TAGS_GENERATION,le)&&(d.ENABLE_TAGS_GENERATION=le,t(0,d))}function T(le){l.$$.not_equal(d.TAGS_GENERATION_PROMPT_TEMPLATE,le)&&(d.TAGS_GENERATION_PROMPT_TEMPLATE=le,t(0,d))}function R(le){l.$$.not_equal(d.ENABLE_RETRIEVAL_QUERY_GENERATION,le)&&(d.ENABLE_RETRIEVAL_QUERY_GENERATION=le,t(0,d))}function O(le){l.$$.not_equal(d.ENABLE_SEARCH_QUERY_GENERATION,le)&&(d.ENABLE_SEARCH_QUERY_GENERATION=le,t(0,d))}function y(le){l.$$.not_equal(d.QUERY_GENERATION_PROMPT_TEMPLATE,le)&&(d.QUERY_GENERATION_PROMPT_TEMPLATE=le,t(0,d))}function L(le){l.$$.not_equal(d.ENABLE_AUTOCOMPLETE_GENERATION,le)&&(d.ENABLE_AUTOCOMPLETE_GENERATION=le,t(0,d))}function P(){d.AUTOCOMPLETE_GENERATION_INPUT_MAX_LENGTH=this.value,t(0,d)}function D(le){l.$$.not_equal(d.IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE,le)&&(d.IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE=le,t(0,d))}function S(le){l.$$.not_equal(d.TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE,le)&&(d.TOOLS_FUNCTION_CALLING_PROMPT_TEMPLATE=le,t(0,d))}const K=()=>{(m.length===0||m.at(-1).content!=="")&&t(2,m=[...m,{id:Pu(),type:"",title:"",content:"",dismissible:!0,timestamp:Math.floor(Date.now()/1e3)}])};function Y(le,x){le[x].type=Ll(this),t(2,m)}function C(le,x){le[x].content=this.value,t(2,m)}function V(le,x){l.$$.not_equal(x.dismissible,le)&&(x.dismissible=le,t(2,m))}const U=le=>{m.splice(le,1),t(2,m)},F=()=>{(E.length===0||E.at(-1).content!=="")&&t(1,E=[...E,{content:"",title:["",""]}])};function X(le,x){le[x].title[0]=this.value,t(1,E)}function Z(le,x){le[x].title[1]=this.value,t(1,E)}function J(le,x){le[x].content=this.value,t(1,E)}return[d,E,m,n,i,a,f,o,v,b,w,A,I,k,T,R,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,le=>{E.splice(le,1),t(1,E)},()=>{v(),f("save")}]}class Qc extends Sl{constructor(e){super(),Pl(this,e,zc,Jc,Ol,{},null,[-1,-1])}}function Qa(l,e,t){const s=l.slice();return s[11]=e[t],s[13]=t,s}function xc(l){let e,t=l[3].t("No models found")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-gray-500 text-xs text-center py-2")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i&8&&t!==(t=n[3].t("No models found")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function ed(l){let e,t=[],s=new Map,n,i=Dt(l[0]);const a=f=>f[11];for(let f=0;f<i.length;f+=1){let o=Qa(l,i,f),d=a(o);s.set(d,t[f]=xa(d,o))}return{c(){e=_("div");for(let f=0;f<t.length;f+=1)t[f].c();this.h()},l(f){e=h(f,"DIV",{class:!0});var o=p(e);for(let d=0;d<t.length;d+=1)t[d].l(o);o.forEach(c),this.h()},h(){u(e,"class","flex flex-col -translate-x-1")},m(f,o){M(f,e,o);for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(e,null);l[7](e),n=!0},p(f,o){o&5&&(i=Dt(f[0]),ht(),t=Ao(t,o,a,1,f,i,s,e,ko,xa,null,Qa),pt())},i(f){if(!n){for(let o=0;o<i.length;o+=1)G(t[o]);n=!0}},o(f){for(let o=0;o<t.length;o+=1)W(t[o]);n=!1},d(f){f&&c(e);for(let o=0;o<t.length;o+=1)t[o].d();l[7](null)}}}function td(l){let e=l[11]+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n&1&&e!==(e=s[11]+"")&&j(t,e)},d(s){s&&c(t)}}}function ld(l){let e=l[2].find(s).name+"",t;function s(...n){return l[6](l[11],...n)}return{c(){t=B(e)},l(n){t=H(n,e)},m(n,i){M(n,t,i)},p(n,i){l=n,i&5&&e!==(e=l[2].find(s).name+"")&&j(t,e)},d(n){n&&c(t)}}}function sd(l){let e,t,s,n,i,a;function f(...m){return l[5](l[11],...m)}t=new Xu({props:{className:"size-4 cursor-move item-handle"}});function o(m,v){return v&5&&(i=null),i==null&&(i=!!m[2].find(f)),i?ld:td}let d=o(l,-1),E=d(l);return{c(){e=_("div"),ce(t.$$.fragment),s=N(),n=_("div"),E.c(),this.h()},l(m){e=h(m,"DIV",{class:!0});var v=p(e);de(t.$$.fragment,v),s=$(v),n=h(v,"DIV",{class:!0});var g=p(n);E.l(g),g.forEach(c),v.forEach(c),this.h()},h(){u(n,"class","text-sm flex-1 py-1 rounded-lg"),u(e,"class","flex items-center gap-1")},m(m,v){M(m,e,v),_e(t,e,null),r(e,s),r(e,n),E.m(n,null),a=!0},p(m,v){l=m,d===(d=o(l,v))&&E?E.p(l,v):(E.d(1),E=d(l),E&&(E.c(),E.m(n,null)))},i(m){a||(G(t.$$.fragment,m),a=!0)},o(m){W(t.$$.fragment,m),a=!1},d(m){m&&c(e),he(t),E.d()}}}function xa(l,e){let t,s,n,i,a;return s=new Gt({props:{content:e[11],placement:"top-start",$$slots:{default:[sd]},$$scope:{ctx:e}}}),{key:l,first:null,c(){t=_("div"),ce(s.$$.fragment),n=N(),this.h()},l(f){t=h(f,"DIV",{class:!0,id:!0});var o=p(t);de(s.$$.fragment,o),n=$(o),o.forEach(c),this.h()},h(){u(t,"class","flex gap-2 w-full justify-between items-center"),u(t,"id",i="model-item-"+e[11]),this.first=t},m(f,o){M(f,t,o),_e(s,t,null),r(t,n),a=!0},p(f,o){e=f;const d={};o&1&&(d.content=e[11]),o&16389&&(d.$$scope={dirty:o,ctx:e}),s.$set(d),(!a||o&1&&i!==(i="model-item-"+e[11]))&&u(t,"id",i)},i(f){a||(G(s.$$.fragment,f),a=!0)},o(f){W(s.$$.fragment,f),a=!1},d(f){f&&c(t),he(s)}}}
64function nd(l){let e,t,s,n;const i=[ed,xc],a=[];function f(o,d){return o[0].length>0?0:1}return e=f(l),t=a[e]=i[e](l),{c(){t.c(),s=xt()},l(o){t.l(o),s=xt()},m(o,d){a[e].m(o,d),M(o,s,d),n=!0},p(o,[d]){let E=e;e=f(o),e===E?a[e].p(o,d):(ht(),W(a[E],1,1,()=>{a[E]=null}),pt(),t=a[e],t?t.p(o,d):(t=a[e]=i[e](o),t.c()),G(t,1),t.m(s.parentNode,s))},i(o){n||(G(t),n=!0)},o(o){W(t),n=!1},d(o){o&&c(s),a[e].d(o)}}}function rd(l,e,t){let s,n;qt(l,Kl,b=>t(2,s=b));const i=Ul("i18n");qt(l,i,b=>t(3,n=b));let{modelIds:a=[]}=e,f=null,o=null;const d=()=>{const b=Array.from(o.children).map(w=>w.id.replace("model-item-",""));t(0,a=b)},E=()=>{f&&f.destroy(),o&&(f=Zu.create(o,{animation:150,handle:".item-handle",onUpdate:async b=>{d()}}))},m=(b,w)=>w.id===b,v=(b,w)=>w.id===b;function g(b){Ye[b?"unshift":"push"](()=>{o=b,t(1,o)})}return l.$$set=b=>{"modelIds"in b&&t(0,a=b.modelIds)},l.$$.update=()=>{l.$$.dirty&1&&a&&E()},[a,o,s,n,i,m,v,g]}class ad extends Sl{constructor(e){super(),Pl(this,e,rd,nd,Ol,{modelIds:0})}}function ei(l,e,t){const s=l.slice();return s[28]=e[t],s[30]=t,s}function ti(l,e,t){const s=l.slice();return s[31]=e[t],s}function id(l){let e,t,s;return t=new Ps({}),{c(){e=_("div"),ce(t.$$.fragment)},l(n){e=h(n,"DIV",{});var i=p(e);de(t.$$.fragment,i),i.forEach(c)},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function od(l){let e,t,s,n,i,a=l[10].t("Reorder Models")+"",f,o,d,E,m,v,g,b,w,A,I,k,T,R,O=l[10].t("Default Models")+"",y,L,P,D,S,K=l[10].t("Select a model")+"",Y,C,V,U,F,X,Z,J,ie,fe,le=l[10].t("Save")+"",x,oe,se,te,ae,Te;const ve=[fd,ud],q=[];function ne(ue,Ee){return ue[6]==="model"?0:1}d=ne(l),E=q[d]=ve[d](l);function Ie(ue){l[18](ue)}let be={};l[5]!==void 0&&(be.modelIds=l[5]),v=new ad({props:be}),Ye.push(()=>qe(v,"modelIds",Ie));let z=Dt(l[11]),ke=[];for(let ue=0;ue<z.length;ue+=1)ke[ue]=li(ti(l,z,ue));const Ue=[hd,_d],we=[];function Ae(ue,Ee){return ue[4].length>0?0:1}U=Ae(l),F=we[U]=Ue[U](l),J=new Gt({props:{content:l[10].t("This will delete all models including custom models"),$$slots:{default:[pd]},$$scope:{ctx:l}}});let Re=l[8]&&ni();return{c(){e=_("form"),t=_("div"),s=_("div"),n=_("button"),i=_("div"),f=B(a),o=N(),E.c(),m=N(),ce(v.$$.fragment),b=N(),w=_("hr"),A=N(),I=_("div"),k=_("div"),T=_("div"),R=_("div"),y=B(O),L=N(),P=_("div"),D=_("select"),S=_("option"),Y=B(K);for(let ue=0;ue<ke.length;ue+=1)ke[ue].c();V=N(),F.c(),X=N(),Z=_("div"),ce(J.$$.fragment),ie=N(),fe=_("button"),x=B(le),oe=N(),Re&&Re.c(),this.h()},l(ue){e=h(ue,"FORM",{class:!0});var Ee=p(e);t=h(Ee,"DIV",{});var Me=p(t);s=h(Me,"DIV",{class:!0});var Ge=p(s);n=h(Ge,"BUTTON",{class:!0,type:!0});var ee=p(n);i=h(ee,"DIV",{class:!0});var me=p(i);f=H(me,a),me.forEach(c),o=$(ee),E.l(ee),ee.forEach(c),m=$(Ge),de(v.$$.fragment,Ge),Ge.forEach(c),Me.forEach(c),b=$(Ee),w=h(Ee,"HR",{class:!0}),A=$(Ee),I=h(Ee,"DIV",{});var ge=p(I);k=h(ge,"DIV",{class:!0});var Ne=p(k);T=h(Ne,"DIV",{class:!0});var ye=p(T);R=h(ye,"DIV",{class:!0});var ze=p(R);y=H(ze,O),ze.forEach(c),ye.forEach(c),L=$(Ne),P=h(Ne,"DIV",{class:!0});var Ce=p(P);D=h(Ce,"SELECT",{class:!0});var Le=p(D);S=h(Le,"OPTION",{});var Ke=p(S);Y=H(Ke,K),Ke.forEach(c);for(let ut=0;ut<ke.length;ut+=1)ke[ut].l(Le);Le.forEach(c),Ce.forEach(c),V=$(Ne),F.l(Ne),Ne.forEach(c),ge.forEach(c),X=$(Ee),Z=h(Ee,"DIV",{class:!0});var re=p(Z);de(J.$$.fragment,re),ie=$(re),fe=h(re,"BUTTON",{class:!0,type:!0});var $e=p(fe);x=H($e,le),oe=$($e),Re&&Re.l($e),$e.forEach(c),re.forEach(c),Ee.forEach(c),this.h()},h(){u(i,"class","text-xs text-gray-500"),u(n,"class","mb-1 flex gap-2"),u(n,"type","button"),u(s,"class","flex flex-col w-full"),u(w,"class","border-gray-100 dark:border-gray-700/10 my-2.5 w-full"),u(R,"class","text-xs text-gray-500"),u(T,"class","mb-1 flex justify-between"),S.__value="",Q(S,S.__value),u(D,"class",C="w-full py-1 text-sm rounded-lg bg-transparent "+(l[2]?"":"text-gray-500")+" placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"),l[2]===void 0&&Cl(()=>l[19].call(D)),u(P,"class","flex items-center -mr-1"),u(k,"class","flex flex-col w-full"),u(fe,"class",se="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(l[8]?" cursor-not-allowed":"")),u(fe,"type","submit"),fe.disabled=l[8],u(Z,"class","flex justify-between pt-3 text-sm font-medium gap-1.5"),u(e,"class","flex flex-col w-full")},m(ue,Ee){M(ue,e,Ee),r(e,t),r(t,s),r(s,n),r(n,i),r(i,f),r(n,o),q[d].m(n,null),r(s,m),_e(v,s,null),r(e,b),r(e,w),r(e,A),r(e,I),r(I,k),r(k,T),r(T,R),r(R,y),r(k,L),r(k,P),r(P,D),r(D,S),r(S,Y);for(let Me=0;Me<ke.length;Me+=1)ke[Me]&&ke[Me].m(D,null);Ft(D,l[2],!0),r(k,V),we[U].m(k,null),r(e,X),r(e,Z),_e(J,Z,null),r(Z,ie),r(Z,fe),r(fe,x),r(fe,oe),Re&&Re.m(fe,null),te=!0,ae||(Te=[pe(n,"click",l[17]),pe(D,"change",l[19]),pe(e,"submit",ds(l[23]))],ae=!0)},p(ue,Ee){(!te||Ee[0]&1024)&&a!==(a=ue[10].t("Reorder Models")+"")&&j(f,a);let Me=d;d=ne(ue),d===Me?q[d].p(ue,Ee):(ht(),W(q[Me],1,1,()=>{q[Me]=null}),pt(),E=q[d],E?E.p(ue,Ee):(E=q[d]=ve[d](ue),E.c()),G(E,1),E.m(n,null));const Ge={};
64if(!g&&Ee[0]&32&&(g=!0,Ge.modelIds=ue[5],Fe(()=>g=!1)),v.$set(Ge),(!te||Ee[0]&1024)&&O!==(O=ue[10].t("Default Models")+"")&&j(y,O),(!te||Ee[0]&1024)&&K!==(K=ue[10].t("Select a model")+"")&&j(Y,K),Ee[0]&2048){z=Dt(ue[11]);let ge;for(ge=0;ge<z.length;ge+=1){const Ne=ti(ue,z,ge);ke[ge]?ke[ge].p(Ne,Ee):(ke[ge]=li(Ne),ke[ge].c(),ke[ge].m(D,null))}for(;ge<ke.length;ge+=1)ke[ge].d(1);ke.length=z.length}(!te||Ee[0]&2052&&C!==(C="w-full py-1 text-sm rounded-lg bg-transparent "+(ue[2]?"":"text-gray-500")+" placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"))&&u(D,"class",C),Ee[0]&2052&&Ft(D,ue[2]);let ee=U;U=Ae(ue),U===ee?we[U].p(ue,Ee):(ht(),W(we[ee],1,1,()=>{we[ee]=null}),pt(),F=we[U],F?F.p(ue,Ee):(F=we[U]=Ue[U](ue),F.c()),G(F,1),F.m(k,null));const me={};Ee[0]&1024&&(me.content=ue[10].t("This will delete all models including custom models")),Ee[0]&1536|Ee[1]&8&&(me.$$scope={dirty:Ee,ctx:ue}),J.$set(me),(!te||Ee[0]&1024)&&le!==(le=ue[10].t("Save")+"")&&j(x,le),ue[8]?Re||(Re=ni(),Re.c(),Re.m(fe,null)):Re&&(Re.d(1),Re=null),(!te||Ee[0]&256&&se!==(se="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(ue[8]?" cursor-not-allowed":"")))&&u(fe,"class",se),(!te||Ee[0]&256)&&(fe.disabled=ue[8])},i(ue){te||(G(E),G(v.$$.fragment,ue),G(F),G(J.$$.fragment,ue),te=!0)},o(ue){W(E),W(v.$$.fragment,ue),W(F),W(J.$$.fragment,ue),te=!1},d(ue){ue&&c(e),q[d].d(),he(v),wl(ke,ue),we[U].d(),he(J),Re&&Re.d(),ae=!1,ml(Te)}}}function ud(l){let e,t,s;return t=new Do({props:{className:"size-3"}}),{c(){e=_("span"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"SPAN",{class:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","invisible")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function fd(l){let e,t,s,n;const i=[dd,cd],a=[];function f(o,d){return o[7]==="asc"?0:1}return t=f(l),s=a[t]=i[t](l),{c(){e=_("span"),s.c(),this.h()},l(o){e=h(o,"SPAN",{class:!0});var d=p(e);s.l(d),d.forEach(c),this.h()},h(){u(e,"class","font-normal self-center")},m(o,d){M(o,e,d),a[t].m(e,null),n=!0},p(o,d){let E=t;t=f(o),t!==E&&(ht(),W(a[E],1,1,()=>{a[E]=null}),pt(),s=a[t],s||(s=a[t]=i[t](o),s.c()),G(s,1),s.m(e,null))},i(o){n||(G(s),n=!0)},o(o){W(s),n=!1},d(o){o&&c(e),a[t].d()}}}function cd(l){let e,t;return e=new Ju({props:{className:"size-3"}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function dd(l){let e,t;return e=new Do({props:{className:"size-3"}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function li(l){let e,t=l[31].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{class:!0});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[31].id,Q(e,e.__value),u(e,"class","bg-gray-50 dark:bg-gray-700")},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&2048&&t!==(t=i[31].name+"")&&j(s,t),a[0]&2048&&n!==(n=i[31].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function _d(l){let e,t=l[10].t("No models selected")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-gray-500 text-xs text-center py-2")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&1024&&t!==(t=n[10].t("No models selected")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function hd(l){let e,t,s=Dt(l[4]),n=[];for(let a=0;a<s.length;a+=1)n[a]=si(ei(l,s,a));const i=a=>W(n[a],1,1,()=>{n[a]=null});return{c(){e=_("div");for(let a=0;a<n.length;a+=1)n[a].c();this.h()},l(a){e=h(a,"DIV",{class:!0});var f=p(e);for(let o=0;o<n.length;o+=1)n[o].l(f);f.forEach(c),this.h()},h(){u(e,"class","flex flex-col")},m(a,f){M(a,e,f);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null);t=!0},p(a,f){if(f[0]&2064){s=Dt(a[4]);let o;for(o=0;o<s.length;o+=1){const d=ei(a,s,o);n[o]?(n[o].p(d,f),G(n[o],1)):(n[o]=si(d),n[o].c(),G(n[o],1),n[o].m(e,null))}for(ht(),o=s.length;o<n.length;o+=1)i(o);pt()}},i(a){if(!t){for(let f=0;f<s.length;f+=1)G(n[f]);t=!0}}
64,o(a){n=n.filter(Boolean);for(let f=0;f<n.length;f+=1)W(n[f]);t=!1},d(a){a&&c(e),wl(n,a)}}}function si(l){var w;let e,t,s=((w=l[11].find(g))==null?void 0:w.name)+"",n,i,a,f,o,d,E,m,v;function g(...A){return l[20](l[28],...A)}o=new To({props:{strokeWidth:"2",className:"size-3.5"}});function b(){return l[21](l[30])}return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("button"),ce(o.$$.fragment),d=N(),this.h()},l(A){e=h(A,"DIV",{class:!0});var I=p(e);t=h(I,"DIV",{class:!0});var k=p(t);n=H(k,s),k.forEach(c),i=$(I),a=h(I,"DIV",{class:!0});var T=p(a);f=h(T,"BUTTON",{type:!0});var R=p(f);de(o.$$.fragment,R),R.forEach(c),T.forEach(c),d=$(I),I.forEach(c),this.h()},h(){u(t,"class","text-sm flex-1 py-1 rounded-lg"),u(f,"type","button"),u(a,"class","shrink-0"),u(e,"class","flex gap-2 w-full justify-between items-center")},m(A,I){M(A,e,I),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),_e(o,f,null),r(e,d),E=!0,m||(v=pe(f,"click",b),m=!0)},p(A,I){var k;l=A,(!E||I[0]&2064)&&s!==(s=((k=l[11].find(g))==null?void 0:k.name)+"")&&j(n,s)},i(A){E||(G(o.$$.fragment,A),E=!0)},o(A){W(o.$$.fragment,A),E=!1},d(A){A&&c(e),he(o),m=!1,v()}}}function pd(l){let e,t=l[10].t("Reset All Models")+"",s,n,i;return{c(){e=_("button"),s=B(t),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);s=H(f,t),f.forEach(c),this.h()},h(){u(e,"class","px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-950 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center"),u(e,"type","button")},m(a,f){M(a,e,f),r(e,s),n||(i=pe(e,"click",l[22]),n=!0)},p(a,f){f[0]&1024&&t!==(t=a[10].t("Reset All Models")+"")&&j(s,t)},d(a){a&&c(e),n=!1,i()}}}function ni(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
65													transform-origin: center;
66													animation: spinner_AtaB 0.75s infinite linear;
67												}
68												@keyframes spinner_AtaB {
69													100% {
70														transform: rotate(360deg);
71													}
72												}
73											</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-178pk2u"&&(e.innerHTML=t),this.h()},h(){u(e,"class","ml-2 self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function vd(l){let e,t,s,n=l[10].t("Settings")+"",i,a,f,o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',d,E,m,v,g,b,w,A;const I=[od,id],k=[];function T(R,O){return R[3]?0:1}return v=T(l),g=k[v]=I[v](l),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("button"),f.innerHTML=o,d=N(),E=_("div"),m=_("div"),g.c(),this.h()},l(R){e=h(R,"DIV",{});var O=p(e);t=h(O,"DIV",{class:!0});var y=p(t);s=h(y,"DIV",{class:!0});var L=p(s);i=H(L,n),L.forEach(c),a=$(y),f=h(y,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(f)!=="svelte-745w2y"&&(f.innerHTML=o),y.forEach(c),d=$(O),E=h(O,"DIV",{class:!0});var P=p(E);m=h(P,"DIV",{class:!0});var D=p(m);g.l(D),D.forEach(c),P.forEach(c),O.forEach(c),this.h()},h(){u(s,"class","text-lg font-medium self-center font-primary"),u(f,"class","self-center"),u(t,"class","flex justify-between dark:text-gray-100 px-5 pt-4 pb-2"),u(m,"class","flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6"),u(E,"class","flex flex-col md:flex-row w-full px-5 pb-4 md:space-x-4 dark:text-gray-200")},m(R,O){M(R,e,O),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(e,d),r(e,E),r(E,m),k[v].m(m,null),b=!0,w||(A=pe(f,"click",l[16]),w=!0)},p(R,O){(!b||O[0]&1024)&&n!==(n=R[10].t("Settings")+"")&&j(i,n);let y=v;v=T(R),v===y?k[v].p(R,O):(ht(),W(k[y],1,1,()=>{k[y]=null}),pt(),g=k[v],g?g.p(R,O):(g=k[v]=I[v](R),g.c()),G(g,1),g.m(m,null))},i(R){b||(G(g),b=!0)},o(R){W(g),b=!1},d(R){R&&c(e),k[v].d(),w=!1,A()}}}function md(l){let e,t,s,n,i,a;function f(m){l[15](m)}let o={title:l[10].t("Reset All Models"),message:l[10].t("This will delete all models including custom models and cannot be undone."),onConfirm:l[14]};l[9]!==void 0&&(o.show=l[9]),e=new Ys({props:o}),Ye.push(()=>qe(e,"show",f));function d(m){l[24](m)}let E={size:"sm",$$slots:{default:[vd]},$$scope:{ctx:l}};return l[0]!==void 0&&(E.show=l[0]),n=new Bn({props:E}),Ye.push(()=>qe(n,"show",d)),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment)},l(m){de(e.$$.fragment,m),s=$(m),de(n.$$.fragment,m)},m(m,v){_e(e,m,v),M(m,s,v),_e(n,m,v),a=!0},p(m,v){const g={};v[0]&1024&&(g.title=m[10].t("Reset All Models")),v[0]&1024&&(g.message=m[10].t("This will delete all models including custom models and cannot be undone.")),v[0]&1026&&(g.onConfirm=m[14]),!t&&v[0]&512&&(t=!0,g.show=m[9],Fe(()=>t=!1)),e.$set(g);const b={};v[0]&4093|v[1]&8&&(b.$$scope={dirty:v,ctx:m}),!i&&v[0]&1&&(i=!0,b.show=m[0],Fe(()=>i=!1)),n.$set(b)},i(m){a||(G(e.$$.fragment,m),G(n.$$.fragment,m),a=!0)},o(m){W(e.$$.fragment,m),W(n.$$.fragment,m),a=!1},d(m){m&&c(s),he(e,m),he(n,m)}}}function gd(l,e,t){let s,n;qt(l,Kl,V=>t(11,n=V));const i=Ul("i18n");qt(l,i,V=>t(10,s=V)),Ss();let{show:a=!1}=e,{initHandler:f=()=>{}}=e,o=null,d="",E=[],m=[],v="",g="",b=!1,w=!1;const A=()=>{if(d!==""){if(E.includes(d)){t(2,d="");return}
73t(4,E=[...E,d]),t(2,d="")}},I=async()=>{t(3,o=await pu(localStorage.token)),o!=null&&o.DEFAULT_MODELS?t(4,E=o==null?void 0:o.DEFAULT_MODELS.split(",").filter(X=>X)):t(4,E=[]);const V=o.MODEL_ORDER_LIST||[],U=n.map(X=>X.id),F=new Set(V);t(5,m=[...V.filter(X=>F.has(X)&&U.includes(X)),...U.filter(X=>!F.has(X)).sort((X,Z)=>X.localeCompare(Z))]),t(6,v=""),t(7,g="")},k=async()=>{t(8,b=!0),await vu(localStorage.token,{DEFAULT_MODELS:E.join(","),MODEL_ORDER_LIST:m})?(Je.success(s.t("Models configuration saved successfully")),f(),t(0,a=!1)):Je.error(s.t("Failed to save models configuration")),t(8,b=!1)};rs(async()=>{I()});const T=async()=>{Ku(localStorage.token)&&(Je.success(s.t("All models deleted successfully")),f())};function R(V){w=V,t(9,w)}const O=()=>{t(0,a=!1)},y=()=>{t(6,v="model"),g==="asc"?t(7,g="desc"):t(7,g="asc"),t(5,m=m.filter(V=>V!=="").sort((V,U)=>{var Z,J;const F=((Z=n.find(ie=>ie.id===V))==null?void 0:Z.name)||V,X=((J=n.find(ie=>ie.id===U))==null?void 0:J.name)||U;return g==="desc"?F.localeCompare(X):X.localeCompare(F)}))};function L(V){m=V,t(5,m)}function P(){d=Ll(this),t(2,d)}const D=(V,U)=>U.id===V,S=V=>{t(4,E=E.filter((U,F)=>F!==V))},K=()=>{t(9,w=!0)},Y=()=>{k()};function C(V){a=V,t(0,a)}return l.$$set=V=>{"show"in V&&t(0,a=V.show),"initHandler"in V&&t(1,f=V.initHandler)},l.$$.update=()=>{l.$$.dirty[0]&1&&a&&I(),l.$$.dirty[0]&4&&d&&A()},[a,f,d,o,E,m,v,g,b,w,s,n,i,k,T,R,O,y,L,P,D,S,K,Y,C]}class Ed extends Sl{constructor(e){super(),Pl(this,e,gd,md,Ol,{show:0,initHandler:1},null,[-1,-1])}}function ri(l,e,t){const s=l.slice();return s[57]=e[t],s}function ai(l,e,t){const s=l.slice();return s[57]=e[t],s}function bd(l){let e,t,s;return t=new Ps({}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","flex justify-center items-center w-full h-full py-3")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function Id(l){let e,t=l[23].t("Failed to fetch models")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","flex justify-center items-center w-full h-full text-xs py-3")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8388608&&t!==(t=n[23].t("Failed to fetch models")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function wd(l){let e,t,s,n,i,a,f=l[23].t("Pull a model from Ollama.com")+"",o,d,E,m,v,g,b,w,A,I,k,T,R,O=l[23].t("To access the available model names for downloading,")+"",y,L,P,D=l[23].t("click here.")+"",S,K,Y,C=Object.keys(l[22]).length>0,V,U,F,X=l[23].t("Delete a model")+"",Z,J,ie,fe,le,x,oe,se,te,ae='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.285a1.5 1.5 0 0 0 1.493-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25Zm2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75h-1.5ZM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6Zm3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711Z" clip-rule="evenodd"></path></svg>',Te,ve,q,ne=l[23].t("Create a model")+"",Ie,be,z,ke,Ue,we,Ae,Re,ue,Ee,Me,Ge,ee,me,ge,Ne,ye,ze,Ce,Le=l[23].t("Experimental")+"",Ke,re,$e,ut=(l[6]?l[23].t("Hide"):l[23].t("Show"))+"",ft,ct,Be,Ve,je;m=new Gt({props:{content:"Update All Models",placement:"top",$$slots:{default:[Td]},$$scope:{ctx:l}}});function Rt(He,at){return He[7]?kd:Ad}let Ot=Rt(l),_t=Ot(l),Et=l[4]&&ii(l),At=C&&oi(l),Tt=!l[21]&&di(l),Ut=Dt(l[3]),rt=[];for(let He=0;He<Ut.length;He+=1)rt[He]=_i(ri(l,Ut,He));let bt=l[12]!==""&&hi(l),lt=l[6]&&vi(l);return{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),i=_("div"),a=_("div"),o=B(f),d=N(),E=_("div"),ce(m.$$.fragment),v=N(),g=_("div"),b=_("div"),w=_("input"),I=N(),k=_("button"),_t.c(),T=N(),R=_("div"),y=B(O),L=N(),P=_("a"),S=B(D),K=N(),Et&&Et.c(),Y=N(),At&&At.c(),V=N(),U=_("div"),F=_("div"),Z=B(X),J=N(),ie=_("div"),fe=_("div"),le=_("select"),Tt&&Tt.c(),x=xt();for(let He=0;He<rt.length;He+=1)rt[He].c();se=N(),te=_("button"),te.innerHTML=ae,Te=N(),ve=_("div"),q=_("div"),Ie=B(ne),be=N(),z=_("div"),ke=_("div"),Ue=_("input"),Ae=N(),Re=_("textarea"),ue=N(),Ee=_("div"),Me=_("button"),Ge=sl("svg"),ee=sl("path"),me=sl("path"),ge=N(),bt&&bt.c(),Ne=N(),ye=_("div"),ze=_("div"),Ce=_("div"),Ke=B(Le),re=N(),$e=_("button"),ft=B(ut),ct=N(),lt&&lt.c(),this.h()},l(He){e=h(He,"DIV",{class:!0});var at=p(e);t=h(at,"DIV",{});var Vt=p(t);s=h(Vt,"DIV",{class:!0});var Qe=p(s);n=h(Qe,"DIV",{});var yt=p(n);i=h(yt,"DIV",{class:!0});var wt=p(i);a=h(wt,"DIV",{});var vt=p(a);o=H(vt,f),vt.forEach(c),d=$(wt),E=h(wt,"DIV",{});var It=p(E);de(m.$$.fragment,It),It.forEach(c),wt.forEach(c),v=$(yt),g=h(yt,"DIV",{class:!0});var el=p(g);b=h(el,"DIV",{class:!0});var Kt=p(b);w=h(Kt,"INPUT",{class:!0,placeholder:!0}),Kt.forEach(c),I=$(el),k=h(el,"BUTTON",{class:!0});var Lt=p(k);_t.l(Lt),Lt.forEach(c),el.forEach(c),T=$(yt),R=h(yt,"DIV",{class:!0});var ol=p(R);y=H(ol,O),L=$(ol),P=h(ol,"A",{class:!0,href:!0,target:!0});var Tl=p(P);S=H(Tl,D),Tl.forEach(c),ol.forEach(c),K=$(yt),Et&&Et.l(yt),Y=$(yt),At&&At.l(yt),yt.forEach(c),V=$(Qe),U=h(Qe,"DIV",{});var Se=p(U);F=h(Se,"DIV",{class:!0});var De=p(F);Z=H(De,X),De.forEach(c),J=$(Se),ie=h(Se,"DIV",{class:!0});var Pe=p(ie);fe=h(Pe,"DIV",{class:!0});var kt=p(fe);le=h(kt,"SELECT",{class:!0,placeholder:!0});var We=p(le);Tt&&Tt.l(We),x=xt();for(let St=0;St<rt.length;St+=1)rt[St].l(We);We.forEach(c),kt.forEach(c),se=$(Pe),te=h(Pe,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(te)!=="svelte-1c45g2d"&&(te.innerHTML=ae),Pe.forEach(c),Se.forEach(c),Te=$(Qe),ve=h(Qe,"DIV",{});var it=p(ve);q=h(it,"DIV",{class:!0});var Mt=p(q);Ie=H(Mt,ne),Mt.forEach(c),be=$(it),z=h(it,"DIV",{class:!0});var xe=p(z);ke=h(xe,"DIV",{class:!0});var mt=p(ke);Ue=h(mt,"INPUT",{class:!0,placeholder:!0}
73),Ae=$(mt),Re=h(mt,"TEXTAREA",{class:!0,rows:!0,placeholder:!0}),p(Re).forEach(c),mt.forEach(c),ue=$(xe),Ee=h(xe,"DIV",{class:!0});var Bt=p(Ee);Me=h(Bt,"BUTTON",{class:!0});var Ze=p(Me);Ge=nl(Ze,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var nt=p(Ge);ee=nl(nt,"path",{d:!0}),p(ee).forEach(c),me=nl(nt,"path",{d:!0}),p(me).forEach(c),nt.forEach(c),Ze.forEach(c),Bt.forEach(c),xe.forEach(c),ge=$(it),bt&&bt.l(it),it.forEach(c),Ne=$(Qe),ye=h(Qe,"DIV",{class:!0});var Yt=p(ye);ze=h(Yt,"DIV",{class:!0});var tl=p(ze);Ce=h(tl,"DIV",{class:!0});var Qt=p(Ce);Ke=H(Qt,Le),Qt.forEach(c),re=$(tl),$e=h(tl,"BUTTON",{class:!0,type:!0});var al=p($e);ft=H(al,ut),al.forEach(c),tl.forEach(c),Yt.forEach(c),ct=$(Qe),lt&&lt.l(Qe),Qe.forEach(c),Vt.forEach(c),at.forEach(c),this.h()},h(){u(i,"class","mb-2 text-sm font-medium flex items-center gap-1.5"),u(w,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(w,"placeholder",A=l[23].t("Enter model tag (e.g. {{modelTag}})",{modelTag:"mistral:7b"})),u(b,"class","flex-1 mr-2"),u(k,"class","px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),k.disabled=l[7],u(g,"class","flex w-full"),u(P,"class","text-gray-500 dark:text-gray-300 font-medium underline"),u(P,"href","https://ollama.com/library"),u(P,"target","_blank"),u(R,"class","mt-2 mb-1 text-xs text-gray-400 dark:text-gray-500"),u(F,"class","mb-2 text-sm font-medium"),u(le,"class","w-full py-2 px-4 text-sm outline-hidden bg-transparent"),u(le,"placeholder",oe=l[23].t("Select a model")),l[21]===void 0&&Cl(()=>l[38].call(le)),u(fe,"class","flex-1 mr-2 pr-1.5 rounded-lg bg-gray-50 dark:text-gray-300 dark:bg-gray-850"),u(te,"class","px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"),u(ie,"class","flex w-full"),u(q,"class","mb-2 text-sm font-medium"),u(Ue,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(Ue,"placeholder",we=l[23].t("Enter model tag (e.g. {{modelTag}})",{modelTag:"my-modelfile"})),Ue.disabled=l[9],u(Re,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-100 dark:bg-gray-850 outline-hidden resize-none scrollbar-hidden"),u(Re,"rows","6"),u(Re,"placeholder",'e.g. {"model": "my-modelfile", "from": "ollama:7b"})'),Re.disabled=l[9],u(ke,"class","flex-1 mr-2 flex flex-col gap-2"),u(ee,"d","M7.25 10.25a.75.75 0 0 0 1.5 0V4.56l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06l2.22-2.22v5.69Z"),u(me,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(Ge,"xmlns","http://www.w3.org/2000/svg"),u(Ge,"viewBox","0 0 16 16"),u(Ge,"fill","currentColor"),u(Ge,"class","size-4"),u(Me,"class","px-2.5 py-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition disabled:cursor-not-allowed"),Me.disabled=l[9],u(Ee,"class","flex self-start"),u(z,"class","flex w-full"),u(Ce,"class","text-sm font-medium"),u($e,"class","text-xs font-medium text-gray-500"),u($e,"type","button"),u(ze,"class","flex justify-between items-center text-xs"),u(ye,"class","pt-1"),u(s,"class","space-y-2"),u(e,"class","flex flex-col w-full")},m(He,at){M(He,e,at),r(e,t),r(t,s),r(s,n),r(n,i),r(i,a),r(a,o),r(i,d),r(i,E),_e(m,E,null),r(n,v),r(n,g),r(g,b),r(b,w),Q(w,l[8]),r(g,I),r(g,k),_t.m(k,null),r(n,T),r(n,R),r(R,y),r(R,L),r(R,P),r(P,S),r(n,K),Et&&Et.m(n,null),r(n,Y),At&&At.m(n,null),r(s,V),r(s,U),r(U,F),r(F,Z),r(U,J),r(U,ie),r(ie,fe),r(fe,le),Tt&&Tt.m(le,null),r(le,x);for(let Vt=0;Vt<rt.length;Vt+=1)rt[Vt]&&rt[Vt].m(le,null);Ft(le,l[21],!0),r(ie,se),r(ie,te),r(s,Te),r(s,ve),r(ve,q),r(q,Ie),r(ve,be),r(ve,z),r(z,ke),r(ke,Ue),Q(Ue,l[10]),r(ke,Ae),r(ke,Re),Q(Re,l[11]),r(z,ue),r(z,Ee),r(Ee,Me),r(Me,Ge),r(Ge,ee),r(Ge,me),r(ve,ge),bt&&bt.m(ve,null),r(s,Ne),r(s,ye),r(ye,ze),r(ze,Ce),r(Ce,Ke),r(ze,re),r(ze,$e),r($e,ft),r(s,ct),lt&&lt.m(s,null),Be=!0,Ve||(je=[pe(w,"input",l[35]),pe(k,"click",l[36]),pe(le,"change",l[38]),pe(te,"click",l[39]),pe(Ue,"input",l[40]),pe(Re,"
73input",l[41]),pe(Me,"click",l[42]),pe($e,"click",l[43])],Ve=!0)},p(He,at){(!Be||at[0]&8388608)&&f!==(f=He[23].t("Pull a model from Ollama.com")+"")&&j(o,f);const Vt={};if(at[2]&1&&(Vt.$$scope={dirty:at,ctx:He}),m.$set(Vt),(!Be||at[0]&8388608&&A!==(A=He[23].t("Enter model tag (e.g. {{modelTag}})",{modelTag:"mistral:7b"})))&&u(w,"placeholder",A),at[0]&256&&w.value!==He[8]&&Q(w,He[8]),Ot!==(Ot=Rt(He))&&(_t.d(1),_t=Ot(He),_t&&(_t.c(),_t.m(k,null))),(!Be||at[0]&128)&&(k.disabled=He[7]),(!Be||at[0]&8388608)&&O!==(O=He[23].t("To access the available model names for downloading,")+"")&&j(y,O),(!Be||at[0]&8388608)&&D!==(D=He[23].t("click here.")+"")&&j(S,D),He[4]?Et?Et.p(He,at):(Et=ii(He),Et.c(),Et.m(n,Y)):Et&&(Et.d(1),Et=null),at[0]&4194304&&(C=Object.keys(He[22]).length>0),C?At?(At.p(He,at),at[0]&4194304&&G(At,1)):(At=oi(He),At.c(),G(At,1),At.m(n,null)):At&&(ht(),W(At,1,1,()=>{At=null}),pt()),(!Be||at[0]&8388608)&&X!==(X=He[23].t("Delete a model")+"")&&j(Z,X),He[21]?Tt&&(Tt.d(1),Tt=null):Tt?Tt.p(He,at):(Tt=di(He),Tt.c(),Tt.m(le,x)),at[0]&8){Ut=Dt(He[3]);let Qe;for(Qe=0;Qe<Ut.length;Qe+=1){const yt=ri(He,Ut,Qe);rt[Qe]?rt[Qe].p(yt,at):(rt[Qe]=_i(yt),rt[Qe].c(),rt[Qe].m(le,null))}for(;Qe<rt.length;Qe+=1)rt[Qe].d(1);rt.length=Ut.length}(!Be||at[0]&8388608&&oe!==(oe=He[23].t("Select a model")))&&u(le,"placeholder",oe),at[0]&2097160&&Ft(le,He[21]),(!Be||at[0]&8388608)&&ne!==(ne=He[23].t("Create a model")+"")&&j(Ie,ne),(!Be||at[0]&8388608&&we!==(we=He[23].t("Enter model tag (e.g. {{modelTag}})",{modelTag:"my-modelfile"})))&&u(Ue,"placeholder",we),(!Be||at[0]&512)&&(Ue.disabled=He[9]),at[0]&1024&&Ue.value!==He[10]&&Q(Ue,He[10]),(!Be||at[0]&512)&&(Re.disabled=He[9]),at[0]&2048&&Q(Re,He[11]),(!Be||at[0]&512)&&(Me.disabled=He[9]),He[12]!==""?bt?bt.p(He,at):(bt=hi(He),bt.c(),bt.m(ve,null)):bt&&(bt.d(1),bt=null),(!Be||at[0]&8388608)&&Le!==(Le=He[23].t("Experimental")+"")&&j(Ke,Le),(!Be||at[0]&8388672)&&ut!==(ut=(He[6]?He[23].t("Hide"):He[23].t("Show"))+"")&&j(ft,ut),He[6]?lt?lt.p(He,at):(lt=vi(He),lt.c(),lt.m(s,null)):lt&&(lt.d(1),lt=null)},i(He){Be||(G(m.$$.fragment,He),G(At),Be=!0)},o(He){W(m.$$.fragment,He),W(At),Be=!1},d(He){He&&c(e),he(m),_t.d(),Et&&Et.d(),At&&At.d(),Tt&&Tt.d(),wl(rt,He),bt&&bt.d(),lt&&lt.d(),Ve=!1,ml(je)}}}function Td(l){let e,t='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M7 1a.75.75 0 0 1 .75.75V6h-1.5V1.75A.75.75 0 0 1 7 1ZM6.25 6v2.94L5.03 7.72a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5a.75.75 0 1 0-1.06-1.06L7.75 8.94V6H10a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2.25Z"></path><path d="M4.268 14A2 2 0 0 0 6 15h6a2 2 0 0 0 2-2v-3a2 2 0 0 0-1-1.732V11a3 3 0 0 1-3 3H4.268Z"></path></svg>',s,n;return{c(){e=_("button"),e.innerHTML=t,this.h()},l(i){e=h(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-91van"&&(e.innerHTML=t),this.h()},h(){u(e,"class","flex gap-2 items-center bg-transparent rounded-lg transition")},m(i,a){M(i,e,a),s||(n=pe(e,"click",l[34]),s=!0)},p:st,d(i){i&&c(e),s=!1,n()}}}function Ad(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
73),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function kd(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
74												transform-origin: center;
75												animation: spinner_AtaB 0.75s infinite linear;
76											}
77
78											@keyframes spinner_AtaB {
79												100% {
80													transform: rotate(360deg);
81												}
82											}
83										</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1x85grn"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function ii(l){let e,t,s,n,i=l[5]?`(${l[5]}%)`:"",a;return{c(){e=_("div"),t=B('Updating "'),s=B(l[4]),n=B('" '),a=B(i),this.h()},l(f){e=h(f,"DIV",{class:!0});var o=p(e);t=H(o,'Updating "'),s=H(o,l[4]),n=H(o,'" '),a=H(o,i),o.forEach(c),this.h()},h(){u(e,"class","text-xs")},m(f,o){M(f,e,o),r(e,t),r(e,s),r(e,n),r(e,a)},p(f,o){o[0]&16&&j(s,f[4]),o[0]&32&&i!==(i=f[5]?`(${f[5]}%)`:"")&&j(a,i)},d(f){f&&c(e)}}}function oi(l){let e,t,s=Dt(Object.keys(l[22])),n=[];for(let a=0;a<s.length;a+=1)n[a]=ci(ai(l,s,a));const i=a=>W(n[a],1,1,()=>{n[a]=null});return{c(){for(let a=0;a<n.length;a+=1)n[a].c();e=xt()},l(a){for(let f=0;f<n.length;f+=1)n[f].l(a);e=xt()},m(a,f){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(a,f);M(a,e,f),t=!0},p(a,f){if(f[0]&549453824){s=Dt(Object.keys(a[22]));let o;for(o=0;o<s.length;o+=1){const d=ai(a,s,o);n[o]?(n[o].p(d,f),G(n[o],1)):(n[o]=ci(d),n[o].c(),G(n[o],1),n[o].m(e.parentNode,e))}for(ht(),o=s.length;o<n.length;o+=1)i(o);pt()}},i(a){if(!t){for(let f=0;f<s.length;f+=1)G(n[f]);t=!0}},o(a){n=n.filter(Boolean);for(let f=0;f<n.length;f+=1)W(n[f]);t=!1},d(a){a&&c(e),wl(n,a)}}}function ui(l){let e,t,s=l[57]+"",n,i,a,f,o,d,E=(l[22][l[57]].pullProgress??0)+"",m,v,g,b,w,A,I;b=new Gt({props:{content:l[23].t("Cancel"),$$slots:{default:[Dd]},$$scope:{ctx:l}}});let k="digest"in l[22][l[57]]&&fi(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("div"),d=_("div"),m=B(E),v=B("%"),g=N(),ce(b.$$.fragment),w=N(),k&&k.c(),A=N(),this.h()},l(T){e=h(T,"DIV",{class:!0});var R=p(e);t=h(R,"DIV",{class:!0});var O=p(t);n=H(O,s),O.forEach(c),i=$(R),a=h(R,"DIV",{class:!0});var y=p(a);f=h(y,"DIV",{class:!0});var L=p(f);o=h(L,"DIV",{class:!0});var P=p(o);d=h(P,"DIV",{class:!0,style:!0});var D=p(d);m=H(D,E),v=H(D,"%"),D.forEach(c),P.forEach(c),g=$(L),de(b.$$.fragment,L),L.forEach(c),w=$(y),k&&k.l(y),y.forEach(c),A=$(R),R.forEach(c),this.h()},h(){u(t,"class","font-medium mb-1"),u(d,"class","dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"),Os(d,"width",Math.max(15,l[22][l[57]].pullProgress??0)+"%"),u(o,"class","flex-1"),u(f,"class","flex flex-row justify-between space-x-4 pr-2"),u(a,"class",""),u(e,"class","flex flex-col")},m(T,R){M(T,e,R),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(o,d),r(d,m),r(d,v),r(f,g),_e(b,f,null),r(a,w),k&&k.m(a,null),r(e,A),I=!0},p(T,R){(!I||R[0]&4194304)&&s!==(s=T[57]+"")&&j(n,s),(!I||R[0]&4194304)&&E!==(E=(T[22][T[57]].pullProgress??0)+"")&&j(m,E),(!I||R[0]&4194304)&&Os(d,"width",Math.max(15,T[22][T[57]].pullProgress??0)+"%");const O={};R[0]&8388608&&(O.content=T[23].t("Cancel")),R[0]&4194304|R[2]&1&&(O.$$scope={dirty:R,ctx:T}),b.$set(O),"digest"in T[22][T[57]]?k?k.p(T,R):(k=fi(T),k.c(),k.m(a,null)):k&&(k.d(1),k=null)},i(T){I||(G(b.$$.fragment,T),I=!0)},o(T){W(b.$$.fragment,T),I=!1},d(T){T&&c(e),he(b),k&&k.d()}}}function Dd(l){let e,t='<svg class="w-4 h-4 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
83<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18 17.94 6M18 18 6.06 6"></path></svg>',s,n;function i(){return l[37](l[57])}return{c(){e=_("button"),e.innerHTML=t,this.h()},l(a){e=h(a,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-aeotdp"&&(e.innerHTML=t),this.h()},h(){u(e,"class","text-gray-800 dark:text-gray-100")},m(a,f){M(a,e,f),s||(n=pe(e,"click",i),s=!0)},p(a,f){l=a},d(a){a&&c(e),s=!1,n()}}}function fi(l){let e,t=l[22][l[57]].digest+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0,style:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","mt-1 text-xs dark:text-gray-500"),Os(e,"font-size","0.5rem")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&4194304&&t!==(t=n[22][n[57]].digest+"")&&j(s,t)},d(n){n&&c(e)}}}function ci(l){let e,t,s="pullProgress"in l[22][l[57]]&&ui(l);return{c(){s&&s.c(),e=xt()},l(n){s&&s.l(n),e=xt()},m(n,i){s&&s.m(n,i),M(n,e,i),t=!0},p(n,i){"pullProgress"in n[22][n[57]]?s?(s.p(n,i),i[0]&4194304&&G(s,1)):(s=ui(n),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(ht(),W(s,1,1,()=>{s=null}),pt())},i(n){t||(G(s),t=!0)},o(n){W(s),t=!1},d(n){n&&c(e),s&&s.d(n)}}}function di(l){let e,t=l[23].t("Select a model")+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value="",Q(e,e.__value),e.disabled=!0,e.selected=!0},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8388608&&t!==(t=n[23].t("Select a model")+"")&&j(s,t)},d(n){n&&c(e)}}}function _i(l){let e,t=l[57].name+" ("+(l[57].size/1073741824).toFixed(1)+" GB)",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{class:!0});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[57].id,Q(e,e.__value),u(e,"class","bg-gray-50 dark:bg-gray-700")},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&8&&t!==(t=i[57].name+" ("+(i[57].size/1024**3).toFixed(1)+" GB)")&&j(s,t),a[0]&8&&n!==(n=i[57].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function hi(l){let e,t,s,n,i,a,f,o,d=(l[13]??0)+"",E,m,v,g=l[12]&&pi(l);return{c(){e=_("div"),t=_("div"),s=B(createModelTag),n=N(),i=_("div"),a=_("div"),f=_("div"),o=_("div"),E=B(d),m=B("%"),v=N(),g&&g.c(),this.h()},l(b){e=h(b,"DIV",{class:!0});var w=p(e);t=h(w,"DIV",{class:!0});var A=p(t);s=H(A,createModelTag),A.forEach(c),n=$(w),i=h(w,"DIV",{class:!0});var I=p(i);a=h(I,"DIV",{class:!0});var k=p(a);f=h(k,"DIV",{class:!0});var T=p(f);o=h(T,"DIV",{class:!0,style:!0});var R=p(o);E=H(R,d),m=H(R,"%"),R.forEach(c),T.forEach(c),k.forEach(c),v=$(I),g&&g.l(I),I.forEach(c),w.forEach(c),this.h()},h(){u(t,"class","font-medium mb-1"),u(o,"class","dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"),Os(o,"width",Math.max(15,l[13]??0)+"%"),u(f,"class","flex-1"),u(a,"class","flex flex-row justify-between space-x-4 pr-2"),u(i,"class",""),u(e,"class","flex flex-col mt-1")},m(b,w){M(b,e,w),r(e,t),r(t,s),r(e,n),r(e,i),r(i,a),r(a,f),r(f,o),r(o,E),r(o,m),r(i,v),g&&g.m(i,null)},p(b,w){w[0]&8192&&d!==(d=(b[13]??0)+"")&&j(E,d),w[0]&8192&&Os(o,"width",Math.max(15,b[13]??0)+"%"),b[12]?g?g.p(b,w):(g=pi(b),g.c(),g.m(i,null)):g&&(g.d(1),g=null)},d(b){b&&c(e),g&&g.d()}}}function pi(l){let e,t;return{c(){e=_("div"),t=B(l[12]),this.h()},l(s){e=h(s,"DIV",{class:!0,style:!0});var n=p(e);
83t=H(n,l[12]),n.forEach(c),this.h()},h(){u(e,"class","mt-1 text-xs dark:text-gray-500"),Os(e,"font-size","0.5rem")},m(s,n){M(s,e,n),r(e,t)},p(s,n){n[0]&4096&&j(t,s[12])},d(s){s&&c(e)}}}function vi(l){let e,t,s,n=l[23].t("Upload a GGUF model")+"",i,a,f,o,d,E,m,v,g,b,w=l[23].t("To access the GGUF models available for downloading,")+"",A,I,k,T=l[23].t("click here.")+"",R,O,y,L;function P(J,ie){return J[14]==="file"?$d:Nd}let D=P(l),S=D(l);function K(J,ie){return J[14]==="file"?Od:Rd}let Y=K(l),C=Y(l),V=(l[14]==="file"&&l[15]&&l[15].length>0||l[14]==="url"&&l[16]!=="")&&mi(l),U=(l[14]==="file"&&l[15]&&l[15].length>0||l[14]==="url"&&l[16]!=="")&&gi(l);function F(J,ie){if(J[20])return Cd;if(J[19]!==null)return Ld}let X=F(l),Z=X&&X(l);return{c(){e=_("form"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("button"),S.c(),o=N(),d=_("div"),E=_("div"),C.c(),m=N(),V&&V.c(),v=N(),U&&U.c(),g=N(),b=_("div"),A=B(w),I=N(),k=_("a"),R=B(T),O=N(),Z&&Z.c(),this.h()},l(J){e=h(J,"FORM",{});var ie=p(e);t=h(ie,"DIV",{class:!0});var fe=p(t);s=h(fe,"DIV",{class:!0});var le=p(s);i=H(le,n),le.forEach(c),a=$(fe),f=h(fe,"BUTTON",{class:!0,type:!0});var x=p(f);S.l(x),x.forEach(c),fe.forEach(c),o=$(ie),d=h(ie,"DIV",{class:!0});var oe=p(d);E=h(oe,"DIV",{class:!0});var se=p(E);C.l(se),se.forEach(c),m=$(oe),V&&V.l(oe),oe.forEach(c),v=$(ie),U&&U.l(ie),g=$(ie),b=h(ie,"DIV",{class:!0});var te=p(b);A=H(te,w),I=$(te),k=h(te,"A",{class:!0,href:!0,target:!0});var ae=p(k);R=H(ae,T),ae.forEach(c),te.forEach(c),O=$(ie),Z&&Z.l(ie),ie.forEach(c),this.h()},h(){u(s,"class","text-sm font-medium"),u(f,"class","p-1 px-3 text-xs flex rounded-sm transition"),u(f,"type","button"),u(t,"class","mb-2 flex w-full justify-between"),u(E,"class","flex flex-col w-full"),u(d,"class","flex w-full mb-1.5"),u(k,"class","text-gray-500 dark:text-gray-300 font-medium underline"),u(k,"href","https://huggingface.co/models?search=gguf"),u(k,"target","_blank"),u(b,"class","mt-1 text-xs text-gray-400 dark:text-gray-500")},m(J,ie){M(J,e,ie),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),S.m(f,null),r(e,o),r(e,d),r(d,E),C.m(E,null),r(d,m),V&&V.m(d,null),r(e,v),U&&U.m(e,null),r(e,g),r(e,b),r(b,A),r(b,I),r(b,k),r(k,R),r(e,O),Z&&Z.m(e,null),y||(L=[pe(f,"click",l[44]),pe(e,"submit",ds(l[51]))],y=!0)},p(J,ie){ie[0]&8388608&&n!==(n=J[23].t("Upload a GGUF model")+"")&&j(i,n),D===(D=P(J))&&S?S.p(J,ie):(S.d(1),S=D(J),S&&(S.c(),S.m(f,null))),Y===(Y=K(J))&&C?C.p(J,ie):(C.d(1),C=Y(J),C&&(C.c(),C.m(E,null))),J[14]==="file"&&J[15]&&J[15].length>0||J[14]==="url"&&J[16]!==""?V?V.p(J,ie):(V=mi(J),V.c(),V.m(d,null)):V&&(V.d(1),V=null),J[14]==="file"&&J[15]&&J[15].length>0||J[14]==="url"&&J[16]!==""?U?U.p(J,ie):(U=gi(J),U.c(),U.m(e,g)):U&&(U.d(1),U=null),ie[0]&8388608&&w!==(w=J[23].t("To access the GGUF models available for downloading,")+"")&&j(A,w),ie[0]&8388608&&T!==(T=J[23].t("click here.")+"")&&j(R,T),X===(X=F(J))&&Z?Z.p(J,ie):(Z&&Z.d(1),Z=X&&X(J),Z&&(Z.c(),Z.m(e,null)))},d(J){J&&c(e),S.d(),C.d(),V&&V.d(),U&&U.d(),Z&&Z.d(),y=!1,ml(L)}}}function Nd(l){let e,t=l[23].t("URL Mode")+"",s;return{c(){e=_("span"),s=B(t),this.h()},l(n){e=h(n,"SPAN",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","ml-2 self-center")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8388608&&t!==(t=n[23].t("URL Mode")+"")&&j(s,t)},d(n){n&&c(e)}}}function $d(l){let e,t=l[23].t("File Mode")+"",s;return{c(){e=_("span"),s=B(t),this.h()},l(n){e=h(n,"SPAN",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","ml-2 self-center")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&8388608&&t!==(t=n[23].t("File Mode")+"")&&j(s,t)},d(n){n&&c(e)}}}function Rd(l){let e,t,s,n,i,a,f;return{c(){e=_("div"),t=_("input"),this.h()},l(o){e=h(o,"DIV",{class:!0});var d=p(e);t=h(d,"INPUT",{class:!0,type:!0,placeholder:!0}),d.forEach(c),this.h()},h(){u(t,"class",s="w-full rounded-lg text-left py-2 px-4 bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden "+(l[16]!==""?"mr-2":"")),u(t,"type","url"),t.required=!0,u(t,"placeholder",n=l[23].t("Type Hugging Face Resolve (Download) URL")),u(e,"class",i="flex-1 "+(l[16]!==""?"mr-2":""))},m(o,d){M(o,e,d),r(e,t),Q(t,l[16]),a||(f=pe(t,"input",l[49]),a=!0)},p(o,d){d[0]&65536&&s!==(s="w-full rounded-lg text-left py-2 px-4 bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden "+(o[16]!==""?"mr-2":""))&&u(t,"class",s),d[0]&8388608&&n!==(n=o[23].t("Type Hugging Face Resolve (Download) URL"))&&u(t,"placeholder",n),d[0]&65536&&t.value!==o[16]&&Q(t,o[16]),d[0]&65536&&i!==(i="flex-1 "+(o[16]!==""?"mr-2":""))&&u(e,"class",i)},d(o){o&&c(e),a=!1,f()}}}function Od(l){let e,t,s,n,i,a,f;function o(m,v){return m[15]&&m[15].length>0?Pd:Sd}let d=o(l),E=d(l);return{c(){e=_("div"),t=_("input"),s=N(),n=_("button"),E.c(),this.h()},l(m){e=h(m,"DIV",{class:!0});var v=p(e);t=h(v,"INPUT",{id:!0,type:!0,accept:!0}),s=$(v),n=h(v,"BUTTON",{type:!0,class:!0});var g=p(n);E.l(g),g.forEach(c),v.forEach(c),this.h()},h(){u(t,"id","model-upload-input"),u(t,"type","file"),u(t,"accept",".gguf,.safetensors"),t.required=!0,t.hidden=!0,u(n,"type","button"),u(n,"class","w-full rounded-lg text-left py-2 px-4 bg-gray-50 dark:text-gray-300 dark:bg-gray-850"),u(e,"class",i="flex-1 "+(l[15]&&l[15].length>0?"mr-2":""))},m(m,v){M(m,e,v),r(e,t),l[45](t),r(e,s),r(e,n),E.m(n,null),a||(f=[pe(t,"change",l[46]),pe(t,"change",l[47]),pe(n,"click",l[48])],a=!0)},p(m,v){d===(d=o(m))&&E?E.p(m,v):(E.d(1),E=d(m),E&&(E.c(),E.m(n,null))),v[0]&32768&&i!==(i="flex-1 "+(m[15]&&m[15].length>0?"mr-2":""))&&u(e,"class",i)},d(m){m&&c(e),l[45](null),E.d(),a=!1,ml(f)}}}function Sd(l){let e=l[23].t("Click here to select")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&8388608&&e!==(e=s[23].t("Click here to select")+"")&&j(t,e)},d(s){s&&c(t)}}}function Pd(l){let e=l[15][0].name+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&32768&&e!==(e=s[15][0].name+"")&&j(t,e)},d(s){s&&c(t)}}}function mi(l){let e;function t(i,a){return i[7]?yd:Vd}let s=t(l),n=s(l);return{c(){e=_("button"),n.c(),this.h()},l(i){e=h(i,"BUTTON",{class:!0,type:!0});var a=p(e);n.l(a),a.forEach(c),this.h()},h(){u(e,"class","px-2.5 bg-gray-50 hover:bg-gray-200 text-gray-800 dark:bg-gray-850 dar
83k:hover:bg-gray-800 dark:text-gray-100 rounded-lg disabled:cursor-not-allowed transition"),u(e,"type","submit"),e.disabled=l[7]},m(i,a){M(i,e,a),n.m(e,null)},p(i,a){s!==(s=t(i))&&(n.d(1),n=s(i),n&&(n.c(),n.m(e,null))),a[0]&128&&(e.disabled=i[7])},d(i){i&&c(e),n.d()}}}function Vd(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M7.25 10.25a.75.75 0 0 0 1.5 0V4.56l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06l2.22-2.22v5.69Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function yd(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
84														transform-origin: center;
85														animation: spinner_AtaB 0.75s infinite linear;
86													}
87
88													@keyframes spinner_AtaB {
89														100% {
90															transform: rotate(360deg);
91														}
92													}
93												</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-j1a4yh"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function gi(l){let e,t,s,n=l[23].t("Modelfile Content")+"",i,a,f,o,d;return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("textarea"),this.h()},l(E){e=h(E,"DIV",{});var m=p(e);t=h(m,"DIV",{});var v=p(t);s=h(v,"DIV",{class:!0});var g=p(s);i=H(g,n),g.forEach(c),a=$(v),f=h(v,"TEXTAREA",{class:!0,rows:!0}),p(f).forEach(c),v.forEach(c),m.forEach(c),this.h()},h(){u(s,"class","my-2.5 text-sm font-medium"),u(f,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-100 dark:bg-gray-850 outline-hidden resize-none"),u(f,"rows","6")},m(E,m){M(E,e,m),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),Q(f,l[17]),o||(d=pe(f,"input",l[50]),o=!0)},p(E,m){m[0]&8388608&&n!==(n=E[23].t("Modelfile Content")+"")&&j(i,n),m[0]&131072&&Q(f,E[17])},d(E){E&&c(e),o=!1,d()}}}function Ld(l){let e,t,s=l[23].t("Upload Progress")+"",n,i,a,f,o=(l[19]??0)+"",d,E,m,v,g;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),d=B(o),E=B("%"),m=N(),v=_("div"),g=B(l[18]),this.h()},l(b){e=h(b,"DIV",{class:!0});var w=p(e);t=h(w,"DIV",{class:!0});var A=p(t);n=H(A,s),A.forEach(c),i=$(w),a=h(w,"DIV",{class:!0});var I=p(a);f=h(I,"DIV",{class:!0,style:!0});var k=p(f);d=H(k,o),E=H(k,"%"),k.forEach(c),I.forEach(c),m=$(w),v=h(w,"DIV",{class:!0,style:!0});var T=p(v);g=H(T,l[18]),T.forEach(c),w.forEach(c),this.h()},h(){u(t,"class","mb-2 text-xs"),u(f,"class","dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"),Os(f,"width",Math.max(15,l[19]??0)+"%"),u(a,"class","w-full rounded-full dark:bg-gray-800"),u(v,"class","mt-1 text-xs dark:text-gray-500"),Os(v,"font-size","0.5rem"),u(e,"class","mt-2")},m(b,w){M(b,e,w),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,d),r(f,E),r(e,m),r(e,v),r(v,g)},p(b,w){w[0]&8388608&&s!==(s=b[23].t("Upload Progress")+"")&&j(n,s),w[0]&524288&&o!==(o=(b[19]??0)+"")&&j(d,o),w[0]&524288&&Os(f,"width",Math.max(15,b[19]??0)+"%"),w[0]&262144&&j(g,b[18])},d(b){b&&c(e)}}}function Cd(l){let e,t,s=l[23].t("Upload Progress")+"",n,i,a,f,o,d,E,m;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=B(l[20]),d=N(),E=_("div"),m=B(l[18]),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);n=H(b,s),b.forEach(c),i=$(g),a=h(g,"DIV",{class:!0});var w=p(a);f=h(w,"DIV",{class:!0,style:!0});var A=p(f);
93o=H(A,l[20]),A.forEach(c),w.forEach(c),d=$(g),E=h(g,"DIV",{class:!0,style:!0});var I=p(E);m=H(I,l[18]),I.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","mb-2 text-xs"),u(f,"class","dark:bg-gray-600 bg-gray-500 text-xs font-medium text-gray-100 text-center p-0.5 leading-none rounded-full"),Os(f,"width","100%"),u(a,"class","w-full rounded-full dark:bg-gray-800"),u(E,"class","mt-1 text-xs dark:text-gray-500"),Os(E,"font-size","0.5rem"),u(e,"class","mt-2")},m(v,g){M(v,e,g),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(e,d),r(e,E),r(E,m)},p(v,g){g[0]&8388608&&s!==(s=v[23].t("Upload Progress")+"")&&j(n,s),g[0]&1048576&&j(o,v[20]),g[0]&262144&&j(m,v[18])},d(v){v&&c(e)}}}function Ud(l){let e,t,s,n,i,a,f;function o(g){l[32](g)}let d={};l[1]!==void 0&&(d.show=l[1]),e=new Ys({props:d}),Ye.push(()=>qe(e,"show",o)),e.$on("confirm",l[33]);const E=[wd,Id,bd],m=[];function v(g,b){return g[2]?g[3]===null?1:2:0}return n=v(l),i=m[n]=E[n](l),{c(){ce(e.$$.fragment),s=N(),i.c(),a=xt()},l(g){de(e.$$.fragment,g),s=$(g),i.l(g),a=xt()},m(g,b){_e(e,g,b),M(g,s,b),m[n].m(g,b),M(g,a,b),f=!0},p(g,b){const w={};!t&&b[0]&2&&(t=!0,w.show=g[1],Fe(()=>t=!1)),e.$set(w);let A=n;n=v(g),n===A?m[n].p(g,b):(ht(),W(m[A],1,1,()=>{m[A]=null}),pt(),i=m[n],i?i.p(g,b):(i=m[n]=E[n](g),i.c()),G(i,1),i.m(a.parentNode,a))},i(g){f||(G(e.$$.fragment,g),G(i),f=!0)},o(g){W(e.$$.fragment,g),W(i),f=!1},d(g){g&&(c(s),c(a)),he(e,g),m[n].d(g)}}}const Md=3;function Bd(l,e,t){let s,n,i,a;qt(l,nn,ee=>t(54,s=ee)),qt(l,fs,ee=>t(55,n=ee)),qt(l,tn,ee=>t(22,i=ee));const f=Ul("i18n");qt(l,f,ee=>t(23,a=ee));let o,d=!1,E=!0,{urlIdx:m=null}
93=e,v=[],g=null,b=null,w=!1,A=!1,I="",k=!1,T="",R="",O="",y=null,L="",P=null,D="file",S=null,K="",Y=`TEMPLATE """{{ .System }}
94USER: {{ .Prompt }}
95ASSISTANT: """
96PARAMETER num_ctx 4096
97PARAMETER stop "</s>"
98PARAMETER stop "USER:"
99PARAMETER stop "ASSISTANT:"`,C="",V=null,U="",F="";const X=async()=>{for(const ee of v){console.log(ee),t(4,g=ee.id);const[me,ge]=await Hr(localStorage.token,ee.id,m).catch(Ne=>(Je.error(`${Ne}`),null));if(me){const Ne=me.body.pipeThrough(new TextDecoderStream).pipeThrough(hn(`
100`)).getReader();for(;;)try{const{value:ye,done:ze}=await Ne.read();if(ze)break;let Ce=ye.split(`
101`);for(const Le of Ce)if(Le!==""){let Ke=JSON.parse(Le);if(console.log(Ke),Ke.error)throw Ke.error;if(Ke.detail)throw Ke.detail;Ke.status&&(Ke.digest?(t(5,b=0),Ke.completed?t(5,b=Math.round(Ke.completed/Ke.total*1e3)/10):t(5,b=100)):Je.success(Ke.status))}}catch(ye){console.log(ye)}}}t(4,g=null),t(5,b=null)},Z=async()=>{var Ne;const ee=I.trim().replace(/^ollama\s+(run|pull)\s+/,"");if(console.log(i),i[ee]){Je.error(a.t("Model '{{modelTag}}' is already in queue for downloading.",{modelTag:ee}));return}if(Object.keys(i).length===Md){Je.error(a.t("Maximum of 3 models can be downloaded simultaneously. Please try again later."));return}const[me,ge]=await Hr(localStorage.token,ee,m).catch(ye=>(Je.error(`${ye}`),null));if(me){const ye=me.body.pipeThrough(new TextDecoderStream).pipeThrough(hn(`
102`)).getReader();for(tn.set({...i,[ee]:{...i[ee],abortController:ge,reader:ye,done:!1}});;)try{const{value:ze,done:Ce}=await ye.read();if(Ce)break;let Le=ze.split(`
103`);for(const Ke of Le)if(Ke!==""){let re=JSON.parse(Ke);if(console.log(re),re.error)throw re.error;if(re.detail)throw re.detail;if(re.status)if(re.digest){let $e=0;re.completed?$e=Math.round(re.completed/re.total*1e3)/10:$e=100,tn.set({...i,[ee]:{...i[ee],pullProgress:$e,digest:re.digest}})}else Je.success(re.status),tn.set({...i,[ee]:{...i[ee],done:re.status==="success"}})}}catch(ze){console.log(ze),typeof ze!="string"&&(ze=ze.message),Je.error(`${ze}`)}console.log(i[ee]),i[ee].done?(Je.success(a.t("Model '{{modelName}}' has been successfully downloaded.",{modelName:ee})),Kl.set(await ns(localStorage.token,((Ne=n==null?void 0:n.features)==null?void 0:Ne.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null)))):Je.error(a.t("Download canceled")),delete i[ee],tn.set({...i})}t(8,I=""),t(7,A=!1)},J=async()=>{var Ne;t(7,A=!0);let ee=!1,me=null,ge="";if(D==="file"){const ye=S?S[0]:null;ye&&(t(20,U="Uploading..."),me=await Qu(localStorage.token,ye,m).catch(ze=>(Je.error(`${ze}`),null)))}else t(19,V=0),me=await xu(localStorage.token,K,m).catch(ye=>(Je.error(`${ye}`),null));if(me&&me.ok){const ye=me.body.pipeThrough(new TextDecoderStream).pipeThrough(hn(`
104`)).getReader();for(;;){const{value:ze,done:Ce}=await ye.read();if(Ce)break;try{let Le=ze.split(`
105`);for(const Ke of Le)if(Ke!==""){let re=JSON.parse(Ke.replace(/^data: /,""));if(re.progress&&(U&&t(20,U=""),t(19,V=re.progress)),re.error)throw re.error;re.done&&(t(18,C=re.blob),ge=re.name,ee=!0)}}catch(Le){console.log(Le)}}}else{const ye=await(me==null?void 0:me.json());Je.error((ye==null?void 0:ye.detail)??ye)}if(ee){const ye=await Kr(localStorage.token,`${ge}:latest`,`FROM @${C}
106${Y}`);if(ye&&ye.ok){const ze=ye.body.pipeThrough(new TextDecoderStream).pipeThrough(hn(`
107`)).getReader();for(;;){const{value:Ce,done:Le}=await ze.read();if(Le)break;try{let Ke=Ce.split(`
108`);for(const re of Ke)if(re!==""){console.log(re);let $e=JSON.parse(re);if(console.log($e),$e.error)throw $e.error;if($e.detail)throw $e.detail;$e.status&&(!$e.digest&&!$e.status.includes("writing")&&!$e.status.includes("sha256")?Je.success($e.status):$e.digest&&(L=$e.digest,$e.completed?P=Math.round($e.completed/$e.total*1e3)/10:P=100))}}catch(Ke){console.log(Ke),Je.error(`${Ke}`)}}}}t(16,K=""),o&&t(0,o.value="",o),t(15,S=null),t(7,A=!1),t(19,V=null),Kl.set(await ns(localStorage.token,((Ne=n==null?void 0:n.features)==null?void 0:Ne.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null)))},ie=async()=>{var me;await Gr(localStorage.token,F,m).catch(ge=>{Je.error(`${ge}`)})&&Je.success(a.t("Deleted {{deleteModelTag}}",{deleteModelTag:F})),t(21,F=""),Kl.set(await ns(localStorage.token,((me=n==null?void 0:n.features)==null?void 0:me.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null)))},fe=async ee=>{const{reader:me,abortController:ge}=i[ee];ge&&ge.abort(),me&&(await me.cancel(),delete i[ee],tn.set({...i}),await Gr(localStorage.token,ee),Je.success(`${ee} download has been canceled`))},le=async()=>{var ge;t(9,k=!0);let ee={};try{ee=JSON.parse(R)}catch(Ne){Je.error(`${Ne}`),t(9,k=!1);return}const me=await Kr(localStorage.token,{model:T,...ee},m).catch(Ne=>(Je.error(`${Ne}`),null));if(me&&me.ok){const Ne=me.body.pipeThrough(new TextDecoderStream).pipeThrough(hn(`
109`)).getReader();for(;;){const{value:ye,done:ze}=await Ne.read();if(ze)break;try{let Ce=ye.split(`
110`);for(const Le of Ce)if(Le!==""){console.log(Le);let Ke=JSON.parse(Le);if(console.log(Ke),Ke.error)throw Ke.error;if(Ke.detail)throw Ke.detail;Ke.status&&(!Ke.digest&&!Ke.status.includes("writing")&&!Ke.status.includes("sha256")?Je.success(Ke.status):Ke.digest&&(t(12,O=Ke.digest),Ke.completed?t(13,y=Math.round(Ke.completed/Ke.total*1e3)/10):t(13,y=100)))}}catch(Ce){console.log(Ce),Je.error(`${Ce}`)}}}Kl.set(await ns(localStorage.token,((ge=n==null?void 0:n.features)==null?void 0:ge.enable_direct_connections)&&((s==null?void 0:s.directConnections)??null))),t(9,k=!1),t(10,T=""),t(11,R=""),t(12,O=""),t(13,y=null)},x=async()=>
110{t(2,E=!0),t(3,v=await zu(localStorage.token,m).catch(ee=>(Je.error(`${ee}`),null))),v&&t(2,E=!1)};function oe(ee){d=ee,t(1,d)}const se=()=>{ie()},te=()=>{X()};function ae(){I=this.value,t(8,I)}const Te=()=>{Z()},ve=ee=>{fe(ee)};function q(){F=Ll(this),t(21,F),t(3,v)}const ne=()=>{t(1,d=!0)};function Ie(){T=this.value,t(10,T)}function be(){R=this.value,t(11,R)}const z=()=>{le()},ke=()=>{t(6,w=!w)},Ue=()=>{D==="file"?t(14,D="url"):t(14,D="file")};function we(ee){Ye[ee?"unshift":"push"](()=>{o=ee,t(0,o)})}function Ae(){S=this.files,t(15,S)}const Re=()=>{console.log(S)},ue=()=>{o.click()};function Ee(){K=this.value,t(16,K)}function Me(){Y=this.value,t(17,Y)}const Ge=()=>{J()};return l.$$set=ee=>{"urlIdx"in ee&&t(31,m=ee.urlIdx)},l.$$.update=()=>{l.$$.dirty[1]&1&&m!==null&&x()},[o,d,E,v,g,b,w,A,I,k,T,R,O,y,D,S,K,Y,C,V,U,F,i,a,f,X,Z,J,ie,fe,le,m,oe,se,te,ae,Te,ve,q,ne,Ie,be,z,ke,Ue,we,Ae,Re,ue,Ee,Me,Ge]}class Oo extends Sl{constructor(e){super(),Pl(this,e,Bd,Ud,Ol,{urlIdx:31},null,[-1,-1,-1])}}function Ei(l,e,t){const s=l.slice();return s[5]=e[t],s[7]=t,s}function bi(l){let e,t,s,n,i,a,f,o,d=Dt(l[0].OLLAMA_BASE_URLS),E=[];for(let m=0;m<d.length;m+=1)E[m]=Ii(Ei(l,d,m));return i=new Oo({props:{urlIdx:l[1]}}),{c(){e=_("div"),t=_("select");for(let m=0;m<E.length;m+=1)E[m].c();n=N(),ce(i.$$.fragment),this.h()},l(m){e=h(m,"DIV",{class:!0});var v=p(e);t=h(v,"SELECT",{class:!0,placeholder:!0});var g=p(t);for(let b=0;b<E.length;b+=1)E[b].l(g);g.forEach(c),v.forEach(c),n=$(m),de(i.$$.fragment,m),this.h()},h(){u(t,"class","w-full py-2 px-4 text-sm outline-hidden bg-transparent"),u(t,"placeholder",s=l[2].t("Select an Ollama instance")),l[1]===void 0&&Cl(()=>l[4].call(t)),u(e,"class","flex-1 mb-2.5 pr-1.5 rounded-lg bg-gray-50 dark:text-gray-300 dark:bg-gray-850")},m(m,v){M(m,e,v),r(e,t);for(let g=0;g<E.length;g+=1)E[g]&&E[g].m(t,null);Ft(t,l[1],!0),M(m,n,v),_e(i,m,v),a=!0,f||(o=pe(t,"change",l[4]),f=!0)},p(m,v){if(v&1){d=Dt(m[0].OLLAMA_BASE_URLS);let b;for(b=0;b<d.length;b+=1){const w=Ei(m,d,b);E[b]?E[b].p(w,v):(E[b]=Ii(w),E[b].c(),E[b].m(t,null))}for(;b<E.length;b+=1)E[b].d(1);E.length=d.length}(!a||v&4&&s!==(s=m[2].t("Select an Ollama instance")))&&u(t,"placeholder",s),v&2&&Ft(t,m[1]);const g={};v&2&&(g.urlIdx=m[1]),i.$set(g)},i(m){a||(G(i.$$.fragment,m),a=!0)},o(m){W(i.$$.fragment,m),a=!1},d(m){m&&(c(e),c(n)),wl(E,m),he(i,m),f=!1,o()}}}function Ii(l){let e,t=l[5]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[7],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p(n,i){i&1&&t!==(t=n[5]+"")&&j(s,t)},d(n){n&&c(e)}}}function Hd(l){let e,t,s=l[0]&&bi(l);return{c(){s&&s.c(),e=xt()},l(n){s&&s.l(n),e=xt()},m(n,i){s&&s.m(n,i),M(n,e,i),t=!0},p(n,[i]){n[0]?s?(s.p(n,i),i&1&&G(s,1)):(s=bi(n),s.c(),G(s,1),s.m(e.parentNode,e)):s&&(ht(),W(s,1,1,()=>{s=null}),pt())},i(n){t||(G(s),t=!0)},o(n){W(s),t=!1},d(n){n&&c(e),s&&s.d(n)}}}function Gd(l,e,t){let s;const n=Ul("i18n");qt(l,n,o=>t(2,s=o));let{ollamaConfig:i=null}=e,a=0;function f(){a=Ll(this),t(1,a)}return l.$$set=o=>{"ollamaConfig"in o&&t(0,i=o.ollamaConfig)},[i,a,s,n,f]}class Kd extends Sl{constructor(e){super(),Pl(this,e,Gd,Hd,Ol,{ollamaConfig:0})}}function Yd(l){let e,t,s;return t=new Ps({}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","py-5")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function jd(l){let e,t,s,n=l[3].t("Ollama")+"",i,a,f,o,d,E,m,v=l[1]==="ollama"&&wi(l);return{c(){e=_("div"),t=_("div"),s=_("button"),i=B(n),f=N(),o=_("div"),v&&v.c(),this.h()},l(g){e=h(g,"DIV",{class:!0});var b=p(e);t=h(b,"DIV",{class:!0});var w=p(t);s=h(w,"BUTTON",{class:!0});var A=p(s);i=H(A,n),A.forEach(c),w.forEach(c),f=$(b),o=h(b,"DIV",{class:!0});var I=p(o);v&&v.l(I),I.forEach(c),b.forEach(c),this.h()},h(){u(s,"class",a="min-w-fit rounded-full p-1.5 "+(l[1]==="ollama"?"":"text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")+" transition"),u(t,"class","flex gap-1 scrollbar-none overflow-x-auto w-fit text-center text-sm font-medium rounded-full bg-transparent dark:text-gray-200"),u(o,"class","px-1.5 py-1"),u(e,"class","flex w-full flex-col")},m(g,b){M(g,e,b),r(e,t),r(t,s),r(s,i),r(e,f),r(e,o),v&&v.m(o,null),d=!0,E||(m=pe(s,"click",l[6]),E=!0)},p(g,b){(!d||b&8)&&n!==(n=g[3].t("Ollama")+"")&&j(i,n),(!d||b&2&&a!==(a="min-w-fit roun
110ded-full p-1.5 "+(g[1]==="ollama"?"":"text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")+" transition"))&&u(s,"class",a),g[1]==="ollama"?v?(v.p(g,b),b&2&&G(v,1)):(v=wi(g),v.c(),G(v,1),v.m(o,null)):v&&(ht(),W(v,1,1,()=>{v=null}),pt())},i(g){d||(G(v),d=!0)},o(g){W(v),d=!1},d(g){g&&c(e),v&&v.d(),E=!1,m()}}}function Wd(l){let e,t,s=l[3].t("No inference engine with management support found")+"",n;return{c(){e=_("div"),t=_("div"),n=B(s),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{});var f=p(t);n=H(f,s),f.forEach(c),a.forEach(c),this.h()},h(){u(e,"class","py-5 text-gray-400 text-xs")},m(i,a){M(i,e,a),r(e,t),r(t,n)},p(i,a){a&8&&s!==(s=i[3].t("No inference engine with management support found")+"")&&j(n,s)},i:st,o:st,d(i){i&&c(e)}}}function wi(l){let e,t;return e=new Kd({props:{ollamaConfig:l[2]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&4&&(i.ollamaConfig=s[2]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Fd(l){let e,t,s,n=l[3].t("Manage Models")+"",i,a,f,o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',d,E,m,v,g,b,w,A;const I=[Wd,jd,Yd],k=[];function T(R,O){return R[1]===""?0:R[1]!==null?1:2}return v=T(l),g=k[v]=I[v](l),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("button"),f.innerHTML=o,d=N(),E=_("div"),m=_("div"),g.c(),this.h()},l(R){e=h(R,"DIV",{});var O=p(e);t=h(O,"DIV",{class:!0});var y=p(t);s=h(y,"DIV",{class:!0});var L=p(s);i=H(L,n),L.forEach(c),a=$(y),f=h(y,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(f)!=="svelte-745w2y"&&(f.innerHTML=o),y.forEach(c),d=$(O),E=h(O,"DIV",{class:!0});var P=p(E);m=h(P,"DIV",{class:!0});var D=p(m);g.l(D),D.forEach(c),P.forEach(c),O.forEach(c),this.h()},h(){u(s,"class","text-lg font-medium self-center font-primary"),u(f,"class","self-center"),u(t,"class","flex justify-between dark:text-gray-100 px-5 pt-4"),u(m,"class","flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6"),u(E,"class","flex flex-col md:flex-row w-full px-3 pb-4 md:space-x-4 dark:text-gray-200")},m(R,O){M(R,e,O),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(e,d),r(e,E),r(E,m),k[v].m(m,null),b=!0,w||(A=pe(f,"click",l[5]),w=!0)},p(R,O){(!b||O&8)&&n!==(n=R[3].t("Manage Models")+"")&&j(i,n);let y=v;v=T(R),v===y?k[v].p(R,O):(ht(),W(k[y],1,1,()=>{k[y]=null}),pt(),g=k[v],g?g.p(R,O):(g=k[v]=I[v](R),g.c()),G(g,1),g.m(m,null))},i(R){b||(G(g),b=!0)},o(R){W(g),b=!1},d(R){R&&c(e),k[v].d(),w=!1,A()}}}function qd(l){let e,t,s;function n(a){l[7](a)}let i={size:"sm",$$slots:{default:[Fd]},$$scope:{ctx:l}};return l[0]!==void 0&&(i.show=l[0]),e=new Bn({props:i}),Ye.push(()=>qe(e,"show",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,[f]){const o={};f&1039&&(o.$$scope={dirty:f,ctx:a}),!t&&f&1&&(t=!0,o.show=a[0],Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Zd(l,e,t){let s,n;qt(l,rn,v=>t(8,s=v));const i=Ul("i18n");qt(l,i,v=>t(3,n=v)),Ss();let{show:a=!1}=e,f=null,o=null;rs(async()=>{if((s==null?void 0:s.role)==="admin"){if(await Promise.all([(async()=>{t(2,o=await No(localStorage.token))})()]),o){t(1,f="ollama");return}t(1,f="")}});const d=()=>{t(0,a=!1)},E=()=>{t(1,f="ollama")};function m(v){a=v,t(0,a)}return l.$$set=v=>{"show"in v&&t(0,a=v.show)},[a,f,o,n,i,d,E,m]}class Xd extends Sl{constructor(e){super(),Pl(this,e,Zd,qd,Ol,{show:0})}}function Jd(l){let e;const t=l[8].default,s=Ko(t,l,l[13],null);return{c(){s&&s.c()},l(n){s&&s.l(n)},m(n,i){s&&s.m(n,i),e=!0},p(n,i){s&&s.p&&(!e||i&8192)&&Yo(s,t,n,n[13],e?Wo(t,n[13],i,null):jo(n[13]),null)},i(n){e||(G(s,n),e=!0)},o(n){W(s,n),e=!1},d(n){s&&s.d(n)}}}function zd(l){let e,t;return e=new Gt({props:{content:l[5].t("More"),$$slots:{default:[Jd]},$$scope:{ctx:l}}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&32&&(i.content=s[5].t("More")),n&8192&&(i.$$scope={dirty:n,ctx:s}),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Qd(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,fill:!0,viewBox:!0,"stroke-width":!0,stroke:!0,class:!0});var i=p(e);t=nl(i,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}
110),p(t).forEach(c),s=nl(i,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"stroke-linecap","round"),u(t,"stroke-linejoin","round"),u(t,"d","M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"),u(s,"stroke-linecap","round"),u(s,"stroke-linejoin","round"),u(s,"d","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","size-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function xd(l){let e,t;return{c(){e=sl("svg"),t=sl("path"),this.h()},l(s){e=nl(s,"svg",{xmlns:!0,fill:!0,viewBox:!0,"stroke-width":!0,stroke:!0,class:!0});var n=p(e);t=nl(n,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}),p(t).forEach(c),n.forEach(c),this.h()},h(){u(t,"stroke-linecap","round"),u(t,"stroke-linejoin","round"),u(t,"d","M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","size-4")},m(s,n){M(s,e,n),r(e,t)},d(s){s&&c(e)}}}function e_(l){let e=l[5].t("Hide Model")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n&32&&e!==(e=s[5].t("Hide Model")+"")&&j(t,e)},d(s){s&&c(t)}}}function t_(l){let e=l[5].t("Show Model")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n&32&&e!==(e=s[5].t("Show Model")+"")&&j(t,e)},d(s){s&&c(t)}}}function l_(l){let e,t;function s(d,E){var m,v;return((v=(m=d[0])==null?void 0:m.meta)==null?void 0:v.hidden)??!1?xd:Qd}let n=s(l),i=n(l);function a(d,E){var m,v;return((v=(m=d[0])==null?void 0:m.meta)==null?void 0:v.hidden)??!1?t_:e_}let f=a(l),o=f(l);return{c(){i.c(),e=N(),t=_("div"),o.c(),this.h()},l(d){i.l(d),e=$(d),t=h(d,"DIV",{class:!0});var E=p(t);o.l(E),E.forEach(c),this.h()},h(){u(t,"class","flex items-center")},m(d,E){i.m(d,E),M(d,e,E),M(d,t,E),o.m(t,null)},p(d,E){n!==(n=s(d))&&(i.d(1),i=n(d),i&&(i.c(),i.m(e.parentNode,e))),f===(f=a(d))&&o?o.p(d,E):(o.d(1),o=f(d),o&&(o.c(),o.m(t,null)))},d(d){d&&(c(e),c(t)),i.d(d),o.d()}}}function s_(l){let e,t,s,n=l[5].t("Export")+"",i,a;return e=new Kn({}),{c(){ce(e.$$.fragment),t=N(),s=_("div"),i=B(n),this.h()},l(f){de(e.$$.fragment,f),t=$(f),s=h(f,"DIV",{class:!0});var o=p(s);i=H(o,n),o.forEach(c),this.h()},h(){u(s,"class","flex items-center")},m(f,o){_e(e,f,o),M(f,t,o),M(f,s,o),r(s,i),a=!0},p(f,o){(!a||o&32)&&n!==(n=f[5].t("Export")+"")&&j(i,n)},i(f){a||(G(e.$$.fragment,f),a=!0)},o(f){W(e.$$.fragment,f),a=!1},d(f){f&&(c(t),c(s)),he(e,f)}}}function n_(l){let e,t,s,n;return e=new Yr({props:{class:"flex  gap-2  items-center px-3 py-2 text-sm  font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md",$$slots:{default:[l_]},$$scope:{ctx:l}}}),e.$on("click",l[9]),s=new Yr({props:{class:"flex gap-2 items-center px-3 py-2 text-sm  font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md",$$slots:{default:[s_]},$$scope:{ctx:l}}}),s.$on("click",l[10]),{c(){ce(e.$$.fragment),t=N(),ce(s.$$.fragment)},l(i){de(e.$$.fragment,i),t=$(i),de(s.$$.fragment,i)},m(i,a){_e(e,i,a),M(i,t,a),_e(s,i,a),n=!0},p(i,a){const f={};a&8225&&(f.$$scope={dirty:a,ctx:i}),e.$set(f);const o={};a&8224&&(o.$$scope={dirty:a,ctx:i}),s.$set(o)},i(i){n||(G(e.$$.fragment,i),G(s.$$.fragment,i),n=!0)},o(i){W(e.$$.fragment,i),W(s.$$.fragment,i),n=!1},d(i){i&&c(t),he(e,i),he(s,i)}}}function r_(l){let e,t,s;return t=new lf({props:{class:"w-full max-w-[160px] rounded-xl px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-850 dark:text-white shadow-sm",sideOffset:-2,side:"bottom",align:"start",transition:sf,$$slots:{default:[n_]},$$scope:{ctx:l}}}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{slot:!0});var i=p(e);
110de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"slot","content")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p(n,i){const a={};i&8231&&(a.$$scope={dirty:i,ctx:n}),t.$set(a)},i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function a_(l){let e,t,s;function n(a){l[11](a)}let i={$$slots:{content:[r_],default:[zd]},$$scope:{ctx:l}};return l[4]!==void 0&&(i.show=l[4]),e=new tf({props:i}),Ye.push(()=>qe(e,"show",n)),e.$on("change",l[12]),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,[f]){const o={};f&8231&&(o.$$scope={dirty:f,ctx:a}),!t&&f&16&&(t=!0,o.show=a[4],Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function i_(l,e,t){let s,{$$slots:n={},$$scope:i}=e;const a=Ul("i18n");qt(l,a,I=>t(5,s=I));let{user:f}=e,{model:o}=e,{exportHandler:d}=e,{hideHandler:E}=e,{onClose:m}=e,v=!1;const g=()=>{E()},b=()=>{d()};function w(I){v=I,t(4,v)}const A=I=>{I.detail===!1&&m()};return l.$$set=I=>{"user"in I&&t(7,f=I.user),"model"in I&&t(0,o=I.model),"exportHandler"in I&&t(1,d=I.exportHandler),"hideHandler"in I&&t(2,E=I.hideHandler),"onClose"in I&&t(3,m=I.onClose),"$$scope"in I&&t(13,i=I.$$scope)},[o,d,E,m,v,s,a,f,n,g,b,w,A,i]}class o_ extends Sl{constructor(e){super(),Pl(this,e,i_,a_,Ol,{user:7,model:0,exportHandler:1,hideHandler:2,onClose:3})}}function u_(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,fill:!0,viewBox:!0,"stroke-width":!0,stroke:!0,class:!0});var i=p(e);t=nl(i,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}),p(t).forEach(c),s=nl(i,"path",{"stroke-linecap":!0,"stroke-linejoin":!0,d:!0}
110),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"stroke-linecap","round"),u(t,"stroke-linejoin","round"),u(t,"d","M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"),u(s,"stroke-linecap","round"),u(s,"stroke-linejoin","round"),u(s,"d","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width",l[1]),u(e,"stroke","currentColor"),u(e,"class",l[0])},m(n,i){M(n,e,i),r(e,t),r(e,s)},p(n,[i]){i&2&&u(e,"stroke-width",n[1]),i&1&&u(e,"class",n[0])},i:st,o:st,d(n){n&&c(e)}}}function f_(l,e,t){let{className:s="w-4 h-4"}=e,{strokeWidth:n="1.5"}=e;return l.$$set=i=>{"className"in i&&t(0,s=i.className),"strokeWidth"in i&&t(1,n=i.strokeWidth)},[s,n]}class c_ extends Sl{constructor(e){super(),Pl(this,e,f_,u_,Ol,{className:0,strokeWidth:1})}}function Ti(l,e,t){const s=l.slice();return s[43]=e[t],s[44]=e,s[45]=t,s}function d_(l){let e,t,s;return t=new Ps({}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","h-full w-full flex justify-center items-center")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function __(l){let e,t,s,n;const i=[p_,h_],a=[];function f(o,d){return o[6]===null?0:1}return e=f(l),t=a[e]=i[e](l),{c(){t.c(),s=xt()},l(o){t.l(o),s=xt()},m(o,d){a[e].m(o,d),M(o,s,d),n=!0},p(o,d){let E=e;e=f(o),e===E?a[e].p(o,d):(ht(),W(a[E],1,1,()=>{a[E]=null}),pt(),t=a[e],t?t.p(o,d):(t=a[e]=i[e](o),t.c()),G(t,1),t.m(s.parentNode,s))},i(o){n||(G(t),n=!0)},o(o){W(t),n=!1},d(o){o&&c(s),a[e].d(o)}}}function h_(l){let e,t;return e=new qu({props:{edit:!0,model:l[0].find(l[37]),preset:!1,onSubmit:l[38],onBack:l[39]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n[0]&65&&(i.model=s[0].find(s[37])),n[0]&64&&(i.onSubmit=s[38]),n[0]&64&&(i.onBack=s[39]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function p_(l){var le;let e,t,s,n=l[9].t("Models")+"",i,a,f,o,d,E=l[5].length+"",m,v,g,b,w,A,I,k,T,R,O,y,L,P,D,S,K,Y,C,V,U,F,X;b=new Gt({props:{content:l[9].t("Manage Models"),$$slots:{default:[v_]},$$scope:{ctx:l}}}),A=new Gt({props:{content:l[9].t("Settings"),$$slots:{default:[m_]},$$scope:{ctx:l}}}),O=new Fu({props:{className:"size-3.5"}});const Z=[E_,g_],J=[];function ie(x,oe){return x[0].length>0?0:1}K=ie(l),Y=J[K]=Z[K](l);let fe=((le=l[12])==null?void 0:le.role)==="admin"&&ki(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=N(),d=_("span"),m=B(E),v=N(),g=_("div"),ce(b.$$.fragment),w=N(),ce(A.$$.fragment),I=N(),k=_("div"),T=_("div"),R=_("div"),ce(O.$$.fragment),y=N(),L=_("input"),D=N(),S=_("div"),Y.c(),C=N(),fe&&fe.c(),V=xt(),this.h()},l(x){e=h(x,"DIV",{class:!0});var oe=p(e);t=h(oe,"DIV",{class:!0});var se=p(t);s=h(se,"DIV",{class:!0});var te=p(s);i=H(te,n),a=$(te),f=h(te,"DIV",{class:!0}),p(f).forEach(c),o=$(te),d=h(te,"SPAN",{class:!0});var ae=p(d);m=H(ae,E),ae.forEach(c),te.forEach(c),v=$(se),g=h(se,"DIV",{class:!0});var Te=p(g);de(b.$$.fragment,Te),w=$(Te),de(A.$$.fragment,Te),Te.forEach(c),se.forEach(c),I=$(oe),k=h(oe,"DIV",{class:!0});var ve=p(k);T=h(ve,"DIV",{class:!0});var q=p(T);R=h(q,"DIV",{class:!0});var ne=p(R);de(O.$$.fragment,ne),ne.forEach(c),y=$(q),L=h(q,"INPUT",{class:!0,placeholder:!0}),q.forEach(c),ve.forEach(c),oe.forEach(c),D=$(x),S=h(x,"DIV",{class:!0,id:!0});var Ie=p(S);Y.l(Ie),Ie.forEach(c),C=$(x),fe&&fe.l(x),V=xt(),this.h()},h(){u(f,"class","flex self-center w-[1px] h-6 mx-2.5 bg-gray-50 dark:bg-gray-850"),u(d,"class","text-lg font-medium text-gray-500 dark:text-gray-300"),u(s,"class","flex items-center md:self-center text-xl font-medium px-0.5"),u(g,"class","flex items-center gap-1.5"),u(t,"class","flex justify-between items-center"),u(R,"class","self-center ml-1 mr-3"),u(L,"class","w-full text-sm py-1 rounded-r-xl outline-hidden bg-transparent"),u(L,"placeholder",P=l[9].t("Search Models")),u(T,"class","flex flex-1 items-center"),u(k,"class","flex flex-1 items-center w-full space-x-2"),u(e,"class","flex flex-col gap-1 mt-1.5 mb-2"),u(S,"class","my-2 mb-5"),u(S,"id","model-list")},m(x,oe){M(x,e,oe),r(e,t),r(t,s),r(s,i),r(s,a),r(s,f),r(s,o),r(s,d),r(d,m),r(t,v),r(t,g),_e(b,g,null),r(g,w),_e(A,g,null),r(e,I),r(e,k),r(k,T),r(T,R),_e(O,R,null),r(T,y),r(T,L),Q(L,l[1]),M(x,D,oe),M(x,S,oe),J[K].m(S,null),M(x,C,oe),fe&&fe.m(x,oe),M(x,V,oe),U=!0,F||(X=pe(L,"input",l[24]),F=!0)},p(x,oe){var Te;(!U||oe[0]&512)&&n!==(n=x[9].t("Models")+"")&&j(i,n),(!U||oe[0]&32)&&E!==(E=x[5].length+"")&&j(m,E);const se={};oe[0]&512&&(se.content=x[9].t("Manage Models")),oe[0]&256|oe[1]&32768&&(se.$$scope={dirty:oe,ctx:x}),b.$set(se);const te={};oe[0]&512&&(te.content=x[9].t("Settings")),oe[0]&128|oe[1]&32768&&(te.$$scope={dirty:oe,ctx:x}),A.$set(te),(!U||oe[0]&512&&P!==(P=x[9].t("Search Models")))&&u(L,"placeholder",P),oe[0]&2&&L.value!==x[1]&&Q(L,x[1]);let ae=K;K=ie(x),K===ae?J[K].p(x,oe):(ht(),W(J[ae],1,1,()=>{J[ae]=null}),pt(),Y=J[K],Y?Y.p(x,oe):(Y=J[K]=Z[K](x),Y.c()),G(Y,1),Y.m(S,null)),((Te=x[12])==null?void 0:Te.role)==="admin"?fe?fe.p(x,oe):(fe=ki(x),fe.c(),fe.m(V.parentNode,V)):fe&&(fe.d(1),fe=null)},i(x){U||(G(b.$$.fragment,x),G(A.$$.fragment,x),G(O.$$.fragment,x),G(Y),U=!0)},o(x){W(b.$$.fragment,x),W(A.$$.fragment,x),W(O.$$.fragment,x),W(Y),U=!1},d(x){x&&(c(e),c(D),c(S),c(C),c(V)),he(b),he(A),he(O),J[K].d(),fe&&fe.d(x),F=!1,X()}}}function v_(l){let e,t,s,n,i;return t=new Kn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","p-1 rounded-full flex gap-1 items-center"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[22]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function m_(l){let e,t,s,n,i;return t=new Mn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","p-1 rounded-full flex gap-1 items-center"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[23]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function g_(l){let e,t,s=l[9].t("No models found")+"",n;return{c(){e=_("div"),t=_("div"),n=B(s),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);n=H(f,s),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","text-gray-500 dark:text-gray-400 text-xs"),u(e,"class","flex flex-col items-center justify-center w-full h-20")},m(i,a){M(i,e,a),r(e,t),r(t,n)},p(i,a){a[0]&512&&s!==(s=i[9].t("No models found")+"")&&j(n,s)},i:st,o:st,d(i){i&&c(e)}}}function E_(l){let e=[],t=new Map,s,n,i=Dt(l[5]);const a=f=>f[43].id;for(let f=0;f<i.length;f+=1){let o=Ti(l,i,f),d=a(o);t.set(d,e[f]=Ai(d,o))}return{c(){for(let f=0;f<e.length;f+=1)e[f].c();s=xt()},l(f){for(let o=0;o<e.length;o+=1)e[o].l(f);s=xt()},m(f,o){for(let d=0;d<e.length;d+=1)e[d]&&e[d].m(f,o);M(f,s,o),n=!0},p(f,o){o[0]&922212&&(i=Dt(f[5]),ht(),e=Ao(e,o,a,1,f,i,t,s.parentNode,ko,Ai,s,Ti),pt())},i(f){if(!n){for(let o=0;o<i.length;o+=1)G(e[o]);n=!0}},o(f){for(let o=0;o<e.length;o+=1)W(e[o]);n=!1},d(f){f&&c(s);for(let o=0;o<e.length;o+=1)e[o].d(f)}}}function b_(l){let e,t=l[43].name+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);
110s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","font-semibold line-clamp-1")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&32&&t!==(t=n[43].name+"")&&j(s,t)},d(n){n&&c(e)}}}function I_(l){var b;let e,t='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"></path></svg>',s,n,i,a,f,o,d,E;function m(){return l[27](l[43])}function v(){return l[28](l[43])}function g(){return l[29](l[43])}return n=new o_({props:{user:l[12],model:l[43],exportHandler:v,hideHandler:g,onClose:R_,$$slots:{default:[T_]},$$scope:{ctx:l}}}),f=new Gt({props:{content:((b=l[43])==null?void 0:b.is_active)??!0?l[9].t("Enabled"):l[9].t("Disabled"),$$slots:{default:[A_]},$$scope:{ctx:l}}}),{c(){e=_("button"),e.innerHTML=t,s=N(),ce(n.$$.fragment),i=N(),a=_("div"),ce(f.$$.fragment),this.h()},l(w){e=h(w,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-jdmw8w"&&(e.innerHTML=t),s=$(w),de(n.$$.fragment,w),i=$(w),a=h(w,"DIV",{class:!0});var A=p(a);de(f.$$.fragment,A),A.forEach(c),this.h()},h(){u(e,"class","self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"),u(e,"type","button"),u(a,"class","ml-1")},m(w,A){M(w,e,A),M(w,s,A),_e(n,w,A),M(w,i,A),M(w,a,A),_e(f,a,null),o=!0,d||(E=pe(e,"click",m),d=!0)},p(w,A){var T;l=w;const I={};A[0]&4096&&(I.user=l[12]),A[0]&32&&(I.model=l[43]),A[0]&32&&(I.exportHandler=v),A[0]&32&&(I.hideHandler=g),A[1]&32768&&(I.$$scope={dirty:A,ctx:l}),n.$set(I);const k={};A[0]&544&&(k.content=((T=l[43])==null?void 0:T.is_active)??!0?l[9].t("Enabled"):l[9].t("Disabled")),A[0]&32|A[1]&32768&&(k.$$scope={dirty:A,ctx:l}),f.$set(k)},i(w){o||(G(n.$$.fragment,w),G(f.$$.fragment,w),o=!0)},o(w){W(n.$$.fragment,w),W(f.$$.fragment,w),o=!1},d(w){w&&(c(e),c(s),c(i),c(a)),he(n,w),he(f),d=!1,E()}}}function w_(l){var s,n;let e,t;return e=new Gt({props:{content:(n=(s=l[43])==null?void 0:s.meta)!=null&&n.hidden?l[9].t("Show"):l[9].t("Hide"),$$slots:{default:[N_]},$$scope:{ctx:l}}}),{c(){ce(e.$$.fragment)},l(i){de(e.$$.fragment,i)},m(i,a){_e(e,i,a),t=!0},p(i,a){var o,d;const f={};a[0]&544&&(f.content=(d=(o=i[43])==null?void 0:o.meta)!=null&&d.hidden?i[9].t("Show"):i[9].t("Hide")),a[0]&32|a[1]&32768&&(f.$$scope={dirty:a,ctx:i}),e.$set(f)},i(i){t||(G(e.$$.fragment,i),t=!0)},o(i){W(e.$$.fragment,i),t=!1},d(i){he(e,i)}}}function T_(l){let e,t,s;return t=new nf({props:{className:"size-5"}}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"BUTTON",{class:!0,type:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"),u(e,"type","button")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function A_(l){let e,t,s;function n(f){l[30](f,l[43])}function i(){return l[31](l[43])}let a={};return l[43].is_active!==void 0&&(a.state=l[43].is_active),e=new vl({props:a}),Ye.push(()=>qe(e,"state",n)),e.$on("change",i),{c(){ce(e.$$.fragment)},l(f){de(e.$$.fragment,f)},m(f,o){_e(e,f,o),s=!0},p(f,o){l=f;const d={};!t&&o[0]&32&&(t=!0,d.state=l[43].is_active,Fe(()=>t=!1)),e.$set(d)},i(f){s||(G(e.$$.fragment,f),s=!0)},o(f){W(e.$$.fragment,f),s=!1},d(f){he(e,f)}}}function k_(l){let e,t;return e=new c_({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function D_(l){let e,t;return e=new Gu({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function N_(l){let e,t,s,n,i,a;const f=[D_,k_],o=[];function d(m,v){var g,b;return(b=(g=m[43])==null?void 0:g.meta)!=null&&b.hidden?0:1}t=d(l),s=o[t]=f[t](l);function E(){return l[26](l[43])}return{c(){e=_("button"),s.c(),this.h()},l(m){e=h(m,"BUTTON",{class:!0,type:!0});var v=p(e);s.l(v),v.forEach(c),this.h()},h(){u(e,"class","self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"),u(e,"type","button")},m(m,v){M(m,e,v),o[t].m(e,null),n=!0,i||(a=pe(e,"click",E),i=!0)},p(m,v){l=m;let g=t;t=d(l),t!==g&&(ht(),W(o[g],1,1,()=>{o[g]=null}),pt(),s=o[t],s||(s=o[t]=f[t](l),s.c()),G(s,1),s.m(e,null))},i(m){n||(G(s),n=!0)},o(m){W(s),n=!1},d(m){m&&c(e),o[t].d(),i=!1,a()}}}function Ai(l,e){var F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne,Ie,be;let t,s,n,i,a,f,o,d,E,m,v,g,b,w=((X=(F=e[43])==null?void 0:F.meta)!=null&&X.description?(J=(Z=e[43])==null?void 0:Z.meta)==null?void 0:J.description:(fe=(ie=e[43])==null?void 0:ie.ollama)!=null&&fe.digest?`${e[43].id} (${(x=(le=e[43])==null?void 0:le.ollama)==null?void 0:x.digest})`:e[43].id)+"",A,I,k,T,R,O,y,L,P,D,S,K;
110m=new Gt({props:{content:Lr.parse((se=(oe=e[43])==null?void 0:oe.meta)!=null&&se.description?(ae=(te=e[43])==null?void 0:te.meta)==null?void 0:ae.description:(ve=(Te=e[43])==null?void 0:Te.ollama)!=null&&ve.digest?`${(ne=(q=e[43])==null?void 0:q.ollama)==null?void 0:ne.digest} **(${(be=(Ie=e[43])==null?void 0:Ie.ollama)==null?void 0:be.modified_at})**`:e[43].id),className:" w-fit",placement:"top-start",$$slots:{default:[b_]},$$scope:{ctx:e}}});function Y(){return e[25](e[43])}const C=[w_,I_],V=[];function U(z,ke){return z[2]?0:1}return R=U(e),O=V[R]=C[R](e),{key:l,first:null,c(){t=_("div"),s=_("button"),n=_("div"),i=_("div"),a=_("img"),d=N(),E=_("div"),ce(m.$$.fragment),v=N(),g=_("div"),b=_("span"),A=B(w),k=N(),T=_("div"),O.c(),y=N(),this.h()},l(z){t=h(z,"DIV",{class:!0,id:!0});var ke=p(t);s=h(ke,"BUTTON",{class:!0,type:!0});var Ue=p(s);n=h(Ue,"DIV",{class:!0});var we=p(n);i=h(we,"DIV",{class:!0});var Ae=p(i);a=h(Ae,"IMG",{src:!0,alt:!0,class:!0}),Ae.forEach(c),we.forEach(c),d=$(Ue),E=h(Ue,"DIV",{class:!0});var Re=p(E);de(m.$$.fragment,Re),v=$(Re),g=h(Re,"DIV",{class:!0});var ue=p(g);b=h(ue,"SPAN",{class:!0});var Ee=p(b);A=H(Ee,w),Ee.forEach(c),ue.forEach(c),Re.forEach(c),Ue.forEach(c),k=$(ke),T=h(ke,"DIV",{class:!0});var Me=p(T);O.l(Me),Me.forEach(c),y=$(ke),ke.forEach(c),this.h()},h(){var z,ke,Ue,we,Ae,Re;sn(a.src,f=((ke=(z=e[43])==null?void 0:z.meta)==null?void 0:ke.profile_image_url)??"/static/favicon.png")||u(a,"src",f),u(a,"alt","modelfile profile"),u(a,"class","rounded-full w-full h-auto object-cover"),u(i,"class",o="rounded-full object-cover "+(((Ue=e[43])==null?void 0:Ue.is_active)??!0?"":"opacity-50 dark:opacity-50")),u(n,"class","self-center w-8"),u(b,"class","line-clamp-1"),u(g,"class","text-xs overflow-hidden text-ellipsis line-clamp-1 text-gray-500"),u(E,"class",I="flex-1 self-center "+(((we=e[43])==null?void 0:we.is_active)??!0?"":"text-gray-500")),u(s,"class","flex flex-1 text-left space-x-3.5 cursor-pointer w-full"),u(s,"type","button"),u(T,"class","flex flex-row gap-0.5 items-center self-center"),u(t,"class",L="flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-lg transition "+((Re=(Ae=e[43])==null?void 0:Ae.meta)!=null&&Re.hidden?"opacity-50 dark:opacity-50":"")),u(t,"id",P="model-item-"+e[43].id),this.first=t},m(z,ke){M(z,t,ke),r(t,s),r(s,n),r(n,i),r(i,a),r(s,d),r(s,E),_e(m,E,null),r(E,v),r(E,g),r(g,b),r(b,A),r(t,k),r(t,T),V[R].m(T,null),r(t,y),D=!0,S||(K=pe(s,"click",Y),S=!0)},p(z,ke){var Ae,Re,ue,Ee,Me,Ge,ee,me,ge,Ne,ye,ze,Ce,Le,Ke,re,$e,ut,ft,ct,Be,Ve,je,Rt;e=z,(!D||ke[0]&32&&!sn(a.src,f=((Re=(Ae=e[43])==null?void 0:Ae.meta)==null?void 0:Re.profile_image_url)??"/static/favicon.png"))&&u(a,"src",f),(!D||ke[0]&32&&o!==(o="rounded-full object-cover "+(((ue=e[43])==null?void 0:ue.is_active)??!0?"":"opacity-50 dark:opacity-50")))&&u(i,"class",o);const Ue={};ke[0]&32&&(Ue.content=Lr.parse((Me=(Ee=e[43])==null?void 0:Ee.meta)!=null&&Me.description?(ee=(Ge=e[43])==null?void 0:Ge.meta)==null?void 0:ee.description:(ge=(me=e[43])==null?void 0:me.ollama)!=null&&ge.digest?`${(ye=(Ne=e[43])==null?void 0:Ne.ollama)==null?void 0:ye.digest} **(${(Ce=(ze=e[43])==null?void 0:ze.ollama)==null?void 0:Ce.modified_at})**`:e[43].id)),ke[0]&32|ke[1]&32768&&(Ue.$$scope={dirty:ke,ctx:e}),m.$set(Ue),(!D||ke[0]&32)&&w!==(w=((Ke=(Le=e[43])==null?void 0:Le.meta)!=null&&Ke.description?($e=(re=e[43])==null?void 0:re.meta)==null?void 0:$e.description:(ft=(ut=e[43])==null?void 0:ut.ollama)!=null&&ft.digest?`${e[43].id} (${(Be=(ct=e[43])==null?void 0:ct.ollama)==null?void 0:Be.digest})`:e[43].id)+"")&&j(A,w),(!D||ke[0]&32&&I!==(I="flex-1 self-center "+(((Ve=e[43])==null?void 0:Ve.is_active)??!0?"":"text-gray-500")))&&u(E,"class",I);let we=R;R=U(e),R===we?V[R].p(e,ke):(ht(),W(V[we],1,1,()=>{V[we]=null}),pt(),O=V[R],O?O.p(e,ke):(O=V[R]=C[R](e),O.c()),G(O,1),O.m(T,null)),(!D||ke[0]&32&&L!==(L="flex space-x-4 cursor-pointer w-full px-3 py-2 dark:hover:bg-white/5 hover:bg-black/5 rounded-lg transition "+((Rt=(je=e[43])==null?void 0:je.meta)!=null&&Rt.hidden?"opacity-50 dark:opacity-50":"")))&&u(t,"class",L),(!D||ke[0]&32&&P!==(P="model-item-"+e[43].id))&&u(t,"id",P)},i(z){D||(G(m.$$.fragment,z),G(O),D=!0)},o(z){W(m.$$.fragment,z),W(O),D=!1},d(z){z&&c(t),he(m),V[R].d(),S=!1,K()}}}function ki(l){let e,t,s,n,i,a,f=l[9].t("Import Presets")+"",o,d,E,m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-3.5 h-3.5"><path fill-rule="evenodd" d="M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 9.5a.75.75 0 0 1-.75-.75V8.06l-.72.72a.75.75 0 0 1-1.06-1.06l2-2a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-.72-.72v2.69a.75.75 0 0 1-.75.75Z" clip-rule="evenodd"></path></svg>',v,g,b,w=l[9].t("Export Presets")+"",A,I,k,T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-3.5 h-3.5"><path fill-rule="evenodd" d="M4 2a1.5 1.5 0 0 0-1.5 1.5v9A1.5 1.5 0 0 0 4 14h8a1.5 1.5 0 0 0 1.5-1.5V6.621a1.5 1.5 0 0 0-.44-1.06L9.94 2.439A1.5 1.5 0 0 0 8.878 2H4Zm4 3.5a.75.75 0 0 1 .75.75v2.69l.72-.72a.75.75 0 1 1 1.06 1.06l-2 2a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 0 1 1.06-1.06l.72.72V6.25A.75.75 0 0 1 8 5.5Z" clip-rule="evenodd"></path></svg>',R,O;return{c(){e=_("div"),t=_("div"),s=_("input"),n=N(),i=_("button"),a=_("div"),o=B(f),d=N(),E=_("div"),E.innerHTML=m,v=N(),g=_("button"),b=_("div"),A=B(w),I=N(),k=_("div"),k.innerHTML=T,this.h()},l(y){e=h(y,"DIV",{class:!0});var L=p(e);t=h(L,"DIV",{class:!0});var P=p(t);s=h(P,"INPUT",{id:!0,type:!0,accept:!0}),n=$(P),i=h(P,"BUTTON",{class:!0});var D=p(i);a=h(D,"DIV",{class:!0});var S=p(a);
110o=H(S,f),S.forEach(c),d=$(D),E=h(D,"DIV",{class:!0,"data-svelte-h":!0}),Wt(E)!=="svelte-1ikvh1y"&&(E.innerHTML=m),D.forEach(c),v=$(P),g=h(P,"BUTTON",{class:!0});var K=p(g);b=h(K,"DIV",{class:!0});var Y=p(b);A=H(Y,w),Y.forEach(c),I=$(K),k=h(K,"DIV",{class:!0,"data-svelte-h":!0}),Wt(k)!=="svelte-1v8dg5r"&&(k.innerHTML=T),K.forEach(c),P.forEach(c),L.forEach(c),this.h()},h(){u(s,"id","models-import-input"),u(s,"type","file"),u(s,"accept",".json"),s.hidden=!0,u(a,"class","self-center mr-2 font-medium line-clamp-1"),u(E,"class","self-center"),u(i,"class","flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 transition"),u(b,"class","self-center mr-2 font-medium line-clamp-1"),u(k,"class","self-center"),u(g,"class","flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-800 dark:hover:bg-gray-700 dark:text-gray-200 transition"),u(t,"class","flex space-x-1"),u(e,"class","flex justify-end w-full mb-3")},m(y,L){M(y,e,L),r(e,t),r(t,s),l[32](s),r(t,n),r(t,i),r(i,a),r(a,o),r(i,d),r(i,E),r(t,v),r(t,g),r(g,b),r(b,A),r(g,I),r(g,k),R||(O=[pe(s,"change",l[33]),pe(s,"change",l[34]),pe(i,"click",l[35]),pe(g,"click",l[36])],R=!0)},p(y,L){L[0]&512&&f!==(f=y[9].t("Import Presets")+"")&&j(o,f),L[0]&512&&w!==(w=y[9].t("Export Presets")+"")&&j(A,w)},d(y){y&&c(e),l[32](null),R=!1,ml(O)}}}function $_(l){let e,t,s,n,i,a,f,o,d,E;function m(k){l[20](k)}let v={initHandler:l[15]};l[7]!==void 0&&(v.show=l[7]),e=new Ed({props:v}),Ye.push(()=>qe(e,"show",m));function g(k){l[21](k)}let b={};l[8]!==void 0&&(b.show=l[8]),n=new Xd({props:b}),Ye.push(()=>qe(n,"show",g));const w=[__,d_],A=[];function I(k,T){return k[0]!==null?0:1}return f=I(l),o=A[f]=w[f](l),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment),a=N(),o.c(),d=xt()},l(k){de(e.$$.fragment,k),s=$(k),de(n.$$.fragment,k),a=$(k),o.l(k),d=xt()},m(k,T){_e(e,k,T),M(k,s,T),_e(n,k,T),M(k,a,T),A[f].m(k,T),M(k,d,T),E=!0},p(k,T){const R={};!t&&T[0]&128&&(t=!0,R.show=k[7],Fe(()=>t=!1)),e.$set(R);const O={};!i&&T[0]&256&&(i=!0,O.show=k[8],Fe(()=>i=!1)),n.$set(O);let y=f;f=I(k),f===y?A[f].p(k,T):(ht(),W(A[y],1,1,()=>{A[y]=null}),pt(),o=A[f],o?o.p(k,T):(o=A[f]=w[f](k),o.c()),G(o,1),o.m(d.parentNode,d))},i(k){E||(G(e.$$.fragment,k),G(n.$$.fragment,k),G(o),E=!0)},o(k){W(e.$$.fragment,k),W(n.$$.fragment,k),W(o),E=!1},d(k){k&&(c(s),c(a),c(d)),he(e,k),he(n,k),A[f].d(k)}}}const R_=()=>{};function O_(l,e,t){let s,n,i,a;qt(l,nn,q=>t(10,n=q)),qt(l,fs,q=>t(11,i=q)),qt(l,rn,q=>t(12,a=q));const{saveAs:f}=wo,o=Ul("i18n");qt(l,o,q=>t(9,s=q));let d=!1,E,m,v=null,g=null,b=null,w=[],A=null,I=!1,k=!1,T="";const R=async q=>{let ne=new Blob([JSON.stringify(q)],{type:"application/json"});f(ne,`models-export-${Date.now()}.json`)},O=async()=>{g=await Yu(localStorage.token),b=await ns(localStorage.token,null,!0),t(0,v=b.map(q=>{const ne=g.find(Ie=>Ie.id===q.id);return ne?{...q,...ne}:{...q,id:q.id,name:q.name,is_active:!0}}))},y=async q=>{var ne;q.base_model_id=null,g.find(Ie=>Ie.id===q.id)?await ju(localStorage.token,q.id,q).catch(be=>null)&&Je.success(s.t("Model updated successfully")):await Br(localStorage.token,{meta:{},id:q.id,name:q.name,base_model_id:null,params:{},access_control:{},...q}).catch(be=>null)&&Je.success(s.t("Model updated successfully")),Kl.set(await ns(localStorage.token,((ne=i==null?void 0:i.features)==null?void 0:ne.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null))),await O()},L=async q=>{var ne;Object.keys(q).includes("base_model_id")?await Wu(localStorage.token,q.id):await Br(localStorage.token,{id:q.id,name:q.name,base_model_id:null,meta:{},params:{},access_control:{},is_active:q.is_active}).catch(Ie=>null),Kl.set(await ns(localStorage.token,((ne=i==null?void 0:i.features)==null?void 0:ne.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null)))},P=async q=>{var ne;q.meta={...q.meta,hidden:!(((ne=q==null?void 0:q.meta)==null?void 0:ne.hidden)??!1)},console.log(q),Je.success(q.meta.hidden?s.t("Model {{name}} is now hidden",{name:q.id}):s.t("Model {{name}} is now visible",{name:q.id})),y(q)},D=async q=>{let ne=new Blob([JSON.stringify([q])],{type:"application/json"});f(ne,`${q.id}-${Date.now()}.json`)};rs(async()=>{await O();const q=be=>{be.key==="Shift"&&t(2,d=!0)},ne=be=>{be.key==="Shift"&&t(2,d=!1)},Ie=()=>{t(2,d=!1)};return window.addEventListener("keydown",q),window.addEventListener("keyup",ne),window.addEventListener("blur-sm",Ie),()=>{window.removeEventListener("keydown",q),window.removeEventListener("keyup",ne),window.removeEventListener("blur-sm",Ie)}});function S(q){I=q,t(7,I)}function K(q){k=q,t(8,k)}const Y=()=>{t(8,k=!0)},C=()=>{t(7,I=!0)};function V(){T=this.value,t(1,T)}const U=q=>{t(6,A=q.id)},F=q=>{P(q)},X=q=>{t(6,A=q.id)},Z=q=>{D(q)},J=q=>{P(q)};function ie(q,ne){l.$$.not_equal(ne.is_active,q)&&(ne.is_active=q,t(5,w),t(0,v),t(1,T))}const fe=async q=>{L(q)};function le(q){Ye[q?"unshift":"push"](()=>{m=q,t(4,m)})}function x(){E=this.files,t(3,E)}const oe=()=>{console.log(E);let q=new FileReader;q.onload=async ne=>{var be;let Ie=JSON.parse(ne.target.result);console.log(Ie);for(const z of Ie)Object.keys(z).includes("base_model_id")?z.base_model_id===null&&y(z):((z==null?void 0:z.info)??!1)&&z.info.base_model_id===null&&y(z.info);await Kl.set(await ns(localStorage.token,((be=i==null?void 0:i.features)==null?void 0:be.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null))),O()},q.readAsText(E[0])},se=()=>{m.click()},te=async()=>{R(v)},ae=q=>q.id===A,Te=q=>{console.log(q),y(q),t(6,A=null)},ve=()=>{t(6,A=null)};return l.$$.update=()=>{l.$$.dirty[0]&3&&v&&t(5,w=v.filter(q=>T===""||q.name.toLowerCase().includes(T.toLowerCase())).sort((q,ne)=>q.name.localeCompare(ne.name)))},[v,T,d,E,m,w,A,I,k,s,n,i,a,o,R,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve]}class S_ extends Sl{constructor(e){super(),Pl(this,e,O_,$_,Ol,{},null,[-1,-1])}}function Di(l){let e;return{c(){e=_("div"),this.h()},l(t){e=h(t,"DIV",{class:!0}),p(e).forEach(c),this.h()},h(){u(e,"class","absolute top-0 bottom-0 left-0 right-0 opacity-60 bg-white dark:bg-gray-900 z-10")},m(t,s){M(t,e,s)},d(t){t&&c(e)}}}function Ni(l){let e,t,s;return t=new Gt({props:{content:"Pipelines",$$slots:{default:[P_]},$$scope:{ctx:l}}}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);
110de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","absolute top-0.5 right-2.5")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function P_(l){let e,t,s,n;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),n=sl("path"),this.h()},l(i){e=nl(i,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var a=p(e);t=nl(a,"path",{d:!0}),p(t).forEach(c),s=nl(a,"path",{d:!0}),p(s).forEach(c),n=nl(a,"path",{d:!0}),p(n).forEach(c),a.forEach(c),this.h()},h(){u(t,"d","M11.644 1.59a.75.75 0 0 1 .712 0l9.75 5.25a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.712 0l-9.75-5.25a.75.75 0 0 1 0-1.32l9.75-5.25Z"),u(s,"d","m3.265 10.602 7.668 4.129a2.25 2.25 0 0 0 2.134 0l7.668-4.13 1.37.739a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.71 0l-9.75-5.25a.75.75 0 0 1 0-1.32l1.37-.738Z"),u(n,"d","m10.933 19.231-7.668-4.13-1.37.739a.75.75 0 0 0 0 1.32l9.75 5.25c.221.12.489.12.71 0l9.75-5.25a.75.75 0 0 0 0-1.32l-1.37-.738-7.668 4.13a2.25 2.25 0 0 1-2.134-.001Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 24 24"),u(e,"fill","currentColor"),u(e,"class","size-4")},m(i,a){M(i,e,a),r(e,t),r(e,s),r(e,n)},p:st,d(i){i&&c(e)}}}function V_(l){var k;let e,t,s,n,i,a,f,o,d,E,m,v,g,b=!(((k=l[2])==null?void 0:k.enable)??!0)&&Di(),w=l[5]&&Ni(l);function A(T){l[16](T)}let I={inputClassName:" outline-hidden bg-transparent w-full",placeholder:l[8].t("API Key")};return l[1]!==void 0&&(I.value=l[1]),d=new _l({props:I}),Ye.push(()=>qe(d,"value",A)),{c(){b&&b.c(),e=N(),t=_("div"),s=_("div"),n=_("input"),f=N(),w&&w.c(),o=N(),ce(d.$$.fragment),this.h()},l(T){b&&b.l(T),e=$(T),t=h(T,"DIV",{class:!0});var R=p(t);s=h(R,"DIV",{class:!0});var O=p(s);n=h(O,"INPUT",{class:!0,placeholder:!0,autocomplete:!0}),f=$(O),w&&w.l(O),O.forEach(c),o=$(R),de(d.$$.fragment,R),R.forEach(c),this.h()},h(){u(n,"class",i="outline-hidden w-full bg-transparent "+(l[5]?"pr-8":"")),u(n,"placeholder",a=l[8].t("API Base URL")),u(n,"autocomplete","off"),u(s,"class","flex-1 relative"),u(t,"class","flex w-full")},m(T,R){b&&b.m(T,R),M(T,e,R),M(T,t,R),r(t,s),r(s,n),Q(n,l[0]),r(s,f),w&&w.m(s,null),r(t,o),_e(d,t,null),m=!0,v||(g=pe(n,"input",l[15]),v=!0)},p(T,R){var y;((y=T[2])==null?void 0:y.enable)??!0?b&&(b.d(1),b=null):b||(b=Di(),b.c(),b.m(e.parentNode,e)),(!m||R&32&&i!==(i="outline-hidden w-full bg-transparent "+(T[5]?"pr-8":"")))&&u(n,"class",i),(!m||R&256&&a!==(a=T[8].t("API Base URL")))&&u(n,"placeholder",a),R&1&&n.value!==T[0]&&Q(n,T[0]),T[5]?w?R&32&&G(w,1):(w=Ni(T),w.c(),G(w,1),w.m(s,null)):w&&(ht(),W(w,1,1,()=>{w=null}),pt());const O={};R&256&&(O.placeholder=T[8].t("API Key")),!E&&R&2&&(E=!0,O.value=T[1],Fe(()=>E=!1)),d.$set(O)},i(T){m||(G(w),G(d.$$.fragment,T),m=!0)},o(T){W(w),W(d.$$.fragment,T),m=!1},d(T){T&&(c(e),c(t)),b&&b.d(T),w&&w.d(),he(d),v=!1,g()}}}function y_(l){let e,t,s,n,i;return t=new Mn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","self-center p-1 bg-transparent hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 rounded-lg transition"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[17]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function L_(l){let e,t,s,n,i,a,f,o,d,E,m,v;function g(I){l[10](I)}let b={};l[7]!==void 0&&(b.show=l[7]),e=new Ys({props:b}),Ye.push(()=>qe(e,"show",g)),e.$on("confirm",l[11]);function w(I){l[14](I)}let A={edit:!0,connection:{url:l[0],key:l[1],config:l[2]},onDelete:l[12],onSubmit:l[13]};return l[6]!==void 0&&(A.show=l[6]),n=new Cn({props:A}),Ye.push(()=>qe(n,"show",w)),o=new Gt({props:{className:"w-full relative",content:l[8].t('WebUI will make requests to "{{url}}/chat/completions"',{url:l[0]}),placement:"top-start",$$slots:{default:[V_]},$$scope:{ctx:l}}}),m=new Gt({props:{content:l[8].t("Configure"),className:"self-start",$$slots:{default:[y_]},$$scope:{ctx:l}}}),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment),a=N(),f=_("div"),ce(o.$$.fragment),d=N(),E=_("div"),ce(m.$$.fragment),this.h()},l(I){de(e.$$.fragment,I),s=$(I),de(n.$$.fragment,I),a=$(I),f=h(I,"DIV",{class:!0});var k=p(f);de(o.$$.fragment,k),d=$(k),E=h(k,"DIV",{class:!0});var T=p(E);
110de(m.$$.fragment,T),T.forEach(c),k.forEach(c),this.h()},h(){u(E,"class","flex gap-1"),u(f,"class","flex w-full gap-2 items-center")},m(I,k){_e(e,I,k),M(I,s,k),_e(n,I,k),M(I,a,k),M(I,f,k),_e(o,f,null),r(f,d),r(f,E),_e(m,E,null),v=!0},p(I,[k]){const T={};!t&&k&128&&(t=!0,T.show=I[7],Fe(()=>t=!1)),e.$set(T);const R={};k&7&&(R.connection={url:I[0],key:I[1],config:I[2]}),k&128&&(R.onDelete=I[12]),k&23&&(R.onSubmit=I[13]),!i&&k&64&&(i=!0,R.show=I[6],Fe(()=>i=!1)),n.$set(R);const O={};k&257&&(O.content=I[8].t('WebUI will make requests to "{{url}}/chat/completions"',{url:I[0]})),k&262439&&(O.$$scope={dirty:k,ctx:I}),o.$set(O);const y={};k&256&&(y.content=I[8].t("Configure")),k&262208&&(y.$$scope={dirty:k,ctx:I}),m.$set(y)},i(I){v||(G(e.$$.fragment,I),G(n.$$.fragment,I),G(o.$$.fragment,I),G(m.$$.fragment,I),v=!0)},o(I){W(e.$$.fragment,I),W(n.$$.fragment,I),W(o.$$.fragment,I),W(m.$$.fragment,I),v=!1},d(I){I&&(c(s),c(a),c(f)),he(e,I),he(n,I),he(o),he(m)}}}function C_(l,e,t){let s;const n=Ul("i18n");qt(l,n,O=>t(8,s=O));let{onDelete:i=()=>{}}=e,{onSubmit:a=()=>{}}=e,{pipeline:f=!1}=e,{url:o=""}=e,{key:d=""}=e,{config:E={}}=e,m=!1,v=!1;function g(O){v=O,t(7,v)}const b=()=>{i()},w=()=>{t(7,v=!0)},A=O=>{t(0,o=O.url),t(1,d=O.key),t(2,E=O.config),a(O)};function I(O){m=O,t(6,m)}function k(){o=this.value,t(0,o)}function T(O){d=O,t(1,d)}const R=()=>{t(6,m=!0)};return l.$$set=O=>{"onDelete"in O&&t(3,i=O.onDelete),"onSubmit"in O&&t(4,a=O.onSubmit),"pipeline"in O&&t(5,f=O.pipeline),"url"in O&&t(0,o=O.url),"key"in O&&t(1,d=O.key),"config"in O&&t(2,E=O.config)},[o,d,E,i,a,f,m,v,s,n,g,b,w,A,I,k,T,R]}class U_ extends Sl{constructor(e){super(),Pl(this,e,C_,L_,Ol,{onDelete:3,onSubmit:4,pipeline:5,url:0,key:1,config:2})}}function M_(l){let e,t,s,n,i=l[2].t("Manage Ollama")+"",a,f,o,d='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',E,m,v,g,b,w;return v=new Oo({props:{urlIdx:l[1]}}),{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("button"),o.innerHTML=d,E=N(),m=_("div"),ce(v.$$.fragment),this.h()},l(A){e=h(A,"DIV",{});var I=p(e);t=h(I,"DIV",{class:!0});var k=p(t);s=h(k,"DIV",{class:!0});var T=p(s);n=h(T,"DIV",{class:!0});var R=p(n);a=H(R,i),R.forEach(c),T.forEach(c),f=$(k),o=h(k,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(o)!=="svelte-745w2y"&&(o.innerHTML=d),k.forEach(c),E=$(I),m=h(I,"DIV",{class:!0});var O=p(m);de(v.$$.fragment,O),O.forEach(c),I.forEach(c),this.h()},h(){u(n,"class","shrink-0"),u(s,"class","flex w-full justify-between items-center text-lg font-medium self-center font-primary"),u(o,"class","self-center"),u(t,"class","flex justify-between dark:text-gray-100 px-5 pt-4 pb-2"),u(m,"class","flex flex-col md:flex-row w-full px-5 pb-4 md:space-x-4 dark:text-gray-200")},m(A,I){M(A,e,I),r(e,t),r(t,s),r(s,n),r(n,a),r(t,f),r(t,o),r(e,E),r(e,m),_e(v,m,null),g=!0,b||(w=pe(o,"click",l[4]),b=!0)},p(A,I){(!g||I&4)&&i!==(i=A[2].t("Manage Ollama")+"")&&j(a,i);const k={};I&2&&(k.urlIdx=A[1]),v.$set(k)},i(A){g||(G(v.$$.fragment,A),g=!0)},o(A){W(v.$$.fragment,A),g=!1},d(A){A&&c(e),he(v),b=!1,w()}}}function B_(l){let e,t,s;function n(a){l[5](a)}let i={size:"sm",$$slots:{default:[M_]},$$scope:{ctx:l}};return l[0]!==void 0&&(i.show=l[0]),e=new Bn({props:i}),Ye.push(()=>qe(e,"show",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,[f]){const o={};f&71&&(o.$$scope={dirty:f,ctx:a}),!t&&f&1&&(t=!0,o.show=a[0],Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function H_(l,e,t){let s;const n=Ul("i18n");qt(l,n,d=>t(2,s=d));let{show:i=!1}=e,{urlIdx:a=null}=e;const f=()=>{t(0,i=!1)};function o(d){i=d,t(0,i)}return l.$$set=d=>{"show"in d&&t(0,i=d.show),"urlIdx"in d&&t(1,a=d.urlIdx)},[i,a,s,n,f,o]}class G_ extends Sl{constructor(e){super(),Pl(this,e,H_,B_,Ol,{show:0,urlIdx:1})}}function $i(l){let e;return{c(){e=_("div"),this.h()},l(t){e=h(t,"DIV",{class:!0}),p(e).forEach(c),this.h()},h(){u(e,"class","absolute top-0 bottom-0 left-0 right-0 opacity-60 bg-white dark:bg-gray-900 z-10")},m(t,s){M(t,e,s)},d(t){t&&c(e)}}}function K_(l){var f;let e,t,s,n,i,a=!(((f=l[1])==null?void 0:f.enable)??!0)&&$i();return{c(){a&&a.c(),e=N(),t=_("input"),this.h()}
110,l(o){a&&a.l(o),e=$(o),t=h(o,"INPUT",{class:!0,placeholder:!0}),this.h()},h(){u(t,"class","w-full text-sm bg-transparent outline-hidden"),u(t,"placeholder",s=l[8].t("Enter URL (e.g. http://localhost:11434)"))},m(o,d){a&&a.m(o,d),M(o,e,d),M(o,t,d),Q(t,l[0]),n||(i=pe(t,"input",l[16]),n=!0)},p(o,d){var E;((E=o[1])==null?void 0:E.enable)??!0?a&&(a.d(1),a=null):a||(a=$i(),a.c(),a.m(e.parentNode,e)),d&256&&s!==(s=o[8].t("Enter URL (e.g. http://localhost:11434)"))&&u(t,"placeholder",s),d&1&&t.value!==o[0]&&Q(t,o[0])},d(o){o&&(c(e),c(t)),a&&a.d(o),n=!1,i()}}}function Y_(l){let e,t,s,n,i;return t=new Kn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","self-center p-1 bg-transparent hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 rounded-lg transition"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[17]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function j_(l){let e,t,s,n,i;return t=new Mn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","self-center p-1 bg-transparent hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-850 rounded-lg transition"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[18]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function W_(l){var P;let e,t,s,n,i,a,f,o,d,E,m,v,g,b,w,A,I;function k(D){l[12](D)}let T={ollama:!0,edit:!0,connection:{url:l[0],key:((P=l[1])==null?void 0:P.key)??"",config:l[1]},onDelete:l[10],onSubmit:l[11]};l[6]!==void 0&&(T.show=l[6]),e=new Cn({props:T}),Ye.push(()=>qe(e,"show",k));function R(D){l[13](D)}let O={};l[7]!==void 0&&(O.show=l[7]),n=new Ys({props:O}),Ye.push(()=>qe(n,"show",R)),n.$on("confirm",l[14]);function y(D){l[15](D)}let L={urlIdx:l[4]};return l[5]!==void 0&&(L.show=l[5]),f=new G_({props:L}),Ye.push(()=>qe(f,"show",y)),m=new Gt({props:{className:"w-full relative",content:l[8].t('WebUI will make requests to "{{url}}/api/chat"',{url:l[0]}),placement:"top-start",$$slots:{default:[K_]},$$scope:{ctx:l}}}),b=new Gt({props:{content:l[8].t("Manage"),className:"self-start",$$slots:{default:[Y_]},$$scope:{ctx:l}}}),A=new Gt({props:{content:l[8].t("Configure"),className:"self-start",$$slots:{default:[j_]},$$scope:{ctx:l}}}),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment),a=N(),ce(f.$$.fragment),d=N(),E=_("div"),ce(m.$$.fragment),v=N(),g=_("div"),ce(b.$$.fragment),w=N(),ce(A.$$.fragment),this.h()},l(D){de(e.$$.fragment,D),s=$(D),de(n.$$.fragment,D),a=$(D),de(f.$$.fragment,D),d=$(D),E=h(D,"DIV",{class:!0});var S=p(E);de(m.$$.fragment,S),v=$(S),g=h(S,"DIV",{class:!0});var K=p(g);de(b.$$.fragment,K),w=$(K),de(A.$$.fragment,K),K.forEach(c),S.forEach(c),this.h()},h(){u(g,"class","flex gap-1"),u(E,"class","flex gap-1.5")},m(D,S){_e(e,D,S),M(D,s,S),_e(n,D,S),M(D,a,S),_e(f,D,S),M(D,d,S),M(D,E,S),_e(m,E,null),r(E,v),r(E,g),_e(b,g,null),r(g,w),_e(A,g,null),I=!0},p(D,[S]){var X;const K={};S&3&&(K.connection={url:D[0],key:((X=D[1])==null?void 0:X.key)??"",config:D[1]}),S&128&&(K.onDelete=D[10]),S&11&&(K.onSubmit=D[11]),!t&&S&64&&(t=!0,K.show=D[6],Fe(()=>t=!1)),e.$set(K);const Y={};!i&&S&128&&(i=!0,Y.show=D[7],Fe(()=>i=!1)),n.$set(Y);const C={};S&16&&(C.urlIdx=D[4]),!o&&S&32&&(o=!0,C.show=D[5],Fe(()=>o=!1)),f.$set(C);const V={};S&257&&(V.content=D[8].t('WebUI will make requests to "{{url}}/api/chat"',{url:D[0]})),S&524547&&(V.$$scope={dirty:S,ctx:D}),m.$set(V);const U={};S&256&&(U.content=D[8].t("Manage")),S&524320&&(U.$$scope={dirty:S,ctx:D}),b.$set(U);const F={};S&256&&(F.content=D[8].t("Configure")),S&524352&&(F.$$scope={dirty:S,ctx:D}),A.$set(F)},i(D){I||(G(e.$$.fragment,D),G(n.$$.fragment,D),G(f.$$.fragment,D),G(m.$$.fragment,D),G(b.$$.fragment,D),G(A.$$.fragment,D),I=!0)},o(D){W(e.$$.fragment,D),W(n.$$.fragment,D),W(f.$$.fragment,D),W(m.$$.fragment,D),W(b.$$.fragment,D),W(A.$$.fragment,D),I=!1},d(D){D&&(c(s),c(a),c(d),c(E)),he(e,D),he(n,D),he(f,D),he(m),he(b),he(A)}}}function F_(l,e,t){let s;const n=Ul("i18n");qt(l,n,y=>t(8,s=y));let{onDelete:i=()=>{}}=e,{onSubmit:a=()=>{}}=e,{url:f=""}=e,{idx:o=0}=e,{config:d={}}=e,E=!1,m=!1,v=!1;const g=()=>{t(7,v=!0)},b=y=>{t(0,f=y.url),t(1,d={...y.config,key:y.key}),a(y)};function w(y){m=y,t(6,m)}function A(y){v=y,t(7,v)}const I=()=>{i(),t(6,m=!1)};function k(y){E=y,t(5,E)}function T(){f=this.value,t(0,f)}const R=()=>{t(5,E=!0)},O=()=>{t(6,m=!0)};return l.$$set=y=>{"onDelete"in y&&t(2,i=y.onDelete),"onSubmit"in y&&t(3,a=y.onSubmit),"url"in y&&t(0,f=y.url),"idx"in y&&t(4,o=y.idx),"config"in y&&t(1,d=y.config)},[f,d,i,a,o,E,m,v,s,n,g,b,w,A,I,k,T,R,O]}class q_ extends Sl{constructor(e){super(),Pl(this,e,F_,W_,Ol,{onDelete:2,onSubmit:3,url:0,idx:4,config:1})}}function Ri(l,e,t){const s=l.slice();return s[43]=e[t],s[44]=e,s[45]=t,s}function Oi(l,e,t){const s=l.slice();return s[43]=e[t],s[46]=e,s[45]=t,s}function Z_(l){let e,t,s,n;return s=new Ps({props:{className:"size-6"}}),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);de(s.$$.fragment,f),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","my-auto"),u(e,"class","flex h-full justify-center")},m(i,a){M(i,e,a),r(e,t),_e(s,t,null),n=!0},p:st,i(i){n||(G(s.$$.fragment,i),n=!0)},o(i){W(s.$$.fragment,i),n=!1},d(i){i&&c(e),he(s)}}}function X_(l){let e,t,s,n,i=l[11].t("OpenAI API")+"",a,f,o,d,E,m,v,g,b,w,A,I,k,T=l[11].t("Ollama API")+"",R,O,y,L,P,D,S,K,Y,C,V,U,F=l[11].t("Direct 
110Connections")+"",X,Z,J,ie,fe,le,x,oe,se,te=l[11].t("Direct Connections allow users to connect to their own OpenAI compatible API endpoints.")+"",ae,Te;function ve(we){l[21](we)}let q={};l[5]!==void 0&&(q.state=l[5]),E=new vl({props:q}),Ye.push(()=>qe(E,"state",ve)),E.$on("change",l[22]);let ne=l[5]&&Si(l);function Ie(we){l[29](we)}let be={};l[6]!==void 0&&(be.state=l[6]),L=new vl({props:be}),Ye.push(()=>qe(L,"state",Ie)),L.$on("change",l[30]);let z=l[6]&&Vi(l);function ke(we){l[36](we)}let Ue={};return l[7].ENABLE_DIRECT_CONNECTIONS!==void 0&&(Ue.state=l[7].ENABLE_DIRECT_CONNECTIONS),fe=new vl({props:Ue}),Ye.push(()=>qe(fe,"state",ke)),fe.$on("change",l[37]),{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("div"),d=_("div"),ce(E.$$.fragment),v=N(),ne&&ne.c(),g=N(),b=_("hr"),w=N(),A=_("div"),I=_("div"),k=_("div"),R=B(T),O=N(),y=_("div"),ce(L.$$.fragment),D=N(),z&&z.c(),S=N(),K=_("hr"),Y=N(),C=_("div"),V=_("div"),U=_("div"),X=B(F),Z=N(),J=_("div"),ie=_("div"),ce(fe.$$.fragment),x=N(),oe=_("div"),se=_("div"),ae=B(te),this.h()},l(we){e=h(we,"DIV",{class:!0});var Ae=p(e);t=h(Ae,"DIV",{class:!0});var Re=p(t);s=h(Re,"DIV",{class:!0});var ue=p(s);n=h(ue,"DIV",{class:!0});var Ee=p(n);a=H(Ee,i),Ee.forEach(c),f=$(ue),o=h(ue,"DIV",{class:!0});var Me=p(o);d=h(Me,"DIV",{class:!0});var Ge=p(d);de(E.$$.fragment,Ge),Ge.forEach(c),Me.forEach(c),ue.forEach(c),v=$(Re),ne&&ne.l(Re),Re.forEach(c),Ae.forEach(c),g=$(we),b=h(we,"HR",{class:!0}),w=$(we),A=h(we,"DIV",{class:!0});var ee=p(A);I=h(ee,"DIV",{class:!0});var me=p(I);k=h(me,"DIV",{class:!0});var ge=p(k);R=H(ge,T),ge.forEach(c),O=$(me),y=h(me,"DIV",{class:!0});var Ne=p(y);de(L.$$.fragment,Ne),Ne.forEach(c),me.forEach(c),D=$(ee),z&&z.l(ee),ee.forEach(c),S=$(we),K=h(we,"HR",{class:!0}),Y=$(we),C=h(we,"DIV",{class:!0});var ye=p(C);V=h(ye,"DIV",{class:!0});var ze=p(V);U=h(ze,"DIV",{class:!0});var Ce=p(U);X=H(Ce,F),Ce.forEach(c),Z=$(ze),J=h(ze,"DIV",{class:!0});var Le=p(J);ie=h(Le,"DIV",{class:!0});var Ke=p(ie);de(fe.$$.fragment,Ke),Ke.forEach(c),Le.forEach(c),ze.forEach(c),x=$(ye),oe=h(ye,"DIV",{class:!0});var re=p(oe);se=h(re,"DIV",{class:!0});var $e=p(se);ae=H($e,te),$e.forEach(c),re.forEach(c),ye.forEach(c),this.h()},h(){u(n,"class","font-medium"),u(d,"class",""),u(o,"class","flex items-center"),u(s,"class","flex justify-between items-center text-sm"),u(t,"class","mt-2 space-y-2 pr-1.5"),u(e,"class","my-2"),u(b,"class","border-gray-100 dark:border-gray-850"),u(k,"class","font-medium"),u(y,"class","mt-1"),u(I,"class","flex justify-between items-center text-sm mb-2"),u(A,"class","pr-1.5 my-2"),u(K,"class","border-gray-100 dark:border-gray-850"),u(U,"class","font-medium"),u(ie,"class",""),u(J,"class","flex items-center"),u(V,"class","flex justify-between items-center text-sm"),u(se,"class","text-xs text-gray-500"),u(oe,"class","mt-1.5"),u(C,"class","pr-1.5 my-2")},m(we,Ae){M(we,e,Ae),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),r(o,d),_e(E,d,null),r(t,v),ne&&ne.m(t,null),M(we,g,Ae),M(we,b,Ae),M(we,w,Ae),M(we,A,Ae),r(A,I),r(I,k),r(k,R),r(I,O),r(I,y),_e(L,y,null),r(A,D),z&&z.m(A,null),M(we,S,Ae),M(we,K,Ae),M(we,Y,Ae),M(we,C,Ae),r(C,V),r(V,U),r(U,X),r(V,Z),r(V,J),r(J,ie),_e(fe,ie,null),r(C,x),r(C,oe),r(oe,se),r(se,ae),Te=!0},p(we,Ae){(!Te||Ae[0]&2048)&&i!==(i=we[11].t("OpenAI API")+"")&&j(a,i);const Re={};!m&&Ae[0]&32&&(m=!0,Re.state=we[5],Fe(()=>m=!1)),E.$set(Re),we[5]?ne?(ne.p(we,Ae),Ae[0]&32&&G(ne,1)):(ne=Si(we),ne.c(),G(ne,1),ne.m(t,null)):ne&&(ht(),W(ne,1,1,()=>{ne=null}),pt()),(!Te||Ae[0]&2048)&&T!==(T=we[11].t("Ollama API")+"")&&j(R,T);const ue={};!P&&Ae[0]&64&&(P=!0,ue.state=we[6],Fe(()=>P=!1)),L.$set(ue),we[6]?z?(z.p(we,Ae),Ae[0]&64&&G(z,1)):(z=Vi(we),z.c(),G(z,1),z.m(A,null)):z&&(ht(),W(z,1,1,()=>{z=null}),pt()),(!Te||Ae[0]&2048)&&F!==(F=we[11].t("Direct Connections")+"")&&j(X,F);const Ee={};!le&&Ae[0]&128&&(le=!0,Ee.state=we[7].ENABLE_DIRECT_CONNECTIONS,Fe(()=>le=!1)),fe.$set(Ee),(!Te||Ae[0]&2048)&&te!==(te=we[11].t("Direct Connections allow users to connect to their own OpenAI compatible API endpoints.")+"")&&j(ae,te)},i(we){Te||(G(E.$$.fragment,we),G(ne),G(L.$$.fragment,we),G(z),G(fe.$$.fragment,we),Te=!0)},o(we){W(E.$$.fragment,we),W(ne),W(L.$$.fragment,we),W(z),W(fe.$$.fragment,we),Te=!1},d(we){we&&(c(e),c(g),c(b),c(w),c(A),c(S),c(K),c(Y),c(C)),he(E),ne&&ne.d(),he(L),z&&z.d(),he(fe)}}}function Si(l){let e,t,s,n,i,a=l[11].t("Manage OpenAI API Connections")+"",f,o,d,E,m,v;d=new Gt({props:{content:l[11].t("Add Connection"),$$slots:{default:[J_]},$$scope:{ctx:l}}});let g=Dt(l[3]),b=[];for(let A=0;A<g.length;A+=1)b[A]=Pi(Oi(l,g,A));const w=A=>W(b[A],1,1,()=>{b[A]=null});return{c(){e=_("hr"),t=N(),s=_("div"),n=_("div"),i=_("div"),f=B(a),o=N(),ce(d.$$.fragment),E=N(),m=_("div");for(let A=0;A<b.length;A+=1)b[A].c();this.h()},l(A){e=h(A,"HR",{class:!0}),t=$(A),s=h(A,"DIV",{class:!0});var I=p(s);n=h(I,"DIV",{class:!0});var k=p(n);i=h(k,"DIV",{class:!0});var T=p(i);
110f=H(T,a),T.forEach(c),o=$(k),de(d.$$.fragment,k),k.forEach(c),E=$(I),m=h(I,"DIV",{class:!0});var R=p(m);for(let O=0;O<b.length;O+=1)b[O].l(R);R.forEach(c),I.forEach(c),this.h()},h(){u(e,"class","border-gray-100 dark:border-gray-850"),u(i,"class","font-medium"),u(n,"class","flex justify-between items-center"),u(m,"class","flex flex-col gap-1.5 mt-1.5"),u(s,"class","")},m(A,I){M(A,e,I),M(A,t,I),M(A,s,I),r(s,n),r(n,i),r(i,f),r(n,o),_e(d,n,null),r(s,E),r(s,m);for(let k=0;k<b.length;k+=1)b[k]&&b[k].m(m,null);v=!0},p(A,I){(!v||I[0]&2048)&&a!==(a=A[11].t("Manage OpenAI API Connections")+"")&&j(f,a);const k={};if(I[0]&2048&&(k.content=A[11].t("Add Connection")),I[0]&512|I[1]&65536&&(k.$$scope={dirty:I,ctx:A}),d.$set(k),I[0]&8476){g=Dt(A[3]);let T;for(T=0;T<g.length;T+=1){const R=Oi(A,g,T);b[T]?(b[T].p(R,I),G(b[T],1)):(b[T]=Pi(R),b[T].c(),G(b[T],1),b[T].m(m,null))}for(ht(),T=g.length;T<b.length;T+=1)w(T);pt()}},i(A){if(!v){G(d.$$.fragment,A);for(let I=0;I<g.length;I+=1)G(b[I]);v=!0}},o(A){W(d.$$.fragment,A),b=b.filter(Boolean);for(let I=0;I<b.length;I+=1)W(b[I]);v=!1},d(A){A&&(c(e),c(t),c(s)),he(d),wl(b,A)}}}function J_(l){let e,t,s,n,i;return t=new pn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","px-1"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[23]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function Pi(l){let e,t,s,n,i;function a(){return l[25](l[45])}function f(m){l[26](m,l[43],l[46],l[45])}function o(m){l[27](m,l[45])}function d(m){l[28](m,l[45])}let E={pipeline:!!l[8][l[43]],onSubmit:l[24],onDelete:a};return l[43]!==void 0&&(E.url=l[43]),l[2][l[45]]!==void 0&&(E.key=l[2][l[45]]),l[4][l[45]]!==void 0&&(E.config=l[4][l[45]]),e=new U_({props:E}),Ye.push(()=>qe(e,"url",f)),Ye.push(()=>qe(e,"key",o)),Ye.push(()=>qe(e,"config",d)),{c(){ce(e.$$.fragment)},l(m){de(e.$$.fragment,m)},m(m,v){_e(e,m,v),i=!0},p(m,v){l=m;const g={};v[0]&264&&(g.pipeline=!!l[8][l[43]]),v[0]&28&&(g.onDelete=a),!t&&v[0]&8&&(t=!0,g.url=l[43],Fe(()=>t=!1)),!s&&v[0]&4&&(s=!0,g.key=l[2][l[45]],Fe(()=>s=!1)),!n&&v[0]&16&&(n=!0,g.config=l[4][l[45]],Fe(()=>n=!1)),e.$set(g)},i(m){i||(G(e.$$.fragment,m),i=!0)},o(m){W(e.$$.fragment,m),i=!1},d(m){he(e,m)}}}function Vi(l){let e,t,s,n,i,a=l[11].t("Manage Ollama API Connections")+"",f,o,d,E,m,v,g,b,w=l[11].t("Trouble accessing Ollama?")+"",A,I,k,T=l[11].t("Click here for help.")+"",R,O;d=new Gt({props:{content:l[11].t("Add Connection"),$$slots:{default:[z_]},$$scope:{ctx:l}}});let y=Dt(l[0]),L=[];for(let D=0;D<y.length;D+=1)L[D]=yi(Ri(l,y,D));const P=D=>W(L[D],1,1,()=>{L[D]=null});return{c(){e=_("hr"),t=N(),s=_("div"),n=_("div"),i=_("div"),f=B(a),o=N(),ce(d.$$.fragment),E=N(),m=_("div"),v=_("div");for(let D=0;D<L.length;D+=1)L[D].c();g=N(),b=_("div"),A=B(w),I=N(),k=_("a"),R=B(T),this.h()},l(D){e=h(D,"HR",{class:!0}),t=$(D),s=h(D,"DIV",{class:!0});var S=p(s);n=h(S,"DIV",{class:!0});var K=p(n);i=h(K,"DIV",{class:!0});var Y=p(i);f=H(Y,a),Y.forEach(c),o=$(K),de(d.$$.fragment,K),K.forEach(c),E=$(S),m=h(S,"DIV",{class:!0});var C=p(m);v=h(C,"DIV",{class:!0});var V=p(v);for(let X=0;X<L.length;X+=1)L[X].l(V);V.forEach(c),C.forEach(c),g=$(S),b=h(S,"DIV",{class:!0});var U=p(b);A=H(U,w),I=$(U),k=h(U,"A",{class:!0,href:!0,target:!0});var F=p(k);R=H(F,T),F.forEach(c),U.forEach(c),S.forEach(c),this.h()},h(){u(e,"class","border-gray-100 dark:border-gray-850 my-2"),u(i,"class","font-medium"),u(n,"class","flex justify-between items-center"),u(v,"class","flex-1 flex flex-col gap-1.5 mt-1.5"),u(m,"class","flex w-full gap-1.5"),u(k,"class","text-gray-300 font-medium underline"),u(k,"href","https://github.com/open-webui/open-webui#troubleshooting"),u(k,"target","_blank"),u(b,"class","mt-1 text-xs text-gray-400 dark:text-gray-500"),u(s,"class","")},m(D,S){M(D,e,S),M(D,t,S),M(D,s,S),r(s,n),r(n,i),r(i,f),r(n,o),_e(d,n,null),r(s,E),r(s,m),r(m,v);for(let K=0;K<L.length;K+=1)L[K]&&L[K].m(v,null);r(s,g),r(s,b),r(b,A),r(b,I),r(b,k),r(k,R),O=!0},p(D,S){(!O||S[0]&2048)&&a!==(a=D[11].t("Manage Ollama API Connections")+"")&&j(f,a);const K={};if(S[0]&2048&&(K.content=D[11].t("Add Connection")),S[0]&1024|S[1]&65536&&(K.$$scope={dirty:S,ctx:D}),d.$set(K),S[0]&16387){y=Dt(D[0]);let Y;for(Y=0;Y<y.length;Y+=1){const C=Ri(D,y,Y);L[Y]?(L[Y].p(C,S),G(L[Y],1)):(L[Y]=yi(C),L[Y].c(),G(L[Y],1),L[Y].m(v,null))}for(ht(),Y=y.length;Y<L.length;
110Y+=1)P(Y);pt()}(!O||S[0]&2048)&&w!==(w=D[11].t("Trouble accessing Ollama?")+"")&&j(A,w),(!O||S[0]&2048)&&T!==(T=D[11].t("Click here for help.")+"")&&j(R,T)},i(D){if(!O){G(d.$$.fragment,D);for(let S=0;S<y.length;S+=1)G(L[S]);O=!0}},o(D){W(d.$$.fragment,D),L=L.filter(Boolean);for(let S=0;S<L.length;S+=1)W(L[S]);O=!1},d(D){D&&(c(e),c(t),c(s)),he(d),wl(L,D)}}}function z_(l){let e,t,s,n,i;return t=new pn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","px-1"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[31]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function yi(l){let e,t,s,n;function i(){return l[33](l[45])}function a(d){l[34](d,l[43],l[44],l[45])}function f(d){l[35](d,l[45])}let o={idx:l[45],onSubmit:l[32],onDelete:i};return l[43]!==void 0&&(o.url=l[43]),l[1][l[45]]!==void 0&&(o.config=l[1][l[45]]),e=new q_({props:o}),Ye.push(()=>qe(e,"url",a)),Ye.push(()=>qe(e,"config",f)),{c(){ce(e.$$.fragment)},l(d){de(e.$$.fragment,d)},m(d,E){_e(e,d,E),n=!0},p(d,E){l=d;const m={};E[0]&3&&(m.onDelete=i),!t&&E[0]&1&&(t=!0,m.url=l[43],Fe(()=>t=!1)),!s&&E[0]&2&&(s=!0,m.config=l[1][l[45]],Fe(()=>s=!1)),e.$set(m)},i(d){n||(G(e.$$.fragment,d),n=!0)},o(d){W(e.$$.fragment,d),n=!1},d(d){he(e,d)}}}function Q_(l){let e,t,s,n,i,a,f,o,d,E,m,v,g,b=l[11].t("Save")+"",w,A,I,k;function T(S){l[19](S)}let R={onSubmit:l[16]};l[9]!==void 0&&(R.show=l[9]),e=new Cn({props:R}),Ye.push(()=>qe(e,"show",T));function O(S){l[20](S)}let y={ollama:!0,onSubmit:l[17]};l[10]!==void 0&&(y.show=l[10]),n=new Cn({props:y}),Ye.push(()=>qe(n,"show",O));const L=[X_,Z_],P=[];function D(S,K){return S[5]!==null&&S[6]!==null&&S[7]!==null?0:1}return d=D(l),E=P[d]=L[d](l),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment),a=N(),f=_("form"),o=_("div"),E.c(),m=N(),v=_("div"),g=_("button"),w=B(b),this.h()},l(S){de(e.$$.fragment,S),s=$(S),de(n.$$.fragment,S),a=$(S),f=h(S,"FORM",{class:!0});var K=p(f);o=h(K,"DIV",{class:!0});var Y=p(o);E.l(Y),Y.forEach(c),m=$(K),v=h(K,"DIV",{class:!0});var C=p(v);g=h(C,"BUTTON",{class:!0,type:!0});var V=p(g);w=H(V,b),V.forEach(c),C.forEach(c),K.forEach(c),this.h()},h(){u(o,"class","overflow-y-scroll scrollbar-hidden h-full"),u(g,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(g,"type","submit"),u(v,"class","flex justify-end pt-3 text-sm font-medium"),u(f,"class","flex flex-col h-full justify-between text-sm")},m(S,K){_e(e,S,K),M(S,s,K),_e(n,S,K),M(S,a,K),M(S,f,K),r(f,o),P[d].m(o,null),r(f,m),r(f,v),r(v,g),r(g,w),A=!0,I||(k=pe(f,"submit",ds(l[18])),I=!0)},p(S,K){const Y={};!t&&K[0]&512&&(t=!0,Y.show=S[9],Fe(()=>t=!1)),e.$set(Y);const C={};!i&&K[0]&1024&&(i=!0,C.show=S[10],Fe(()=>i=!1)),n.$set(C);let V=d;d=D(S),d===V?P[d].p(S,K):(ht(),W(P[V],1,1,()=>{P[V]=null}),pt(),E=P[d],E?E.p(S,K):(E=P[d]=L[d](S),E.c()),G(E,1),E.m(o,null)),(!A||K[0]&2048)&&b!==(b=S[11].t("Save")+"")&&j(w,b)},i(S){A||(G(e.$$.fragment,S),G(n.$$.fragment,S),G(E),A=!0)},o(S){W(e.$$.fragment,S),W(n.$$.fragment,S),W(E),A=!1},d(S){S&&(c(s),c(a),c(f)),he(e,S),he(n,S),P[d].d(),I=!1,k()}}}function x_(l,e,t){let s,n,i,a;qt(l,rn,q=>t(38,s=q)),qt(l,nn,q=>t(39,i=q)),qt(l,fs,q=>t(40,a=q));const f=Ss(),o=Ul("i18n");qt(l,o,q=>t(11,n=q));const d=async()=>{var ne;return await ns(localStorage.token,((ne=a==null?void 0:a.features)==null?void 0:ne.enable_direct_connections)&&((i==null?void 0:i.directConnections)??null))};let E=[""],m={},v=[""],g=[""],b={},w=null,A=null,I=null,k={},T=!1,R=!1;const O=async()=>{if(w!==null){if(t(3,g=g.map(ne=>ne.replace(/\/$/,""))),v.length!==g.length&&(v.length>g.length&&t(2,v=v.slice(0,g.length)),v.length<g.length)){const ne=g.length-v.length;for(let Ie=0;Ie<ne;Ie++)v.push("")}await of(localStorage.token,{ENABLE_OPENAI_API:w,OPENAI_API_BASE_URLS:g,OPENAI_API_KEYS:v,OPENAI_API_CONFIGS:b}).catch(ne=>{Je.error(`${ne}`)})&&(Je.success(n.t("OpenAI API settings updated")),await Kl.set(await d()))}},y=async()=>{A!==null&&(t(0,E=E.map(ne=>ne.replace(/\/$/,""))),await ef(localStorage.token,{ENABLE_OLLAMA_API:A,OLLAMA_BASE_URLS:E,OLLAMA_API_CONFIGS:m}).catch(ne=>{Je.error(`${ne}`)})&&(Je.success(n.t("Ollama API settings updated")),await Kl.set(await d())))},L=async()=>{await gu(localStorage.token,I).catch(ne=>{Je.error(`${ne}`)}
110)&&(Je.success(n.t("Direct Connections settings updated")),await Kl.set(await d()))},P=async q=>{t(3,g=[...g,q.url]),t(2,v=[...v,q.key]),t(4,b[g.length-1]=q.config,b),await O()},D=async q=>{t(0,E=[...E,q.url]),t(1,m[E.length-1]={...q.config,key:q.key},m),await y()};rs(async()=>{if((s==null?void 0:s.role)==="admin"){let q={},ne={};if(await Promise.all([(async()=>{q=await No(localStorage.token)})(),(async()=>{ne=await rf(localStorage.token)})(),(async()=>{t(7,I=await mu(localStorage.token))})()]),t(5,w=ne.ENABLE_OPENAI_API),t(6,A=q.ENABLE_OLLAMA_API),t(3,g=ne.OPENAI_API_BASE_URLS),t(2,v=ne.OPENAI_API_KEYS),t(4,b=ne.OPENAI_API_CONFIGS),t(0,E=q.OLLAMA_BASE_URLS),t(1,m=q.OLLAMA_API_CONFIGS),w){for(const[Ie,be]of g.entries())b[Ie]||t(4,b[Ie]=b[be]||{},b);g.forEach(async(Ie,be)=>{var ke;if(t(4,b[be]=b[be]||{},b),!(((ke=b[be])==null?void 0:ke.enable)??!0))return;(await af(localStorage.token,be)).pipelines&&t(8,k[Ie]=!0,k)})}if(A)for(const[Ie,be]of E.entries())m[Ie]||t(1,m[Ie]=m[be]||{},m)}});const S=async()=>{O(),y(),L(),f("save")};function K(q){T=q,t(9,T)}function Y(q){R=q,t(10,R)}function C(q){w=q,t(5,w)}const V=async()=>{O()},U=()=>{t(9,T=!0)},F=()=>{O()},X=q=>{t(3,g=g.filter((Ie,be)=>q!==be)),t(2,v=v.filter((Ie,be)=>q!==be));let ne={};g.forEach((Ie,be)=>{ne[be]=b[be<q?be:be+1]}),t(4,b=ne),O()};function Z(q,ne,Ie,be){Ie[be]=q,t(3,g)}function J(q,ne){l.$$.not_equal(v[ne],q)&&(v[ne]=q,t(2,v))}function ie(q,ne){l.$$.not_equal(b[ne],q)&&(b[ne]=q,t(4,b))}function fe(q){A=q,t(6,A)}const le=async()=>{y()},x=()=>{t(10,R=!0)},oe=()=>{y()},se=q=>{t(0,E=E.filter((Ie,be)=>q!==be));let ne={};E.forEach((Ie,be)=>{ne[be]=m[be<q?be:be+1]}),t(1,m=ne)};function te(q,ne,Ie,be){Ie[be]=q,t(0,E)}function ae(q,ne){l.$$.not_equal(m[ne],q)&&(m[ne]=q,t(1,m))}function Te(q){l.$$.not_equal(I.ENABLE_DIRECT_CONNECTIONS,q)&&(I.ENABLE_DIRECT_CONNECTIONS=q,t(7,I))}return[E,m,v,g,b,w,A,I,k,T,R,n,o,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,async()=>{L()}]}class e1 extends Sl{constructor(e){super(),Pl(this,e,x_,Q_,Ol,{},null,[-1,-1])}}function t1(l){let e,t,s;return t=new Ps({}),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);de(t.$$.fragment,i),i.forEach(c),this.h()},h(){u(e,"class","flex items-center justify-center h-full")},m(n,i){M(n,e,i),_e(t,e,null),s=!0},p:st,i(n){s||(G(t.$$.fragment,n),s=!0)},o(n){W(t.$$.fragment,n),s=!1},d(n){n&&c(e),he(t)}}}function l1(l){let e,t,s,n,i=l[14].t("General")+"",a,f,o,d,E,m,v,g=l[14].t("Content Extraction Engine")+"",b,w,A,I,k,T=l[14].t("Default")+"",R,O,y=l[14].t("Tika")+"",L,P,D=l[14].t("Docling")+"",S,K,Y=l[14].t("Document Intelligence")+"",C,V,U=l[14].t("Mistral OCR")+"",F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne,Ie=l[14].t("Files")+"",be,z,ke,Ue,we,Ae,Re=l[14].t("Max Upload Size")+"",ue,Ee,Me,Ge,ee,me,ge,Ne=l[14].t("Max Upload Count")+"",ye,ze,Ce,Le,Ke,re,$e,ut=l[14].t("Integration")+"",ft,ct,Be,Ve,je,Rt,Ot=l[14].t("Google Drive")+"",_t,Et,At,Tt,Ut,rt,bt,lt,He=l[14].t("OneDrive")+"",at,Vt,Qe,yt,wt,vt,It,el,Kt=l[14].t("Danger Zone")+"",Lt,ol,Tl,Se,De,Pe,kt=l[14].t("Reset Upload Directory")+"",We,it,Mt,xe,mt=l[14].t("Reset")+"",Bt,Ze,nt,Yt,tl=l[14].t("Reset Vector Storage/Knowledge")+"",Qt,al,St,Zt,Xt=l[14].t("Reset")+"",hl,cl,Jt,zt,Nt=l[14].t("Reindex Knowledge Base Vectors")+"",Al,Rl,dl,Pt,gl=l[14].t("Reindex")+"",ot,$t,dt,kl,rl=l[14].t("Save")+"",$l,ul,pl,_s;const Il=[i1,a1,r1,n1,s1],ll=[];function ts(et,gt){return et[13].CONTENT_EXTRACTION_ENGINE===""?0:et[13].CONTENT_EXTRACTION_ENGINE==="tika"?1:et[13].CONTENT_EXTRACTION_ENGINE==="docling"?2:et[13].CONTENT_EXTRACTION_ENGINE==="document_intelligence"?3:et[13].CONTENT_EXTRACTION_ENGINE==="mistral_ocr"?4:-1}~(Z=ts(l))&&(J=ll[Z]=Il[Z](l)),x=new Gt({props:{content:l[14].t("Full Context Mode"),placement:"top-start",$$slots:{default:[o1]},$$scope:{ctx:l}}}),te=new Gt({props:{content:l[13].BYPASS_EMBEDDING_AND_RETRIEVAL?l[14].t("Inject the entire content as context for comprehensive processing, this is recommended for complex queries."):l[14].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases."),$$slots:{default:[u1]},$$scope:{ctx:l}}});let Dl=!l[13].BYPASS_EMBEDDING_AND_RETRIEVAL&&Li(l),Nl=!l[13].BYPASS_EMBEDDING_AND_RETRIEVAL&&Ci(l);Ge=new Gt({props:{content:l[14].t("The maximum file size in MB. If the file size exceeds this limit, the file will not be uploaded."),placement:"top-start",$$slots:{default:[b1]},$$scope:{ctx:l}}}),Le=new Gt({props:{content:l[14].t("The maximum number of files that can be used at once in chat. If the number of files exceeds this limit, the files will not be uploaded."),placement:"top-start",$$slots:{default:[I1]},$$scope:{ctx:l}}});function ls(et){l[57](et)}let El={};l[13].ENABLE_GOOGLE_DRIVE_INTEGRATION!==void 0&&(El.state=l[13].ENABLE_GOOGLE_DRIVE_INTEGRATION),Tt=new vl({props:El}),Ye.push(()=>qe(Tt,"state",ls));function Vl(et){l[58](et)}let il={};return l[13].ENABLE_ONEDRIVE_INTEGRATION!==void 0&&(il.state=l[13].ENABLE_ONEDRIVE_INTEGRATION),yt=ne
110w vl({props:il}),Ye.push(()=>qe(yt,"state",Vl)),{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("hr"),d=N(),E=_("div"),m=_("div"),v=_("div"),b=B(g),w=N(),A=_("div"),I=_("select"),k=_("option"),R=B(T),O=_("option"),L=B(y),P=_("option"),S=B(D),K=_("option"),C=B(Y),V=_("option"),F=B(U),X=N(),J&&J.c(),ie=N(),fe=_("div"),le=_("div"),ce(x.$$.fragment),oe=N(),se=_("div"),ce(te.$$.fragment),ae=N(),Dl&&Dl.c(),Te=N(),Nl&&Nl.c(),ve=N(),q=_("div"),ne=_("div"),be=B(Ie),z=N(),ke=_("hr"),Ue=N(),we=_("div"),Ae=_("div"),ue=B(Re),Ee=N(),Me=_("div"),ce(Ge.$$.fragment),ee=N(),me=_("div"),ge=_("div"),ye=B(Ne),ze=N(),Ce=_("div"),ce(Le.$$.fragment),Ke=N(),re=_("div"),$e=_("div"),ft=B(ut),ct=N(),Be=_("hr"),Ve=N(),je=_("div"),Rt=_("div"),_t=B(Ot),Et=N(),At=_("div"),ce(Tt.$$.fragment),rt=N(),bt=_("div"),lt=_("div"),at=B(He),Vt=N(),Qe=_("div"),ce(yt.$$.fragment),vt=N(),It=_("div"),el=_("div"),Lt=B(Kt),ol=N(),Tl=_("hr"),Se=N(),De=_("div"),Pe=_("div"),We=B(kt),it=N(),Mt=_("div"),xe=_("button"),Bt=B(mt),Ze=N(),nt=_("div"),Yt=_("div"),Qt=B(tl),al=N(),St=_("div"),Zt=_("button"),hl=B(Xt),cl=N(),Jt=_("div"),zt=_("div"),Al=B(Nt),Rl=N(),dl=_("div"),Pt=_("button"),ot=B(gl),$t=N(),dt=_("div"),kl=_("button"),$l=B(rl),this.h()},l(et){e=h(et,"DIV",{class:!0});var gt=p(e);t=h(gt,"DIV",{class:!0});var yl=p(t);s=h(yl,"DIV",{class:!0});var Oe=p(s);n=h(Oe,"DIV",{class:!0});var tt=p(n);a=H(tt,i),tt.forEach(c),f=$(Oe),o=h(Oe,"HR",{class:!0}),d=$(Oe),E=h(Oe,"DIV",{class:!0});var fl=p(E);m=h(fl,"DIV",{class:!0});var jt=p(m);v=h(jt,"DIV",{class:!0});var Yl=p(v);b=H(Yl,g),Yl.forEach(c),w=$(jt),A=h(jt,"DIV",{class:!0});var Ml=p(A);I=h(Ml,"SELECT",{class:!0});var Wl=p(I);k=h(Wl,"OPTION",{});var Fl=p(k);R=H(Fl,T),Fl.forEach(c),O=h(Wl,"OPTION",{});var Bl=p(O);L=H(Bl,y),Bl.forEach(c),P=h(Wl,"OPTION",{});var as=p(P);S=H(as,D),as.forEach(c),K=h(Wl,"OPTION",{});var hs=p(K);C=H(hs,Y),hs.forEach(c),V=h(Wl,"OPTION",{});var ss=p(V);F=H(ss,U),ss.forEach(c),Wl.forEach(c),Ml.forEach(c),jt.forEach(c),X=$(fl),J&&J.l(fl),fl.forEach(c),ie=$(Oe),fe=h(Oe,"DIV",{class:!0});var Ct=p(fe);le=h(Ct,"DIV",{class:!0});var ql=p(le);de(x.$$.fragment,ql),ql.forEach(c),oe=$(Ct),se=h(Ct,"DIV",{class:!0});var As=p(se);de(te.$$.fragment,As),As.forEach(c),Ct.forEach(c),ae=$(Oe),Dl&&Dl.l(Oe),Oe.forEach(c),Te=$(yl),Nl&&Nl.l(yl),ve=$(yl),q=h(yl,"DIV",{class:!0});var cs=p(q);ne=h(cs,"DIV",{class:!0});var gs=p(ne);be=H(gs,Ie),gs.forEach(c),z=$(cs),ke=h(cs,"HR",{class:!0}),Ue=$(cs),we=h(cs,"DIV",{class:!0});var Is=p(we);Ae=h(Is,"DIV",{class:!0});var ks=p(Ae);ue=H(ks,Re),ks.forEach(c),Ee=$(Is),Me=h(Is,"DIV",{class:!0});var Ls=p(Me);de(Ge.$$.fragment,Ls),Ls.forEach(c),Is.forEach(c),ee=$(cs),me=h(cs,"DIV",{class:!0});var zl=p(me);ge=h(zl,"DIV",{class:!0});var Cs=p(ge);ye=H(Cs,Ne),Cs.forEach(c),ze=$(zl),Ce=h(zl,"DIV",{class:!0});var Ds=p(Ce);de(Le.$$.fragment,Ds),Ds.forEach(c),zl.forEach(c),cs.forEach(c),Ke=$(yl),re=h(yl,"DIV",{class:!0});var Zl=p(re);$e=h(Zl,"DIV",{class:!0});var ps=p($e);ft=H(ps,ut),ps.forEach(c),ct=$(Zl),Be=h(Zl,"HR",{class:!0}),Ve=$(Zl),je=h(Zl,"DIV",{class:!0});var Es=p(je);Rt=h(Es,"DIV",{class:!0});var ws=p(Rt);_t=H(ws,Ot),ws.forEach(c),Et=$(Es),At=h(Es,"DIV",{class:!0});var Us=p(At);de(Tt.$$.fragment,Us),Us.forEach(c),Es.forEach(c),rt=$(Zl),bt=h(Zl,"DIV",{class:!0});var Ql=p(bt);lt=h(Ql,"DIV",{class:!0});var Ms=p(lt);at=H(Ms,He),Ms.forEach(c),Vt=$(Ql),Qe=h(Ql,"DIV",{class:!0});var Ns=p(Qe);de(yt.$$.fragment,Ns),Ns.forEach(c),Ql.forEach(c),Zl.forEach(c),vt=$(yl),It=h(yl,"DIV",{class:!0});var Hl=p(It);el=h(Hl,"DIV",{class:!0});var xl=p(el);Lt=H(xl,Kt),xl.forEach(c),ol=$(Hl),Tl=h(Hl,"HR",{class:!0}),Se=$(Hl),De=h(Hl,"DIV",{class:!0});var vs=p(De);Pe=h(vs,"DIV",{class:!0});var bs=p(Pe);We=H(bs,kt),bs.forEach(c),it=$(vs),Mt=h(vs,"DIV",{class:!0});var Ts=p(Mt);xe=h(Ts,"BUTTON",{class:!0});var Bs=p(xe);Bt=H(Bs,mt),Bs.forEach(c),Ts.forEach(c),vs.forEach(c),Ze=$(Hl),nt=h(Hl,"DIV",{class:!0});var ms=p(nt);Yt=h(ms,"DIV",{class:!0});var is=p(Yt);Qt=H(is,tl),is.forEach(c),al=$(ms),St=h(ms,"DIV",{class:!0});var Hs=p(St);Zt=h(Hs,"BUTTON",{class:!0});var jl=p(Zt);
110hl=H(jl,Xt),jl.forEach(c),Hs.forEach(c),ms.forEach(c),cl=$(Hl),Jt=h(Hl,"DIV",{class:!0});var Vs=p(Jt);zt=h(Vs,"DIV",{class:!0});var js=p(zt);Al=H(js,Nt),js.forEach(c),Rl=$(Vs),dl=h(Vs,"DIV",{class:!0});var zs=p(dl);Pt=h(zs,"BUTTON",{class:!0});var $s=p(Pt);ot=H($s,gl),$s.forEach(c),zs.forEach(c),Vs.forEach(c),Hl.forEach(c),yl.forEach(c),gt.forEach(c),$t=$(et),dt=h(et,"DIV",{class:!0});var Gs=p(dt);kl=h(Gs,"BUTTON",{class:!0,type:!0});var Ks=p(kl);$l=H(Ks,rl),Ks.forEach(c),Gs.forEach(c),this.h()},h(){u(n,"class","mb-2.5 text-base font-medium"),u(o,"class","border-gray-100 dark:border-gray-850 my-2"),u(v,"class","self-center text-xs font-medium"),k.__value="",Q(k,k.__value),O.__value="tika",Q(O,O.__value),P.__value="docling",Q(P,P.__value),K.__value="document_intelligence",Q(K,K.__value),V.__value="mistral_ocr",Q(V,V.__value),u(I,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"),l[13].CONTENT_EXTRACTION_ENGINE===void 0&&Cl(()=>l[25].call(I)),u(A,"class",""),u(m,"class","flex w-full justify-between"),u(E,"class","mb-2.5 flex flex-col w-full justify-between"),u(le,"class","self-center text-xs font-medium"),u(se,"class","flex items-center relative"),u(fe,"class","mb-2.5 flex w-full justify-between"),u(s,"class","mb-3"),u(ne,"class","mb-2.5 text-base font-medium"),u(ke,"class","border-gray-100 dark:border-gray-850 my-2"),u(Ae,"class","self-center text-xs font-medium"),u(Me,"class","flex items-center relative"),u(we,"class","mb-2.5 flex w-full justify-between"),u(ge,"class","self-center text-xs font-medium"),u(Ce,"class","flex items-center relative"),u(me,"class","mb-2.5 flex w-full justify-between"),u(q,"class","mb-3"),u($e,"class","mb-2.5 text-base font-medium"),u(Be,"class","border-gray-100 dark:border-gray-850 my-2"),u(Rt,"class","self-center text-xs font-medium"),u(At,"class","flex items-center relative"),u(je,"class","mb-2.5 flex w-full justify-between"),u(lt,"class","self-center text-xs font-medium"),u(Qe,"class","flex items-center relative"),u(bt,"class","mb-2.5 flex w-full justify-between"),u(re,"class","mb-3"),u(el,"class","mb-2.5 text-base font-medium"),u(Tl,"class","border-gray-100 dark:border-gray-850 my-2"),u(Pe,"class","self-center text-xs font-medium"),u(xe,"class","text-xs"),u(Mt,"class","flex items-center relative"),u(De,"class","mb-2.5 flex w-full justify-between"),u(Yt,"class","self-center text-xs font-medium"),u(Zt,"class","text-xs"),u(St,"class","flex items-center relative"),u(nt,"class","mb-2.5 flex w-full justify-between"),u(zt,"class","self-center text-xs font-medium"),u(Pt,"class","text-xs"),u(dl,"class","flex items-center relative"),u(Jt,"class","mb-2.5 flex w-full justify-between"),u(It,"class","mb-3"),u(t,"class",""),u(e,"class","space-y-2.5 overflow-y-scroll scrollbar-hidden h-full pr-1.5"),u(kl,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(kl,"type","submit"),u(dt,"class","flex justify-end pt-3 text-sm font-medium")},m(et,gt){M(et,e,gt),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),r(s,d),r(s,E),r(E,m),r(m,v),r(v,b),r(m,w),r(m,A),r(A,I),r(I,k),r(k,R),r(I,O),r(O,L),r(I,P),r(P,S),r(I,K),r(K,C),r(I,V),r(V,F),Ft(I,l[13].CONTENT_EXTRACTION_ENGINE,!0),r(E,X),~Z&&ll[Z].m(E,null),r(s,ie),r(s,fe),r(fe,le),_e(x,le,null),r(fe,oe),r(fe,se),_e(te,se,null),r(s,ae),Dl&&Dl.m(s,null),r(t,Te),Nl&&Nl.m(t,null),r(t,ve),r(t,q),r(q,ne),r(ne,be),r(q,z),r(q,ke),r(q,Ue),r(q,we),r(we,Ae),r(Ae,ue),r(we,Ee),r(we,Me),_e(Ge,Me,null),r(q,ee),r(q,me),r(me,ge),r(ge,ye),r(me,ze),r(me,Ce),_e(Le,Ce,null),r(t,Ke),r(t,re),r(re,$e),r($e,ft),r(re,ct),r(re,Be),r(re,Ve),r(re,je),r(je,Rt),r(Rt,_t),r(je,Et),r(je,At),_e(Tt,At,null),r(re,rt),r(re,bt),r(bt,lt),r(lt,at),r(bt,Vt),r(bt,Qe),_e(yt,Qe,null),r(t,vt),r(t,It),r(It,el),r(el,Lt),r(It,ol),r(It,Tl),r(It,Se),r(It,De),r(De,Pe),r(Pe,We),r(De,it),r(De,Mt),r(Mt,xe),r(xe,Bt),r(It,Ze),r(It,nt),r(nt,Yt),r(Yt,Qt),r(nt,al),r(nt,St),r(St,Zt),r(Zt,hl),r(It,cl),r(It,Jt),r(Jt,zt),r(zt,Al),r(Jt,Rl),r(Jt,dl),r(dl,Pt),r(Pt,ot),M(et,$t,gt),M(et,dt,gt),r(dt,kl),r(kl,$l),ul=!0,pl||(_s=[pe(I,"change",l[25]),pe(xe,"click",l[59]),pe(Zt,"click",l[60]),pe(Pt,"click",l[61])],pl=!0)},p(et,gt){(!ul||gt[0]&16384)&&i!==(i=et[14].t("General")+"")&&j(a,i),(!ul||gt[0]&16384)&&g!==(g=et[14].t("Content Extraction Engine")+"")&&j(b,g),(!ul||gt[0]&16384)&&T!==(T=et[14].t("Default")+"")&&j(R,T),(!ul||gt[0]&16384)&&y!==(y=et[14].t("Tika")+"")&&j(L,y),(!ul||gt[0]&16384)&&D!==(D=et[14].t("Docling")+"")&&j(S,D),(!ul||gt[0]&16384)&&Y!==(Y=et[14].t("Document Intelligence")+"")&&j(C,Y),(!ul||gt[0]&16384)&&U!==(U=et[14].t("Mistral OCR")+"")&&j(F,U),gt[0]&8192&&Ft(I,et[13].CONTENT_EXTRACTION_ENGINE);let yl=Z;Z=ts(et),Z===yl?~Z&&ll[Z].p(et,gt):(J&&(ht(),W(ll[yl],1,1,()=>{ll[yl]=null}),pt()),~Z?(J=ll[Z],J?J.p(et,gt):(J=ll[Z]=Il[Z](et),J.c()),G(J,1),J.m(E,null)):J=null);const Oe={};gt[0]&16384&&(Oe.content=et[14].t("Full Context Mode")),gt[0]&16384|gt[2]&32&&(Oe.$$scope={dirty:gt,ctx:et}),x.$set(Oe);const tt={};gt[0]&24576&&(tt.content=et[13].BYPASS_EMBEDDING_AND_RETRIEVAL?et[14].t("Inject the entire content as context for comprehensive processing, this is recommended for c
110omplex queries."):et[14].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.")),gt[0]&8192|gt[2]&32&&(tt.$$scope={dirty:gt,ctx:et}),te.$set(tt),et[13].BYPASS_EMBEDDING_AND_RETRIEVAL?Dl&&(Dl.d(1),Dl=null):Dl?Dl.p(et,gt):(Dl=Li(et),Dl.c(),Dl.m(s,null)),et[13].BYPASS_EMBEDDING_AND_RETRIEVAL?Nl&&(ht(),W(Nl,1,1,()=>{Nl=null}),pt()):Nl?(Nl.p(et,gt),gt[0]&8192&&G(Nl,1)):(Nl=Ci(et),Nl.c(),G(Nl,1),Nl.m(t,ve)),(!ul||gt[0]&16384)&&Ie!==(Ie=et[14].t("Files")+"")&&j(be,Ie),(!ul||gt[0]&16384)&&Re!==(Re=et[14].t("Max Upload Size")+"")&&j(ue,Re);const fl={};gt[0]&16384&&(fl.content=et[14].t("The maximum file size in MB. If the file size exceeds this limit, the file will not be uploaded.")),gt[0]&24576|gt[2]&32&&(fl.$$scope={dirty:gt,ctx:et}),Ge.$set(fl),(!ul||gt[0]&16384)&&Ne!==(Ne=et[14].t("Max Upload Count")+"")&&j(ye,Ne);const jt={};gt[0]&16384&&(jt.content=et[14].t("The maximum number of files that can be used at once in chat. If the number of files exceeds this limit, the files will not be uploaded.")),gt[0]&24576|gt[2]&32&&(jt.$$scope={dirty:gt,ctx:et}),Le.$set(jt),(!ul||gt[0]&16384)&&ut!==(ut=et[14].t("Integration")+"")&&j(ft,ut),(!ul||gt[0]&16384)&&Ot!==(Ot=et[14].t("Google Drive")+"")&&j(_t,Ot);const Yl={};!Ut&&gt[0]&8192&&(Ut=!0,Yl.state=et[13].ENABLE_GOOGLE_DRIVE_INTEGRATION,Fe(()=>Ut=!1)),Tt.$set(Yl),(!ul||gt[0]&16384)&&He!==(He=et[14].t("OneDrive")+"")&&j(at,He);const Ml={};!wt&&gt[0]&8192&&(wt=!0,Ml.state=et[13].ENABLE_ONEDRIVE_INTEGRATION,Fe(()=>wt=!1)),yt.$set(Ml),(!ul||gt[0]&16384)&&Kt!==(Kt=et[14].t("Danger Zone")+"")&&j(Lt,Kt),(!ul||gt[0]&16384)&&kt!==(kt=et[14].t("Reset Upload Directory")+"")&&j(We,kt),(!ul||gt[0]&16384)&&mt!==(mt=et[14].t("Reset")+"")&&j(Bt,mt),(!ul||gt[0]&16384)&&tl!==(tl=et[14].t("Reset Vector Storage/Knowledge")+"")&&j(Qt,tl),(!ul||gt[0]&16384)&&Xt!==(Xt=et[14].t("Reset")+"")&&j(hl,Xt),(!ul||gt[0]&16384)&&Nt!==(Nt=et[14].t("Reindex Knowledge Base Vectors")+"")&&j(Al,Nt),(!ul||gt[0]&16384)&&gl!==(gl=et[14].t("Reindex")+"")&&j(ot,gl),(!ul||gt[0]&16384)&&rl!==(rl=et[14].t("Save")+"")&&j($l,rl)},i(et){ul||(G(J),G(x.$$.fragment,et),G(te.$$.fragment,et),G(Nl),G(Ge.$$.fragment,et),G(Le.$$.fragment,et),G(Tt.$$.fragment,et),G(yt.$$.fragment,et),ul=!0)},o(et){W(J),W(x.$$.fragment,et),W(te.$$.fragment,et),W(Nl),W(Ge.$$.fragment,et),W(Le.$$.fragment,et),W(Tt.$$.fragment,et),W(yt.$$.fragment,et),ul=!1},d(et){et&&(c(e),c($t),c(dt)),~Z&&ll[Z].d(),he(x),he(te),Dl&&Dl.d(),Nl&&Nl.d(),he(Ge),he(Le),he(Tt),he(yt),pl=!1,ml(_s)}}}function s1(l){let e,t,s,n;function i(f){l[31](f)}let a={placeholder:l[14].t("Enter Mistral API Key")};return l[13].MISTRAL_OCR_API_KEY!==void 0&&(a.value=l[13].MISTRAL_OCR_API_KEY),t=new _l({props:a}),Ye.push(()=>qe(t,"value",i)),{c(){e=_("div"),ce(t.$$.fragment),this.h()},l(f){e=h(f,"DIV",{class:!0});var o=p(e);de(t.$$.fragment,o),o.forEach(c),this.h()},h(){u(e,"class","my-0.5 flex gap-2 pr-2")},m(f,o){M(f,e,o),_e(t,e,null),n=!0},p(f,o){const d={};o[0]&16384&&(d.placeholder=f[14].t("Enter Mistral API Key")),!s&&o[0]&8192&&(s=!0,d.value=f[13].MISTRAL_OCR_API_KEY,Fe(()=>s=!1)),t.$set(d)},i(f){n||(G(t.$$.fragment,f),n=!0)},o(f){W(t.$$.fragment,f),n=!1},d(f){f&&c(e),he(t)}}}function n1(l){let e,t,s,n,i,a,f,o,d;function E(v){l[30](v)}let m={placeholder:l[14].t("Enter Document Intelligence Key")};return l[13].DOCUMENT_INTELLIGENCE_KEY!==void 0&&(m.value=l[13].DOCUMENT_INTELLIGENCE_KEY),i=new _l({props:m}),Ye.push(()=>qe(i,"value",E)),{c(){e=_("div"),t=_("input"),n=N(),ce(i.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"INPUT",{class:!0,placeholder:!0}),n=$(g),de(i.$$.fragment,g),g.forEach(c),this.h()},h(){u(t,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(t,"placeholder",s=l[14].t("Enter Document Intelligence Endpoint")),u(e,"class","my-0.5 flex gap-2 pr-2")},m(v,g){M(v,e,g),r(e,t),Q(t,l[13].DOCUMENT_INTELLIGENCE_ENDPOINT),r(e,n),_e(i,e,null),f=!0,o||(d=pe(t,"input",l[29]),o=!0)},p(v,g){(!f||g[0]&16384&&s!==(s=v[14].t("Enter Document Intelligence Endpoint")))&&u(t,"placeholder",s),g[0]&8192&&t.value!==v[13].DOCUMENT_INTELLIGENCE_ENDPOINT&&Q(t,v[13].DOCUMENT_INTELLIGENCE_ENDPOINT);const b={};g[0]&16384&&(b.placeholder=v[14].t("Enter Document Intelligence Ke
110y")),!a&&g[0]&8192&&(a=!0,b.value=v[13].DOCUMENT_INTELLIGENCE_KEY,Fe(()=>a=!1)),i.$set(b)},i(v){f||(G(i.$$.fragment,v),f=!0)},o(v){W(i.$$.fragment,v),f=!1},d(v){v&&c(e),he(i),o=!1,d()}}}function r1(l){let e,t,s,n,i;return{c(){e=_("div"),t=_("input"),this.h()},l(a){e=h(a,"DIV",{class:!0});var f=p(e);t=h(f,"INPUT",{class:!0,placeholder:!0}),f.forEach(c),this.h()},h(){u(t,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(t,"placeholder",s=l[14].t("Enter Docling Server URL")),u(e,"class","flex w-full mt-1")},m(a,f){M(a,e,f),r(e,t),Q(t,l[13].DOCLING_SERVER_URL),n||(i=pe(t,"input",l[28]),n=!0)},p(a,f){f[0]&16384&&s!==(s=a[14].t("Enter Docling Server URL"))&&u(t,"placeholder",s),f[0]&8192&&t.value!==a[13].DOCLING_SERVER_URL&&Q(t,a[13].DOCLING_SERVER_URL)},i:st,o:st,d(a){a&&c(e),n=!1,i()}}}function a1(l){let e,t,s,n,i,a;return{c(){e=_("div"),t=_("div"),s=_("input"),this.h()},l(f){e=h(f,"DIV",{class:!0});var o=p(e);t=h(o,"DIV",{class:!0});var d=p(t);s=h(d,"INPUT",{class:!0,placeholder:!0}),d.forEach(c),o.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(s,"placeholder",n=l[14].t("Enter Tika Server URL")),u(t,"class","flex-1 mr-2"),u(e,"class","flex w-full mt-1")},m(f,o){M(f,e,o),r(e,t),r(t,s),Q(s,l[13].TIKA_SERVER_URL),i||(a=pe(s,"input",l[27]),i=!0)},p(f,o){o[0]&16384&&n!==(n=f[14].t("Enter Tika Server URL"))&&u(s,"placeholder",n),o[0]&8192&&s.value!==f[13].TIKA_SERVER_URL&&Q(s,f[13].TIKA_SERVER_URL)},i:st,o:st,d(f){f&&c(e),i=!1,a()}}}function i1(l){let e,t,s,n=l[14].t("PDF Extract Images (OCR)")+"",i,a,f,o,d,E;function m(g){l[26](g)}let v={};return l[13].PDF_EXTRACT_IMAGES!==void 0&&(v.state=l[13].PDF_EXTRACT_IMAGES),o=new vl({props:v}),Ye.push(()=>qe(o,"state",m)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),ce(o.$$.fragment),this.h()},l(g){e=h(g,"DIV",{class:!0});var b=p(e);t=h(b,"DIV",{class:!0});var w=p(t);s=h(w,"DIV",{class:!0});var A=p(s);i=H(A,n),A.forEach(c),a=$(w),f=h(w,"DIV",{class:!0});var I=p(f);de(o.$$.fragment,I),I.forEach(c),w.forEach(c),b.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium"),u(f,"class","flex items-center relative"),u(t,"class","flex-1 flex justify-between"),u(e,"class","flex w-full mt-1")},m(g,b){M(g,e,b),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),_e(o,f,null),E=!0},p(g,b){(!E||b[0]&16384)&&n!==(n=g[14].t("PDF Extract Images (OCR)")+"")&&j(i,n);const w={};!d&&b[0]&8192&&(d=!0,w.state=g[13].PDF_EXTRACT_IMAGES,Fe(()=>d=!1)),o.$set(w)},i(g){E||(G(o.$$.fragment,g),E=!0)},o(g){W(o.$$.fragment,g),E=!1},d(g){g&&c(e),he(o)}}}function o1(l){let e=l[14].t("Bypass Embedding and Retrieval")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&16384&&e!==(e=s[14].t("Bypass Embedding and Retrieval")+"")&&j(t,e)},d(s){s&&c(t)}}}function u1(l){let e,t,s;function n(a){l[32](a)}let i={};return l[13].BYPASS_EMBEDDING_AND_RETRIEVAL!==void 0&&(i.state=l[13].BYPASS_EMBEDDING_AND_RETRIEVAL),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f[0]&8192&&(t=!0,o.state=a[13].BYPASS_EMBEDDING_AND_RETRIEVAL,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Li(l){let e,t,s=l[14].t("Text Splitter")+"",n,i,a,f,o,d=l[14].t("Default")+"",E,m,v=l[14].t("Character")+"",g,b,w,A=l[14].t("Token")+"",I,k,T=l[14].t("Tiktoken")+"",R,O,y,L,P,D,S,K=l[14].t("Chunk Size")+"",Y,C,V,U,F,X,Z,J,ie=l[14].t("Chunk Overlap")+"",fe,le,x,oe,se,te,ae;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("select"),o=_("option"),E=B(d),m=B(" ("),g=B(v),b=B(")"),w=_("option"),I=B(A),k=B(" ("),R=B(T),O=B(")"),y=N(),L=_("div"),P=_("div"),D=_("div"),S=_("div"),Y=B(K),C=N(),V=_("div"),U=_("input"),X=N(),Z=_("div"),J=_("div"),fe=B(ie),le=N(),x=_("div"),oe=_("input"),this.h()},l(Te){e=h(Te,"DIV",{class:!0});var ve=p(e);t=h(ve,"DIV",{class:!0});var q=p(t);n=H(q,s),q.forEach(c),i=$(ve),a=h(ve,"DIV",{class:!0});var ne=p(a);f=h(ne,"SELECT",{class:!0});var Ie=p(f);o=h(Ie,"OPTION",{});var be=p(o);E=H(be,d),m=H(be," ("),g=H(be,v),b=H(be,")"),be.forEach(c),w=h(Ie,"OPTION",{});var z=p(w);I=H(z,A),k=H(z," ("),R=H(z,T),O=H(z,")"),z.forEach(c),Ie.forEach(c),ne.forEach(c),ve.forEach(c),y=$(Te),L=h(Te,"DIV",{class:!0});var ke=p(L);P=h(ke,"DIV",{class:!0});var Ue=p(P);D=h(Ue,"DIV",{class:!0});var we=p(D);S=h(we,"DIV",{class:!0});var Ae=p(S);Y=H(Ae,K),Ae.forEach(c),C=$(we),V=h(we,"DIV",{class:!0});var Re=p(V);U=h(Re,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),Re.forEach(c),we.forEach(c),X=$(Ue),Z=h(Ue,"DIV",{class:!0});var ue=p(Z);J=h(ue,"DIV",{class:!0});var Ee=p(J);fe=H(Ee,ie),Ee.forEach(c),le=$(ue),x=h(ue,"DIV",{class:!0});var Me=p(x);oe=h(Me,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),Me.forEach(c),ue.forEach(c),Ue.forEach(c),ke.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium"),o.__value="",Q(o,o.__value),w.__value="token",Q(w,w.__value),u(f,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-hidden text-right"),l[13].TEXT_SPLITTER===void 0&&Cl(()=>l[33].call(f)),u(a,"class","flex items-center relative"),u(e,"class","mb-2.5 flex w-full justify-between"),u(S,"class","self-center text-xs font-medium min-w-fit mb-1"),u(U,"class","w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(U,"type","number"),u(U,"placeholder",F=l[14].t("Enter Chunk Size")),u(U,"autocomplete","off"),u(U,"min","0"),u(V,"class","self-center"),u(D,"class","w-full justify-between"),u(J,"class","self-center text-xs font-medium min-w-fit mb-1"),u(oe,"class","w-full rounded-lg py-1.5 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(oe,"type","number"),u(oe,"placeholder",se=l[14].t("Enter Chunk Overlap")),u(oe,"autocomplete","off"),u(oe,"min","0"),u(x,"class","self-center"),u(Z,"class","w-full"),u(P,"class","flex gap-1.5 w-full"),u(L,"class","mb-2.5 flex w-full justify-between")},m(Te,ve){M(Te,e,ve),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(o,E),r(o,m),r(o,g),r(o,b),r(f,w),r(w,I),r(w,k),r(w,R),r(w,O),Ft(f,l[13].TEXT_SPLITTER,!0),M(Te,y,ve),M(Te,L,ve),r(L,P),r(P,D),r(D,S),r(S,Y),r(D,C),r(D,V),r(V,U),Q(U,l[13].CHUNK_SIZE),r(P,X),r(P,Z),r(Z,J),r(J,fe),r(Z,le),r(Z,x),r(x,oe),Q(oe,l[13].CHUNK_OVERLAP),te||(ae=[pe(f,"change",l[33]),pe(U,"input",l[34]),pe(oe,"input",l[35])],te=!0)},p(Te,ve){ve[0]&16384&&s!==(s=Te[14].t("Text Splitter")+"")&&j(n,s),ve[0]&16384&&d!==(d=Te[14].t("Default")+"")&&j(E,d),ve[0]&16384&&v!==(v=Te[14].t("Character")+"")&&j(g,v),ve[0]&16384&&A!==(A=Te[14].t("Token")+"")&&j(I,A),ve[0]&16384&&T!==(T=Te[14].t("Tiktoken")+"")&&j(R,T),ve[0]&8192&&Ft(f,Te[13].TEXT_SPLITTER),ve[0]&16384&&K!==(K=Te[14].t("Chunk Size")+"")&&j(Y,K),ve[0]&16384&&F!==(F=Te[14].t("Enter Chunk Size"))&&u(U,"placeholder",F),ve[0]&8192&&Gl(U.value)!==Te[13].CHUNK_SIZE&&Q(U,Te[13].CHUNK_SIZE),ve[0]&16384&&ie!==(ie=Te[14].t("Chunk Overlap")+"")&&j(fe,ie),ve[0]&16384&&se!==(se=Te[14].t("Enter Chunk Overlap"))&&u(oe,"placeholder",se),ve[0]&8192&&Gl(oe.value)!==Te[13].CHUNK_OVERLAP&&Q(oe,Te[13].CHUNK_OVERLAP)},d(Te){Te&&(c(e),c(y),c(L)),te=!1,ml(ae)}}}function Ci(l){let e,t,s=l[14].t("Embedding")+"",n,i,a,f,o,d,E,m=l[14].t("Embedding Model Engine")+"",v,g,b,w,A,I=l[14].t("Default (SentenceTransformers)")+"",k,T,R=l[14].t("Ollama")+"",O,y,L=l[14].t("OpenAI")+"",P,D,S,K,Y,C,V,U=l[14].t("Embedding Model")+"",F,X,Z,J,ie,fe=l[14].t("Warning: If you update or change your embedding model, you will need to re-import all documents.")+"",le,x,oe,se,te,ae=l[14].t("Retrieval")+"",Te,ve,q,ne,Ie,be,z=l[14].t("Full Context Mode")+"",ke,Ue,we,Ae,Re,ue,Ee,Me,Ge=l[14].t("RAG Template")+"",ee,me,ge,Ne,ye,ze,Ce;
110const Le=[c1,f1],Ke=[];function re(Ve,je){return Ve[5]==="openai"?0:Ve[5]==="ollama"?1:-1}~(S=re(l))&&(K=Ke[S]=Le[S](l));function $e(Ve,je){return Ve[5]==="ollama"?_1:d1}let ut=$e(l),ft=ut(l),ct=(l[5]==="ollama"||l[5]==="openai")&&Mi(l);Ae=new Gt({props:{content:l[13].RAG_FULL_CONTEXT?l[14].t("Inject the entire content as context for comprehensive processing, this is recommended for complex queries."):l[14].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases."),$$slots:{default:[v1]},$$scope:{ctx:l}}});let Be=!l[13].RAG_FULL_CONTEXT&&Bi(l);return Ne=new Gt({props:{content:l[14].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",className:"w-full",$$slots:{default:[E1]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("hr"),f=N(),o=_("div"),d=_("div"),E=_("div"),v=B(m),g=N(),b=_("div"),w=_("select"),A=_("option"),k=B(I),T=_("option"),O=B(R),y=_("option"),P=B(L),D=N(),K&&K.c(),Y=N(),C=_("div"),V=_("div"),F=B(U),X=N(),Z=_("div"),ft.c(),J=N(),ie=_("div"),le=B(fe),x=N(),ct&&ct.c(),oe=N(),se=_("div"),te=_("div"),Te=B(ae),ve=N(),q=_("hr"),ne=N(),Ie=_("div"),be=_("div"),ke=B(z),Ue=N(),we=_("div"),ce(Ae.$$.fragment),Re=N(),Be&&Be.c(),ue=N(),Ee=_("div"),Me=_("div"),ee=B(Ge),me=N(),ge=_("div"),ce(Ne.$$.fragment),this.h()},l(Ve){e=h(Ve,"DIV",{class:!0});var je=p(e);t=h(je,"DIV",{class:!0});var Rt=p(t);n=H(Rt,s),Rt.forEach(c),i=$(je),a=h(je,"HR",{class:!0}),f=$(je),o=h(je,"DIV",{class:!0});var Ot=p(o);d=h(Ot,"DIV",{class:!0});var _t=p(d);E=h(_t,"DIV",{class:!0});var Et=p(E);v=H(Et,m),Et.forEach(c),g=$(_t),b=h(_t,"DIV",{class:!0});var At=p(b);w=h(At,"SELECT",{class:!0,placeholder:!0});var Tt=p(w);A=h(Tt,"OPTION",{});var Ut=p(A);k=H(Ut,I),Ut.forEach(c),T=h(Tt,"OPTION",{});var rt=p(T);O=H(rt,R),rt.forEach(c),y=h(Tt,"OPTION",{});var bt=p(y);P=H(bt,L),bt.forEach(c),Tt.forEach(c),At.forEach(c),_t.forEach(c),D=$(Ot),K&&K.l(Ot),Ot.forEach(c),Y=$(je),C=h(je,"DIV",{class:!0});var lt=p(C);V=h(lt,"DIV",{class:!0});var He=p(V);F=H(He,U),He.forEach(c),X=$(lt),Z=h(lt,"DIV",{class:!0});var at=p(Z);ft.l(at),at.forEach(c),J=$(lt),ie=h(lt,"DIV",{class:!0});var Vt=p(ie);le=H(Vt,fe),Vt.forEach(c),lt.forEach(c),x=$(je),ct&&ct.l(je),je.forEach(c),oe=$(Ve),se=h(Ve,"DIV",{class:!0});var Qe=p(se);te=h(Qe,"DIV",{class:!0});var yt=p(te);Te=H(yt,ae),yt.forEach(c),ve=$(Qe),q=h(Qe,"HR",{class:!0}),ne=$(Qe),Ie=h(Qe,"DIV",{class:!0});var wt=p(Ie);be=h(wt,"DIV",{class:!0});var vt=p(be);ke=H(vt,z),vt.forEach(c),Ue=$(wt),we=h(wt,"DIV",{class:!0});var It=p(we);de(Ae.$$.fragment,It),It.forEach(c),wt.forEach(c),Re=$(Qe),Be&&Be.l(Qe),ue=$(Qe),Ee=h(Qe,"DIV",{class:!0});var el=p(Ee);Me=h(el,"DIV",{class:!0});var Kt=p(Me);ee=H(Kt,Ge),Kt.forEach(c),me=$(el),ge=h(el,"DIV",{class:!0});var Lt=p(ge);de(Ne.$$.fragment,Lt),Lt.forEach(c),el.forEach(c),Qe.forEach(c),this.h()},h(){u(t,"class","mb-2.5 text-base font-medium"),u(a,"class","border-gray-100 dark:border-gray-850 my-2"),u(E,"class","self-center text-xs font-medium"),A.__value="",Q(A,A.__value),T.__value="ollama",Q(T,T.__value),y.__value="openai",Q(y,y.__value),u(w,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(w,"placeholder","Select an embedding model engine"),l[5]===void 0&&Cl(()=>l[36].call(w)),u(b,"class","flex items-center relative"),u(d,"class","flex w-full justify-between"),u(o,"class","mb-2.5 flex flex-col w-full justify-between"),u(V,"class","mb-1 text-xs font-medium"),u(Z,"class",""),u(ie,"class","mt-1 mb-1 text-xs text-gray-400 dark:text-gray-500"),u(C,"class","mb-2.5 flex flex-col w-full"),u(e,"class","mb-3"),u(te,"class","mb-2.5 text-base font-medium"),u(q,"class","border-gray-100 dark:border-gray-850 my-2"),u(be,"class","self-center text-xs font-medium"),u(we,"class","flex items-center relative"),u(Ie,"class","mb-2.5 flex w-full justify-between"),u(Me,"class","mb-1 text-xs font-medium"),u(ge,"class","flex w-full items-center relative"),u(Ee,"class","mb-2.5 flex flex-col w-full justify-between"),u(se,"class","mb-3")},m(Ve,je){M(Ve,e,je),r(e,t),r(t,n),r(e,i),r(e,a),r(e,f),r(e,o),r(o,d),r(d,E),r(E,v),r(d,g),r(d,b),r(b,w),r(w,A),r(A,k),r(w,T),r(T,O),r(w,y),r(y,P),Ft(w,l[5],!0),r(o,D),~S&&Ke[S].m(o,null),r(e,Y),r(e,C),r(C,V),r(V,F),r(C,X),r(C,Z),ft.m(Z,null),r(C,J),r(C,ie),r(ie,le),r(e,x),ct&&ct.m(e,null),M(Ve,oe,je),M(Ve,se,je),r(se,te),r(te,Te),r(se,ve),r(se,q),r(se,ne),r(se,Ie),r(Ie,be),r(be,ke),r(
110Ie,Ue),r(Ie,we),_e(Ae,we,null),r(se,Re),Be&&Be.m(se,null),r(se,ue),r(se,Ee),r(Ee,Me),r(Me,ee),r(Ee,me),r(Ee,ge),_e(Ne,ge,null),ye=!0,ze||(Ce=[pe(w,"change",l[36]),pe(w,"change",l[37])],ze=!0)},p(Ve,je){(!ye||je[0]&16384)&&s!==(s=Ve[14].t("Embedding")+"")&&j(n,s),(!ye||je[0]&16384)&&m!==(m=Ve[14].t("Embedding Model Engine")+"")&&j(v,m),(!ye||je[0]&16384)&&I!==(I=Ve[14].t("Default (SentenceTransformers)")+"")&&j(k,I),(!ye||je[0]&16384)&&R!==(R=Ve[14].t("Ollama")+"")&&j(O,R),(!ye||je[0]&16384)&&L!==(L=Ve[14].t("OpenAI")+"")&&j(P,L),je[0]&32&&Ft(w,Ve[5]);let Rt=S;S=re(Ve),S===Rt?~S&&Ke[S].p(Ve,je):(K&&(ht(),W(Ke[Rt],1,1,()=>{Ke[Rt]=null}),pt()),~S?(K=Ke[S],K?K.p(Ve,je):(K=Ke[S]=Le[S](Ve),K.c()),G(K,1),K.m(o,null)):K=null),(!ye||je[0]&16384)&&U!==(U=Ve[14].t("Embedding Model")+"")&&j(F,U),ut===(ut=$e(Ve))&&ft?ft.p(Ve,je):(ft.d(1),ft=ut(Ve),ft&&(ft.c(),ft.m(Z,null))),(!ye||je[0]&16384)&&fe!==(fe=Ve[14].t("Warning: If you update or change your embedding model, you will need to re-import all documents.")+"")&&j(le,fe),Ve[5]==="ollama"||Ve[5]==="openai"?ct?ct.p(Ve,je):(ct=Mi(Ve),ct.c(),ct.m(e,null)):ct&&(ct.d(1),ct=null),(!ye||je[0]&16384)&&ae!==(ae=Ve[14].t("Retrieval")+"")&&j(Te,ae),(!ye||je[0]&16384)&&z!==(z=Ve[14].t("Full Context Mode")+"")&&j(ke,z);const Ot={};je[0]&24576&&(Ot.content=Ve[13].RAG_FULL_CONTEXT?Ve[14].t("Inject the entire content as context for comprehensive processing, this is recommended for complex queries."):Ve[14].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.")),je[0]&8192|je[2]&32&&(Ot.$$scope={dirty:je,ctx:Ve}),Ae.$set(Ot),Ve[13].RAG_FULL_CONTEXT?Be&&(ht(),W(Be,1,1,()=>{Be=null}),pt()):Be?(Be.p(Ve,je),je[0]&8192&&G(Be,1)):(Be=Bi(Ve),Be.c(),G(Be,1),Be.m(se,ue)),(!ye||je[0]&16384)&&Ge!==(Ge=Ve[14].t("RAG Template")+"")&&j(ee,Ge);const _t={};je[0]&16384&&(_t.content=Ve[14].t("Leave empty to use the default prompt, or enter a custom prompt")),je[0]&24576|je[2]&32&&(_t.$$scope={dirty:je,ctx:Ve}),Ne.$set(_t)},i(Ve){ye||(G(K),G(Ae.$$.fragment,Ve),G(Be),G(Ne.$$.fragment,Ve),ye=!0)},o(Ve){W(K),W(Ae.$$.fragment,Ve),W(Be),W(Ne.$$.fragment,Ve),ye=!1},d(Ve){Ve&&(c(e),c(oe),c(se)),~S&&Ke[S].d(),ft.d(),ct&&ct.d(),he(Ae),Be&&Be.d(),he(Ne),ze=!1,ml(Ce)}}}function f1(l){let e,t,s,n,i,a,f,o,d;function E(v){l[41](v)}let m={placeholder:l[14].t("API Key"),required:!1};return l[12]!==void 0&&(m.value=l[12]),i=new _l({props:m}),Ye.push(()=>qe(i,"value",E)),{c(){e=_("div"),t=_("input"),n=N(),ce(i.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"INPUT",{class:!0,placeholder:!0}),n=$(g),de(i.$$.fragment,g),g.forEach(c),this.h()},h(){u(t,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(t,"placeholder",s=l[14].t("API Base URL")),t.required=!0,u(e,"class","my-0.5 flex gap-2 pr-2")}
110,m(v,g){M(v,e,g),r(e,t),Q(t,l[11]),r(e,n),_e(i,e,null),f=!0,o||(d=pe(t,"input",l[40]),o=!0)},p(v,g){(!f||g[0]&16384&&s!==(s=v[14].t("API Base URL")))&&u(t,"placeholder",s),g[0]&2048&&t.value!==v[11]&&Q(t,v[11]);const b={};g[0]&16384&&(b.placeholder=v[14].t("API Key")),!a&&g[0]&4096&&(a=!0,b.value=v[12],Fe(()=>a=!1)),i.$set(b)},i(v){f||(G(i.$$.fragment,v),f=!0)},o(v){W(i.$$.fragment,v),f=!1},d(v){v&&c(e),he(i),o=!1,d()}}}function c1(l){let e,t,s,n,i,a,f,o,d;function E(v){l[39](v)}let m={placeholder:l[14].t("API Key")};return l[10]!==void 0&&(m.value=l[10]),i=new _l({props:m}),Ye.push(()=>qe(i,"value",E)),{c(){e=_("div"),t=_("input"),n=N(),ce(i.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"INPUT",{class:!0,placeholder:!0}),n=$(g),de(i.$$.fragment,g),g.forEach(c),this.h()},h(){u(t,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(t,"placeholder",s=l[14].t("API Base URL")),t.required=!0,u(e,"class","my-0.5 flex gap-2 pr-2")},m(v,g){M(v,e,g),r(e,t),Q(t,l[9]),r(e,n),_e(i,e,null),f=!0,o||(d=pe(t,"input",l[38]),o=!0)},p(v,g){(!f||g[0]&16384&&s!==(s=v[14].t("API Base URL")))&&u(t,"placeholder",s),g[0]&512&&t.value!==v[9]&&Q(t,v[9]);const b={};g[0]&16384&&(b.placeholder=v[14].t("API Key")),!a&&g[0]&1024&&(a=!0,b.value=v[10],Fe(()=>a=!1)),i.$set(b)},i(v){f||(G(i.$$.fragment,v),f=!0)},o(v){W(i.$$.fragment,v),f=!1},d(v){v&&c(e),he(i),o=!1,d()}}}function d1(l){let e,t,s,n,i,a,f,o=l[5]===""&&Ui(l);return{c(){e=_("div"),t=_("div"),s=_("input"),i=N(),o&&o.c(),this.h()},l(d){e=h(d,"DIV",{class:!0});var E=p(e);t=h(E,"DIV",{class:!0});var m=p(t);s=h(m,"INPUT",{class:!0,placeholder:!0}),m.forEach(c),i=$(E),o&&o.l(E),E.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(s,"placeholder",n=l[14].t("Set embedding model (e.g. {{model}})",{model:l[6].slice(-40)})),u(t,"class","flex-1 mr-2"),u(e,"class","flex w-full")},m(d,E){M(d,e,E),r(e,t),r(t,s),Q(s,l[6]),r(e,i),o&&o.m(e,null),a||(f=pe(s,"input",l[43]),a=!0)},p(d,E){E[0]&16448&&n!==(n=d[14].t("Set embedding model (e.g. {{model}})",{model:d[6].slice(-40)}))&&u(s,"placeholder",n),E[0]&64&&s.value!==d[6]&&Q(s,d[6]),d[5]===""?o?o.p(d,E):(o=Ui(d),o.c(),o.m(e,null)):o&&(o.d(1),o=null)},d(d){d&&c(e),o&&o.d(),a=!1,f()}}}function _1(l){let e,t,s,n,i,a;return{c(){e=_("div"),t=_("div"),s=_("input"),this.h()},l(f){e=h(f,"DIV",{class:!0});var o=p(e);t=h(o,"DIV",{class:!0});var d=p(t);s=h(d,"INPUT",{class:!0,placeholder:!0}),d.forEach(c),o.forEach(c),this.h()},h(){u(s,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(s,"placeholder",n=l[14].t("Set embedding model")),s.required=!0,u(t,"class","flex-1 mr-2"),u(e,"class","flex w-full")},m(f,o){M(f,e,o),r(e,t),r(t,s),Q(s,l[6]),i||(a=pe(s,"input",l[42]),i=!0)},p(f,o){o[0]&16384&&n!==(n=f[14].t("Set embedding model"))&&u(s,"placeholder",n),o[0]&64&&s.value!==f[6]&&Q(s,f[6])},d(f){f&&c(e),i=!1,a()}}}function Ui(l){let e,t,s;function n(f,o){return f[0]?p1:h1}let i=n(l),a=i(l);return{c(){e=_("button"),a.c(),this.h()},l(f){e=h(f,"BUTTON",{class:!0});var o=p(e);a.l(o),o.forEach(c),this.h()},h(){u(e,"class","px-2.5 bg-transparent text-gray-800 dark:bg-transparent dark:text-gray-100 rounded-lg transition"),e.disabled=l[0]},m(f,o){M(f,e,o),a.m(e,null),t||(s=pe(e,"click",l[44]),t=!0)},p(f,o){i!==(i=n(f))&&(a.d(1),a=i(f),a&&(a.c(),a.m(e,null))),o[0]&1&&(e.disabled=f[0])},d(f){f&&c(e),a.d(),t=!1,s()}}}function h1(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
110),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function p1(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
111																	transform-origin: center;
112																	animation: spinner_AtaB 0.75s infinite linear;
113																}
114
115																@keyframes spinner_AtaB {
116																	100% {
117																		transform: rotate(360deg);
118																	}
119																}
120															</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1q4oig8"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function Mi(l){let e,t,s=l[14].t("Embedding Batch Size")+"",n,i,a,f,o,d;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("input"),this.h()},l(E){e=h(E,"DIV",{class:!0});var m=p(e);t=h(m,"DIV",{class:!0});var v=p(t);n=H(v,s),v.forEach(c),i=$(m),a=h(m,"DIV",{class:!0});var g=p(a);f=h(g,"INPUT",{type:!0,class:!0,min:!0,max:!0,step:!0}),g.forEach(c),m.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(f,"type","number"),u(f,"class","bg-transparent text-center w-14 outline-none"),u(f,"min","-2"),u(f,"max","16000"),u(f,"step","1"),u(a,"class",""),u(e,"class","mb-2.5 flex w-full justify-between")},m(E,m){M(E,e,m),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),Q(f,l[7]),o||(d=pe(f,"input",l[45]),o=!0)},p(E,m){m[0]&16384&&s!==(s=E[14].t("Embedding Batch Size")+"")&&j(n,s),m[0]&128&&Gl(f.value)!==E[7]&&Q(f,E[7])},d(E){E&&c(e),o=!1,d()}}}function v1(l){let e,t,s;function n(a){l[46](a)}let i={};return l[13].RAG_FULL_CONTEXT!==void 0&&(i.state=l[13].RAG_FULL_CONTEXT),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f[0]&8192&&(t=!0,o.state=a[13].RAG_FULL_CONTEXT,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Bi(l){let e,t,s=l[14].t("Hybrid Search")+"",n,i,a,f,o,d,E,m,v,g=l[14].t("Top K")+"",b,w,A,I,k,T,R,O,y,L,P;function D(V){l[47](V)}let S={};l[13].ENABLE_RAG_HYBRID_SEARCH!==void 0&&(S.state=l[13].ENABLE_RAG_HYBRID_SEARCH),f=new vl({props:S}),Ye.push(()=>qe(f,"state",D)),f.$on("change",l[48]);let K=l[13].ENABLE_RAG_HYBRID_SEARCH===!0&&Hi(l),Y=l[13].ENABLE_RAG_HYBRID_SEARCH===!0&&Gi(l),C=l[13].ENABLE_RAG_HYBRID_SEARCH===!0&&Ki(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),ce(f.$$.fragment),d=N(),K&&K.c(),E=N(),m=_("div"),v=_("div"),b=B(g),w=N(),A=_("div"),I=_("input"),T=N(),Y&&Y.c(),R=N(),C&&C.c(),O=xt(),this.h()},l(V){e=h(V,"DIV",{class:!0});var U=p(e);t=h(U,"DIV",{class:!0});var F=p(t);n=H(F,s),F.forEach(c),i=$(U),a=h(U,"DIV",{class:!0});var X=p(a);de(f.$$.fragment,X),X.forEach(c),U.forEach(c),d=$(V),K&&K.l(V),E=$(V),m=h(V,"DIV",{class:!0});var Z=p(m);v=h(Z,"DIV",{class:!0});var J=p(v);b=H(J,g),J.forEach(c),w=$(Z),A=h(Z,"DIV",{class:!0});var ie=p(A);I=h(ie,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),ie.forEach(c),Z.forEach(c),T=$(V),Y&&Y.l(V),R=$(V),C&&C.l(V),O=xt(),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(a,"class","flex items-center relative"),u(e,"class","mb-2.5 flex w-full justify-between"),u(v,"class","self-center text-xs font-medium"),u(I,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(I,"type","number"),u(I,"placeholder",k=l[14].t("Enter Top K")),u(I,"autocomplete","off"),u(I,"min","0"),u(A,"class","flex items-center relative"),u(m,"class","mb-2.5 flex w-full justify-between")},m(V,U){M(V,e,U),r(e,t),r(t,n),r(e,i),r(e,a),_e(f,a,null),M(V,d,U),K&&K.m(V,U),M(V,E,U),M(V,m,U),r(m,v),r(v,b),r(m,w),r(m,A),r(A,I),Q(I,l[13].TOP_K),M(V,T,U),Y&&Y.m(V,U),M(V,R,U),C&&C.m(V,U),M(V,O,U),y=!0,L||(P=pe(I,"input",l[51]),L=!0)},p(V,U){(!y||U[0]&16384)&&s!==(s=V[14].t("Hybrid Search")+"")&&j(n,s);const F={};!o&&U[0]&8192&&(o=!0,F.state=V[13].ENABLE_RAG_HYBRID_SEARCH,Fe(()=>o=!1)),f.$set(F),V[13].ENABLE_RAG_HYBRID_SEARCH===!0?K?K.p(V,U):(K=Hi(V),K.c(),K.m(E.parentNode,E)):K&&(K.d(1),K=null),(!y||U[0]&16384)&&g!==(g=V[14].t("Top K")+"")&&j(b,g),(!y||U[0]&16384&&k!==(k=V[14].t("Enter Top K")))&&u(I,"placeholder",k),U[0]&8192&&Gl(I.value)!==V[13].TOP_K&&Q(I,V[13].TOP_K),V[13].ENABLE_RAG_HYBRID_SEARCH===!0?Y?Y.p(V,U):(Y=Gi(V),Y.c(),Y.m(R.parentNode,R)):Y&&(Y.d(1),Y=null),V[13].ENABLE_RAG_HYBRID_SEARCH===!0?C?C.p(V,U):(C=Ki(V),C.c(),C.m(O.parentNode,O)):C&&(C.d(1),C=null)},i(V){y||(G(f.$$.fragment,V),y=!0)},o(V){W(f.$$.fragment,V),y=!1},d(V){V&&(c(e),c(d),c(E),c(m),c(T),c(R),c(O)),he(f),K&&K.d(V),Y&&Y.d(V),C&&C.d(V),L=!1,P()}}}function Hi(l){let e,t,s=l[14].t("Reranking Model")+"",n,i,a,f,o,d,E,m,v,g,b;function w(k,T){return k[1]?g1:m1}let A=w(l),I=A(l);return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("div"),d=_("input"),m=N(),v=_("button"),I.c(),this.h()},l(k){e=h(k,"DIV",{class:!0});var T=p(e);t=h(T,"DIV",{class:!0});var R=p(t);n=H(R,s),R.forEach(c),i=$(T),a=h(T,"DIV",{class:!0});var O=p(a);f=h(O,"DIV",{class:!0});var y=p(f);o=h(y,"DIV",{class:!0});var L=p(o);d=h(L,"INPUT",{class:!0,placeholder:!0}
120),L.forEach(c),m=$(y),v=h(y,"BUTTON",{class:!0});var P=p(v);I.l(P),P.forEach(c),y.forEach(c),O.forEach(c),T.forEach(c),this.h()},h(){u(t,"class","mb-1 text-xs font-medium"),u(d,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(d,"placeholder",E=l[14].t("Set reranking model (e.g. {{model}})",{model:"BAAI/bge-reranker-v2-m3"})),u(o,"class","flex-1 mr-2"),u(v,"class","px-2.5 bg-transparent text-gray-800 dark:bg-transparent dark:text-gray-100 rounded-lg transition"),v.disabled=l[1],u(f,"class","flex w-full"),u(a,"class",""),u(e,"class","mb-2.5 flex flex-col w-full")},m(k,T){M(k,e,T),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),r(o,d),Q(d,l[8]),r(f,m),r(f,v),I.m(v,null),g||(b=[pe(d,"input",l[49]),pe(v,"click",l[50])],g=!0)},p(k,T){T[0]&16384&&s!==(s=k[14].t("Reranking Model")+"")&&j(n,s),T[0]&16384&&E!==(E=k[14].t("Set reranking model (e.g. {{model}})",{model:"BAAI/bge-reranker-v2-m3"}))&&u(d,"placeholder",E),T[0]&256&&d.value!==k[8]&&Q(d,k[8]),A!==(A=w(k))&&(I.d(1),I=A(k),I&&(I.c(),I.m(v,null))),T[0]&2&&(v.disabled=k[1])},d(k){k&&c(e),I.d(),g=!1,ml(b)}}}function m1(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{d:!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
120),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"d","M8.75 2.75a.75.75 0 0 0-1.5 0v5.69L5.03 6.22a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 0 0-1.06-1.06L8.75 8.44V2.75Z"),u(s,"d","M3.5 9.75a.75.75 0 0 0-1.5 0v1.5A2.75 2.75 0 0 0 4.75 14h6.5A2.75 2.75 0 0 0 14 11.25v-1.5a.75.75 0 0 0-1.5 0v1.5c0 .69-.56 1.25-1.25 1.25h-6.5c-.69 0-1.25-.56-1.25-1.25v-1.5Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 16 16"),u(e,"fill","currentColor"),u(e,"class","w-4 h-4")},m(n,i){M(n,e,i),r(e,t),r(e,s)},d(n){n&&c(e)}}}function g1(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
121																	transform-origin: center;
122																	animation: spinner_AtaB 0.75s infinite linear;
123																}
124
125																@keyframes spinner_AtaB {
126																	100% {
127																		transform: rotate(360deg);
128																	}
129																}
130															</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1q4oig8"&&(e.innerHTML=t),this.h()},h(){u(e,"class","self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function Gi(l){let e,t,s=l[14].t("Top K Reranker")+"",n,i,a,f,o,d,E;return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("input"),this.h()},l(m){e=h(m,"DIV",{class:!0});var v=p(e);t=h(v,"DIV",{class:!0});var g=p(t);n=H(g,s),g.forEach(c),i=$(v),a=h(v,"DIV",{class:!0});var b=p(a);f=h(b,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),b.forEach(c),v.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(f,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(f,"type","number"),u(f,"placeholder",o=l[14].t("Enter Top K Reranker")),u(f,"autocomplete","off"),u(f,"min","0"),u(a,"class","flex items-center relative"),u(e,"class","mb-2.5 flex w-full justify-between")},m(m,v){M(m,e,v),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),Q(f,l[13].TOP_K_RERANKER),d||(E=pe(f,"input",l[52]),d=!0)},p(m,v){v[0]&16384&&s!==(s=m[14].t("Top K Reranker")+"")&&j(n,s),v[0]&16384&&o!==(o=m[14].t("Enter Top K Reranker"))&&u(f,"placeholder",o),v[0]&8192&&Gl(f.value)!==m[13].TOP_K_RERANKER&&Q(f,m[13].TOP_K_RERANKER)},d(m){m&&c(e),d=!1,E()}}}function Ki(l){let e,t,s,n=l[14].t("Relevance Threshold")+"",i,a,f,o,d,E,m,v,g=l[14].t("Note: If you set a minimum score, the search will only return documents with a score greater than or equal to the minimum score.")+"",b,w,A;return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("input"),m=N(),v=_("div"),b=B(g),this.h()},l(I){e=h(I,"DIV",{class:!0});var k=p(e);t=h(k,"DIV",{class:!0});var T=p(t);s=h(T,"DIV",{class:!0});var R=p(s);i=H(R,n),R.forEach(c),a=$(T),f=h(T,"DIV",{class:!0});var O=p(f);o=h(O,"INPUT",{class:!0,type:!0,step:!0,placeholder:!0,autocomplete:!0,min:!0,title:!0}),O.forEach(c),T.forEach(c),m=$(k),v=h(k,"DIV",{class:!0});var y=p(v);b=H(y,g),y.forEach(c),k.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium"),u(o,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(o,"type","number"),u(o,"step","0.01"),u(o,"placeholder",d=l[14].t("Enter Score")),u(o,"autocomplete","off"),u(o,"min","0.0"),u(o,"title",E=l[14].t("The score should be a value between 0.0 (0%) and 1.0 (100%).")),u(f,"class","flex items-center relative"),u(t,"class","flex w-full justify-between"),u(v,"class","mt-1 text-xs text-gray-400 dark:text-gray-500"),u(e,"class","mb-2.5 flex flex-col w-full justify-between")},m(I,k){M(I,e,k),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),Q(o,l[13].RELEVANCE_THRESHOLD),r(e,m),r(e,v),r(v,b),w||(A=pe(o,"input",l[53]),w=!0)},p(I,k){k[0]&16384&&n!==(n=I[14].t("Relevance Threshold")+"")&&j(i,n),k[0]&16384&&d!==(d=I[14].t("Enter Score"))&&u(o,"placeholder",d),k[0]&16384&&E!==(E=I[14].t("The score should be a value between 0.0 (0%) and 1.0 (100%)."))&&u(o,"title",E),k[0]&8192&&Gl(o.value)!==I[13].RELEVANCE_THRESHOLD&&Q(o,I[13].RELEVANCE_THRESHOLD),k[
1300]&16384&&g!==(g=I[14].t("Note: If you set a minimum score, the search will only return documents with a score greater than or equal to the minimum score.")+"")&&j(b,g)},d(I){I&&c(e),w=!1,A()}}}function E1(l){let e,t,s;function n(a){l[54](a)}let i={placeholder:l[14].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[13].RAG_TEMPLATE!==void 0&&(i.value=l[13].RAG_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f[0]&16384&&(o.placeholder=a[14].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f[0]&8192&&(t=!0,o.value=a[13].RAG_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function b1(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),this.h()},h(){u(e,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(e,"type","number"),u(e,"placeholder",t=l[14].t("Leave empty for unlimited")),u(e,"autocomplete","off"),u(e,"min","0")},m(i,a){M(i,e,a),Q(e,l[13].FILE_MAX_SIZE),s||(n=pe(e,"input",l[55]),s=!0)},p(i,a){a[0]&16384&&t!==(t=i[14].t("Leave empty for unlimited"))&&u(e,"placeholder",t),a[0]&8192&&Gl(e.value)!==i[13].FILE_MAX_SIZE&&Q(e,i[13].FILE_MAX_SIZE)},d(i){i&&c(e),s=!1,n()}}}function I1(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0,min:!0}),this.h()},h(){u(e,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(e,"type","number"),u(e,"placeholder",t=l[14].t("Leave empty for unlimited")),u(e,"autocomplete","off"),u(e,"min","0")},m(i,a){M(i,e,a),Q(e,l[13].FILE_MAX_COUNT),s||(n=pe(e,"input",l[56]),s=!0)},p(i,a){a[0]&16384&&t!==(t=i[14].t("Leave empty for unlimited"))&&u(e,"placeholder",t),a[0]&8192&&Gl(e.value)!==i[13].FILE_MAX_COUNT&&Q(e,i[13].FILE_MAX_COUNT)},d(i){i&&c(e),s=!1,n()}}}function w1(l){let e,t,s,n,i,a,f,o,d,E,m,v,g,b,w;function A(D){l[19](D)}let I={};l[3]!==void 0&&(I.show=l[3]),e=new Ys({props:I}),Ye.push(()=>qe(e,"show",A)),e.$on("confirm",l[20]);function k(D){l[21](D)}let T={};l[2]!==void 0&&(T.show=l[2]),n=new Ys({props:T}),Ye.push(()=>qe(n,"show",k)),n.$on("confirm",l[22]);function R(D){l[23](D)}let O={};l[4]!==void 0&&(O.show=l[4]),f=new Ys({props:O}),Ye.push(()=>qe(f,"show",R)),f.$on("confirm",l[24]);const y=[l1,t1],L=[];function P(D,S){return D[13]?0:1}return m=P(l),v=L[m]=y[m](l),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment),a=N(),ce(f.$$.fragment),d=N(),E=_("form"),v.c(),this.h()},l(D){de(e.$$.fragment,D),s=$(D),de(n.$$.fragment,D),a=$(D),de(f.$$.fragment,D),d=$(D),E=h(D,"FORM",{class:!0});var S=p(E);v.l(S),S.forEach(c),this.h()},h(){u(E,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(D,S){_e(e,D,S),M(D,s,S),_e(n,D,S),M(D,a,S),_e(f,D,S),M(D,d,S),M(D,E,S),L[m].m(E,null),g=!0,b||(w=pe(E,"submit",ds(l[62])),b=!0)},p(D,S){const K={};!t&&S[0]&8&&(t=!0,K.show=D[3],Fe(()=>t=!1)),e.$set(K);const Y={};!i&&S[0]&4&&(i=!0,Y.show=D[2],Fe(()=>i=!1)),n.$set(Y);const C={};!o&&S[0]&16&&(o=!0,C.show=D[4],Fe(()=>o=!1)),f.$set(C);let V=m;m=P(D),m===V?L[m].p(D,S):(ht(),W(L[V],1,1,()=>{L[V]=null}),pt(),v=L[m],v?v.p(D,S):(v=L[m]=y[m](D),v.c()),G(v,1),v.m(E,null))},i(D){g||(G(e.$$.fragment,D),G(n.$$.fragment,D),G(f.$$.fragment,D),G(v),g=!0)},o(D){W(e.$$.fragment,D),W(n.$$.fragment,D),W(f.$$.fragment,D),W(v),g=!1},d(D){D&&(c(s),c(a),c(d),c(E)),he(e,D),he(n,D),he(f,D),L[m].d(),b=!1,w()}}}function T1(l,e,t){let s;const n=Ss(),i=Ul("i18n");qt(l,i,re=>t(14,s=re));let a=!1,f=!1,o=!1,d=!1,E=!1,m="",v="",g=1,b="",w="",A="",I="",k="",T=null;const R=async()=>{if(m===""&&v.split("/").length-1>1){Je.error(s.t("Model filesystem path detected. Model shortname is required for update, cannot continue."));return}if(m==="ollama"&&v===""){Je.error(s.t("Model filesystem path detected. Model shortname is required for update, cannot continue."));return}if(m==="openai"&&v===""){Je.error(s.t("Model filesystem path detected. Model shortname is required for update, cannot continue."));return}if(m==="openai"&&A===""||w===""){Je.error(s.t("OpenAI URL/Key required."));return}console.log("Update embedding model attempt:",v),t(0,a=!0);const re=await _f(localStorage.token,{embedding_engine:m,embedding_model:v,embedding_batch_size:g,ollama_config:{key:k,url:I},openai_config:{key:A,url:w}}).catch(async $e=>(Je.error(`${$e}`),await L(),null));t(0,a=!1),re&&(console.log("embeddingModelUpdateHandler:",re),re.status===!0&&Je.success(s.t('Embedding model set to "{{embedding_model}}"',re),{duration:1e3*10}))},O=async()=>{console.log("Update reranking model attempt:",b),t(1,f=!0);const re=await uf(localStorage.token,{reranking_model:b}).catch(async $e=>(Je.error(`${$e}`),await P(),null));t(1,f=!1),re&&(console.log("rerankingModelUpdateHandler:",re),re.status===!0&&(b===""?Je.success(s.t("Reranking model disabled",re),{duration:1e3*10}):Je.success(s.t('Reranking model set to "{{reranking_model}}"',re),{duration:1e3*10})))},y=async()=>
130{if(T.CONTENT_EXTRACTION_ENGINE==="tika"&&T.TIKA_SERVER_URL===""){Je.error(s.t("Tika Server URL required."));return}if(T.CONTENT_EXTRACTION_ENGINE==="docling"&&T.DOCLING_SERVER_URL===""){Je.error(s.t("Docling Server URL required."));return}if(T.CONTENT_EXTRACTION_ENGINE==="document_intelligence"&&(T.DOCUMENT_INTELLIGENCE_ENDPOINT===""||T.DOCUMENT_INTELLIGENCE_KEY==="")){Je.error(s.t("Document Intelligence endpoint and key required."));return}if(T.CONTENT_EXTRACTION_ENGINE==="mistral_ocr"&&T.MISTRAL_OCR_API_KEY===""){Je.error(s.t("Mistral OCR API Key required."));return}T.BYPASS_EMBEDDING_AND_RETRIEVAL||(await R(),T.ENABLE_RAG_HYBRID_SEARCH&&await O()),await Ro(localStorage.token,T),n("save")},L=async()=>{const re=await ff(localStorage.token);re&&(t(5,m=re.embedding_engine),t(6,v=re.embedding_model),t(7,g=re.embedding_batch_size??1),t(10,A=re.openai_config.key),t(9,w=re.openai_config.url),t(12,k=re.ollama_config.key),t(11,I=re.ollama_config.url))},P=async()=>{const re=await cf(localStorage.token);re&&t(8,b=re.reranking_model)};rs(async()=>{await L(),await P(),t(13,T=await $o(localStorage.token))});function D(re){d=re,t(3,d)}const S=async()=>{await pf(localStorage.token).catch($e=>(Je.error(`${$e}`),null))&&Je.success(s.t("Success"))};function K(re){o=re,t(2,o)}const Y=()=>{df(localStorage.token).catch($e=>(Je.error(`${$e}`),null))&&Je.success(s.t("Success"))};function C(re){E=re,t(4,E)}const V=async()=>{await hf(localStorage.token).catch($e=>(Je.error(`${$e}`),null))&&Je.success(s.t("Success"))};function U(){T.CONTENT_EXTRACTION_ENGINE=Ll(this),t(13,T)}function F(re){l.$$.not_equal(T.PDF_EXTRACT_IMAGES,re)&&(T.PDF_EXTRACT_IMAGES=re,t(13,T))}function X(){T.TIKA_SERVER_URL=this.value,t(13,T)}function Z(){T.DOCLING_SERVER_URL=this.value,t(13,T)}function J(){T.DOCUMENT_INTELLIGENCE_ENDPOINT=this.value,t(13,T)}function ie(re){l.$$.not_equal(T.DOCUMENT_INTELLIGENCE_KEY,re)&&(T.DOCUMENT_INTELLIGENCE_KEY=re,t(13,T))}function fe(re){l.$$.not_equal(T.MISTRAL_OCR_API_KEY,re)&&(T.MISTRAL_OCR_API_KEY=re,t(13,T))}function le(re){l.$$.not_equal(T.BYPASS_EMBEDDING_AND_RETRIEVAL,re)&&(T.BYPASS_EMBEDDING_AND_RETRIEVAL=re,t(13,T))}function x(){T.TEXT_SPLITTER=Ll(this),t(13,T)}function oe(){T.CHUNK_SIZE=Gl(this.value),t(13,T)}function se(){T.CHUNK_OVERLAP=Gl(this.value),t(13,T)}function te(){m=Ll(this),t(5,m)}const ae=re=>{re.target.value==="ollama"?t(6,v=""):re.target.value==="openai"?t(6,v="text-embedding-3-small"):re.target.value===""&&t(6,v="sentence-transformers/all-MiniLM-L6-v2")};function Te(){w=this.value,t(9,w)}function ve(re){A=re,t(10,A)}function q(){I=this.value,t(11,I)}function ne(re){k=re,t(12,k)}function Ie(){v=this.value,t(6,v)}function be(){v=this.value,t(6,v)}const z=()=>{R()};function ke(){g=Gl(this.value),t(7,g)}function Ue(re){l.$$.not_equal(T.RAG_FULL_CONTEXT,re)&&(T.RAG_FULL_CONTEXT=re,t(13,T))}function we(re){l.$$.not_equal(T.ENABLE_RAG_HYBRID_SEARCH,re)&&(T.ENABLE_RAG_HYBRID_SEARCH=re,t(13,T))}const Ae=()=>{y()};function Re(){b=this.value,t(8,b)}const ue=()=>{O()};function Ee(){T.TOP_K=Gl(this.value),t(13,T)}function Me(){T.TOP_K_RERANKER=Gl(this.value),t(13,T)}function Ge(){T.RELEVANCE_THRESHOLD=Gl(this.value),t(13,T)}function ee(re){l.$$.not_equal(T.RAG_TEMPLATE,re)&&(T.RAG_TEMPLATE=re,t(13,T))}function me(){T.FILE_MAX_SIZE=Gl(this.value),t(13,T)}function ge(){T.FILE_MAX_COUNT=Gl(this.value),t(13,T)}function Ne(re){l.$$.not_equal(T.ENABLE_GOOGLE_DRIVE_INTEGRATION,re)&&(T.ENABLE_GOOGLE_DRIVE_INTEGRATION=re,t(13,T))}function ye(re){l.$$.not_equal(T.ENABLE_ONEDRIVE_INTEGRATION,re)&&(T.ENABLE_ONEDRIVE_INTEGRATION=re,t(13,T))}return[a,f,o,d,E,m,v,g,b,w,A,I,k,T,s,i,R,O,y,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne,Ie,be,z,ke,Ue,we,Ae,Re,ue,Ee,Me,Ge,ee,me,ge,Ne,ye,()=>{t(3,d=!0)},()=>{t(2,o=!0)},()=>{t(4,E=!0)},()=>{y()}]}class A1 extends Sl{constructor(e){super(),Pl(this,e,T1,w1,Ol,{},null,[-1,-1,-1])}}function Yi(l,e,t){const s=l.slice();return s[47]=e[t],s}function ji(l,e,t){const s=l.slice();return s[47]=e[t],s}function Wi(l){let e,t,s,n=l[2].t("General")+"",i,a,f,o,d,E,m=l[2].t("Web Search")+"",v,g,b,w,A,I,k,T,R=l[2].t("Web Search Engine")+"",O,y,L,P,D,S=l[2].t("Select a engine")+"",K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se=l[2].t("Trust Proxy 
130Environment")+"",te,ae,Te,ve,q,ne,Ie,be=l[2].t("Loader")+"",z,ke,Ue,we,Ae,Re,ue=l[2].t("Web Loader Engine")+"",Ee,Me,Ge,ee,me,ge=l[2].t("Default")+"",Ne,ye,ze,Ce,Le,Ke,re,$e,ut=l[2].t("Youtube Language")+"",ft,ct,Be,Ve,je,Rt,Ot,_t,Et=l[2].t("Youtube Proxy URL")+"",At,Tt,Ut,rt,bt,lt,He,at;function Vt(Se){l[7](Se)}let Qe={};l[1].ENABLE_WEB_SEARCH!==void 0&&(Qe.state=l[1].ENABLE_WEB_SEARCH),w=new vl({props:Qe}),Ye.push(()=>qe(w,"state",Vt));let yt=Dt(l[4]),wt=[];for(let Se=0;Se<yt.length;Se+=1)wt[Se]=Fi(ji(l,yt,Se));let vt=l[1].WEB_SEARCH_ENGINE!==""&&qi(l),It=l[1].ENABLE_WEB_SEARCH&&Zi(l);Z=new Gt({props:{content:l[2].t("Full Context Mode"),placement:"top-start",$$slots:{default:[K1]},$$scope:{ctx:l}}}),fe=new Gt({props:{content:l[1].BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL?l[2].t("Inject the entire content as context for comprehensive processing, this is recommended for complex queries."):l[2].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases."),$$slots:{default:[Y1]},$$scope:{ctx:l}}}),ve=new Gt({props:{content:l[1].WEB_SEARCH_TRUST_ENV?l[2].t("Use proxy designated by http_proxy and https_proxy environment variables to fetch page contents."):l[2].t("Use no proxy to fetch page contents."),$$slots:{default:[j1]},$$scope:{ctx:l}}});let el=Dt(l[5]),Kt=[];for(let Se=0;Se<el.length;Se+=1)Kt[Se]=Xi(Yi(l,el,Se));const Lt=[Z1,q1,F1,W1],ol=[];function Tl(Se,De){return Se[1].WEB_LOADER_ENGINE===""||Se[1].WEB_LOADER_ENGINE==="safe_web"?0:Se[1].WEB_LOADER_ENGINE==="playwright"?1:Se[1].WEB_LOADER_ENGINE==="firecrawl"?2:Se[1].WEB_LOADER_ENGINE==="tavily"?3:-1}return~(Ce=Tl(l))&&(Le=ol[Ce]=Lt[Ce](l)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("hr"),o=N(),d=_("div"),E=_("div"),v=B(m),g=N(),b=_("div"),ce(w.$$.fragment),I=N(),k=_("div"),T=_("div"),O=B(R),y=N(),L=_("div"),P=_("select"),D=_("option"),K=B(S);for(let Se=0;Se<wt.length;Se+=1)wt[Se].c();C=N(),vt&&vt.c(),V=N(),It&&It.c(),U=N(),F=_("div"),X=_("div"),ce(Z.$$.fragment),J=N(),ie=_("div"),ce(fe.$$.fragment),le=N(),x=_("div"),oe=_("div"),te=B(se),ae=N(),Te=_("div"),ce(ve.$$.fragment),q=N(),ne=_("div"),Ie=_("div"),z=B(be),ke=N(),Ue=_("hr"),we=N(),Ae=_("div"),Re=_("div"),Ee=B(ue),Me=N(),Ge=_("div"),ee=_("select"),me=_("option"),Ne=B(ge);for(let Se=0;Se<Kt.length;Se+=1)Kt[Se].c();ze=N(),Le&&Le.c(),Ke=N(),re=_("div"),$e=_("div"),ft=B(ut),ct=N(),Be=_("div"),Ve=_("input"),Rt=N(),Ot=_("div"),_t=_("div"),At=B(Et),Tt=N(),Ut=_("div"),rt=_("input"),this.h()},l(Se){e=h(Se,"DIV",{class:!0});var De=p(e);t=h(De,"DIV",{class:!0});var Pe=p(t);s=h(Pe,"DIV",{class:!0});var kt=p(s);i=H(kt,n),kt.forEach(c),a=$(Pe),f=h(Pe,"HR",{class:!0}),o=$(Pe),d=h(Pe,"DIV",{class:!0});var We=p(d);E=h(We,"DIV",{class:!0});var it=p(E);v=H(it,m),it.forEach(c),g=$(We),b=h(We,"DIV",{class:!0});var Mt=p(b);de(w.$$.fragment,Mt),Mt.forEach(c),We.forEach(c),I=$(Pe),k=h(Pe,"DIV",{class:!0});var xe=p(k);T=h(xe,"DIV",{class:!0});var mt=p(T);O=H(mt,R),mt.forEach(c),y=$(xe),L=h(xe,"DIV",{class:!0});var Bt=p(L);P=h(Bt,"SELECT",{class:!0,placeholder:!0});var Ze=p(P);D=h(Ze,"OPTION",{});var nt=p(D);K=H(nt,S),nt.forEach(c);for(let dt=0;dt<wt.length;dt+=1)wt[dt].l(Ze);Ze.forEach(c),Bt.forEach(c),xe.forEach(c),C=$(Pe),vt&&vt.l(Pe),V=$(Pe),It&&It.l(Pe),U=$(Pe),F=h(Pe,"DIV",{class:!0});var Yt=p(F);X=h(Yt,"DIV",{class:!0});var tl=p(X);de(Z.$$.fragment,tl),tl.forEach(c),J=$(Yt),ie=h(Yt,"DIV",{class:!0});var Qt=p(ie);de(fe.$$.fragment,Qt),Qt.forEach(c),Yt.forEach(c),le=$(Pe),x=h(Pe,"DIV",{class:!0});var al=p(x);oe=h(al,"DIV",{class:!0});var St=p(oe);te=H(St,se),St.forEach(c),ae=$(al),Te=h(al,"DIV",{class:!0});var Zt=p(Te);de(ve.$$.fragment,Zt),Zt.forEach(c),al.forEach(c),Pe.forEach(c),q=$(De),ne=h(De,"DIV",{class:!0});var Xt=p(ne);Ie=h(Xt,"DIV",{class:!0});var hl=p(Ie);z=H(hl,be),hl.forEach(c),ke=$(Xt),Ue=h(Xt,"HR",{class:!0}),we=$(Xt),Ae=h(Xt,"DIV",{class:!0});var cl=p(Ae);Re=h(cl,"DIV",{class:!0});var Jt=p(Re);Ee=H(Jt,ue),Jt.forEach(c),Me=$(cl),Ge=h(cl,"DIV",{class:!0});var zt=p(Ge);ee=h(zt,"SELECT",{class:!0,placeholder:!0});var Nt=p(ee);me=h(Nt,"OPTION",{});var Al=p(me);Ne=H(Al,ge),Al.forEach(c);for(let dt=0;dt<Kt.length;dt+=1)Kt[dt].l(Nt);Nt.forEach(c),zt.forEach(c),cl.forEach(c),ze=$(Xt),Le&&Le.l(Xt),Ke=$(Xt),re=h(Xt,"DIV",{class:!0});var Rl=p(re);$e=h(Rl,"DIV",{class:!0});var dl=p($e);ft=H(dl,ut),dl.forEach(c),ct=$(Rl),Be=h(Rl,"DIV",{class:!0});var Pt=p(Be);Ve=h(Pt,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),Pt.forEach(c),Rl.forEach(c),Rt=$(Xt),Ot=h(Xt,"DIV",{class:!0});var gl=p(Ot);_t=h(gl,"DIV",{class:!0});var ot=p(_t);At=H(ot,Et),ot.forEach(c),Tt=$(gl),Ut=h(gl,"DIV",{class:!0});var $t=p(Ut);rt=h($t,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),$t.forEach(c),gl.forEach(c),Xt.forEach(c),De.forEach(c),this.h()},h(){u(s,"class","mb-2.5 text-base font-medium"),u(f,"class","border-gray-100 dark:border-gray-850 my-2"),u(E,"class","self-center text-xs font-medium"),u(b,"class","flex items-center relative"),u(d,"class","mb-2.5 flex w-full justify-between"),u(T,"class","self-center text-xs font-medium"),D.disabled=!0,D.selected=!0,D.__value="",Q(D,D.__value),u(P,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(P,"placeholder",Y=l[2].t("Select a engine")),P.required=!0,l[1].WEB_SEARCH_ENGINE===void 0&&Cl(()=>
130l[8].call(P)),u(L,"class","flex items-center relative"),u(k,"class","mb-2.5 flex w-full justify-between"),u(X,"class","self-center text-xs font-medium"),u(ie,"class","flex items-center relative"),u(F,"class","mb-2.5 flex w-full justify-between"),u(oe,"class","self-center text-xs font-medium"),u(Te,"class","flex items-center relative"),u(x,"class","mb-2.5 flex w-full justify-between"),u(t,"class","mb-3"),u(Ie,"class","mb-2.5 text-base font-medium"),u(Ue,"class","border-gray-100 dark:border-gray-850 my-2"),u(Re,"class","self-center text-xs font-medium"),me.__value="",Q(me,me.__value),u(ee,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(ee,"placeholder",ye=l[2].t("Select a engine")),l[1].WEB_LOADER_ENGINE===void 0&&Cl(()=>l[36].call(ee)),u(Ge,"class","flex items-center relative"),u(Ae,"class","mb-2.5 flex w-full justify-between"),u($e,"class","self-center text-xs font-medium"),u(Ve,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(Ve,"type","text"),u(Ve,"placeholder",je=l[2].t("Enter language codes")),u(Ve,"autocomplete","off"),u(Be,"class","flex items-center relative"),u(re,"class","mb-2.5 flex w-full justify-between"),u(_t,"class","mb-1 text-xs font-medium"),u(rt,"class","flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"),u(rt,"type","text"),u(rt,"placeholder",bt=l[2].t("Enter proxy URL (e.g. https://user:password@host:port)")),u(rt,"autocomplete","off"),u(Ut,"class","flex items-center relative"),u(Ot,"class","mb-2.5 flex flex-col w-full justify-between"),u(ne,"class","mb-3"),u(e,"class","")},m(Se,De){M(Se,e,De),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(t,o),r(t,d),r(d,E),r(E,v),r(d,g),r(d,b),_e(w,b,null),r(t,I),r(t,k),r(k,T),r(T,O),r(k,y),r(k,L),r(L,P),r(P,D),r(D,K);for(let Pe=0;Pe<wt.length;Pe+=1)wt[Pe]&&wt[Pe].m(P,null);Ft(P,l[1].WEB_SEARCH_ENGINE,!0),r(t,C),vt&&vt.m(t,null),r(t,V),It&&It.m(t,null),r(t,U),r(t,F),r(F,X),_e(Z,X,null),r(F,J),r(F,ie),_e(fe,ie,null),r(t,le),r(t,x),r(x,oe),r(oe,te),r(x,ae),r(x,Te),_e(ve,Te,null),r(e,q),r(e,ne),r(ne,Ie),r(Ie,z),r(ne,ke),r(ne,Ue),r(ne,we),r(ne,Ae),r(Ae,Re),r(Re,Ee),r(Ae,Me),r(Ae,Ge),r(Ge,ee),r(ee,me),r(me,Ne);for(let Pe=0;Pe<Kt.length;Pe+=1)Kt[Pe]&&Kt[Pe].m(ee,null);Ft(ee,l[1].WEB_LOADER_ENGINE,!0),r(ne,ze),~Ce&&ol[Ce].m(ne,null),r(ne,Ke),r(ne,re),r(re,$e),r($e,ft),r(re,ct),r(re,Be),r(Be,Ve),Q(Ve,l[1].YOUTUBE_LOADER_LANGUAGE),r(ne,Rt),r(ne,Ot),r(Ot,_t),r(_t,At),r(Ot,Tt),r(Ot,Ut),r(Ut,rt),Q(rt,l[1].YOUTUBE_LOADER_PROXY_URL),lt=!0,He||(at=[pe(P,"change",l[8]),pe(ee,"change",l[36]),pe(Ve,"input",l[44]),pe(rt,"input",l[45])],He=!0)},p(Se,De){(!lt||De[0]&4)&&n!==(n=Se[2].t("General")+"")&&j(i,n),(!lt||De[0]&4)&&m!==(m=Se[2].t("Web Search")+"")&&j(v,m);const Pe={};if(!A&&De[0]&2&&(A=!0,Pe.state=Se[1].ENABLE_WEB_SEARCH,Fe(()=>A=!1)),w.$set(Pe),(!lt||De[0]&4)&&R!==(R=Se[2].t("Web Search Engine")+"")&&j(O,R),(!lt||De[0]&4)&&S!==(S=Se[2].t("Select a engine")+"")&&j(K,S),De[0]&16){yt=Dt(Se[4]);let xe;for(xe=0;xe<yt.length;xe+=1){const mt=ji(Se,yt,xe);wt[xe]?wt[xe].p(mt,De):(wt[xe]=Fi(mt),wt[xe].c(),wt[xe].m(P,null))}for(;xe<wt.length;xe+=1)wt[xe].d(1);wt.length=yt.length}(!lt||De[0]&4&&Y!==(Y=Se[2].t("Select a engine")))&&u(P,"placeholder",Y),De[0]&18&&Ft(P,Se[1].WEB_SEARCH_ENGINE),Se[1].WEB_SEARCH_ENGINE!==""?vt?(vt.p(Se,De),De[0]&2&&G(vt,1)):(vt=qi(Se),vt.c(),G(vt,1),vt.m(t,V)):vt&&(ht(),W(vt,1,1,()=>{vt=null}),pt()),Se[1].ENABLE_WEB_SEARCH?It?It.p(Se,De):(It=Zi(Se),It.c(),It.m(t,U)):It&&(It.d(1),It=null);const kt={};De[0]&4&&(kt.content=Se[2].t("Full Context Mode")),De[0]&4|De[1]&2097152&&(kt.$$scope={dirty:De,ctx:Se}),Z.$set(kt);const We={};De[0]&6&&(We.content=Se[1].BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL?Se[2].t("Inject the entire content as context for comprehensive processing, this is recommended for complex queries."):Se[2].t("Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.")),De[0]&2|De[1]&2097152&&(We.$$scope={dirty:De,ctx:Se}),fe.$set(We),(!lt||De[0]&4)&&se!==(se=Se[2].t("Trust Proxy Environment")+"")&&j(te,se);const it={};if(De[0]&6&&(it.content=Se[1].WEB_SEARCH_TRUST_ENV?Se[2].t("Use proxy designated by http_proxy and https_proxy environment variables to fetch page contents."):Se[2].t("Use no proxy to fetch page contents.")),De[0]&2|De[1]&2097152&&(it.$$scope={dirty:De,ctx:Se}),ve.$set(it),(!lt||De[0]&4)&&be!==(be=Se[2].t("Loader")+"")&&j(z,be),(!lt||De[0]&4)&&ue!==(ue=Se[2].t("Web Loader Engine")+"")&&j(Ee,ue),(!lt||De[0]&4)&&ge!==(ge=Se[2].t("Default")+"")&&j(Ne,ge),De[0]&32){el=Dt(Se[5]);let xe;for(xe=0;xe<el.length;xe+=1){const mt=Yi(Se,el,xe);Kt[xe]?Kt[xe].p(mt,De):(Kt[xe]=Xi(mt),Kt[xe].c(),Kt[xe].m(ee,null))}for(;xe<Kt.length;xe+=1)Kt[xe].d(1);Kt.length=el.length}(!lt||De[0]&4&&ye!==(ye=Se[2].t("Select a engine")))&&u(ee,"placeholder",ye),De[0]&18&&Ft(ee,Se[1].WEB_LOADER_ENGINE);let Mt=Ce;Ce=Tl(Se),Ce===Mt?~Ce&&ol[Ce].p(Se,De):(Le&&(ht(),W(ol[Mt],1,1,()=>{ol[Mt]=null}),pt()),~Ce?(Le=ol[Ce],Le?Le.p(Se,De):(Le=ol[Ce]=Lt[Ce](Se),Le.c()),G(Le,1),Le.m(ne,Ke)):Le=null),(!lt||De[0]&4)&&ut!==(ut=Se[2].t("Youtube Language")+"")&&j(ft,ut),(!lt||De[0]&4&&je!==(je=Se[2].t("Enter language codes")))&&u(Ve,"placeholder",je),De[0]&18&&Ve.value!==Se[1].YOUTUBE_LOADER_LANGUAGE&&Q(Ve,Se[1].YOUTUBE_LOADER_LANGUAGE),(!lt||De[0]&4)&&Et!==(Et=Se[2].t("Youtube Proxy URL")+"")&&j(At,Et),(!lt||De[0]&4&&bt!==(bt=Se[2].t("Enter proxy URL (e.g. https://user:password@host:port)")))&&u(rt,"placeholder",bt),De[0]&18&&rt.value!==Se[1].YOUTUBE_LOADER_PROXY_URL&&Q(rt,Se[1].YOUTUBE_LOADER_PROXY_URL)},i(Se){lt||(G(w.$$.fragment,Se),G(vt),G(Z.$$.fragment,Se),G(fe.$$.fragment,Se),G(ve.$$.fragment,Se),G(Le),lt=!0)},o(Se){W(w.$$.fragment,Se),W(vt),W(Z.$$.fragment,Se),W(fe.$$.fragment,Se),W(ve.$$.fragment,Se),W(Le),lt=!1},d(Se){Se&&c(e),he(w),wl(wt,Se),vt&&vt.d(),It&&It.d(),he(Z),he(fe),he(ve),wl(Kt,Se),~Ce&&ol[Ce].d(),He=!1,ml(at)}}}function Fi(l){let e,t=l[47]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);
130s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[47],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function qi(l){let e,t,s,n;const i=[G1,H1,B1,M1,U1,C1,L1,y1,V1,P1,S1,O1,R1,$1,N1,D1,k1],a=[];function f(o,d){return o[1].WEB_SEARCH_ENGINE==="searxng"?0:o[1].WEB_SEARCH_ENGINE==="google_pse"?1:o[1].WEB_SEARCH_ENGINE==="brave"?2:o[1].WEB_SEARCH_ENGINE==="kagi"?3:o[1].WEB_SEARCH_ENGINE==="mojeek"?4:o[1].WEB_SEARCH_ENGINE==="bocha"?5:o[1].WEB_SEARCH_ENGINE==="serpstack"?6:o[1].WEB_SEARCH_ENGINE==="serper"?7:o[1].WEB_SEARCH_ENGINE==="serply"?8:o[1].WEB_SEARCH_ENGINE==="tavily"?9:o[1].WEB_SEARCH_ENGINE==="searchapi"?10:o[1].WEB_SEARCH_ENGINE==="serpapi"?11:o[1].WEB_SEARCH_ENGINE==="jina"?12:o[1].WEB_SEARCH_ENGINE==="bing"?13:o[1].WEB_SEARCH_ENGINE==="exa"?14:o[1].WEB_SEARCH_ENGINE==="perplexity"?15:o[1].WEB_SEARCH_ENGINE==="sougou"?16:-1}return~(e=f(l))&&(t=a[e]=i[e](l)),{c(){t&&t.c(),s=xt()},l(o){t&&t.l(o),s=xt()},m(o,d){~e&&a[e].m(o,d),M(o,s,d),n=!0},p(o,d){let E=e;e=f(o),e===E?~e&&a[e].p(o,d):(t&&(ht(),W(a[E],1,1,()=>{a[E]=null}),pt()),~e?(t=a[e],t?t.p(o,d):(t=a[e]=i[e](o),t.c()),G(t,1),t.m(s.parentNode,s)):t=null)},i(o){n||(G(t),n=!0)},o(o){W(t),n=!1},d(o){o&&c(s),~e&&a[e].d(o)}}}function k1(l){let e,t,s,n=l[2].t("Sougou Search API sID")+"",i,a,f,o,d,E,m,v,g=l[2].t("Sougou Search API SK")+"",b,w,A,I,k;function T(L){l[29](L)}let R={placeholder:l[2].t("Enter Sougou Search API sID")};l[1].SOUGOU_API_SID!==void 0&&(R.value=l[1].SOUGOU_API_SID),f=new _l({props:R}),Ye.push(()=>qe(f,"value",T));function O(L){l[30](L)}let y={placeholder:l[2].t("Enter Sougou Search API SK")};return l[1].SOUGOU_API_SK!==void 0&&(y.value=l[1].SOUGOU_API_SK),A=new _l({props:y}),Ye.push(()=>qe(A,"value",O)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),d=N(),E=_("div"),m=_("div"),v=_("div"),b=B(g),w=N(),ce(A.$$.fragment),this.h()},l(L){e=h(L,"DIV",{class:!0});var P=p(e);t=h(P,"DIV",{});var D=p(t);s=h(D,"DIV",{class:!0});var S=p(s);i=H(S,n),S.forEach(c),a=$(D),de(f.$$.fragment,D),D.forEach(c),P.forEach(c),d=$(L),E=h(L,"DIV",{class:!0});var K=p(E);m=h(K,"DIV",{});var Y=p(m);v=h(Y,"DIV",{class:!0});var C=p(v);b=H(C,g),C.forEach(c),w=$(Y),de(A.$$.fragment,Y),Y.forEach(c),K.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col"),u(v,"class","self-center text-xs font-medium mb-1"),u(E,"class","mb-2.5 flex w-full flex-col")},m(L,P){M(L,e,P),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),M(L,d,P),M(L,E,P),r(E,m),r(m,v),r(v,b),r(m,w),_e(A,m,null),k=!0},p(L,P){(!k||P[0]&4)&&n!==(n=L[2].t("Sougou Search API sID")+"")&&j(i,n);const D={};P[0]&4&&(D.placeholder=L[2].t("Enter Sougou Search API sID")),!o&&P[0]&2&&(o=!0,D.value=L[1].SOUGOU_API_SID,Fe(()=>o=!1)),f.$set(D),(!k||P[0]&4)&&g!==(g=L[2].t("Sougou Search API SK")+"")&&j(b,g);const S={};P[0]&4&&(S.placeholder=L[2].t("Enter Sougou Search API SK")),!I&&P[0]&2&&(I=!0,S.value=L[1].SOUGOU_API_SK,Fe(()=>I=!1)),A.$set(S)},i(L){k||(G(f.$$.fragment,L),G(A.$$.fragment,L),k=!0)},o(L){W(f.$$.fragment,L),W(A.$$.fragment,L),k=!1},d(L){L&&(c(e),c(d),c(E)),he(f),he(A)}}}function D1(l){let e,t,s=l[2].t("Perplexity API Key")+"",n,i,a,f,o;function d(m){l[28](m)}let E={placeholder:l[2].t("Enter Perplexity API Key")};return l[1].PERPLEXITY_API_KEY!==void 0&&(E.value=l[1].PERPLEXITY_API_KEY),a=new _l({props:E}),Ye.push(()=>qe(a,"value",d)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),this.h()},l(m){e=h(m,"DIV",{});var v=p(e);t=h(v,"DIV",{class:!0});var g=p(t);n=H(g,s),g.forEach(c),i=$(v),de(a.$$.fragment,v),v.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium mb-1")},m(m,v){M(m,e,v),r(e,t),r(t,n),r(e,i),_e(a,e,null),o=!0},p(m,v){(!o||v[0]&4)&&s!==(s=m[2].t("Perplexity API Key")+"")&&j(n,s);const g={};v[0]&4&&(g.placeholder=m[2].t("Enter Perplexity API Key")),!f&&v[0]&2&&(f=!0,g.value=m[1].PERPLEXITY_API_KEY,Fe(()=>f=!1)),a.$set(g)},i(m){o||(G(a.$$.fragment,m),o=!0)},o(m){W(a.$$.fragment,m),o=!1},d(m){m&&c(e),he(a)}}}function N1(l){let e,t,s,n=l[2].t("Exa API Key")+"",i,a,f,o,d;function E(v){l[27](v)}let m={placeholder:l[2].t("Enter Exa API Key")};return l[1].EXA_API_KEY!==void 0&&(m.value=l[1].EXA_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
130i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Exa API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Exa API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].EXA_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function $1(l){let e,t,s,n=l[2].t("Bing Search V7 Endpoint")+"",i,a,f,o,d,E,m,v,g,b=l[2].t("Bing Search V7 Subscription Key")+"",w,A,I,k,T,R,O;function y(P){l[26](P)}let L={placeholder:l[2].t("Enter Bing Search V7 Subscription Key")};return l[1].BING_SEARCH_V7_SUBSCRIPTION_KEY!==void 0&&(L.value=l[1].BING_SEARCH_V7_SUBSCRIPTION_KEY),I=new _l({props:L}),Ye.push(()=>qe(I,"value",y)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),m=N(),v=_("div"),g=_("div"),w=B(b),A=N(),ce(I.$$.fragment),this.h()},l(P){e=h(P,"DIV",{class:!0});var D=p(e);t=h(D,"DIV",{});var S=p(t);s=h(S,"DIV",{class:!0});var K=p(s);i=H(K,n),K.forEach(c),a=$(S),f=h(S,"DIV",{class:!0});var Y=p(f);o=h(Y,"DIV",{class:!0});var C=p(o);d=h(C,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),C.forEach(c),Y.forEach(c),S.forEach(c),m=$(D),v=h(D,"DIV",{class:!0});var V=p(v);g=h(V,"DIV",{class:!0});var U=p(g);w=H(U,b),U.forEach(c),A=$(V),de(I.$$.fragment,V),V.forEach(c),D.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"type","text"),u(d,"placeholder",E=l[2].t("Enter Bing Search V7 Endpoint")),u(d,"autocomplete","off"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(g,"class","self-center text-xs font-medium mb-1"),u(v,"class","mt-2"),u(e,"class","mb-2.5 flex w-full flex-col")},m(P,D){M(P,e,D),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[1].BING_SEARCH_V7_ENDPOINT),r(e,m),r(e,v),r(v,g),r(g,w),r(v,A),_e(I,v,null),T=!0,R||(O=pe(d,"input",l[25]),R=!0)},p(P,D){(!T||D[0]&4)&&n!==(n=P[2].t("Bing Search V7 Endpoint")+"")&&j(i,n),(!T||D[0]&4&&E!==(E=P[2].t("Enter Bing Search V7 Endpoint")))&&u(d,"placeholder",E),D[0]&18&&d.value!==P[1].BING_SEARCH_V7_ENDPOINT&&Q(d,P[1].BING_SEARCH_V7_ENDPOINT),(!T||D[0]&4)&&b!==(b=P[2].t("Bing Search V7 Subscription Key")+"")&&j(w,b);const S={};D[0]&4&&(S.placeholder=P[2].t("Enter Bing Search V7 Subscription Key")),!k&&D[0]&2&&(k=!0,S.value=P[1].BING_SEARCH_V7_SUBSCRIPTION_KEY,Fe(()=>k=!1)),I.$set(S)},i(P){T||(G(I.$$.fragment,P),T=!0)},o(P){W(I.$$.fragment,P),T=!1},d(P){P&&c(e),he(I),R=!1,O()}}}function R1(l){let e,t,s,n=l[2].t("Jina API Key")+"",i,a,f,o,d;function E(v){l[24](v)}let m={placeholder:l[2].t("Enter Jina API Key")};return l[1].JINA_API_KEY!==void 0&&(m.value=l[1].JINA_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
130i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Jina API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Jina API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].JINA_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function O1(l){let e,t,s,n=l[2].t("SerpApi API Key")+"",i,a,f,o,d,E,m,v=l[2].t("SerpApi Engine")+"",g,b,w,A,I,k,T,R,O;function y(P){l[22](P)}let L={placeholder:l[2].t("Enter SerpApi API Key")};return l[1].SERPAPI_API_KEY!==void 0&&(L.value=l[1].SERPAPI_API_KEY),f=new _l({props:L}),Ye.push(()=>qe(f,"value",y)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),d=N(),E=_("div"),m=_("div"),g=B(v),b=N(),w=_("div"),A=_("div"),I=_("input"),this.h()},l(P){e=h(P,"DIV",{class:!0});var D=p(e);t=h(D,"DIV",{});var S=p(t);s=h(S,"DIV",{class:!0});var K=p(s);i=H(K,n),K.forEach(c),a=$(S),de(f.$$.fragment,S),S.forEach(c),d=$(D),E=h(D,"DIV",{class:!0});var Y=p(E);m=h(Y,"DIV",{class:!0});var C=p(m);g=H(C,v),C.forEach(c),b=$(Y),w=h(Y,"DIV",{class:!0});var V=p(w);A=h(V,"DIV",{class:!0});var U=p(A);I=h(U,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),U.forEach(c),V.forEach(c),Y.forEach(c),D.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(m,"class","self-center text-xs font-medium mb-1"),u(I,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(I,"type","text"),u(I,"placeholder",k=l[2].t("Enter SerpApi Engine")),u(I,"autocomplete","off"),u(A,"class","flex-1"),u(w,"class","flex w-full"),u(E,"class","mt-1.5"),u(e,"class","mb-2.5 flex w-full flex-col")},m(P,D){M(P,e,D),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),r(e,d),r(e,E),r(E,m),r(m,g),r(E,b),r(E,w),r(w,A),r(A,I),Q(I,l[1].SERPAPI_ENGINE),T=!0,R||(O=pe(I,"input",l[23]),R=!0)},p(P,D){(!T||D[0]&4)&&n!==(n=P[2].t("SerpApi API Key")+"")&&j(i,n);const S={};D[0]&4&&(S.placeholder=P[2].t("Enter SerpApi API Key")),!o&&D[0]&2&&(o=!0,S.value=P[1].SERPAPI_API_KEY,Fe(()=>o=!1)),f.$set(S),(!T||D[0]&4)&&v!==(v=P[2].t("SerpApi Engine")+"")&&j(g,v),(!T||D[0]&4&&
130k!==(k=P[2].t("Enter SerpApi Engine")))&&u(I,"placeholder",k),D[0]&18&&I.value!==P[1].SERPAPI_ENGINE&&Q(I,P[1].SERPAPI_ENGINE)},i(P){T||(G(f.$$.fragment,P),T=!0)},o(P){W(f.$$.fragment,P),T=!1},d(P){P&&c(e),he(f),R=!1,O()}}}function S1(l){let e,t,s,n=l[2].t("SearchApi API Key")+"",i,a,f,o,d,E,m,v=l[2].t("SearchApi Engine")+"",g,b,w,A,I,k,T,R,O;function y(P){l[20](P)}let L={placeholder:l[2].t("Enter SearchApi API Key")};return l[1].SEARCHAPI_API_KEY!==void 0&&(L.value=l[1].SEARCHAPI_API_KEY),f=new _l({props:L}),Ye.push(()=>qe(f,"value",y)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),d=N(),E=_("div"),m=_("div"),g=B(v),b=N(),w=_("div"),A=_("div"),I=_("input"),this.h()},l(P){e=h(P,"DIV",{class:!0});var D=p(e);t=h(D,"DIV",{});var S=p(t);s=h(S,"DIV",{class:!0});var K=p(s);i=H(K,n),K.forEach(c),a=$(S),de(f.$$.fragment,S),S.forEach(c),d=$(D),E=h(D,"DIV",{class:!0});var Y=p(E);m=h(Y,"DIV",{class:!0});var C=p(m);g=H(C,v),C.forEach(c),b=$(Y),w=h(Y,"DIV",{class:!0});var V=p(w);A=h(V,"DIV",{class:!0});var U=p(A);I=h(U,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),U.forEach(c),V.forEach(c),Y.forEach(c),D.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(m,"class","self-center text-xs font-medium mb-1"),u(I,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(I,"type","text"),u(I,"placeholder",k=l[2].t("Enter SearchApi Engine")),u(I,"autocomplete","off"),u(A,"class","flex-1"),u(w,"class","flex w-full"),u(E,"class","mt-1.5"),u(e,"class","mb-2.5 flex w-full flex-col")},m(P,D){M(P,e,D),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),r(e,d),r(e,E),r(E,m),r(m,g),r(E,b),r(E,w),r(w,A),r(A,I),Q(I,l[1].SEARCHAPI_ENGINE),T=!0,R||(O=pe(I,"input",l[21]),R=!0)},p(P,D){(!T||D[0]&4)&&n!==(n=P[2].t("SearchApi API Key")+"")&&j(i,n);const S={};D[0]&4&&(S.placeholder=P[2].t("Enter SearchApi API Key")),!o&&D[0]&2&&(o=!0,S.value=P[1].SEARCHAPI_API_KEY,Fe(()=>o=!1)),f.$set(S),(!T||D[0]&4)&&v!==(v=P[2].t("SearchApi Engine")+"")&&j(g,v),(!T||D[0]&4&&
130k!==(k=P[2].t("Enter SearchApi Engine")))&&u(I,"placeholder",k),D[0]&18&&I.value!==P[1].SEARCHAPI_ENGINE&&Q(I,P[1].SEARCHAPI_ENGINE)},i(P){T||(G(f.$$.fragment,P),T=!0)},o(P){W(f.$$.fragment,P),T=!1},d(P){P&&c(e),he(f),R=!1,O()}}}function P1(l){let e,t,s,n=l[2].t("Tavily API Key")+"",i,a,f,o,d;function E(v){l[19](v)}let m={placeholder:l[2].t("Enter Tavily API Key")};return l[1].TAVILY_API_KEY!==void 0&&(m.value=l[1].TAVILY_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Tavily API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Tavily API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].TAVILY_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function V1(l){let e,t,s,n=l[2].t("Serply API Key")+"",i,a,f,o,d;function E(v){l[18](v)}let m={placeholder:l[2].t("Enter Serply API Key")};return l[1].SERPLY_API_KEY!==void 0&&(m.value=l[1].SERPLY_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
130i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Serply API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Serply API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].SERPLY_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function y1(l){let e,t,s,n=l[2].t("Serper API Key")+"",i,a,f,o,d;function E(v){l[17](v)}let m={placeholder:l[2].t("Enter Serper API Key")};return l[1].SERPER_API_KEY!==void 0&&(m.value=l[1].SERPER_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Serper API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Serper API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].SERPER_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function L1(l){let e,t,s,n=l[2].t("Serpstack API Key")+"",i,a,f,o,d;function E(v){l[16](v)}let m={placeholder:l[2].t("Enter Serpstack API Key")};return l[1].SERPSTACK_API_KEY!==void 0&&(m.value=l[1].SERPSTACK_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
130i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Serpstack API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Serpstack API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].SERPSTACK_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function C1(l){let e,t,s,n=l[2].t("Bocha Search API Key")+"",i,a,f,o,d;function E(v){l[15](v)}let m={placeholder:l[2].t("Enter Bocha Search API Key")};return l[1].BOCHA_SEARCH_API_KEY!==void 0&&(m.value=l[1].BOCHA_SEARCH_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Bocha Search API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Bocha Search API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].BOCHA_SEARCH_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function U1(l){let e,t,s,n=l[2].t("Mojeek Search API Key")+"",i,a,f,o,d;function E(v){l[14](v)}let m={placeholder:l[2].t("Enter Mojeek Search API Key")};return l[1].MOJEEK_SEARCH_API_KEY!==void 0&&(m.value=l[1].MOJEEK_SEARCH_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
130i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Mojeek Search API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Mojeek Search API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].MOJEEK_SEARCH_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function M1(l){let e,t,s,n=l[2].t("Kagi Search API Key")+"",i,a,f,o,d,E;function m(g){l[13](g)}let v={placeholder:l[2].t("Enter Kagi Search API Key")};return l[1].KAGI_SEARCH_API_KEY!==void 0&&(v.value=l[1].KAGI_SEARCH_API_KEY),f=new _l({props:v}),Ye.push(()=>qe(f,"value",m)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),d=B(`
131								.`),this.h()},l(g){e=h(g,"DIV",{class:!0});var b=p(e);t=h(b,"DIV",{});var w=p(t);s=h(w,"DIV",{class:!0});var A=p(s);i=H(A,n),A.forEach(c),a=$(w),de(f.$$.fragment,w),w.forEach(c),d=H(b,`
132								.`),b.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(g,b){M(g,e,b),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),r(e,d),E=!0},p(g,b){(!E||b[0]&4)&&n!==(n=g[2].t("Kagi Search API Key")+"")&&j(i,n);const w={};b[0]&4&&(w.placeholder=g[2].t("Enter Kagi Search API Key")),!o&&b[0]&2&&(o=!0,w.value=g[1].KAGI_SEARCH_API_KEY,Fe(()=>o=!1)),f.$set(w)},i(g){E||(G(f.$$.fragment,g),E=!0)},o(g){W(f.$$.fragment,g),E=!1},d(g){g&&c(e),he(f)}}}function B1(l){let e,t,s,n=l[2].t("Brave Search API Key")+"",i,a,f,o,d;function E(v){l[12](v)}let m={placeholder:l[2].t("Enter Brave Search API Key")};return l[1].BRAVE_SEARCH_API_KEY!==void 0&&(m.value=l[1].BRAVE_SEARCH_API_KEY),f=new _l({props:m}),Ye.push(()=>qe(f,"value",E)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{});var b=p(t);s=h(b,"DIV",{class:!0});var w=p(s);
132i=H(w,n),w.forEach(c),a=$(b),de(f.$$.fragment,b),b.forEach(c),g.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(e,"class","mb-2.5 flex w-full flex-col")},m(v,g){M(v,e,g),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),d=!0},p(v,g){(!d||g[0]&4)&&n!==(n=v[2].t("Brave Search API Key")+"")&&j(i,n);const b={};g[0]&4&&(b.placeholder=v[2].t("Enter Brave Search API Key")),!o&&g[0]&2&&(o=!0,b.value=v[1].BRAVE_SEARCH_API_KEY,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function H1(l){let e,t,s,n=l[2].t("Google PSE API Key")+"",i,a,f,o,d,E,m,v=l[2].t("Google PSE Engine Id")+"",g,b,w,A,I,k,T,R,O;function y(P){l[10](P)}let L={placeholder:l[2].t("Enter Google PSE API Key")};return l[1].GOOGLE_PSE_API_KEY!==void 0&&(L.value=l[1].GOOGLE_PSE_API_KEY),f=new _l({props:L}),Ye.push(()=>qe(f,"value",y)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),ce(f.$$.fragment),d=N(),E=_("div"),m=_("div"),g=B(v),b=N(),w=_("div"),A=_("div"),I=_("input"),this.h()},l(P){e=h(P,"DIV",{class:!0});var D=p(e);t=h(D,"DIV",{});var S=p(t);s=h(S,"DIV",{class:!0});var K=p(s);i=H(K,n),K.forEach(c),a=$(S),de(f.$$.fragment,S),S.forEach(c),d=$(D),E=h(D,"DIV",{class:!0});var Y=p(E);m=h(Y,"DIV",{class:!0});var C=p(m);g=H(C,v),C.forEach(c),b=$(Y),w=h(Y,"DIV",{class:!0});var V=p(w);A=h(V,"DIV",{class:!0});var U=p(A);I=h(U,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),U.forEach(c),V.forEach(c),Y.forEach(c),D.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(m,"class","self-center text-xs font-medium mb-1"),u(I,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(I,"type","text"),u(I,"placeholder",k=l[2].t("Enter Google PSE Engine Id")),u(I,"autocomplete","off"),u(A,"class","flex-1"),u(w,"class","flex w-full"),u(E,"class","mt-1.5"),u(e,"class","mb-2.5 flex w-full flex-col")},m(P,D){M(P,e,D),r(e,t),r(t,s),r(s,i),r(t,a),_e(f,t,null),r(e,d),r(e,E),r(E,m),r(m,g),r(E,b),r(E,w),r(w,A),r(A,I),Q(I,l[1].GOOGLE_PSE_ENGINE_ID),T=!0,R||(O=pe(I,"input",l[11]),R=!0)},p(P,D){(!T||D[0]&4)&&n!==(n=P[2].t("Google PSE API Key")+"")&&j(i,n);const S={};D[0]&4&&(S.placeholder=P[2].t("Enter Google PSE API Key")),!o&&D[0]&2&&(o=!0,S.value=P[1].GOOGLE_PSE_API_KEY,Fe(()=>o=!1)),f.$set(S),(!T||D[0]&4)&&v!==(v=P[2].t("Google PSE Engine Id")+"")&&j(g,v),(!T||D[0]&4&&
132k!==(k=P[2].t("Enter Google PSE Engine Id")))&&u(I,"placeholder",k),D[0]&18&&I.value!==P[1].GOOGLE_PSE_ENGINE_ID&&Q(I,P[1].GOOGLE_PSE_ENGINE_ID)},i(P){T||(G(f.$$.fragment,P),T=!0)},o(P){W(f.$$.fragment,P),T=!1},d(P){P&&c(e),he(f),R=!1,O()}}}function G1(l){let e,t,s,n=l[2].t("Searxng Query URL")+"",i,a,f,o,d,E,m,v;return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),this.h()},l(g){e=h(g,"DIV",{class:!0});var b=p(e);t=h(b,"DIV",{});var w=p(t);s=h(w,"DIV",{class:!0});var A=p(s);i=H(A,n),A.forEach(c),a=$(w),f=h(w,"DIV",{class:!0});var I=p(f);o=h(I,"DIV",{class:!0});var k=p(o);d=h(k,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),k.forEach(c),I.forEach(c),w.forEach(c),b.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"type","text"),u(d,"placeholder",E=l[2].t("Enter Searxng Query URL")),u(d,"autocomplete","off"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(e,"class","mb-2.5 flex w-full flex-col")},m(g,b){M(g,e,b),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[1].SEARXNG_QUERY_URL),m||(v=pe(d,"input",l[9]),m=!0)},p(g,b){b[0]&4&&n!==(n=g[2].t("Searxng Query URL")+"")&&j(i,n),b[0]&4&&E!==(E=g[2].t("Enter Searxng Query URL"))&&u(d,"placeholder",E),b[0]&18&&d.value!==g[1].SEARXNG_QUERY_URL&&Q(d,g[1].SEARXNG_QUERY_URL)},i:st,o:st,d(g){g&&c(e),m=!1,v()}}}function Zi(l){let e,t,s,n,i=l[2].t("Search Result Count")+"",a,f,o,d,E,m,v,g=l[2].t("Concurrent Requests")+"",b,w,A,I,k,T,R,O=l[2].t("Domain Filter List")+"",y,L,P,D,S,K;return{c(){e=_("div"),t=_("div"),s=_("div"),n=_("div"),a=B(i),f=N(),o=_("input"),E=N(),m=_("div"),v=_("div"),b=B(g),w=N(),A=_("input"),k=N(),T=_("div"),R=_("div"),y=B(O),L=N(),P=_("input"),this.h()},l(Y){e=h(Y,"DIV",{class:!0});var C=p(e);t=h(C,"DIV",{class:!0});var V=p(t);s=h(V,"DIV",{class:!0});var U=p(s);n=h(U,"DIV",{class:!0});var F=p(n);a=H(F,i),F.forEach(c),f=$(U),o=h(U,"INPUT",{class:!0,placeholder:!0}),U.forEach(c),E=$(V),m=h(V,"DIV",{class:!0});var X=p(m);v=h(X,"DIV",{class:!0});var Z=p(v);b=H(Z,g),Z.forEach(c),w=$(X),A=h(X,"INPUT",{class:!0,placeholder:!0}),X.forEach(c),V.forEach(c),C.forEach(c),k=$(Y),T=h(Y,"DIV",{class:!0});var J=p(T);R=h(J,"DIV",{class:!0});var ie=p(R);y=H(ie,O),ie.forEach(c),L=$(J),P=h(J,"INPUT",{class:!0,placeholder:!0}),J.forEach(c),this.h()},h(){u(n,"class","self-center text-xs font-medium mb-1"),u(o,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(o,"placeholder",d=l[2].t("Search Result Count")),o.required=!0,u(s,"class","w-full"),u(v,"class","self-center text-xs font-medium mb-1"),u(A,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(A,"placeholder",I=l[2].t("Concurrent Requests")),A.required=!0,u(m,"class","w-full"),u(t,"class","flex gap-2"),u(e,"class","mb-2.5 flex w-full flex-col"),u(R,"class","text-xs font-medium mb-1"),u(P,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(P,"placeholder",D=l[2].t("Enter domains separated by commas (e.g., example.com,site.org)")),u(T,"class","mb-2.5 flex w-full flex-col")},m(Y,C){M(Y,e,C),r(e,t),r(t,s),r(s,n),r(n,a),r(s,f),r(s,o),Q(o,l[1].WEB_SEARCH_RESULT_COUNT),r(t,E),r(t,m),r(m,v),r(v,b),r(m,w),r(m,A),Q(A,l[1].WEB_SEARCH_CONCURRENT_REQUESTS),M(Y,k,C),M(Y,T,C),r(T,R),r(R,y),r(T,L),r(T,P),Q(P,l[1].WEB_SEARCH_DOMAIN_FILTER_LIST),S||(K=[pe(o,"input",l[31]),pe(A,"input",l[32]),pe(P,"input",l[33])],S=!0)},p(Y,C){C[0]&4&&i!==(i=Y[2].t("Search Result Count")+"")&&j(a,i),C[0]&4&&d!==(d=Y[2].t("Search Result Count"))&&u(o,"placeholder",d),C[0]&18&&o.value!==Y[1].WEB_SEARCH_RESULT_COUNT&&Q(o,Y[1].WEB_SEARCH_RESULT_COUNT),C[0]&4&&g!==(g=Y[2].t("Concurrent Requests")+"")&&j(b,g),C[0]&4&&I!==(I=Y[2].t("Concurrent Requests"))&&u(A,"placeholder",I),C[0]&18&&A.value!==Y[1].WEB_SEARCH_CONCURRENT_REQUESTS&&Q(A,Y[1].WEB_SEARCH_CONCURRENT_REQUESTS),C[0]&4&&O!==(O=Y[2].t("Domain Filter List")+"")&&j(y,O),C[0]&4&&D!==(D=Y[2].t("Enter domains separated by commas (e.g., example.com,site.org)"))&&u(P,"placeholder",D),C[0]&18&&P.value!==Y[1].WEB_SEARCH_DOMAIN_FILTER_LIST&&Q(P,Y[1].WEB_SEARCH_DOMAIN_FILTER_LIST)},d(Y){Y&&(c(e),c(k),c(T)),S=!1,ml(K)}}}function K1(l){let e=l[2].t("Bypass Embedding and Retrieval")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&4&&e!==(e=s[2].t("Bypass Embedding and Retrieval")+"")&&j(t,e)},d(s){s&&c(t)}}}function Y1(l){let e,t,s;function n(a){l[34](a)}let i={};return l[1].BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL!==void 0&&(i.state=l[1].BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f[0]&2&&(t=!0,o.state=a[1].BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function j1(l){let e,t,s;function n(a){l[35](a)}let i={};return l[1].WEB_SEARCH_TRUST_ENV!==void 0&&(i.state=l[1].WEB_SEARCH_TRUST_ENV),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f[0]&2&&(t=!0,o.state=a[1].WEB_SEARCH_TRUST_ENV,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Xi(l){let e,t=l[47]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);
132s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[47],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function W1(l){let e,t,s,n=l[2].t("Tavily Extract Depth")+"",i,a,f,o,d,E,m,v,g,b,w=l[1].WEB_SEARCH_ENGINE!=="tavily"&&Ji(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),m=N(),w&&w.c(),this.h()},l(A){e=h(A,"DIV",{class:!0});var I=p(e);t=h(I,"DIV",{});var k=p(t);s=h(k,"DIV",{class:!0});var T=p(s);i=H(T,n),T.forEach(c),a=$(k),f=h(k,"DIV",{class:!0});var R=p(f);o=h(R,"DIV",{class:!0});var O=p(o);d=h(O,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),O.forEach(c),R.forEach(c),k.forEach(c),m=$(I),w&&w.l(I),I.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"type","text"),u(d,"placeholder",E=l[2].t("Enter Tavily Extract Depth")),u(d,"autocomplete","off"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(e,"class","mb-2.5 flex w-full flex-col")},m(A,I){M(A,e,I),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[1].TAVILY_EXTRACT_DEPTH),r(e,m),w&&w.m(e,null),v=!0,g||(b=pe(d,"input",l[42]),g=!0)},p(A,I){(!v||I[0]&4)&&n!==(n=A[2].t("Tavily Extract Depth")+"")&&j(i,n),(!v||I[0]&4&&E!==(E=A[2].t("Enter Tavily Extract Depth")))&&u(d,"placeholder",E),I[0]&18&&d.value!==A[1].TAVILY_EXTRACT_DEPTH&&Q(d,A[1].TAVILY_EXTRACT_DEPTH),A[1].WEB_SEARCH_ENGINE!=="tavily"?w?(w.p(A,I),I[0]&2&&G(w,1)):(w=Ji(A),w.c(),G(w,1),w.m(e,null)):w&&(ht(),W(w,1,1,()=>{w=null}),pt())},i(A){v||(G(w),v=!0)},o(A){W(w),v=!1},d(A){A&&c(e),w&&w.d(),g=!1,b()}}}function F1(l){let e,t,s,n=l[2].t("Firecrawl API Base URL")+"",i,a,f,o,d,E,m,v,g,b=l[2].t("Firecrawl API Key")+"",w,A,I,k,T,R,O;function y(P){l[41](P)}let L={placeholder:l[2].t("Enter Firecrawl API Key")};return l[1].FIRECRAWL_API_KEY!==void 0&&(L.value=l[1].FIRECRAWL_API_KEY),I=new _l({props:L}),Ye.push(()=>qe(I,"value",y)),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),m=N(),v=_("div"),g=_("div"),w=B(b),A=N(),ce(I.$$.fragment),this.h()},l(P){e=h(P,"DIV",{class:!0});var D=p(e);t=h(D,"DIV",{});var S=p(t);s=h(S,"DIV",{class:!0});var K=p(s);i=H(K,n),K.forEach(c),a=$(S),f=h(S,"DIV",{class:!0});var Y=p(f);o=h(Y,"DIV",{class:!0});var C=p(o);d=h(C,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),C.forEach(c),Y.forEach(c),S.forEach(c),m=$(D),v=h(D,"DIV",{class:!0});var V=p(v);g=h(V,"DIV",{class:!0});var U=p(g);w=H(U,b),U.forEach(c),A=$(V),de(I.$$.fragment,V),V.forEach(c),D.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"type","text"),u(d,"placeholder",E=l[2].t("Enter Firecrawl API Base URL")),u(d,"autocomplete","off"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(g,"class","self-center text-xs font-medium mb-1"),u(v,"class","mt-2"),u(e,"class","mb-2.5 flex w-full flex-col")},m(P,D){M(P,e,D),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[1].FIRECRAWL_API_BASE_URL),r(e,m),r(e,v),r(v,g),r(g,w),r(v,A),_e(I,v,null),T=!0,R||(O=pe(d,"input",l[40]),R=!0)},p(P,D){(!T||D[0]&4)&&n!==(n=P[2].t("Firecrawl API Base URL")+"")&&j(i,n),(!T||D[0]&4&&E!==(E=P[2].t("Enter Firecrawl API Base URL")))&&u(d,"placeholder",E),D[0]&18&&d.value!==P[1].FIRECRAWL_API_BASE_URL&&Q(d,P[1].FIRECRAWL_API_BASE_URL),(!T||D[0]&4)&&b!==(b=P[2].t("Firecrawl API Key")+"")&&j(w,b);const S={};D[0]&4&&(S.placeholder=P[2].t("Enter Firecrawl API Key")),!k&&D[0]&2&&(k=!0,S.value=P[1].FIRECRAWL_API_KEY,Fe(()=>k=!1)),I.$set(S)},i(P){T||(G(I.$$.fragment,P),T=!0)},o(P){W(I.$$.fragment,P),T=!1},d(P){P&&c(e),he(I),R=!1,O()}}}function q1(l){let e,t,s,n=l[2].t("Playwright WebSocket URL")+"",i,a,f,o,d,E,m,v,g,b=l[2].t("Playwright Timeout (ms)")+"",w,A,I,k,T,R,O,y;return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("div"),d=_("input"),m=N(),v=_("div"),g=_("div"),w=B(b),A=N(),I=_("div"),k=_("div"),T=_("input"),this.h()},l(L){e=h(L,"DIV",{class:!0});var P=p(e);t=h(P,"DIV",{});var D=p(t);s=h(D,"DIV",{class:!0});var S=p(s);
132i=H(S,n),S.forEach(c),a=$(D),f=h(D,"DIV",{class:!0});var K=p(f);o=h(K,"DIV",{class:!0});var Y=p(o);d=h(Y,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),Y.forEach(c),K.forEach(c),D.forEach(c),m=$(P),v=h(P,"DIV",{class:!0});var C=p(v);g=h(C,"DIV",{class:!0});var V=p(g);w=H(V,b),V.forEach(c),A=$(C),I=h(C,"DIV",{class:!0});var U=p(I);k=h(U,"DIV",{class:!0});var F=p(k);T=h(F,"INPUT",{class:!0,placeholder:!0,autocomplete:!0}),F.forEach(c),U.forEach(c),C.forEach(c),P.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium mb-1"),u(d,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(d,"type","text"),u(d,"placeholder",E=l[2].t("Enter Playwright WebSocket URL")),u(d,"autocomplete","off"),u(o,"class","flex-1"),u(f,"class","flex w-full"),u(g,"class","self-center text-xs font-medium mb-1"),u(T,"class","w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"),u(T,"placeholder",R=l[2].t("Enter Playwright Timeout")),u(T,"autocomplete","off"),u(k,"class","flex-1"),u(I,"class","flex w-full"),u(v,"class","mt-2"),u(e,"class","mb-2.5 flex w-full flex-col")},m(L,P){M(L,e,P),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),Q(d,l[1].PLAYWRIGHT_WS_URL),r(e,m),r(e,v),r(v,g),r(g,w),r(v,A),r(v,I),r(I,k),r(k,T),Q(T,l[1].PLAYWRIGHT_TIMEOUT),O||(y=[pe(d,"input",l[38]),pe(T,"input",l[39])],O=!0)},p(L,P){P[0]&4&&n!==(n=L[2].t("Playwright WebSocket URL")+"")&&j(i,n),P[0]&4&&E!==(E=L[2].t("Enter Playwright WebSocket URL"))&&u(d,"placeholder",E),P[0]&18&&d.value!==L[1].PLAYWRIGHT_WS_URL&&Q(d,L[1].PLAYWRIGHT_WS_URL),P[0]&4&&b!==(b=L[2].t("Playwright Timeout (ms)")+"")&&j(w,b),P[0]&4&&R!==(R=L[2].t("Enter Playwright Timeout"))&&u(T,"placeholder",R),P[0]&18&&T.value!==L[1].PLAYWRIGHT_TIMEOUT&&Q(T,L[1].PLAYWRIGHT_TIMEOUT)},i:st,o:st,d(L){L&&c(e),O=!1,ml(y)}}}function Z1(l){let e,t,s=l[2].t("Verify SSL Certificate")+"",n,i,a,f,o,d;function E(v){l[37](v)}let m={};return l[1].ENABLE_WEB_LOADER_SSL_VERIFICATION!==void 0&&(m.state=l[1].ENABLE_WEB_LOADER_SSL_VERIFICATION),f=new vl({props:m}),Ye.push(()=>qe(f,"state",E)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),ce(f.$$.fragment),this.h()},l(v){e=h(v,"DIV",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);n=H(b,s),b.forEach(c),i=$(g),a=h(g,"DIV",{class:!0});var w=p(a);de(f.$$.fragment,w),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium"),u(a,"class","flex items-center relative"),u(e,"class","mb-2.5 flex w-full justify-between")},m(v,g){M(v,e,g),r(e,t),r(t,n),r(e,i),r(e,a),_e(f,a,null),d=!0},p(v,g){(!d||g[0]&4)&&s!==(s=v[2].t("Verify SSL Certificate")+"")&&j(n,s);const b={};!o&&g[0]&2&&(o=!0,b.state=v[1].ENABLE_WEB_LOADER_SSL_VERIFICATION,Fe(()=>o=!1)),f.$set(b)},i(v){d||(G(f.$$.fragment,v),d=!0)},o(v){W(f.$$.fragment,v),d=!1},d(v){v&&c(e),he(f)}}}function Ji(l){let e,t,s=l[2].t("Tavily API Key")+"",n,i,a,f,o;function d(m){l[43](m)}let E={placeholder:l[2].t("Enter Tavily API Key")};return l[1].TAVILY_API_KEY!==void 0&&(E.value=l[1].TAVILY_API_KEY),a=new _l({props:E}),Ye.push(()=>qe(a,"value",d)),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),ce(a.$$.fragment),this.h()},l(m){e=h(m,"DIV",{class:!0});var v=p(e);t=h(v,"DIV",{class:!0});var g=p(t);n=H(g,s),g.forEach(c),i=$(v),de(a.$$.fragment,v),v.forEach(c),this.h()},h(){u(t,"class","self-center text-xs font-medium mb-1"),u(e,"class","mt-2")},m(m,v){M(m,e,v),r(e,t),r(t,n),r(e,i),_e(a,e,null),o=!0},p(m,v){(!o||v[0]&4)&&s!==(s=m[2].t("Tavily API Key")+"")&&j(n,s);const g={};v[0]&4&&(g.placeholder=m[2].t("Enter Tavily API Key")),!f&&v[0]&2&&(f=!0,g.value=m[1].TAVILY_API_KEY,Fe(()=>f=!1)),a.$set(g)},i(m){o||(G(a.$$.fragment,m),o=!0)},o(m){W(a.$$.fragment,m),o=!1},d(m){m&&c(e),he(a)}}}function X1(l){let e,t,s,n,i,a=l[2].t("Save")+"",f,o,d,E,m=l[1]&&Wi(l);return{c(){e=_("form"),t=_("div"),m&&m.c(),s=N(),n=_("div"),i=_("button"),f=B(a),this.h()},l(v){e=h(v,"FORM",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);m&&m.l(b),b.forEach(c),s=$(g),n=h(g,"DIV",{class:!0});var w=p(n);i=h(w,"BUTTON",{class:!0,type:!0});var A=p(i);
132f=H(A,a),A.forEach(c),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","space-y-3 overflow-y-scroll scrollbar-hidden h-full"),u(i,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(i,"type","submit"),u(n,"class","flex justify-end pt-3 text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(v,g){M(v,e,g),r(e,t),m&&m.m(t,null),r(e,s),r(e,n),r(n,i),r(i,f),o=!0,d||(E=pe(e,"submit",ds(l[46])),d=!0)},p(v,g){v[1]?m?(m.p(v,g),g[0]&2&&G(m,1)):(m=Wi(v),m.c(),G(m,1),m.m(t,null)):m&&(ht(),W(m,1,1,()=>{m=null}),pt()),(!o||g[0]&4)&&a!==(a=v[2].t("Save")+"")&&j(f,a)},i(v){o||(G(m),o=!0)},o(v){W(m),o=!1},d(v){v&&c(e),m&&m.d(),d=!1,E()}}}function J1(l,e,t){let s;const n=Ul("i18n");qt(l,n,z=>t(2,s=z));let{saveHandler:i}=e,a=["searxng","google_pse","brave","kagi","mojeek","bocha","serpstack","serper","serply","searchapi","serpapi","duckduckgo","tavily","jina","bing","exa","perplexity","sougou"],f=["playwright","firecrawl","tavily"],o=null;const d=async()=>{o.WEB_SEARCH_DOMAIN_FILTER_LIST?t(1,o.WEB_SEARCH_DOMAIN_FILTER_LIST=o.WEB_SEARCH_DOMAIN_FILTER_LIST.split(",").map(z=>z.trim()).filter(z=>z.length>0),o):t(1,o.WEB_SEARCH_DOMAIN_FILTER_LIST=[],o),o.YOUTUBE_LOADER_LANGUAGE?t(1,o.YOUTUBE_LOADER_LANGUAGE=o.YOUTUBE_LOADER_LANGUAGE.split(",").map(z=>z.trim()).filter(z=>z.length>0),o):t(1,o.YOUTUBE_LOADER_LANGUAGE=[],o),await Ro(localStorage.token,{web:o}),t(1,o.WEB_SEARCH_DOMAIN_FILTER_LIST=o.WEB_SEARCH_DOMAIN_FILTER_LIST.join(","),o),t(1,o.YOUTUBE_LOADER_LANGUAGE=o.YOUTUBE_LOADER_LANGUAGE.join(","),o)};rs(async()=>{const z=await $o(localStorage.token);z&&(t(1,o=z.web),o!=null&&o.WEB_SEARCH_DOMAIN_FILTER_LIST&&t(1,o.WEB_SEARCH_DOMAIN_FILTER_LIST=o.WEB_SEARCH_DOMAIN_FILTER_LIST.join(","),o),t(1,o.YOUTUBE_LOADER_LANGUAGE=o.YOUTUBE_LOADER_LANGUAGE.join(","),o))});function E(z){l.$$.not_equal(o.ENABLE_WEB_SEARCH,z)&&(o.ENABLE_WEB_SEARCH=z,t(1,o))}function m(){o.WEB_SEARCH_ENGINE=Ll(this),t(1,o),t(4,a)}function v(){o.SEARXNG_QUERY_URL=this.value,t(1,o),t(4,a)}function g(z){l.$$.not_equal(o.GOOGLE_PSE_API_KEY,z)&&(o.GOOGLE_PSE_API_KEY=z,t(1,o))}function b(){o.GOOGLE_PSE_ENGINE_ID=this.value,t(1,o),t(4,a)}function w(z){l.$$.not_equal(o.BRAVE_SEARCH_API_KEY,z)&&(o.BRAVE_SEARCH_API_KEY=z,t(1,o))}function A(z){l.$$.not_equal(o.KAGI_SEARCH_API_KEY,z)&&(o.KAGI_SEARCH_API_KEY=z,t(1,o))}function I(z){l.$$.not_equal(o.MOJEEK_SEARCH_API_KEY,z)&&(o.MOJEEK_SEARCH_API_KEY=z,t(1,o))}function k(z){l.$$.not_equal(o.BOCHA_SEARCH_API_KEY,z)&&(o.BOCHA_SEARCH_API_KEY=z,t(1,o))}function T(z){l.$$.not_equal(o.SERPSTACK_API_KEY,z)&&(o.SERPSTACK_API_KEY=z,t(1,o))}function R(z){l.$$.not_equal(o.SERPER_API_KEY,z)&&(o.SERPER_API_KEY=z,t(1,o))}function O(z){l.$$.not_equal(o.SERPLY_API_KEY,z)&&(o.SERPLY_API_KEY=z,t(1,o))}function y(z){l.$$.not_equal(o.TAVILY_API_KEY,z)&&(o.TAVILY_API_KEY=z,t(1,o))}function L(z){l.$$.not_equal(o.SEARCHAPI_API_KEY,z)&&(o.SEARCHAPI_API_KEY=z,t(1,o))}function P(){o.SEARCHAPI_ENGINE=this.value,t(1,o),t(4,a)}function D(z){l.$$.not_equal(o.SERPAPI_API_KEY,z)&&(o.SERPAPI_API_KEY=z,t(1,o))}function S(){o.SERPAPI_ENGINE=this.value,t(1,o),t(4,a)}function K(z){l.$$.not_equal(o.JINA_API_KEY,z)&&(o.JINA_API_KEY=z,t(1,o))}function Y(){o.BING_SEARCH_V7_ENDPOINT=this.value,t(1,o),t(4,a)}function C(z){l.$$.not_equal(o.BING_SEARCH_V7_SUBSCRIPTION_KEY,z)&&(o.BING_SEARCH_V7_SUBSCRIPTION_KEY=z,t(1,o))}function V(z){l.$$.not_equal(o.EXA_API_KEY,z)&&(o.EXA_API_KEY=z,t(1,o))}function U(z){l.$$.not_equal(o.PERPLEXITY_API_KEY,z)&&(o.PERPLEXITY_API_KEY=z,t(1,o))}function F(z){l.$$.not_equal(o.SOUGOU_API_SID,z)&&(o.SOUGOU_API_SID=z,t(1,o))}function X(z){l.$$.not_equal(o.SOUGOU_API_SK,z)&&(o.SOUGOU_API_SK=z,t(1,o))}function Z(){o.WEB_SEARCH_RESULT_COUNT=this.value,t(1,o),t(4,a)}function J(){o.WEB_SEARCH_CONCURRENT_REQUESTS=this.value,t(1,o),t(4,a)}function ie(){o.WEB_SEARCH_DOMAIN_FILTER_LIST=this.value,t(1,o),t(4,a)}function fe(z){l.$$.not_equal(o.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL,z)&&(o.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL=z,t(1,o))}function le(z){l.$$.not_equal(o.WEB_SEARCH_TRUST_ENV,z)&&(o.WEB_SEARCH_TRUST_ENV=z,t(1,o))}function x(){o.WEB_LOADER_ENGINE=Ll(this),t(1,o),t(4,a)}function oe(z){l.$$.not_equal(o.ENABLE_WEB_LOADER_SSL_VERIFICATION,z)&&(o.ENABLE_WEB_LOADER_SSL_VERIFICATION=z,t(1,o))}function se(){o.PLAYWRIGHT_WS_URL=this.value,t(1,o),t(4,a)}function te(){o.PLAYWRIGHT_TIMEOUT=this.value,t(1,o),t(4,a)}function ae(){o.FIRECRAWL_API_BASE_URL=this.value,t(1,o),t(4,a)}function Te(z){l.$$.not_equal(o.FIRECRAWL_API_KEY,z)&&(o.FIRECRAWL_API_KEY=z,t(1,o))}function ve(){o.TAVILY_EXTRACT_DEPTH=this.value,t(1,o),t(4,a)}function q(z){l.$$.not_equal(o.TAVILY_API_KEY,z)&&(o.TAVILY_API_KEY=z,t(1,o))}function ne(){o.YOUTUBE_LOADER_LANGUAGE=this.value,t(1,o),t(4,a)}function Ie(){o.YOUTUBE_LOADER_PROXY_URL=this.value,t(1,o),t(4,a)}const be=async()=>{await d(),i()};return l.$$set=z=>{"saveHandler"in z&&t(0,i=z.saveHandler)},[i,o,s,n,a,f,d,E,m,v,g,b,w,A,I,k,T,R,O,y,L,P,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te,ae,Te,ve,q,ne,Ie,be]}class z1 extends Sl{constructor(e){super(),Pl(this,e,J1,X1,Ol,{saveHandler:0},null,[-1,-1])}}function Q1(l){let e,t,s;return{c(){e=sl("svg"),t=sl("path"),s=sl("path"),this.h()},l(n){e=nl(n,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=p(e);t=nl(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),p(t).forEach(c),s=nl(i,"path",{d:!0}
132),p(s).forEach(c),i.forEach(c),this.h()},h(){u(t,"fill-rule","evenodd"),u(t,"d","M5.625 1.5H9a3.75 3.75 0 0 1 3.75 3.75v1.875c0 1.036.84 1.875 1.875 1.875H16.5a3.75 3.75 0 0 1 3.75 3.75v7.875c0 1.035-.84 1.875-1.875 1.875H5.625a1.875 1.875 0 0 1-1.875-1.875V3.375c0-1.036.84-1.875 1.875-1.875ZM9.75 17.25a.75.75 0 0 0-1.5 0V18a.75.75 0 0 0 1.5 0v-.75Zm2.25-3a.75.75 0 0 1 .75.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75Zm3.75-1.5a.75.75 0 0 0-1.5 0V18a.75.75 0 0 0 1.5 0v-5.25Z"),u(t,"clip-rule","evenodd"),u(s,"d","M14.25 5.25a5.23 5.23 0 0 0-1.279-3.434 9.768 9.768 0 0 1 6.963 6.963A5.23 5.23 0 0 0 16.5 7.5h-1.875a.375.375 0 0 1-.375-.375V5.25Z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"viewBox","0 0 24 24"),u(e,"fill","currentColor"),u(e,"class",l[0])},m(n,i){M(n,e,i),r(e,t),r(e,s)},p(n,[i]){i&1&&u(e,"class",n[0])},i:st,o:st,d(n){n&&c(e)}}}function x1(l,e,t){let{className:s="size-4"}=e,{strokeWidth:n="1.5"}=e;return l.$$set=i=>{"className"in i&&t(0,s=i.className),"strokeWidth"in i&&t(1,n=i.strokeWidth)},[s,n]}class eh extends Sl{constructor(e){super(),Pl(this,e,x1,Q1,Ol,{className:0,strokeWidth:1})}}function zi(l,e,t){const s=l.slice();return s[2]=e[t],s}function Qi(l,e,t){const s=l.slice();return s[42]=e[t],s[44]=t,s}function th(l){let e=l[15].t("Add Arena Model")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&32768&&e!==(e=s[15].t("Add Arena Model")+"")&&j(t,e)},d(s){s&&c(t)}}}function lh(l){let e=l[15].t("Edit Arena Model")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&32768&&e!==(e=s[15].t("Edit Arena Model")+"")&&j(t,e)},d(s){s&&c(t)}}}function sh(l){let e=l[15].t("Exclude")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&32768&&e!==(e=s[15].t("Exclude")+"")&&j(t,e)},d(s){s&&c(t)}}}function nh(l){let e=l[15].t("Include")+"",t;return{c(){t=B(e)},l(s){t=H(s,e)},m(s,n){M(s,t,n)},p(s,n){n[0]&32768&&e!==(e=s[15].t("Include")+"")&&j(t,e)},d(s){s&&c(t)}}}function rh(l){let e,t=l[15].t("Leave empty to include all models or select specific models")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-gray-500 text-xs text-center py-2")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i[0]&32768&&t!==(t=n[15].t("Leave empty to include all models or select specific models")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function ah(l){let e,t,s=Dt(l[8]),n=[];for(let a=0;a<s.length;a+=1)n[a]=xi(Qi(l,s,a));const i=a=>W(n[a],1,1,()=>{n[a]=null});return{c(){e=_("div");for(let a=0;a<n.length;a+=1)n[a].c();this.h()},l(a){e=h(a,"DIV",{class:!0});var f=p(e);for(let o=0;o<n.length;o+=1)n[o].l(f);f.forEach(c),this.h()},h(){u(e,"class","flex flex-col")},m(a,f){M(a,e,f);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null);t=!0},p(a,f){if(f[0]&16640){s=Dt(a[8]);let o;for(o=0;o<s.length;o+=1){const d=Qi(a,s,o);n[o]?(n[o].p(d,f),G(n[o],1)):(n[o]=xi(d),n[o].c(),G(n[o],1),n[o].m(e,null))}for(ht(),o=s.length;o<n.length;o+=1)i(o);pt()}},i(a){if(!t){for(let f=0;f<s.length;f+=1)G(n[f]);t=!0}},o(a){n=n.filter(Boolean);for(let f=0;f<n.length;f+=1)W(n[f]);t=!1},d(a){a&&c(e),wl(n,a)}}}function xi(l){var w;let e,t,s=((w=l[14].find(g))==null?void 0:w.name)+"",n,i,a,f,o,d,E,m,v;function g(...A){return l[31](l[42],...A)}o=new To({props:{strokeWidth:"2",className:"size-3.5"}});function b(){return l[32](l[44])}return{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("button"),ce(o.$$.fragment),d=N(),this.h()},l(A){e=h(A,"DIV",{class:!0});var I=p(e);t=h(I,"DIV",{class:!0});var k=p(t);n=H(k,s),k.forEach(c),i=$(I),a=h(I,"DIV",{class:!0});var T=p(a);f=h(T,"BUTTON",{type:!0});var R=p(f);de(o.$$.fragment,R),R.forEach(c),T.forEach(c),d=$(I),I.forEach(c),this.h()},h(){u(t,"class","text-sm flex-1 py-1 rounded-lg"),u(f,"type","button"),u(a,"class","shrink-0"),u(e,"class","flex gap-2 w-full justify-between items-center")},m(A,I){M(A,e,I),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),_e(o,f,null),r(e,d),E=!0,m||(v=pe(f,"click",b),m=!0)},p(A,I){var k;l=A,(!E||I[0]&16640)&&s!==(s=((k=l[14].find(g))==null?void 0:k.name)+"")&&j(n,s)},i(A){E||(G(o.$$.fragment,A),E=!0)},o(A){W(o.$$.fragment,A),E=!1},d(A){A&&c(e),he(o),m=!1,v()}}}function eo(l){let e,t=l[2].name+"",s,n;return{c(){e=_("option"),s=B(t),this.h()},l(i){e=h(i,"OPTION",{class:!0});var a=p(e);s=H(a,t),a.forEach(c),this.h()},h(){e.__value=n=l[2].id,Q(e,e.__value),u(e,"class","bg-gray-50 dark:bg-gray-700")},m(i,a){M(i,e,a),r(e,s)},p(i,a){a[0]&16384&&t!==(t=i[2].name+"")&&j(s,t),a[0]&16384&&n!==(n=i[2].id)&&(e.__value=n,Q(e,e.__value))},d(i){i&&c(e)}}}function to(l){let e,t=l[15].t("Delete")+"",s,n,i;return{c(){e=_("button"),s=B(t),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);s=H(f,t),f.forEach(c),this.h()},h(){u(e,"class","px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-950 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center"),u(e,"type","button")},m(a,f){M(a,e,f),r(e,s),n||(i=pe(e,"click",l[35]),n=!0)},p(a,f){f[0]&32768&&t!==(t=a[15].t("Delete")+"")&&j(s,t)},d(a){a&&c(e),n=!1,i()}}}function lo(l){let e,t=`<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><style>.spinner_ajPY {
133												transform-origin: center;
134												animation: spinner_AtaB 0.75s infinite linear;
135											}
136											@keyframes spinner_AtaB {
137												100% {
138													transform: rotate(360deg);
139												}
140											}
141										</style><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="spinner_ajPY"></path></svg>`;return{c(){e=_("div"),e.innerHTML=t,this.h()},l(s){e=h(s,"DIV",{class:!0,"data-svelte-h":!0}),Wt(e)!=="svelte-1vuzrxa"&&(e.innerHTML=t),this.h()},h(){u(e,"class","ml-2 self-center")},m(s,n){M(s,e,n)},d(s){s&&c(e)}}}function ih(l){let e,t,s,n,i,a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5"><path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"></path></svg>',f,o,d,E,m,v,g,b,w,A,I,k,T,R,O,y,L,P,D,S=l[15].t("Name")+"",K,Y,C,V,U,F,X,Z,J=l[15].t("ID")+"",ie,fe,le,x,oe,se,te,ae,Te=l[15].t("Description")+"",ve,q,ne,Ie,be,z,ke,Ue,we,Ae,Re,ue,Ee,Me,Ge,ee,me,ge,Ne=l[15].t("Models")+"",ye,ze,Ce,Le,Ke,re,$e,ut,ft,ct,Be,Ve,je,Rt=l[15].t("Select a model")+"",Ot,_t,Et,At,Tt,Ut,rt,bt,lt,He,at=l[15].t("Save")+"",Vt,Qe,yt,wt,vt,It;function el(Ze,nt){return Ze[1]?lh:th}let Kt=el(l),Lt=Kt(l);O=new If({props:{className:"size-4"}});function ol(Ze){l[29](Ze)}let Tl={};l[10]!==void 0&&(Tl.accessControl=l[10]),Re=new gf({props:Tl}),Ye.push(()=>qe(Re,"accessControl",ol));function Se(Ze,nt){return Ze[9]==="include"?nh:sh}let De=Se(l),Pe=De(l);const kt=[ah,rh],We=[];function it(Ze,nt){return Ze[8].length>0?0:1}re=it(l),$e=We[re]=kt[re](l);let Mt=Dt(l[14].filter(so)),xe=[];for(let Ze=0;Ze<Mt.length;Ze+=1)xe[Ze]=eo(zi(l,Mt,Ze));Ut=new pn({props:{className:"size-3.5",strokeWidth:"2"}});let mt=l[1]&&to(l),Bt=l[12]&&lo();return{c(){e=_("div"),t=_("div"),s=_("div"),Lt.c(),n=N(),i=_("button"),i.innerHTML=a,f=N(),o=_("div"),d=_("div"),E=_("form"),m=_("div"),v=_("div"),g=_("input"),b=N(),w=_("button"),A=_("img"),k=N(),T=_("div"),R=_("div"),ce(O.$$.fragment),y=N(),L=_("div"),P=_("div"),D=_("div"),K=B(S),Y=N(),C=_("div"),V=_("input"),F=N(),X=_("div"),Z=_("div"),ie=B(J),fe=N(),le=_("div"),x=_("input"),se=N(),te=_("div"),ae=_("div"),ve=B(Te),q=N(),ne=_("div"),Ie=_("input"),z=N(),ke=_("hr"),Ue=N(),we=_("div"),Ae=_("div"),ce(Re.$$.fragment),Ee=N(),Me=_("hr"),Ge=N(),ee=_("div"),me=_("div"),ge=_("div"),ye=B(Ne),ze=N(),Ce=_("div"),Le=_("button"),Pe.c(),Ke=N(),$e.c(),ut=N(),ft=_("hr"),ct=N(),Be=_("div"),Ve=_("select"),je=_("option"),Ot=B(Rt);for(let Ze=0;Ze<xe.length;Ze+=1)xe[Ze].c();Et=N(),At=_("div"),Tt=_("button"),ce(Ut.$$.fragment),rt=N(),bt=_("div"),mt&&mt.c(),lt=N(),He=_("button"),Vt=B(at),Qe=N(),Bt&&Bt.c(),this.h()},l(Ze){e=h(Ze,"DIV",{});var nt=p(e);t=h(nt,"DIV",{class:!0});var Yt=p(t);s=h(Yt,"DIV",{class:!0});var tl=p(s);Lt.l(tl),tl.forEach(c),n=$(Yt),i=h(Yt,"BUTTON",{class:!0,"data-svelte-h":!0}),Wt(i)!=="svelte-745w2y"&&(i.innerHTML=a),Yt.forEach(c),f=$(nt),o=h(nt,"DIV",{class:!0});var Qt=p(o);d=h(Qt,"DIV",{class:!0});var al=p(d);E=h(al,"FORM",{class:!0});var St=p(E);m=h(St,"DIV",{class:!0});var Zt=p(m);v=h(Zt,"DIV",{class:!0});var Xt=p(v);g=h(Xt,"INPUT",{type:!0,accept:!0}),b=$(Xt),w=h(Xt,"BUTTON",{class:!0,type:!0});
141var hl=p(w);A=h(hl,"IMG",{src:!0,class:!0,alt:!0}),k=$(hl),T=h(hl,"DIV",{class:!0});var cl=p(T);R=h(cl,"DIV",{class:!0});var Jt=p(R);de(O.$$.fragment,Jt),Jt.forEach(c),cl.forEach(c),hl.forEach(c),Xt.forEach(c),y=$(Zt),L=h(Zt,"DIV",{class:!0});var zt=p(L);P=h(zt,"DIV",{class:!0});var Nt=p(P);D=h(Nt,"DIV",{class:!0});var Al=p(D);K=H(Al,S),Al.forEach(c),Y=$(Nt),C=h(Nt,"DIV",{class:!0});var Rl=p(C);V=h(Rl,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),Rl.forEach(c),Nt.forEach(c),F=$(zt),X=h(zt,"DIV",{class:!0});var dl=p(X);Z=h(dl,"DIV",{class:!0});var Pt=p(Z);ie=H(Pt,J),Pt.forEach(c),fe=$(dl),le=h(dl,"DIV",{class:!0});var gl=p(le);x=h(gl,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),gl.forEach(c),dl.forEach(c),zt.forEach(c),se=$(Zt),te=h(Zt,"DIV",{class:!0});var ot=p(te);ae=h(ot,"DIV",{class:!0});var $t=p(ae);ve=H($t,Te),$t.forEach(c),q=$(ot),ne=h(ot,"DIV",{class:!0});var dt=p(ne);Ie=h(dt,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),dt.forEach(c),ot.forEach(c),z=$(Zt),ke=h(Zt,"HR",{class:!0}),Ue=$(Zt),we=h(Zt,"DIV",{class:!0});var kl=p(we);Ae=h(kl,"DIV",{class:!0});var rl=p(Ae);de(Re.$$.fragment,rl),rl.forEach(c),kl.forEach(c),Ee=$(Zt),Me=h(Zt,"HR",{class:!0}),Ge=$(Zt),ee=h(Zt,"DIV",{class:!0});var $l=p(ee);me=h($l,"DIV",{class:!0});var ul=p(me);ge=h(ul,"DIV",{class:!0});var pl=p(ge);ye=H(pl,Ne),pl.forEach(c),ze=$(ul),Ce=h(ul,"DIV",{});var _s=p(Ce);Le=h(_s,"BUTTON",{class:!0,type:!0});var Il=p(Le);Pe.l(Il),Il.forEach(c),_s.forEach(c),ul.forEach(c),Ke=$($l),$e.l($l),$l.forEach(c),ut=$(Zt),ft=h(Zt,"HR",{class:!0}),ct=$(Zt),Be=h(Zt,"DIV",{class:!0});var ll=p(Be);Ve=h(ll,"SELECT",{class:!0});var ts=p(Ve);je=h(ts,"OPTION",{});var Dl=p(je);Ot=H(Dl,Rt),Dl.forEach(c);for(let il=0;il<xe.length;il+=1)xe[il].l(ts);ts.forEach(c),Et=$(ll),At=h(ll,"DIV",{});var Nl=p(At);Tt=h(Nl,"BUTTON",{type:!0});var ls=p(Tt);
141de(Ut.$$.fragment,ls),ls.forEach(c),Nl.forEach(c),ll.forEach(c),Zt.forEach(c),rt=$(St),bt=h(St,"DIV",{class:!0});var El=p(bt);mt&&mt.l(El),lt=$(El),He=h(El,"BUTTON",{class:!0,type:!0});var Vl=p(He);Vt=H(Vl,at),Qe=$(Vl),Bt&&Bt.l(Vl),Vl.forEach(c),El.forEach(c),St.forEach(c),al.forEach(c),Qt.forEach(c),nt.forEach(c),this.h()},h(){u(s,"class","text-lg font-medium self-center font-primary"),u(i,"class","self-center"),u(t,"class","flex justify-between dark:text-gray-100 px-5 pt-4 pb-2"),u(g,"type","file"),g.hidden=!0,u(g,"accept","image/*"),sn(A.src,I=l[5])||u(A,"src",I),u(A,"class","size-16 rounded-full object-cover shrink-0"),u(A,"alt","Profile"),u(R,"class","my-auto text-white"),u(T,"class","absolute flex justify-center rounded-full bottom-0 left-0 right-0 top-0 h-full w-full overflow-hidden bg-gray-700 bg-fixed opacity-0 transition duration-300 ease-in-out hover:opacity-50"),u(w,"class","relative rounded-full w-fit h-fit shrink-0"),u(w,"type","button"),u(v,"class","flex justify-center pb-3"),u(D,"class","mb-0.5 text-xs text-gray-500"),u(V,"class","w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"),u(V,"type","text"),u(V,"placeholder",U=l[15].t("Model Name")),u(V,"autocomplete","off"),V.required=!0,u(C,"class","flex-1"),u(P,"class","flex flex-col w-full"),u(Z,"class","mb-0.5 text-xs text-gray-500"),u(x,"class","w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"),u(x,"type","text"),u(x,"placeholder",oe=l[15].t("Model ID")),u(x,"autocomplete","off"),x.required=!0,x.disabled=l[1],u(le,"class","flex-1"),u(X,"class","flex flex-col w-full"),u(L,"class","flex gap-2"),u(ae,"class","mb-1 text-xs text-gray-500"),u(Ie,"class","w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"),u(Ie,"type","text"),u(Ie,"placeholder",be=l[15].t("Enter description")),u(Ie,"autocomplete","off"),u(ne,"class","flex-1"),u(te,"class","flex flex-col w-full mt-2"),u(ke,"class","border-gray-100 dark:border-gray-700/10 my-2.5 w-full"),u(Ae,"class","px-3 py-2 bg-gray-50 dark:bg-gray-950 rounded-lg"),u(we,"class","my-2 -mx-2"),u(Me,"class","border-gray-100 dark:border-gray-700/10 my-2.5 w-full"),u(ge,"class","text-xs text-gray-500"),u(Le,"class","text-xs text-gray-500"),u(Le,"type","button"),u(me,"class","mb-1 flex justify-between"),u(ee,"class","flex flex-col w-full"),u(ft,"class","border-gray-100 dark:border-gray-700/10 my-2.5 w-full"),je.__value="",Q(je,je.__value),u(Ve,"class",_t="w-full py-1 text-sm rounded-lg bg-transparent "+(l[7]?"":"text-gray-500")+" placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"),l[7]===void 0&&Cl(()=>l[33].call(Ve)),u(Tt,"type","button"),u(Be,"class","flex items-center"),u(m,"class","px-1"),u(He,"class",yt="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-950 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(l[12]?" cursor-not-allowed":"")),u(He,"type","submit"),He.disabled=l[12],u(bt,"class","flex justify-end pt-3 text-sm font-medium gap-1.5"),u(E,"class","flex flex-col w-full"),u(d,"class","flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6"),u(o,"class","flex flex-col md:flex-row w-full px-4 pb-4 md:space-x-4 dark:text-gray-200")},m(Ze,nt){M(Ze,e,nt),r(e,t),r(t,s),Lt.m(s,null),r(t,n),r(t,i),r(e,f),r(e,o),r(o,d),r(d,E),r(E,m),r(m,v),r(v,g),l[23](g),r(v,b),r(v,w),r(w,A),r(w,k),r(w,T),r(T,R),_e(O,R,null),r(m,y),r(m,L),r(L,P),r(P,D),r(D,K),r(P,Y),r(P,C),r(C,V),Q(V,l[3]),r(L,F),r(L,X),r(X,Z),r(Z,ie),r(X,fe),r(X,le),r(le,x),Q(x,l[4]),r(m,se),r(m,te),r(te,ae),r(ae,ve),r(te,q),r(te,ne),r(ne,Ie),Q(Ie,l[6]),r(m,z),r(m,ke),r(m,Ue),r(m,we),r(we,Ae),_e(Re,Ae,null),r(m,Ee),r(m,Me),r(m,Ge),r(m,ee),r(ee,me),r(me,ge),r(ge,ye),r(me,ze),r(me,Ce),r(Ce,Le),Pe.m(Le,null),r(ee,Ke),We[re].m(ee,null),r(m,ut),r(m,ft),r(m,ct),r(m,Be),r(Be,Ve),r(Ve,je),r(je,Ot);for(let Yt=0;Yt<xe.length;Yt+=1)xe[Yt]&&xe[Yt].m(Ve,null);Ft(Ve,l[7],!0),r(Be,Et),r(Be,At),r(At,Tt),_e(Ut,Tt,null),r(E,rt),r(E,bt),mt&&mt.m(bt,null),r(bt,lt),r(bt,He),r(He,Vt),r(He,Qe),Bt&&Bt.m(He,null),wt=!0,vt||(It=[pe(i,"click",l[22]),pe(g,"change",l[24]),pe(w,"click",l[25]
141),pe(V,"input",l[26]),pe(x,"input",l[27]),pe(Ie,"input",l[28]),pe(Le,"click",l[30]),pe(Ve,"change",l[33]),pe(Tt,"click",l[34]),pe(E,"submit",ds(l[36]))],vt=!0)},p(Ze,nt){Kt===(Kt=el(Ze))&&Lt?Lt.p(Ze,nt):(Lt.d(1),Lt=Kt(Ze),Lt&&(Lt.c(),Lt.m(s,null))),(!wt||nt[0]&32&&!sn(A.src,I=Ze[5]))&&u(A,"src",I),(!wt||nt[0]&32768)&&S!==(S=Ze[15].t("Name")+"")&&j(K,S),(!wt||nt[0]&32768&&U!==(U=Ze[15].t("Model Name")))&&u(V,"placeholder",U),nt[0]&8&&V.value!==Ze[3]&&Q(V,Ze[3]),(!wt||nt[0]&32768)&&J!==(J=Ze[15].t("ID")+"")&&j(ie,J),(!wt||nt[0]&32768&&oe!==(oe=Ze[15].t("Model ID")))&&u(x,"placeholder",oe),(!wt||nt[0]&2)&&(x.disabled=Ze[1]),nt[0]&16&&x.value!==Ze[4]&&Q(x,Ze[4]),(!wt||nt[0]&32768)&&Te!==(Te=Ze[15].t("Description")+"")&&j(ve,Te),(!wt||nt[0]&32768&&be!==(be=Ze[15].t("Enter description")))&&u(Ie,"placeholder",be),nt[0]&64&&Ie.value!==Ze[6]&&Q(Ie,Ze[6]);const Yt={};!ue&&nt[0]&1024&&(ue=!0,Yt.accessControl=Ze[10],Fe(()=>ue=!1)),Re.$set(Yt),(!wt||nt[0]&32768)&&Ne!==(Ne=Ze[15].t("Models")+"")&&j(ye,Ne),De===(De=Se(Ze))&&Pe?Pe.p(Ze,nt):(Pe.d(1),Pe=De(Ze),Pe&&(Pe.c(),Pe.m(Le,null)));let tl=re;if(re=it(Ze),re===tl?We[re].p(Ze,nt):(ht(),W(We[tl],1,1,()=>{We[tl]=null}),pt(),$e=We[re],$e?$e.p(Ze,nt):($e=We[re]=kt[re](Ze),$e.c()),G($e,1),$e.m(ee,null)),(!wt||nt[0]&32768)&&Rt!==(Rt=Ze[15].t("Select a model")+"")&&j(Ot,Rt),nt[0]&16384){Mt=Dt(Ze[14].filter(so));let Qt;for(Qt=0;Qt<Mt.length;Qt+=1){const al=zi(Ze,Mt,Qt);xe[Qt]?xe[Qt].p(al,nt):(xe[Qt]=eo(al),xe[Qt].c(),xe[Qt].m(Ve,null))}for(;Qt<xe.length;Qt+=1)xe[Qt].d(1);xe.length=Mt.length}(!wt||nt[0]&16512&&_t!==(_t="w-full py-1 text-sm rounded-lg bg-transparent "+(Ze[7]?"":"text-gray-500")+" placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"))&&u(Ve,"class",_t),nt[0]&16512&&Ft(Ve,Ze[7]),Ze[1]?mt?mt.p(Ze,nt):(mt=to(Ze),mt.c(),mt.m(bt,lt)):mt&&(mt.d(1),mt=null),(!wt||nt[0]&32768)&&at!==(at=Ze[15].t("Save")+"")&&j(Vt,at),Ze[12]?Bt||(Bt=lo(),Bt.c(),Bt.m(He,null)):Bt&&(Bt.d(1),Bt=null),(!wt||nt[0]&4096&&yt!==(yt="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-950 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center "+(Ze[12]?" cursor-not-allowed":"")))&&u(He,"class",yt),(!wt||nt[0]&4096)&&(He.disabled=Ze[12])},i(Ze){wt||(G(O.$$.fragment,Ze),G(Re.$$.fragment,Ze),G($e),G(Ut.$$.fragment,Ze),wt=!0)},o(Ze){W(O.$$.fragment,Ze),W(Re.$$.fragment,Ze),W($e),W(Ut.$$.fragment,Ze),wt=!1},d(Ze){Ze&&c(e),Lt.d(),l[23](null),he(O),he(Re),Pe.d(),We[re].d(),wl(xe,Ze),he(Ut),mt&&mt.d(),Bt&&Bt.d(),vt=!1,ml(It)}}}function oh(l){let e,t,s,n,i,a;function f(m){l[20](m)}let o={};l[13]!==void 0&&(o.show=l[13]),e=new Ys({props:o}),Ye.push(()=>qe(e,"show",f)),e.$on("confirm",l[21]);function d(m){l[37](m)}let E={size:"sm",$$slots:{default:[ih]},$$scope:{ctx:l}};return l[0]!==void 0&&(E.show=l[0]),n=new Bn({props:E}),Ye.push(()=>qe(n,"show",d)),{c(){ce(e.$$.fragment),s=N(),ce(n.$$.fragment)},l(m){de(e.$$.fragment,m),s=$(m),de(n.$$.fragment,m)},m(m,v){_e(e,m,v),M(m,s,v),_e(n,m,v),a=!0},p(m,v){const g={};!t&&v[0]&8192&&(t=!0,g.show=m[13],Fe(()=>t=!1)),e.$set(g);const b={};v[0]&65531|v[1]&16384&&(b.$$scope={dirty:v,ctx:m}),!i&&v[0]&1&&(i=!0,b.show=m[0],Fe(()=>i=!1)),n.$set(b)},i(m){a||(G(e.$$.fragment,m),G(n.$$.fragment,m),a=!0)},o(m){W(e.$$.fragment,m),W(n.$$.fragment,m),a=!1},d(m){m&&c(s),he(e,m),he(n,m)}}}const so=l=>(l==null?void 0:l.owned_by)!=="arena";function uh(l,e,t){let s,n;qt(l,Kl,ae=>t(14,s=ae));const i=Ul("i18n");qt(l,i,ae=>t(15,n=ae));const a=Ss();let{show:f=!1}=e,{edit:o=!1}=e,{model:d=null}=e,E="",m="";const v=()=>{o||t(4,m=E.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""))};let g="/favicon.png",b="",w="",A=[],I="include",k={},T,R=!1,O=!1;const y=()=>{w&&(t(8,A=[...A,w]),t(7,w=""))},L=()=>
141{if(t(12,R=!0),!E||!m){t(12,R=!1),Je.error("Name and ID are required, please fill them out");return}if(!o&&s.find(Te=>Te.name===E)){t(12,R=!1),t(3,E=""),Je.error("Model name already exists, please choose a different one");return}const ae={id:m,name:E,meta:{profile_image_url:g,description:b||null,model_ids:A.length>0?A:null,filter_mode:A.length>0&&I||null,access_control:k}};a("submit",ae),t(12,R=!1),t(0,f=!1),t(3,E=""),t(4,m=""),t(5,g="/favicon.png"),t(6,b=""),t(8,A=[]),t(7,w="")},P=()=>{var ae;d&&(t(3,E=d.name),t(4,m=d.id),t(5,g=d.meta.profile_image_url),t(6,b=d.meta.description),t(8,A=d.meta.model_ids||[]),t(9,I=((ae=d.meta)==null?void 0:ae.filter_mode)??"include"),t(10,k="access_control"in d.meta?d.meta.access_control:{}))};rs(()=>{P()});function D(ae){O=ae,t(13,O)}const S=()=>{a("delete",d),t(0,f=!1)},K=()=>{t(0,f=!1)};function Y(ae){Ye[ae?"unshift":"push"](()=>{T=ae,t(11,T)})}const C=ae=>{const Te=ae.target.files??[];let ve=new FileReader;ve.onload=q=>{let ne=`${q.target.result}`;const Ie=new Image;Ie.src=ne,Ie.onload=function(){const be=document.createElement("canvas"),z=be.getContext("2d"),ke=Ie.width/Ie.height;let Ue,we;ke>1?(Ue=250*ke,we=250):(Ue=250,we=250/ke),be.width=250,be.height=250;const Ae=(250-Ue)/2,Re=(250-we)/2;z.drawImage(Ie,Ae,Re,Ue,we);const ue=be.toDataURL("image/jpeg");t(5,g=ue),ae.target.files=null}},Te.length>0&&["image/gif","image/webp","image/jpeg","image/png"].includes(Te[0].type)&&ve.readAsDataURL(Te[0])},V=()=>{T.click()};function U(){E=this.value,t(3,E)}function F(){m=this.value,t(4,m)}function X(){b=this.value,t(6,b)}function Z(ae){k=ae,t(10,k)}const J=()=>{t(9,I=I==="include"?"exclude":"include")},ie=(ae,Te)=>Te.id===ae,fe=ae=>{t(8,A=A.filter((Te,ve)=>ve!==ae))};function le(){w=Ll(this),t(7,w)}const x=()=>{y()},oe=()=>{t(13,O=!0)},se=()=>{L()};function te(ae){f=ae,t(0,f)}return l.$$set=ae=>{"show"in ae&&t(0,f=ae.show),"edit"in ae&&t(1,o=ae.edit),"model"in ae&&t(2,d=ae.model)},l.$$.update=()=>{l.$$.dirty[0]&8&&E&&v(),l.$$.dirty[0]&1&&f&&P()},[f,o,d,E,m,g,b,w,A,I,k,T,R,O,s,n,i,a,y,L,D,S,K,Y,C,V,U,F,X,Z,J,ie,fe,le,x,oe,se,te]}class So extends Sl{constructor(e){super(),Pl(this,e,uh,oh,Ol,{show:0,edit:1,model:2},null,[-1,-1])}}function fh(l){var U,F;let e,t,s,n,i,a,f,o,d,E,m,v,g,b,w=l[0].name+"",A,I,k,T,R=(((F=(U=l[0])==null?void 0:U.meta)==null?void 0:F.description)??l[0].id)+"",O,y,L,P,D,S,K,Y;function C(X){l[3](X)}let V={edit:!0,model:l[0]};return l[1]!==void 0&&(V.show=l[1]),e=new So({props:V}),Ye.push(()=>qe(e,"show",C)),e.$on("submit",l[4]),e.$on("delete",l[5]),D=new Mn({}),{c(){ce(e.$$.fragment),s=N(),n=_("div"),i=_("div"),a=_("div"),f=_("div"),o=_("img"),m=N(),v=_("div"),g=_("div"),b=_("div"),A=B(w),I=N(),k=_("div"),T=_("div"),O=B(R),y=N(),L=_("div"),P=_("button"),ce(D.$$.fragment),this.h()},l(X){de(e.$$.fragment,X),s=$(X),n=h(X,"DIV",{class:!0});var Z=p(n);i=h(Z,"DIV",{class:!0});var J=p(i);a=h(J,"DIV",{class:!0});var ie=p(a);f=h(ie,"DIV",{class:!0});var fe=p(f);o=h(fe,"IMG",{src:!0,alt:!0,class:!0}),m=$(fe),v=h(fe,"DIV",{class:!0});var le=p(v);g=h(le,"DIV",{class:!0});var x=p(g);b=h(x,"DIV",{class:!0});var oe=p(b);A=H(oe,w),oe.forEach(c),x.forEach(c),I=$(le),k=h(le,"DIV",{class:!0});var se=p(k);T=h(se,"DIV",{class:!0});var te=p(T);O=H(te,R),te.forEach(c),se.forEach(c),le.forEach(c),fe.forEach(c),ie.forEach(c),y=$(J),L=h(J,"DIV",{class:!0});var ae=p(L);P=h(ae,"BUTTON",{class:!0,type:!0});var Te=p(P);de(D.$$.fragment,Te),Te.forEach(c),ae.forEach(c),J.forEach(c),Z.forEach(c),this.h()},h(){sn(o.src,d=l[0].meta.profile_image_url)||u(o,"src",d),u(o,"alt",E=l[0].name),u(o,"class","size-8 rounded-full object-cover shrink-0"),u(b,"class","shrink-0 line-clamp-1"),u(g,"class","flex items-center gap-1"),u(T,"class","text-xs w-full text-gray-500 bg-transparent line-clamp-1"),u(k,"class","flex items-center gap-1"),u(v,"class","w-full flex flex-col"),u(f,"class","flex gap-2.5 items-center"),u(a,"class","flex flex-col flex-1"),u(P,"class","self-center w-fit text-sm p-1.5 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"),u(P,"type","button"),u(L,"class","flex items-center"),u(i,"class","flex justify-between items-center mb-1"),u(n,"class","py-0.5")},m(X,Z){_e(e,X,Z),M(X,s,Z),M(X,n,Z),r(n,i),r(i,a),r(a,f),r(f,o),r(f,m),r(f,v),r(v,g),r(g,b),r(b,A),r(v,I),r(v,k),r(k,T),r(T,O),r(i,y),r(i,L),r(L,P),_e(D,P,null),S=!0,K||(Y=pe(P,"click",l[6]),K=!0)},p(X,[Z]){var ie,fe;const J={};Z&1&&(J.model=X[0]),!t&&Z&2&&(t=!0,J.show=X[1],Fe(()=>t=!1)),e.$set(J),(!S||Z&1&&!sn(o.src,d=X[0].meta.profile_image_url))&&u(o,"src",d),(!S||Z&1&&E!==(E=X[0].name))&&u(o,"alt",E),(!S||Z&1)&&w!==(w=X[0].name+"")&&j(A,w),(!S||Z&1)&&R!==(R=(((fe=(ie=X[0])==null?void 0:ie.meta)==null?void 0:fe.description)??X[0].id)+"")&&j(O,R)}
141,i(X){S||(G(e.$$.fragment,X),G(D.$$.fragment,X),S=!0)},o(X){W(e.$$.fragment,X),W(D.$$.fragment,X),S=!1},d(X){X&&(c(s),c(n)),he(e,X),he(D),K=!1,Y()}}}function ch(l,e,t){const s=Ss();Ul("i18n");let{model:n}=e,i=!1;function a(E){i=E,t(1,i)}const f=async E=>{s("edit",E.detail)},o=async()=>{s("delete")},d=()=>{t(1,i=!0)};return l.$$set=E=>{"model"in E&&t(0,n=E.model)},[n,i,s,a,f,o,d]}class dh extends Sl{constructor(e){super(),Pl(this,e,ch,fh,Ol,{model:0})}}function no(l,e,t){const s=l.slice();return s[19]=e[t],s[21]=t,s}function _h(l){let e,t,s,n;return s=new Ps({props:{className:"size-6"}}),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);de(s.$$.fragment,f),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","my-auto"),u(e,"class","flex h-full justify-center")},m(i,a){M(i,e,a),r(e,t),_e(s,t,null),n=!0},p:st,i(i){n||(G(s.$$.fragment,i),n=!0)},o(i){W(s.$$.fragment,i),n=!1},d(i){i&&c(e),he(s)}}}function hh(l){let e,t,s,n=l[2].t("General")+"",i,a,f,o,d,E,m=l[2].t("Arena Models")+"",v,g,b,w,A;b=new Gt({props:{content:l[2].t("Message rating should be enabled to use this feature"),$$slots:{default:[ph]},$$scope:{ctx:l}}});let I=l[0].ENABLE_EVALUATION_ARENA_MODELS&&ro(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("hr"),o=N(),d=_("div"),E=_("div"),v=B(m),g=N(),ce(b.$$.fragment),w=N(),I&&I.c(),this.h()},l(k){e=h(k,"DIV",{class:!0});var T=p(e);t=h(T,"DIV",{class:!0});var R=p(t);s=h(R,"DIV",{class:!0});var O=p(s);i=H(O,n),O.forEach(c),a=$(R),f=h(R,"HR",{class:!0}),o=$(R),d=h(R,"DIV",{class:!0});var y=p(d);E=h(y,"DIV",{class:!0});var L=p(E);v=H(L,m),L.forEach(c),g=$(y),de(b.$$.fragment,y),y.forEach(c),R.forEach(c),w=$(T),I&&I.l(T),T.forEach(c),this.h()},h(){u(s,"class","mb-2.5 text-base font-medium"),u(f,"class","border-gray-100 dark:border-gray-850 my-2"),u(E,"class","text-xs font-medium"),u(d,"class","mb-2.5 flex w-full justify-between"),u(t,"class","mb-3"),u(e,"class","")},m(k,T){M(k,e,T),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(t,o),r(t,d),r(d,E),r(E,v),r(d,g),_e(b,d,null),r(e,w),I&&I.m(e,null),A=!0},p(k,T){(!A||T&4)&&n!==(n=k[2].t("General")+"")&&j(i,n),(!A||T&4)&&m!==(m=k[2].t("Arena Models")+"")&&j(v,m);const R={};T&4&&(R.content=k[2].t("Message rating should be enabled to use this feature")),T&4194305&&(R.$$scope={dirty:T,ctx:k}),b.$set(R),k[0].ENABLE_EVALUATION_ARENA_MODELS?I?(I.p(k,T),T&1&&G(I,1)):(I=ro(k),I.c(),G(I,1),I.m(e,null)):I&&(ht(),W(I,1,1,()=>{I=null}),pt())},i(k){A||(G(b.$$.fragment,k),G(I),A=!0)},o(k){W(b.$$.fragment,k),W(I),A=!1},d(k){k&&c(e),he(b),I&&I.d()}}}function ph(l){let e,t,s;
141function n(a){l[11](a)}let i={};return l[0].ENABLE_EVALUATION_ARENA_MODELS!==void 0&&(i.state=l[0].ENABLE_EVALUATION_ARENA_MODELS),e=new vl({props:i}),Ye.push(()=>qe(e,"state",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};!t&&f&1&&(t=!0,o.state=a[0].ENABLE_EVALUATION_ARENA_MODELS,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function ro(l){let e,t,s,n=l[2].t("Manage")+"",i,a,f,o,d,E,m,v,g,b,w;o=new Gt({props:{content:l[2].t("Add Arena Model"),$$slots:{default:[vh]},$$scope:{ctx:l}}});const A=[gh,mh],I=[];function k(T,R){var O;return(((O=T[0])==null?void 0:O.EVALUATION_ARENA_MODELS)??[]).length>0?0:1}return g=k(l),b=I[g]=A[g](l),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),ce(o.$$.fragment),d=N(),E=_("hr"),m=N(),v=_("div"),b.c(),this.h()},l(T){e=h(T,"DIV",{class:!0});var R=p(e);t=h(R,"DIV",{class:!0});var O=p(t);s=h(O,"DIV",{});var y=p(s);i=H(y,n),y.forEach(c),a=$(O),f=h(O,"DIV",{});var L=p(f);de(o.$$.fragment,L),L.forEach(c),O.forEach(c),d=$(R),E=h(R,"HR",{class:!0}),m=$(R),v=h(R,"DIV",{class:!0});var P=p(v);b.l(P),P.forEach(c),R.forEach(c),this.h()},h(){u(t,"class","mb-2.5 text-base font-medium flex justify-between items-center"),u(E,"class","border-gray-100 dark:border-gray-850 my-2"),u(v,"class","flex flex-col gap-2"),u(e,"class","mb-3")},m(T,R){M(T,e,R),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),_e(o,f,null),r(e,d),r(e,E),r(e,m),r(e,v),I[g].m(v,null),w=!0},p(T,R){(!w||R&4)&&n!==(n=T[2].t("Manage")+"")&&j(i,n);const O={};R&4&&(O.content=T[2].t("Add Arena Model")),R&4194306&&(O.$$scope={dirty:R,ctx:T}),o.$set(O);let y=g;g=k(T),g===y?I[g].p(T,R):(ht(),W(I[y],1,1,()=>{I[y]=null}),pt(),b=I[g],b?b.p(T,R):(b=I[g]=A[g](T),b.c()),G(b,1),b.m(v,null))},i(T){w||(G(o.$$.fragment,T),G(b),w=!0)},o(T){W(o.$$.fragment,T),W(b),w=!1},d(T){T&&c(e),he(o),I[g].d()}}}function vh(l){let e,t,s,n,i;return t=new pn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","p-1"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[12]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function mh(l){let e,t=l[2].t("Using the default arena model with all models. Click the plus button to add custom models.")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-center text-xs text-gray-500")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i&4&&t!==(t=n[2].t("Using the default arena model with all models. Click the plus button to add custom models.")+"")&&j(s,t)},i:st,o:st,d(n){n&&c(e)}}}function gh(l){let e,t,s=Dt(l[0].EVALUATION_ARENA_MODELS),n=[];for(let a=0;a<s.length;a+=1)n[a]=ao(no(l,s,a));const i=a=>W(n[a],1,1,()=>{n[a]=null});return{c(){for(let a=0;a<n.length;a+=1)n[a].c();e=xt()},l(a){for(let f=0;f<n.length;f+=1)n[f].l(a);e=xt()},m(a,f){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(a,f);M(a,e,f),t=!0},p(a,f){if(f&385){s=Dt(a[0].EVALUATION_ARENA_MODELS);let o;for(o=0;o<s.length;o+=1){const d=no(a,s,o);n[o]?(n[o].p(d,f),G(n[o],1)):(n[o]=ao(d),n[o].c(),G(n[o],1),n[o].m(e.parentNode,e))}for(ht(),o=s.length;o<n.length;o+=1)i(o);pt()}},i(a){if(!t){for(let f=0;f<s.length;f+=1)G(n[f]);t=!0}},o(a){n=n.filter(Boolean);for(let f=0;f<n.length;f+=1)W(n[f]);t=!1},d(a){a&&c(e),wl(n,a)}}}function ao(l){let e,t;function s(...i){return l[13](l[21],...i)}function n(...i){return l[14](l[21],...i)}return e=new dh({props:{model:l[19]}}),e.$on("edit",s),e.$on("delete",n),{c(){ce(e.$$.fragment)},l(i){de(e.$$.fragment,i)},m(i,a){_e(e,i,a),t=!0},p(i,a){l=i;const f={};a&1&&(f.model=l[19]),e.$set(f)},i(i){t||(G(e.$$.fragment,i),t=!0)},o(i){W(e.$$.fragment,i),t=!1},d(i){he(e,i)}}}function Eh(l){let e,t,s,n,i,a,f,o,d,E,m=l[2].t("Save")+"",v,g,b,w;function A(O){l[9](O)}let I={};l[1]!==void 0&&(I.show=l[1]),e=new So({props:I}),Ye.push(()=>qe(e,"show",A)),e.$on("submit",l[10]);const k=[hh,_h],T=[];function R(O,y){return O[0]!==null?0:1}return a=R(l),f=T[a]=k[a](l),{c(){ce(e.$$.fragment),s=N(),n=_("form"),i=_("div"),f.c(),o=N(),d=_("div"),E=_("button"),v=
141B(m),this.h()},l(O){de(e.$$.fragment,O),s=$(O),n=h(O,"FORM",{class:!0});var y=p(n);i=h(y,"DIV",{class:!0});var L=p(i);f.l(L),L.forEach(c),o=$(y),d=h(y,"DIV",{class:!0});var P=p(d);E=h(P,"BUTTON",{class:!0,type:!0});var D=p(E);v=H(D,m),D.forEach(c),P.forEach(c),y.forEach(c),this.h()},h(){u(i,"class","overflow-y-scroll scrollbar-hidden h-full"),u(E,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(E,"type","submit"),u(d,"class","flex justify-end pt-3 text-sm font-medium"),u(n,"class","flex flex-col h-full justify-between text-sm")},m(O,y){_e(e,O,y),M(O,s,y),M(O,n,y),r(n,i),T[a].m(i,null),r(n,o),r(n,d),r(d,E),r(E,v),g=!0,b||(w=pe(n,"submit",ds(l[15])),b=!0)},p(O,[y]){const L={};!t&&y&2&&(t=!0,L.show=O[1],Fe(()=>t=!1)),e.$set(L);let P=a;a=R(O),a===P?T[a].p(O,y):(ht(),W(T[P],1,1,()=>{T[P]=null}),pt(),f=T[a],f?f.p(O,y):(f=T[a]=k[a](O),f.c()),G(f,1),f.m(i,null)),(!g||y&4)&&m!==(m=O[2].t("Save")+"")&&j(v,m)},i(O){g||(G(e.$$.fragment,O),G(f),g=!0)},o(O){W(e.$$.fragment,O),W(f),g=!1},d(O){O&&(c(s),c(n)),he(e,O),T[a].d(),b=!1,w()}}}function bh(l,e,t){let s,n,i,a;qt(l,rn,y=>t(16,s=y)),qt(l,nn,y=>t(17,n=y)),qt(l,fs,y=>t(18,i=y));const f=Ss(),o=Ul("i18n");qt(l,o,y=>t(2,a=y));let d=null,E=!1;const m=async()=>{var y;t(0,d=await mf(localStorage.token,d).catch(L=>(Je.error(L),null))),d&&(Je.success("Settings saved successfully"),Kl.set(await ns(localStorage.token,((y=i==null?void 0:i.features)==null?void 0:y.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null))))},v=async y=>{var L;d.EVALUATION_ARENA_MODELS.push(y),t(0,d.EVALUATION_ARENA_MODELS=[...d.EVALUATION_ARENA_MODELS],d),await m(),Kl.set(await ns(localStorage.token,((L=i==null?void 0:i.features)==null?void 0:L.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null)))},g=async(y,L)=>{var P;t(0,d.EVALUATION_ARENA_MODELS[L]=y,d),t(0,d.EVALUATION_ARENA_MODELS=[...d.EVALUATION_ARENA_MODELS],d),await m(),Kl.set(await ns(localStorage.token,((P=i==null?void 0:i.features)==null?void 0:P.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null)))},b=async y=>{var L;t(0,d.EVALUATION_ARENA_MODELS=d.EVALUATION_ARENA_MODELS.filter((P,D)=>D!==y),d),await m(),Kl.set(await ns(localStorage.token,((L=i==null?void 0:i.features)==null?void 0:L.enable_direct_connections)&&((n==null?void 0:n.directConnections)??null)))};rs(async()=>{(s==null?void 0:s.role)==="admin"&&t(0,d=await vf(localStorage.token).catch(y=>(Je.error(y),null)))});function w(y){E=y,t(1,E)}const A=async y=>{v(y.detail)};function I(y){l.$$.not_equal(d.ENABLE_EVALUATION_ARENA_MODELS,y)&&(d.ENABLE_EVALUATION_ARENA_MODELS=y,t(0,d))}return[d,E,a,f,o,m,v,g,b,w,A,I,()=>{t(1,E=!0)},(y,L)=>{g(L.detail,y)},(y,L)=>{b(y)},()=>{m(),f("save")}]}class Ih extends Sl{constructor(e){super(),Pl(this,e,bh,Eh,Ol,{})}}function io(l,e,t){const s=l.slice();return s[22]=e[t],s}function oo(l,e,t){const s=l.slice();return s[22]=e[t],s}function uo(l){let e,t,s,n=l[2].t("General")+"",i,a,f,o,d,E,m,v=l[2].t("Enable Code Execution")+"",g,b,w,A,I,k,T,R,O=l[2].t("Code Execution Engine")+"",y,L,P,D,S,K=l[2].t("Select a engine")+"",Y,C,V,U,F,X,Z,J=l[2].t("Code Interpreter")+"",ie,fe,le,x,oe,se,te,ae=l[2].t("Enable Code Interpreter")+"",Te,ve,q,ne,Ie,be,z,ke;function Ue(me){l[6](me)}let we={};l[1].ENABLE_CODE_EXECUTION!==void 0&&(we.state=l[1].ENABLE_CODE_EXECUTION),w=new vl({props:we}),Ye.push(()=>qe(w,"state",Ue));let Ae=Dt(l[4]),Re=[];for(let me=0;me<Ae.length;me+=1)Re[me]=fo(oo(l,Ae,me));let ue=l[1].CODE_EXECUTION_ENGINE==="jupyter"&&co(l),Ee=l[1].CODE_EXECUTION_ENGINE==="jupyter"&&_o(l);function Me(me){l[13](me)}let Ge={};l[1].ENABLE_CODE_INTERPRETER!==void 0&&(Ge.state=l[1].ENABLE_CODE_INTERPRETER),q=new vl({props:Ge}),Ye.push(()=>qe(q,"state",Me));let ee=l[1].ENABLE_CODE_INTERPRETER&&po(l);return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("hr"),o=N(),d=_("div"),E=_("div"),m=_("div"),g=B(v),b=N(),ce(w.$$.fragment),I=N(),k=_("div"),T=_("div"),R=_("div"),y=B(O),L=N(),P=_("div"),D=_("select"),S=_("option"),Y=B(K);for(let me=0;me<Re.length;me+=1)Re[me].c();V=N(),ue&&ue.c(),U=N(),Ee&&Ee.c(),F=N(),X=_("div"),Z=_("div"),ie=B(J),fe=N(),le=_("hr"),x=N(),oe=_("div"),se=_("div"),te=_("div"),Te=B(ae),ve=N(),ce(q.$$.fragment),Ie=N(),ee&&ee.c(),this.h()},l(me){e=h(me,"DIV",{});var ge=p(e);t=h(ge,"DIV",{class:!0});var Ne=p(t);s=h(Ne,"DIV",{class:!0});var ye=p(s);i=H(ye,n),ye.forEach(c),a=$(Ne),f=h(Ne,"HR",{class:!0}),o=$(Ne),d=h(Ne,"DIV",{class:!0});var ze=p(d);E=h(ze,"DIV",{class:!0});var Ce=p(E);m=h(Ce,"DIV",{class:!0});var Le=p(m);
141g=H(Le,v),Le.forEach(c),b=$(Ce),de(w.$$.fragment,Ce),Ce.forEach(c),ze.forEach(c),I=$(Ne),k=h(Ne,"DIV",{class:!0});var Ke=p(k);T=h(Ke,"DIV",{class:!0});var re=p(T);R=h(re,"DIV",{class:!0});var $e=p(R);y=H($e,O),$e.forEach(c),L=$(re),P=h(re,"DIV",{class:!0});var ut=p(P);D=h(ut,"SELECT",{class:!0,placeholder:!0});var ft=p(D);S=h(ft,"OPTION",{});var ct=p(S);Y=H(ct,K),ct.forEach(c);for(let _t=0;_t<Re.length;_t+=1)Re[_t].l(ft);ft.forEach(c),ut.forEach(c),re.forEach(c),V=$(Ke),ue&&ue.l(Ke),Ke.forEach(c),U=$(Ne),Ee&&Ee.l(Ne),Ne.forEach(c),F=$(ge),X=h(ge,"DIV",{class:!0});var Be=p(X);Z=h(Be,"DIV",{class:!0});var Ve=p(Z);ie=H(Ve,J),Ve.forEach(c),fe=$(Be),le=h(Be,"HR",{class:!0}),x=$(Be),oe=h(Be,"DIV",{class:!0});var je=p(oe);se=h(je,"DIV",{class:!0});var Rt=p(se);te=h(Rt,"DIV",{class:!0});var Ot=p(te);Te=H(Ot,ae),Ot.forEach(c),ve=$(Rt),de(q.$$.fragment,Rt),Rt.forEach(c),je.forEach(c),Ie=$(Be),ee&&ee.l(Be),Be.forEach(c),ge.forEach(c),this.h()},h(){u(s,"class","mb-2.5 text-base font-medium"),u(f,"class","border-gray-100 dark:border-gray-850 my-2"),u(m,"class","self-center text-xs font-medium"),u(E,"class","flex w-full justify-between"),u(d,"class","mb-2.5"),u(R,"class","self-center text-xs font-medium"),S.disabled=!0,S.selected=!0,S.__value="",Q(S,S.__value),u(D,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(D,"placeholder",C=l[2].t("Select a engine")),D.required=!0,l[1].CODE_EXECUTION_ENGINE===void 0&&Cl(()=>l[7].call(D)),u(P,"class","flex items-center relative"),u(T,"class","flex w-full justify-between"),u(k,"class","mb-2.5"),u(t,"class","mb-3.5"),u(Z,"class","mb-2.5 text-base font-medium"),u(le,"class","border-gray-100 dark:border-gray-850 my-2"),u(te,"class","self-center text-xs font-medium"),u(se,"class","flex w-full justify-between"),u(oe,"class","mb-2.5"),u(X,"class","mb-3.5")},m(me,ge){M(me,e,ge),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(t,o),r(t,d),r(d,E),r(E,m),r(m,g),r(E,b),_e(w,E,null),r(t,I),r(t,k),r(k,T),r(T,R),r(R,y),r(T,L),r(T,P),r(P,D),r(D,S),r(S,Y);for(let Ne=0;Ne<Re.length;Ne+=1)Re[Ne]&&Re[Ne].m(D,null);Ft(D,l[1].CODE_EXECUTION_ENGINE,!0),r(k,V),ue&&ue.m(k,null),r(t,U),Ee&&Ee.m(t,null),r(e,F),r(e,X),r(X,Z),r(Z,ie),r(X,fe),r(X,le),r(X,x),r(X,oe),r(oe,se),r(se,te),r(te,Te),r(se,ve),_e(q,se,null),r(X,Ie),ee&&ee.m(X,null),be=!0,z||(ke=pe(D,"change",l[7]),z=!0)},p(me,ge){(!be||ge&4)&&n!==(n=me[2].t("General")+"")&&j(i,n),(!be||ge&4)&&v!==(v=me[2].t("Enable Code Execution")+"")&&j(g,v);const Ne={};if(!A&&ge&2&&(A=!0,Ne.state=me[1].ENABLE_CODE_EXECUTION,Fe(()=>A=!1)),w.$set(Ne),(!be||ge&4)&&O!==(O=me[2].t("Code Execution Engine")+"")&&j(y,O),(!be||ge&4)&&K!==(K=me[2].t("Select a engine")+"")&&j(Y,K),ge&16){Ae=Dt(me[4]);let ze;for(ze=0;ze<Ae.length;ze+=1){const Ce=oo(me,Ae,ze);Re[ze]?Re[ze].p(Ce,ge):(Re[ze]=fo(Ce),Re[ze].c(),Re[ze].m(D,null))}for(;ze<Re.length;ze+=1)Re[ze].d(1);Re.length=Ae.length}(!be||ge&4&&C!==(C=me[2].t("Select a engine")))&&u(D,"placeholder",C),ge&18&&Ft(D,me[1].CODE_EXECUTION_ENGINE),me[1].CODE_EXECUTION_ENGINE==="jupyter"?ue?ue.p(me,ge):(ue=co(me),ue.c(),ue.m(k,null)):ue&&(ue.d(1),ue=null),me[1].CODE_EXECUTION_ENGINE==="jupyter"?Ee?(Ee.p(me,ge),ge&2&&G(Ee,1)):(Ee=_o(me),Ee.c(),G(Ee,1),Ee.m(t,null)):Ee&&(ht(),W(Ee,1,1,()=>{Ee=null}),pt()),(!be||ge&4)&&J!==(J=me[2].t("Code Interpreter")+"")&&j(ie,J),(!be||ge&4)&&ae!==(ae=me[2].t("Enable Code Interpreter")+"")&&j(Te,ae);const ye={};!ne&&ge&2&&(ne=!0,ye.state=me[1].ENABLE_CODE_INTERPRETER,Fe(()=>ne=!1)),q.$set(ye),me[1].ENABLE_CODE_INTERPRETER?ee?(ee.p(me,ge),ge&2&&G(ee,1)):(ee=po(me),ee.c(),G(ee,1),ee.m(X,null)):ee&&(ht(),W(ee,1,1,()=>{ee=null}),pt())},i(me){be||(G(w.$$.fragment,me),G(Ee),G(q.$$.fragment,me),G(ee),be=!0)},o(me){W(w.$$.fragment,me),W(Ee),W(q.$$.fragment,me),W(ee),be=!1},d(me){me&&c(e),he(w),wl(Re,me),ue&&ue.d(),Ee&&Ee.d(),he(q),ee&&ee.d(),z=!1,ke()}}}function fo(l){let e,t=l[22]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[22],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function co(l){let e,t=l[2].t("Warning: Jupyter execution enables arbitrary code execution, posing severe security risks—proceed with extreme caution.")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);
141s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-gray-500 text-xs")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i&4&&t!==(t=n[2].t("Warning: Jupyter execution enables arbitrary code execution, posing severe security risks—proceed with extreme caution.")+"")&&j(s,t)},d(n){n&&c(e)}}}function _o(l){let e,t,s=l[2].t("Jupyter URL")+"",n,i,a,f,o,d,E,m,v,g,b=l[2].t("Jupyter Auth")+"",w,A,I,k,T,R=l[2].t("None")+"",O,y,L=l[2].t("Token")+"",P,D,S=l[2].t("Password")+"",K,Y,C,V,U,F,X=l[2].t("Code Execution Timeout")+"",Z,J,ie,fe,le,x,oe,se=l[1].CODE_EXECUTION_JUPYTER_AUTH&&ho(l);return fe=new Gt({props:{content:l[2].t("Enter timeout in seconds"),$$slots:{default:[Ah]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),E=N(),m=_("div"),v=_("div"),g=_("div"),w=B(b),A=N(),I=_("div"),k=_("select"),T=_("option"),O=B(R),y=_("option"),P=B(L),D=_("option"),K=B(S),C=N(),se&&se.c(),V=N(),U=_("div"),F=_("div"),Z=B(X),J=N(),ie=_("div"),ce(fe.$$.fragment),this.h()},l(te){e=h(te,"DIV",{class:!0});var ae=p(e);t=h(ae,"DIV",{class:!0});var Te=p(t);n=H(Te,s),Te.forEach(c),i=$(ae),a=h(ae,"DIV",{class:!0});var ve=p(a);f=h(ve,"DIV",{class:!0});var q=p(f);o=h(q,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),q.forEach(c),ve.forEach(c),ae.forEach(c),E=$(te),m=h(te,"DIV",{class:!0});var ne=p(m);v=h(ne,"DIV",{class:!0});var Ie=p(v);g=h(Ie,"DIV",{class:!0});var be=p(g);w=H(be,b),be.forEach(c),A=$(Ie),I=h(Ie,"DIV",{});var z=p(I);k=h(z,"SELECT",{class:!0,placeholder:!0});var ke=p(k);T=h(ke,"OPTION",{});var Ue=p(T);O=H(Ue,R),Ue.forEach(c),y=h(ke,"OPTION",{});var we=p(y);P=H(we,L),we.forEach(c),D=h(ke,"OPTION",{});var Ae=p(D);K=H(Ae,S),Ae.forEach(c),ke.forEach(c),z.forEach(c),Ie.forEach(c),C=$(ne),se&&se.l(ne),ne.forEach(c),V=$(te),U=h(te,"DIV",{class:!0});var Re=p(U);F=h(Re,"DIV",{class:!0});var ue=p(F);Z=H(ue,X),ue.forEach(c),J=$(Re),ie=h(Re,"DIV",{class:!0});var Ee=p(ie);de(fe.$$.fragment,Ee),Ee.forEach(c),Re.forEach(c),this.h()},h(){u(t,"class","text-xs font-medium"),u(o,"class","w-full text-sm py-0.5 placeholder:text-gray-300 dark:placeholder:text-gray-700 bg-transparent outline-hidden"),u(o,"type","text"),u(o,"placeholder",d=l[2].t("Enter Jupyter URL")),u(o,"autocomplete","off"),u(f,"class","flex-1"),u(a,"class","flex w-full"),u(e,"class","mb-2.5 flex flex-col gap-1.5 w-full"),u(g,"class","text-xs font-medium"),T.selected=!0,T.__value="",Q(T,T.__value),y.__value="token",Q(y,y.__value),D.__value="password",Q(D,D.__value),u(k,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-left"),u(k,"placeholder",Y=l[2].t("Select an auth method")),l[1].CODE_EXECUTION_JUPYTER_AUTH===void 0&&Cl(()=>l[9].call(k)),u(v,"class","flex gap-2 w-full items-center justify-between"),u(m,"class","mb-2.5 flex flex-col gap-1.5 w-full"),u(F,"class","text-xs font-medium"),u(ie,"class",""),u(U,"class","flex gap-2 w-full items-center justify-between")},m(te,ae){M(te,e,ae),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[1].CODE_EXECUTION_JUPYTER_URL),M(te,E,ae),M(te,m,ae),r(m,v),r(v,g),r(g,w),r(v,A),r(v,I),r(I,k),r(k,T),r(T,O),r(k,y),r(y,P),r(k,D),r(D,K),Ft(k,l[1].CODE_EXECUTION_JUPYTER_AUTH,!0),r(m,C),se&&se.m(m,null),M(te,V,ae),M(te,U,ae),r(U,F),r(F,Z),r(U,J),r(U,ie),_e(fe,ie,null),le=!0,x||(oe=[pe(o,"input",l[8]),pe(k,"change",l[9])],x=!0)},p(te,ae){(!le||ae&4)&&s!==(s=te[2].t("Jupyter URL")+"")&&j(n,s),(!le||ae&4&&d!==(d=te[2].t("Enter Jupyter URL")))&&u(o,"placeholder",d),ae&18&&o.value!==te[1].CODE_EXECUTION_JUPYTER_URL&&Q(o,te[1].CODE_EXECUTION_JUPYTER_URL),(!le||ae&4)&&b!==(b=te[2].t("Jupyter Auth")+"")&&j(w,b),(!le||ae&4)&&R!==(R=te[2].t("None")+"")&&j(O,R),(!le||ae&4)&&L!==(L=te[2].t("Token")+"")&&j(P,L),(!le||ae&4)&&S!==(S=te[2].t("Password")+"")&&j(K,S),(!le||ae&4&&Y!==(Y=te[2].t("Select an auth method")))&&u(k,"placeholder",Y),ae&18&&Ft(k,te[1].CODE_EXECUTION_JUPYTER_AUTH),te[1].CODE_EXECUTION_JUPYTER_AUTH?se?(se.p(te,ae),ae&2&&G(se,1)):(se=ho(te),se.c(),G(se,1),se.m(m,null)):se&&(ht(),W(se,1,1,()=>{se=null}),pt()),(!le||ae&4)&&X!==(X=te[2].t("Code Execution Timeout")+"")&&j(Z,X);const Te={};ae&4&&(Te.content=te[2].t("Enter timeout in seconds")),ae&134217734&&(Te.$$scope={dirty:ae,ctx:te}),fe.$set(Te)},i(te){le||(G(se),G(fe.$$.fragment,te),le=!0)},o(te){W(se),W(fe.$$.fragment,te),le=!1},d(te){te&&(c(e),c(E),c(m),c(V),c(U)),se&&se.d(),he(fe),x=!1,ml(oe)}}}function ho(l){let e,t,s,n,i;const a=[Th,wh],f=[];function o(d,E){return d[1].CODE_EXECUTION_JUPYTER_AUTH==="password"?0:1}return s=o(l),n=f[s]=a[s](l),{c(){e=_("div"),t=_("div"),n.c(),this.h()},l(d){e=h(d,"DIV",{class:!0});var E=p(e);t=h(E,"DIV",{class:!0});var m=p(t);
141n.l(m),m.forEach(c),E.forEach(c),this.h()},h(){u(t,"class","flex-1"),u(e,"class","flex w-full gap-2")},m(d,E){M(d,e,E),r(e,t),f[s].m(t,null),i=!0},p(d,E){let m=s;s=o(d),s===m?f[s].p(d,E):(ht(),W(f[m],1,1,()=>{f[m]=null}),pt(),n=f[s],n?n.p(d,E):(n=f[s]=a[s](d),n.c()),G(n,1),n.m(t,null))},i(d){i||(G(n),i=!0)},o(d){W(n),i=!1},d(d){d&&c(e),f[s].d()}}}function wh(l){let e,t,s;function n(a){l[11](a)}let i={type:"text",placeholder:l[2].t("Enter Jupyter Token"),autocomplete:"off"};return l[1].CODE_EXECUTION_JUPYTER_AUTH_TOKEN!==void 0&&(i.value=l[1].CODE_EXECUTION_JUPYTER_AUTH_TOKEN),e=new _l({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f&4&&(o.placeholder=a[2].t("Enter Jupyter Token")),!t&&f&2&&(t=!0,o.value=a[1].CODE_EXECUTION_JUPYTER_AUTH_TOKEN,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Th(l){let e,t,s;function n(a){l[10](a)}let i={type:"text",placeholder:l[2].t("Enter Jupyter Password"),autocomplete:"off"};return l[1].CODE_EXECUTION_JUPYTER_AUTH_PASSWORD!==void 0&&(i.value=l[1].CODE_EXECUTION_JUPYTER_AUTH_PASSWORD),e=new _l({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f&4&&(o.placeholder=a[2].t("Enter Jupyter Password")),!t&&f&2&&(t=!0,o.value=a[1].CODE_EXECUTION_JUPYTER_AUTH_PASSWORD,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Ah(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),this.h()},h(){u(e,"class","dark:bg-gray-900 w-fit rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(e,"type","number"),u(e,"placeholder",t=l[2].t("e.g. 60")),u(e,"autocomplete","off")},m(i,a){M(i,e,a),Q(e,l[1].CODE_EXECUTION_JUPYTER_TIMEOUT),s||(n=pe(e,"input",l[12]),s=!0)},p(i,a){a&4&&t!==(t=i[2].t("e.g. 60"))&&u(e,"placeholder",t),a&18&&Gl(e.value)!==i[1].CODE_EXECUTION_JUPYTER_TIMEOUT&&Q(e,i[1].CODE_EXECUTION_JUPYTER_TIMEOUT)},d(i){i&&c(e),s=!1,n()}}}function po(l){let e,t,s,n=l[2].t("Code Interpreter Engine")+"",i,a,f,o,d,E=l[2].t("Select a engine")+"",m,v,g,b,w,A,I,k,T,R,O=l[2].t("Code Interpreter Prompt Template")+"",y,L,P,D,S,K,Y=Dt(l[4]),C=[];for(let F=0;F<Y.length;F+=1)C[F]=vo(io(l,Y,F));let V=l[1].CODE_INTERPRETER_ENGINE==="jupyter"&&mo(l),U=l[1].CODE_INTERPRETER_ENGINE==="jupyter"&&go(l);return P=new Gt({props:{content:l[2].t("Leave empty to use the default prompt, or enter a custom prompt"),placement:"top-start",$$slots:{default:[$h]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("div"),o=_("select"),d=_("option"),m=B(E);for(let F=0;F<C.length;F+=1)C[F].c();g=N(),V&&V.c(),b=N(),U&&U.c(),w=N(),A=_("hr"),I=N(),k=_("div"),T=_("div"),R=_("div"),y=B(O),L=N(),ce(P.$$.fragment),this.h()},l(F){e=h(F,"DIV",{class:!0});var X=p(e);t=h(X,"DIV",{class:!0});var Z=p(t);s=h(Z,"DIV",{class:!0});var J=p(s);i=H(J,n),J.forEach(c),a=$(Z),f=h(Z,"DIV",{class:!0});var ie=p(f);o=h(ie,"SELECT",{class:!0,placeholder:!0});var fe=p(o);d=h(fe,"OPTION",{});var le=p(d);m=H(le,E),le.forEach(c);for(let te=0;te<C.length;te+=1)C[te].l(fe);fe.forEach(c),ie.forEach(c),Z.forEach(c),g=$(X),V&&V.l(X),X.forEach(c),b=$(F),U&&U.l(F),w=$(F),A=h(F,"HR",{class:!0}),I=$(F),k=h(F,"DIV",{});var x=p(k);T=h(x,"DIV",{class:!0});var oe=p(T);R=h(oe,"DIV",{class:!0});var se=p(R);y=H(se,O),se.forEach(c),L=$(oe),de(P.$$.fragment,oe),oe.forEach(c),x.forEach(c),this.h()},h(){u(s,"class","self-center text-xs font-medium"),d.disabled=!0,d.selected=!0,d.__value="",Q(d,d.__value),u(o,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(o,"placeholder",v=l[2].t("Select a engine")),o.required=!0,l[1].CODE_INTERPRETER_ENGINE===void 0&&Cl(()=>l[14].call(o)),u(f,"class","flex items-center relative"),u(t,"class","flex w-full justify-between"),u(e,"class","mb-2.5"),u(A,"class","border-gray-100 dark:border-gray-850 my-2"),u(R,"class","mb-2.5 text-xs font-medium"),u(T,"class","py-0.5 w-full")}
141,m(F,X){M(F,e,X),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(f,o),r(o,d),r(d,m);for(let Z=0;Z<C.length;Z+=1)C[Z]&&C[Z].m(o,null);Ft(o,l[1].CODE_INTERPRETER_ENGINE,!0),r(e,g),V&&V.m(e,null),M(F,b,X),U&&U.m(F,X),M(F,w,X),M(F,A,X),M(F,I,X),M(F,k,X),r(k,T),r(T,R),r(R,y),r(T,L),_e(P,T,null),D=!0,S||(K=pe(o,"change",l[14]),S=!0)},p(F,X){if((!D||X&4)&&n!==(n=F[2].t("Code Interpreter Engine")+"")&&j(i,n),(!D||X&4)&&E!==(E=F[2].t("Select a engine")+"")&&j(m,E),X&16){Y=Dt(F[4]);let J;for(J=0;J<Y.length;J+=1){const ie=io(F,Y,J);C[J]?C[J].p(ie,X):(C[J]=vo(ie),C[J].c(),C[J].m(o,null))}for(;J<C.length;J+=1)C[J].d(1);C.length=Y.length}(!D||X&4&&v!==(v=F[2].t("Select a engine")))&&u(o,"placeholder",v),X&18&&Ft(o,F[1].CODE_INTERPRETER_ENGINE),F[1].CODE_INTERPRETER_ENGINE==="jupyter"?V?V.p(F,X):(V=mo(F),V.c(),V.m(e,null)):V&&(V.d(1),V=null),F[1].CODE_INTERPRETER_ENGINE==="jupyter"?U?(U.p(F,X),X&2&&G(U,1)):(U=go(F),U.c(),G(U,1),U.m(w.parentNode,w)):U&&(ht(),W(U,1,1,()=>{U=null}),pt()),(!D||X&4)&&O!==(O=F[2].t("Code Interpreter Prompt Template")+"")&&j(y,O);const Z={};X&4&&(Z.content=F[2].t("Leave empty to use the default prompt, or enter a custom prompt")),X&134217734&&(Z.$$scope={dirty:X,ctx:F}),P.$set(Z)},i(F){D||(G(U),G(P.$$.fragment,F),D=!0)},o(F){W(U),W(P.$$.fragment,F),D=!1},d(F){F&&(c(e),c(b),c(w),c(A),c(I),c(k)),wl(C,F),V&&V.d(),U&&U.d(F),he(P),S=!1,K()}}}function vo(l){let e,t=l[22]+"",s;return{c(){e=_("option"),s=B(t),this.h()},l(n){e=h(n,"OPTION",{});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){e.__value=l[22],Q(e,e.__value)},m(n,i){M(n,e,i),r(e,s)},p:st,d(n){n&&c(e)}}}function mo(l){let e,t=l[2].t("Warning: Jupyter execution enables arbitrary code execution, posing severe security risks—proceed with extreme caution.")+"",s;return{c(){e=_("div"),s=B(t),this.h()},l(n){e=h(n,"DIV",{class:!0});var i=p(e);s=H(i,t),i.forEach(c),this.h()},h(){u(e,"class","text-gray-500 text-xs")},m(n,i){M(n,e,i),r(e,s)},p(n,i){i&4&&t!==(t=n[2].t("Warning: Jupyter execution enables arbitrary code execution, posing severe security risks—proceed with extreme caution.")+"")&&j(s,t)},d(n){n&&c(e)}}}function go(l){let e,t,s=l[2].t("Jupyter URL")+"",n,i,a,f,o,d,E,m,v,g,b=l[2].t("Jupyter Auth")+"",w,A,I,k,T,R=l[2].t("None")+"",O,y,L=l[2].t("Token")+"",P,D,S=l[2].t("Password")+"",K,Y,C,V,U,F,X=l[2].t("Code Execution Timeout")+"",Z,J,ie,fe,le,x,oe,se=l[1].CODE_INTERPRETER_JUPYTER_AUTH&&Eo(l);return fe=new Gt({props:{content:l[2].t("Enter timeout in seconds"),$$slots:{default:[Nh]},$$scope:{ctx:l}}}),{c(){e=_("div"),t=_("div"),n=B(s),i=N(),a=_("div"),f=_("div"),o=_("input"),E=N(),m=_("div"),v=_("div"),g=_("div"),w=B(b),A=N(),I=_("div"),k=_("select"),T=_("option"),O=B(R),y=_("option"),P=B(L),D=_("option"),K=B(S),C=N(),se&&se.c(),V=N(),U=_("div"),F=_("div"),Z=B(X),J=N(),ie=_("div"),ce(fe.$$.fragment),this.h()},l(te){e=h(te,"DIV",{class:!0});var ae=p(e);t=h(ae,"DIV",{class:!0});var Te=p(t);n=H(Te,s),Te.forEach(c),i=$(ae),a=h(ae,"DIV",{class:!0});var ve=p(a);f=h(ve,"DIV",{class:!0});var q=p(f);o=h(q,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),q.forEach(c),ve.forEach(c),ae.forEach(c),E=$(te),m=h(te,"DIV",{class:!0});var ne=p(m);v=h(ne,"DIV",{class:!0});var Ie=p(v);g=h(Ie,"DIV",{class:!0});var be=p(g);w=H(be,b),be.forEach(c),A=$(Ie),I=h(Ie,"DIV",{});var z=p(I);k=h(z,"SELECT",{class:!0,placeholder:!0});var ke=p(k);T=h(ke,"OPTION",{});var Ue=p(T);O=H(Ue,R),Ue.forEach(c),y=h(ke,"OPTION",{});var we=p(y);P=H(we,L),we.forEach(c),D=h(ke,"OPTION",{});var Ae=p(D);K=H(Ae,S),Ae.forEach(c),ke.forEach(c),z.forEach(c),Ie.forEach(c),C=$(ne),se&&se.l(ne),ne.forEach(c),V=$(te),U=h(te,"DIV",{class:!0});var Re=p(U);F=h(Re,"DIV",{class:!0});var ue=p(F);Z=H(ue,X),ue.forEach(c),J=$(Re),ie=h(Re,"DIV",{class:!0});var Ee=p(ie);de(fe.$$.fragment,Ee),Ee.forEach(c),Re.forEach(c),this.h()},h(){u(t,"class","text-xs font-medium"),u(o,"class","w-full text-sm py-0.5 placeholder:text-gray-300 dark:placeholder:text-gray-700 bg-transparent outline-hidden"),u(o,"type","text"),u(o,"placeholder",d=l[2].t("Enter Jupyter URL")),u(o,"autocomplete","off"),u(f,"class","flex-1"),u(a,"class","flex w-full"),u(e,"class","mb-2.5 flex flex-col gap-1.5 w-full"),u(g,"class","text-xs font-medium"),T.selected=!0,T.__value="",Q(T,T.__value),y.__value="token",Q(y,y.__value),D.__value="password",Q(D,D.__value),u(k,"class","dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-left"),u(k,"placeholder",Y=l[2].t("Select an auth method")),l[1].CODE_INTERPRETER_JUPYTER_AUTH===void 0&&Cl(()=>
141l[16].call(k)),u(v,"class","flex gap-2 w-full items-center justify-between"),u(m,"class","mb-2.5 flex flex-col gap-1.5 w-full"),u(F,"class","text-xs font-medium"),u(ie,"class",""),u(U,"class","flex gap-2 w-full items-center justify-between")},m(te,ae){M(te,e,ae),r(e,t),r(t,n),r(e,i),r(e,a),r(a,f),r(f,o),Q(o,l[1].CODE_INTERPRETER_JUPYTER_URL),M(te,E,ae),M(te,m,ae),r(m,v),r(v,g),r(g,w),r(v,A),r(v,I),r(I,k),r(k,T),r(T,O),r(k,y),r(y,P),r(k,D),r(D,K),Ft(k,l[1].CODE_INTERPRETER_JUPYTER_AUTH,!0),r(m,C),se&&se.m(m,null),M(te,V,ae),M(te,U,ae),r(U,F),r(F,Z),r(U,J),r(U,ie),_e(fe,ie,null),le=!0,x||(oe=[pe(o,"input",l[15]),pe(k,"change",l[16])],x=!0)},p(te,ae){(!le||ae&4)&&s!==(s=te[2].t("Jupyter URL")+"")&&j(n,s),(!le||ae&4&&d!==(d=te[2].t("Enter Jupyter URL")))&&u(o,"placeholder",d),ae&18&&o.value!==te[1].CODE_INTERPRETER_JUPYTER_URL&&Q(o,te[1].CODE_INTERPRETER_JUPYTER_URL),(!le||ae&4)&&b!==(b=te[2].t("Jupyter Auth")+"")&&j(w,b),(!le||ae&4)&&R!==(R=te[2].t("None")+"")&&j(O,R),(!le||ae&4)&&L!==(L=te[2].t("Token")+"")&&j(P,L),(!le||ae&4)&&S!==(S=te[2].t("Password")+"")&&j(K,S),(!le||ae&4&&Y!==(Y=te[2].t("Select an auth method")))&&u(k,"placeholder",Y),ae&18&&Ft(k,te[1].CODE_INTERPRETER_JUPYTER_AUTH),te[1].CODE_INTERPRETER_JUPYTER_AUTH?se?(se.p(te,ae),ae&2&&G(se,1)):(se=Eo(te),se.c(),G(se,1),se.m(m,null)):se&&(ht(),W(se,1,1,()=>{se=null}),pt()),(!le||ae&4)&&X!==(X=te[2].t("Code Execution Timeout")+"")&&j(Z,X);const Te={};ae&4&&(Te.content=te[2].t("Enter timeout in seconds")),ae&134217734&&(Te.$$scope={dirty:ae,ctx:te}),fe.$set(Te)},i(te){le||(G(se),G(fe.$$.fragment,te),le=!0)},o(te){W(se),W(fe.$$.fragment,te),le=!1},d(te){te&&(c(e),c(E),c(m),c(V),c(U)),se&&se.d(),he(fe),x=!1,ml(oe)}}}function Eo(l){let e,t,s,n,i;const a=[Dh,kh],f=[];function o(d,E){return d[1].CODE_INTERPRETER_JUPYTER_AUTH==="password"?0:1}return s=o(l),n=f[s]=a[s](l),{c(){e=_("div"),t=_("div"),n.c(),this.h()},l(d){e=h(d,"DIV",{class:!0});var E=p(e);t=h(E,"DIV",{class:!0});var m=p(t);n.l(m),m.forEach(c),E.forEach(c),this.h()},h(){u(t,"class","flex-1"),u(e,"class","flex w-full gap-2")},m(d,E){M(d,e,E),r(e,t),f[s].m(t,null),i=!0},p(d,E){let m=s;s=o(d),s===m?f[s].p(d,E):(ht(),W(f[m],1,1,()=>{f[m]=null}),pt(),n=f[s],n?n.p(d,E):(n=f[s]=a[s](d),n.c()),G(n,1),n.m(t,null))},i(d){i||(G(n),i=!0)},o(d){W(n),i=!1},d(d){d&&c(e),f[s].d()}}}function kh(l){let e,t,s;function n(a){l[18](a)}let i={type:"text",placeholder:l[2].t("Enter Jupyter Token"),autocomplete:"off"};return l[1].CODE_INTERPRETER_JUPYTER_AUTH_TOKEN!==void 0&&(i.value=l[1].CODE_INTERPRETER_JUPYTER_AUTH_TOKEN),e=new _l({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f&4&&(o.placeholder=a[2].t("Enter Jupyter Token")),!t&&f&2&&(t=!0,o.value=a[1].CODE_INTERPRETER_JUPYTER_AUTH_TOKEN,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Dh(l){let e,t,s;function n(a){l[17](a)}let i={type:"text",placeholder:l[2].t("Enter Jupyter Password"),autocomplete:"off"};return l[1].CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD!==void 0&&(i.value=l[1].CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD),e=new _l({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f&4&&(o.placeholder=a[2].t("Enter Jupyter Password")),!t&&f&2&&(t=!0,o.value=a[1].CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Nh(l){let e,t,s,n;return{c(){e=_("input"),this.h()},l(i){e=h(i,"INPUT",{class:!0,type:!0,placeholder:!0,autocomplete:!0}),this.h()},h(){u(e,"class","dark:bg-gray-900 w-fit rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"),u(e,"type","number"),u(e,"placeholder",t=l[2].t("e.g. 60")),u(e,"autocomplete","off")},m(i,a){M(i,e,a),Q(e,l[1].CODE_INTERPRETER_JUPYTER_TIMEOUT),s||(n=pe(e,"input",l[19]),s=!0)},p(i,a){a&4&&t!==(t=i[2].t("e.g. 60"))&&u(e,"placeholder",t),a&18&&Gl(e.value)!==i[1].CODE_INTERPRETER_JUPYTER_TIMEOUT&&Q(e,i[1].CODE_INTERPRETER_JUPYTER_TIMEOUT)},d(i){i&&c(e),s=!1,n()}}}function $h(l){let e,t,s;function n(a){l[20](a)}let i={placeholder:l[2].t("Leave empty to use the default prompt, or enter a custom prompt")};return l[1].CODE_INTERPRETER_PROMPT_TEMPLATE!==void 0&&(i.value=l[1].CODE_INTERPRETER_PROMPT_TEMPLATE),e=new Js({props:i}),Ye.push(()=>qe(e,"value",n)),{c(){ce(e.$$.fragment)},l(a){de(e.$$.fragment,a)},m(a,f){_e(e,a,f),s=!0},p(a,f){const o={};f&4&&(o.placeholder=a[2].t("Leave empty to use the default prompt, or enter a custom prompt")),!t&&f&2&&(t=!0,o.value=a[1].CODE_INTERPRETER_PROMPT_TEMPLATE,Fe(()=>t=!1)),e.$set(o)},i(a){s||(G(e.$$.fragment,a),s=!0)},o(a){W(e.$$.fragment,a),s=!1},d(a){he(e,a)}}}function Rh(l){let e,t,s,n,i,a=l[2].t("Save")+"",f,o,d,E,m=l[1]&&uo(l);return{c(){e=_("form"),t=_("div"),m&&m.c(),s=N(),n=_("div"),i=_("button"),f=B(a),this.h()},l(v){e=h(v,"FORM",{class:!0});var g=p(e);t=h(g,"DIV",{class:!0});var b=p(t);m&&m.l(b),b.forEach(c),s=$(g),n=h(g,"DIV",{class:!0});var w=p(n);i=h(w,"BUTTON",{class:!0,type:!0});var A=p(i);
141f=H(A,a),A.forEach(c),w.forEach(c),g.forEach(c),this.h()},h(){u(t,"class","space-y-3 overflow-y-scroll scrollbar-hidden h-full"),u(i,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(i,"type","submit"),u(n,"class","flex justify-end pt-3 text-sm font-medium"),u(e,"class","flex flex-col h-full justify-between space-y-3 text-sm")},m(v,g){M(v,e,g),r(e,t),m&&m.m(t,null),r(e,s),r(e,n),r(n,i),r(i,f),o=!0,d||(E=pe(e,"submit",ds(l[21])),d=!0)},p(v,[g]){v[1]?m?(m.p(v,g),g&2&&G(m,1)):(m=uo(v),m.c(),G(m,1),m.m(t,null)):m&&(ht(),W(m,1,1,()=>{m=null}),pt()),(!o||g&4)&&a!==(a=v[2].t("Save")+"")&&j(f,a)},i(v){o||(G(m),o=!0)},o(v){W(m),o=!1},d(v){v&&c(e),m&&m.d(),d=!1,E()}}}function Oh(l,e,t){let s;const n=Ul("i18n");qt(l,n,D=>t(2,s=D));let{saveHandler:i}=e,a=null,f=["pyodide","jupyter"];const o=async()=>{await bu(localStorage.token,a)};rs(async()=>{const D=await Eu(localStorage.token);D&&t(1,a=D)});function d(D){l.$$.not_equal(a.ENABLE_CODE_EXECUTION,D)&&(a.ENABLE_CODE_EXECUTION=D,t(1,a))}function E(){a.CODE_EXECUTION_ENGINE=Ll(this),t(1,a),t(4,f)}function m(){a.CODE_EXECUTION_JUPYTER_URL=this.value,t(1,a),t(4,f)}function v(){a.CODE_EXECUTION_JUPYTER_AUTH=Ll(this),t(1,a),t(4,f)}function g(D){l.$$.not_equal(a.CODE_EXECUTION_JUPYTER_AUTH_PASSWORD,D)&&(a.CODE_EXECUTION_JUPYTER_AUTH_PASSWORD=D,t(1,a))}function b(D){l.$$.not_equal(a.CODE_EXECUTION_JUPYTER_AUTH_TOKEN,D)&&(a.CODE_EXECUTION_JUPYTER_AUTH_TOKEN=D,t(1,a))}function w(){a.CODE_EXECUTION_JUPYTER_TIMEOUT=Gl(this.value),t(1,a),t(4,f)}function A(D){l.$$.not_equal(a.ENABLE_CODE_INTERPRETER,D)&&(a.ENABLE_CODE_INTERPRETER=D,t(1,a))}function I(){a.CODE_INTERPRETER_ENGINE=Ll(this),t(1,a),t(4,f)}function k(){a.CODE_INTERPRETER_JUPYTER_URL=this.value,t(1,a),t(4,f)}function T(){a.CODE_INTERPRETER_JUPYTER_AUTH=Ll(this),t(1,a),t(4,f)}function R(D){l.$$.not_equal(a.CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD,D)&&(a.CODE_INTERPRETER_JUPYTER_AUTH_PASSWORD=D,t(1,a))}function O(D){l.$$.not_equal(a.CODE_INTERPRETER_JUPYTER_AUTH_TOKEN,D)&&(a.CODE_INTERPRETER_JUPYTER_AUTH_TOKEN=D,t(1,a))}function y(){a.CODE_INTERPRETER_JUPYTER_TIMEOUT=Gl(this.value),t(1,a),t(4,f)}function L(D){l.$$.not_equal(a.CODE_INTERPRETER_PROMPT_TEMPLATE,D)&&(a.CODE_INTERPRETER_PROMPT_TEMPLATE=D,t(1,a))}const P=async()=>{await o(),i()};return l.$$set=D=>{"saveHandler"in D&&t(0,i=D.saveHandler)},[i,a,s,n,f,o,d,E,m,v,g,b,w,A,I,k,T,R,O,y,L,P]}class Sh extends Sl{constructor(e){super(),Pl(this,e,Oh,Rh,Ol,{saveHandler:0})}}function bo(l,e,t){const s=l.slice();return s[14]=e[t],s[15]=e,s[16]=t,s}function Ph(l){let e,t,s,n;return s=new Ps({props:{className:"size-6"}}),{c(){e=_("div"),t=_("div"),ce(s.$$.fragment),this.h()},l(i){e=h(i,"DIV",{class:!0});var a=p(e);t=h(a,"DIV",{class:!0});var f=p(t);de(s.$$.fragment,f),f.forEach(c),a.forEach(c),this.h()},h(){u(t,"class","my-auto"),u(e,"class","flex h-full justify-center")},m(i,a){M(i,e,a),r(e,t),_e(s,t,null),n=!0},p:st,i(i){n||(G(s.$$.fragment,i),n=!0)},o(i){W(s.$$.fragment,i),n=!1},d(i){i&&c(e),he(s)}}}function Vh(l){let e,t,s,n=l[2].t("General")+"",i,a,f,o,d,E,m,v=l[2].t("Manage Tool Servers")+"",g,b,w,A,I,k,T,R,O=l[2].t("Connect to your own OpenAPI compatible external tool servers.")+"",y,L;w=new Gt({props:{content:l[2].t("Add Connection"),$$slots:{default:[yh]},$$scope:{ctx:l}}});let P=Dt(l[0]),D=[];for(let K=0;K<P.length;K+=1)D[K]=Io(bo(l,P,K));const S=K=>W(D[K],1,1,()=>{D[K]=null});return{c(){e=_("div"),t=_("div"),s=_("div"),i=B(n),a=N(),f=_("hr"),o=N(),d=_("div"),E=_("div"),m=_("div"),g=B(v),b=N(),ce(w.$$.fragment),A=N(),I=_("div");for(let K=0;K<D.length;K+=1)D[K].c();k=N(),T=_("div"),R=_("div"),y=B(O),this.h()},l(K){e=h(K,"DIV",{class:!0});var Y=p(e);t=h(Y,"DIV",{class:!0});var C=p(t);s=h(C,"DIV",{class:!0});var V=p(s);i=H(V,n),V.forEach(c),a=$(C),f=h(C,"HR",{class:!0}),o=$(C),d=h(C,"DIV",{class:!0});var U=p(d);E=h(U,"DIV",{class:!0});var F=p(E);m=h(F,"DIV",{class:!0});var X=p(m);g=H(X,v),X.forEach(c),b=$(F),de(w.$$.fragment,F),F.forEach(c),A=$(U),I=h(U,"DIV",{class:!0});var Z=p(I);for(let fe=0;fe<D.length;fe+=1)D[fe].l(Z);Z.forEach(c),k=$(U),T=h(U,"DIV",{class:!0});var J=p(T);R=h(J,"DIV",{class:!0});var ie=p(R);
141y=H(ie,O),ie.forEach(c),J.forEach(c),U.forEach(c),C.forEach(c),Y.forEach(c),this.h()},h(){u(s,"class","mb-2.5 text-base font-medium"),u(f,"class","border-gray-100 dark:border-gray-850 my-2"),u(m,"class","font-medium"),u(E,"class","flex justify-between items-center mb-0.5"),u(I,"class","flex flex-col gap-1.5"),u(R,"class","text-xs text-gray-500"),u(T,"class","my-1.5"),u(d,"class","mb-2.5 flex flex-col w-full justify-between"),u(t,"class","mb-3"),u(e,"class","")},m(K,Y){M(K,e,Y),r(e,t),r(t,s),r(s,i),r(t,a),r(t,f),r(t,o),r(t,d),r(d,E),r(E,m),r(m,g),r(E,b),_e(w,E,null),r(d,A),r(d,I);for(let C=0;C<D.length;C+=1)D[C]&&D[C].m(I,null);r(d,k),r(d,T),r(T,R),r(R,y),L=!0},p(K,Y){(!L||Y&4)&&n!==(n=K[2].t("General")+"")&&j(i,n),(!L||Y&4)&&v!==(v=K[2].t("Manage Tool Servers")+"")&&j(g,v);const C={};if(Y&4&&(C.content=K[2].t("Add Connection")),Y&131074&&(C.$$scope={dirty:Y,ctx:K}),w.$set(C),Y&33){P=Dt(K[0]);let V;for(V=0;V<P.length;V+=1){const U=bo(K,P,V);D[V]?(D[V].p(U,Y),G(D[V],1)):(D[V]=Io(U),D[V].c(),G(D[V],1),D[V].m(I,null))}for(ht(),V=P.length;V<D.length;V+=1)S(V);pt()}(!L||Y&4)&&O!==(O=K[2].t("Connect to your own OpenAPI compatible external tool servers.")+"")&&j(y,O)},i(K){if(!L){G(w.$$.fragment,K);for(let Y=0;Y<P.length;Y+=1)G(D[Y]);L=!0}},o(K){W(w.$$.fragment,K),D=D.filter(Boolean);for(let Y=0;Y<D.length;Y+=1)W(D[Y]);L=!1},d(K){K&&c(e),he(w),wl(D,K)}}}function yh(l){let e,t,s,n,i;return t=new pn({}),{c(){e=_("button"),ce(t.$$.fragment),this.h()},l(a){e=h(a,"BUTTON",{class:!0,type:!0});var f=p(e);de(t.$$.fragment,f),f.forEach(c),this.h()},h(){u(e,"class","px-1"),u(e,"type","button")},m(a,f){M(a,e,f),_e(t,e,null),s=!0,n||(i=pe(e,"click",l[8]),n=!0)},p:st,i(a){s||(G(t.$$.fragment,a),s=!0)},o(a){W(t.$$.fragment,a),s=!1},d(a){a&&c(e),he(t),n=!1,i()}}}function Io(l){let e,t,s;function n(){return l[10](l[16])}function i(f){l[11](f,l[14],l[15],l[16])}let a={onSubmit:l[9],onDelete:n};return l[14]!==void 0&&(a.connection=l[14]),e=new Au({props:a}),Ye.push(()=>qe(e,"connection",i)),{c(){ce(e.$$.fragment)},l(f){de(e.$$.fragment,f)},m(f,o){_e(e,f,o),s=!0},p(f,o){l=f;const d={};o&1&&(d.onDelete=n),!t&&o&1&&(t=!0,d.connection=l[14],Fe(()=>t=!1)),e.$set(d)},i(f){s||(G(e.$$.fragment,f),s=!0)},o(f){W(e.$$.fragment,f),s=!1},d(f){he(e,f)}}}function Lh(l){let e,t,s,n,i,a,f,o,d,E,m=l[2].t("Save")+"",v,g,b,w;function A(O){l[7](O)}let I={onSubmit:l[4]};l[1]!==void 0&&(I.show=l[1]),e=new Iu({props:I}),Ye.push(()=>qe(e,"show",A));const k=[Vh,Ph],T=[];function R(O,y){return O[0]!==null?0:1}return a=R(l),f=T[a]=k[a](l),{c(){ce(e.$$.fragment),s=N(),n=_("form"),i=_("div"),f.c(),o=N(),d=_("div"),E=_("button"),v=B(m),this.h()},l(O){de(e.$$.fragment,O),s=$(O),n=h(O,"FORM",{class:!0});var y=p(n);i=h(y,"DIV",{class:!0});var L=p(i);f.l(L),L.forEach(c),o=$(y),d=h(y,"DIV",{class:!0});var P=p(d);E=h(P,"BUTTON",{class:!0,type:!0});var D=p(E);v=H(D,m),D.forEach(c),P.forEach(c),y.forEach(c),this.h()},h(){u(i,"class","overflow-y-scroll scrollbar-hidden h-full"),u(E,"class","px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"),u(E,"type","submit"),u(d,"class","flex justify-end pt-3 text-sm font-medium"),u(n,"class","flex flex-col h-full justify-between text-sm")},m(O,y){_e(e,O,y),M(O,s,y),M(O,n,y),r(n,i),T[a].m(i,null),r(n,o),r(n,d),r(d,E),r(E,v),g=!0,b||(w=pe(n,"submit",ds(l[12])),b=!0)},p(O,[y]){const L={};!t&&y&2&&(t=!0,L.show=O[1],Fe(()=>t=!1)),e.$set(L);let P=a;a=R(O),a===P?T[a].p(O,y):(ht(),W(T[P],1,1,()=>{T[P]=null}),pt(),f=T[a],f?f.p(O,y):(f=T[a]=k[a](O),f.c()),G(f,1),f.m(i,null)),(!g||y&4)&&m!==(m=O[2].t("Save")+"")&&j(v,m)},i(O){g||(G(e.$$.fragment,O),G(f),g=!0)},o(O){W(e.$$.fragment,O),W(f),g=!1},d(O){O&&(c(s),c(n)),he(e,O),T[a].d(),b=!1,w()}}}function Ch(l,e,t){let s;Ss();const n=Ul("i18n");qt(l,n,A=>t(2,s=A));let{saveSettings:i}=e,a=null,f=!1;const o=async A=>{t(0,a=[...a,A]),await d()},d=async()=>{await Tu(localStorage.token,{TOOL_SERVER_CONNECTIONS:a}).catch(I=>(Je.error(s.t("Failed to save connections")),null))&&Je.success(s.t("Connections saved successfully"))};rs(async()=>{const A=await wu(localStorage.token);t(0,a=A.TOOL_SERVER_CONNECTIONS)});function E(A){f=A,t(1,f)}const m=()=>{t(1,f=!0)},v=()=>{d()},g=A=>{t(0,a=a.filter((I,k)=>k!==A)),d()};function b(A,I,k,T){k[T]=A,t(0,a)}const w=()=>{d()};return l.$$set=A=>{"saveSettings"in A&&t(6,i=A.saveSettings)},[a,f,s,n,o,d,i,E,m,v,g,b,w]}class Uh extends Sl{constructor(e){super(),Pl(this,e,Ch,Lh,Ol,{saveSettings:6})}}function Mh(l){let e,t;return e=new oc({props:{saveHandler:l[25]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[25]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Bh(l){let e,t;return e=new Af({props:{saveHandler:l[24]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[24]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Hh(l){let e,t;return e=new Hc({}),e.$on("save",l[23]),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Gh(l){let e,t;return e=new kc({props:{saveHandler:l[22]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[22]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Kh(l){let e,t;return e=new Qc({}),e.$on("save",l[21]),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Yh(l){let e,t;return e=new Sh({props:{saveHandler:l[20]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[20]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function jh(l){let e,t;return e=new z1({props:{saveHandler:l[19]}}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[19]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Wh(l){let e,t;return e=new A1({}),e.$on("save",l[18]),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Fh(l){let e,t;return e=new Uh({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function qh(l){let e,t;return e=new Ih({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Zh(l){let e,t;return e=new S_({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Xh(l){let e,t;return e=new e1({}),e.$on("save",l[17]),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function Jh(l){let e,t;return e=new Cf({props:{saveHandler:l[16]}}
141),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p(s,n){const i={};n&2&&(i.saveHandler=s[16]),e.$set(i)},i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}function zh(l){let e,t,s,n,i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M6.955 1.45A.5.5 0 0 1 7.452 1h1.096a.5.5 0 0 1 .497.45l.17 1.699c.484.12.94.312 1.356.562l1.321-1.081a.5.5 0 0 1 .67.033l.774.775a.5.5 0 0 1 .034.67l-1.08 1.32c.25.417.44.873.561 1.357l1.699.17a.5.5 0 0 1 .45.497v1.096a.5.5 0 0 1-.45.497l-1.699.17c-.12.484-.312.94-.562 1.356l1.082 1.322a.5.5 0 0 1-.034.67l-.774.774a.5.5 0 0 1-.67.033l-1.322-1.08c-.416.25-.872.44-1.356.561l-.17 1.699a.5.5 0 0 1-.497.45H7.452a.5.5 0 0 1-.497-.45l-.17-1.699a4.973 4.973 0 0 1-1.356-.562L4.108 13.37a.5.5 0 0 1-.67-.033l-.774-.775a.5.5 0 0 1-.034-.67l1.08-1.32a4.971 4.971 0 0 1-.561-1.357l-1.699-.17A.5.5 0 0 1 1 8.548V7.452a.5.5 0 0 1 .45-.497l1.699-.17c.12-.484.312-.94.562-1.356L2.629 4.107a.5.5 0 0 1 .034-.67l.774-.774a.5.5 0 0 1 .67-.033L5.43 3.71a4.97 4.97 0 0 1 1.356-.561l.17-1.699ZM6 8c0 .538.212 1.026.558 1.385l.057.057a2 2 0 0 0 2.828-2.828l-.058-.056A2 2 0 0 0 6 8Z" clip-rule="evenodd"></path></svg>',a,f,o=l[1].t("General")+"",d,E,m,v,g,b='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M1 9.5A3.5 3.5 0 0 0 4.5 13H12a3 3 0 0 0 .917-5.857 2.503 2.503 0 0 0-3.198-3.019 3.5 3.5 0 0 0-6.628 2.171A3.5 3.5 0 0 0 1 9.5Z"></path></svg>',w,A,I=l[1].t("Connections")+"",k,T,R,O,y,L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M10 1c3.866 0 7 1.79 7 4s-3.134 4-7 4-7-1.79-7-4 3.134-4 7-4zm5.694 8.13c.464-.264.91-.583 1.306-.952V10c0 2.21-3.134 4-7 4s-7-1.79-7-4V8.178c.396.37.842.688 1.306.953C5.838 10.006 7.854 10.5 10 10.5s4.162-.494 5.694-1.37zM3 13.179V15c0 2.21 3.134 4 7 4s7-1.79 7-4v-1.822c-.396.37-.842.688-1.306.953-1.532.875-3.548 1.369-5.694 1.369s-4.162-.494-5.694-1.37A7.009 7.009 0 013 13.179z" clip-rule="evenodd"></path></svg>',P,D,S=l[1].t("Models")+"",K,Y,C,V,U,F,X,Z,J=l[1].t("Evaluations")+"",ie,fe,le,x,oe,se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-4"><path fill-rule="evenodd" d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z" clip-rule="evenodd"></path></svg>',te,ae,Te=l[1].t("Tools")+"",ve,q,ne,Ie,be,z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4"><path d="M11.625 16.5a1.875 1.875 0 1 0 0-3.75 1.875 1.875 0 0 0 0 3.75Z"></path><path fill-rule="evenodd" d="M5.625 1.5H9a3.75 3.75 0 0 1 3.75 3.75v1.875c0 1.036.84 1.875 1.875 1.875H16.5a3.75 3.75 0 0 1 3.75 3.75v7.875c0 1.035-.84 1.875-1.875 1.875H5.625a1.875 1.875 0 0 1-1.875-1.875V3.375c0-1.036.84-1.875 1.875-1.875Zm6 16.5c.66 0 1.277-.19 1.797-.518l1.048 1.048a.75.75 0 0 0 1.06-1.06l-1.047-1.048A3.375 3.375 0 1 0 11.625 18Z" clip-rule="evenodd"></path><path d="M14.25 5.25a5.23 5.23 0 0 0-1.279-3.434 9.768 9.768 0 0 1 6.963 6.963A5.23 5.23 0 0 0 16.5 7.5h-1.875a.375.375 0 0 1-.375-.375V5.25Z"></path></svg>',ke,Ue,we=l[1].t("Documents")+"",Ae,Re,ue,Ee,Me,Ge='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4"><path d="M21.721 12.752a9.711 9.711 0 0 0-.945-5.003 12.754 12.754 0 0 1-4.339 2.708 18.991 18.991 0 0 1-.214 4.772 17.165 17.165 0 0 0 5.498-2.477ZM14.634 15.55a17.324 17.324 0 0 0 .332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 0 0 .332 4.647 17.385 17.385 0 0 0 5.268 0ZM9.772 17.119a18.963 18.963 0 0 0 4.456 0A17.182 17.182 0 0 1 12 21.724a17.18 17.18 0 0 1-2.228-4.605ZM7.777 15.23a18.87 18.87 0 0 1-.214-4.774 12.753 12.753 0 0 1-4.34-2.708 9.711 9.711 0 0 0-.944 5.004 17.165 17.165 0 0 0 5.498 2.477ZM21.356 14.752a9.765 9.765 0 0 1-7.478 6.817 18.64 18.64 0 0 0 1.988-4.718 18.627 18.627 0 0 0 5.49-2.098ZM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 0 0 1.988 4.718 9.765 9.765 0 0 1-7.478-6.816ZM13.878 2.43a9.755 9.755 0 0 1 6.116 3.986 11.267 11.267 0 0 1-3.746 2.504 18.63 18.63 0 0 0-2.37-6.49ZM12 2.276a17.152 17.152 0 0 1 2.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0 1 12 2.276ZM10.122 2.43a18.629 18.629 0 0 0-2.37 6.49 11.266 11.266 0 0 1-3.746-2.504 9.754 9.754 0 0 1 6.116-3.985Z"></path></svg>
141',ee,me,ge=l[1].t("Web Search")+"",Ne,ye,ze,Ce,Le,Ke='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4"><path fill-rule="evenodd" d="M2 4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm2.22 1.97a.75.75 0 0 0 0 1.06l.97.97-.97.97a.75.75 0 1 0 1.06 1.06l1.5-1.5a.75.75 0 0 0 0-1.06l-1.5-1.5a.75.75 0 0 0-1.06 0ZM8.75 8.5a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5h-2.5Z" clip-rule="evenodd"></path></svg>',re,$e,ut=l[1].t("Code Execution")+"",ft,ct,Be,Ve,je,Rt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M2 4.25A2.25 2.25 0 0 1 4.25 2h7.5A2.25 2.25 0 0 1 14 4.25v5.5A2.25 2.25 0 0 1 11.75 12h-1.312c.1.128.21.248.328.36a.75.75 0 0 1 .234.545v.345a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1-.75-.75v-.345a.75.75 0 0 1 .234-.545c.118-.111.228-.232.328-.36H4.25A2.25 2.25 0 0 1 2 9.75v-5.5Zm2.25-.75a.75.75 0 0 0-.75.75v4.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 0 0-.75-.75h-7.5Z" clip-rule="evenodd"></path></svg>',Ot,_t,Et=l[1].t("Interface")+"",At,Tt,Ut,rt,bt,lt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124ZM12.95 3.05a.75.75 0 1 0-1.06 1.06 5.5 5.5 0 0 1 0 7.78.75.75 0 1 0 1.06 1.06 7 7 0 0 0 0-9.9Z"></path><path d="M10.828 5.172a.75.75 0 1 0-1.06 1.06 2.5 2.5 0 0 1 0 3.536.75.75 0 1 0 1.06 1.06 4 4 0 0 0 0-5.656Z"></path></svg>',He,at,Vt=l[1].t("Audio")+"",Qe,yt,wt,vt,It,el='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path fill-rule="evenodd" d="M2 4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm10.5 5.707a.5.5 0 0 0-.146-.353l-1-1a.5.5 0 0 0-.708 0L9.354 9.646a.5.5 0 0 1-.708 0L6.354 7.354a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0-.146.353V12a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V9.707ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" clip-rule="evenodd"></path></svg>',Kt,Lt,ol=l[1].t("Images")+"",Tl,Se,De,Pe,kt,We='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-4"><path d="M11.644 1.59a.75.75 0 0 1 .712 0l9.75 5.25a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.712 0l-9.75-5.25a.75.75 0 0 1 0-1.32l9.75-5.25Z"></path><path d="m3.265 10.602 7.668 4.129a2.25 2.25 0 0 0 2.134 0l7.668-4.13 1.37.739a.75.75 0 0 1 0 1.32l-9.75 5.25a.75.75 0 0 1-.71 0l-9.75-5.25a.75.75 0 0 1 0-1.32l1.37-.738Z"></path><path d="m10.933 19.231-7.668-4.13-1.37.739a.75.75 0 0 0 0 1.32l9.75 5.25c.221.12.489.12.71 0l9.75-5.25a.75.75 0 0 0 0-1.32l-1.37-.738-7.668 4.13a2.25 2.25 0 0 1-2.134-.001Z"></path></svg>',it,Mt,xe=l[1].t("Pipelines")+"",mt,Bt,Ze,nt,Yt,tl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4"><path d="M8 7c3.314 0 6-1.343 6-3s-2.686-3-6-3-6 1.343-6 3 2.686 3 6 3Z"></path><path d="M8 8.5c1.84 0 3.579-.37 4.914-1.037A6.33 6.33 0 0 0 14 6.78V8c0 1.657-2.686 3-6 3S2 9.657 2 8V6.78c.346.273.72.5 1.087.683C4.42 8.131 6.16 8.5 8 8.5Z"></path><path d="M8 12.5c1.84 0 3.579-.37 4.914-1.037.366-.183.74-.41 1.086-.684V12c0 1.657-2.686 3-6 3s-6-1.343-6-3v-1.22c.346.273.72.5 1.087.683C4.42 12.131 6.16 12.5 8 12.5Z"></path></svg>',Qt,al,St=l[1].t("Database")+"",Zt,Xt,hl,cl,Jt,zt,Nt,Al,Rl;F=new eh({});const dl=[Jh,Xh,Zh,qh,Fh,Wh,jh,Yh,Kh,Gh,Hh,Bh,Mh],Pt=[];function gl(ot,$t){return ot[0]==="general"?0:ot[0]==="connections"?1:ot[0]==="models"?2:ot[0]==="evaluations"?3:ot[0]==="tools"?4:ot[0]==="documents"?5:ot[0]==="web"?6:ot[0]==="code-execution"?7:ot[0]==="interface"?8:ot[0]==="audio"?9:ot[0]==="images"?10:ot[0]==="db"?11:ot[0]==="pipelines"?12:-1}return~(Jt=gl(l))&&(zt=Pt[Jt]=dl[Jt](l)),{c(){e=_("div"),t=_("div"),s=_("button"),n=_("div"),n.innerHTML=i,a=N(),f=_("div"),d=B(o),m=N(),v=_("button"),g=_("div"),g.innerHTML=b,w=N(),A=_("div"),k=B(I),R=N(),O=_("button"),y=_("div"),y.innerHTML=L,P=N(),D=_("div"),K=B(S),C=N(),V=_("button"),U=_("div"),ce(F.$$.fragment),X=N(),Z=_("div"),ie=B(J),le=N(),x=_("button"),oe=_("div"),oe.innerHTML=se,te=N(),ae=_("div"),ve=B(Te),ne=N(),Ie=_("button"),be=_("div"),be.innerHTML=z,ke=N(),Ue=_("div"),Ae=B(we),ue=N(),Ee=_("button"),Me=_("div"),Me.innerHTML=Ge,ee=N(),me=_("div"),Ne=B(ge),ze=N(),Ce=_("button"),Le=_("div"),Le.innerHTML=Ke,re=N(),$e=_("div"),ft=B(ut),Be=N(),Ve=_("button"),je=_("div"),je.innerHTML=Rt,Ot=N(),_t=_("div"),At=B(Et),Ut=N(),rt=_("button"),bt=_("div"),bt.innerHTML=lt,He=N(),at=_("div"),Qe=B(Vt),wt=N(),vt=_("button"),It=_("div"),It.innerHTML=el,Kt=N(),Lt=_("div"),Tl=B(ol),De=N(),Pe=_("button"),kt=_("div"),kt.innerHTML=We,it=N(),Mt=_("div"),mt=B(xe),Ze=N(),nt=_("button"),Yt=_("div"),Yt.innerHTML=tl,Qt=N(),al=_("div"),Zt=B(St),hl=N(),cl=_("div"),zt&&zt.c(),this.h()},l(ot){e=h(ot,"DIV",{class:!0});var $t=p(e);t=h($t,"DIV",{id:!0,class:!0});var dt=p(t);s=h(dt,"BUTTON",{class:!0});var kl=p(s);n=h(kl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(n)!=="svelte-1e9u9pw"&&(n.innerHTML=i),a=$(kl),f=h(kl,"DIV",{class:!0});var rl=p(f);d=H(rl,o),rl.forEach(c),kl.forEach(c),m=$(dt),v=h(dt,"BUTTON",{class:!0});var $l=p(v);g=h($l,"DIV",{class:!0,"data-svelte-h":!0}),Wt(g)!=="svelte-1xixjje"&&(g.innerHTML=b),w=$($l),A=h($l,"DIV",{class:!0});var ul=p(A);k=H(ul,I),ul.forEach(c),$l.forEach(c),R=$(dt),O=h(dt,"BUTTON",{class:!0});var pl=p(O);y=h(pl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(y)!=="svelte-17kkxfv"&&(y.innerHTML=L),P=$(pl),D=h(pl,"DIV",{class:!0});var _s=p(D);
141K=H(_s,S),_s.forEach(c),pl.forEach(c),C=$(dt),V=h(dt,"BUTTON",{class:!0});var Il=p(V);U=h(Il,"DIV",{class:!0});var ll=p(U);de(F.$$.fragment,ll),ll.forEach(c),X=$(Il),Z=h(Il,"DIV",{class:!0});var ts=p(Z);ie=H(ts,J),ts.forEach(c),Il.forEach(c),le=$(dt),x=h(dt,"BUTTON",{class:!0});var Dl=p(x);oe=h(Dl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(oe)!=="svelte-18r8u50"&&(oe.innerHTML=se),te=$(Dl),ae=h(Dl,"DIV",{class:!0});var Nl=p(ae);ve=H(Nl,Te),Nl.forEach(c),Dl.forEach(c),ne=$(dt),Ie=h(dt,"BUTTON",{class:!0});var ls=p(Ie);be=h(ls,"DIV",{class:!0,"data-svelte-h":!0}),Wt(be)!=="svelte-ofbvgh"&&(be.innerHTML=z),ke=$(ls),Ue=h(ls,"DIV",{class:!0});var El=p(Ue);Ae=H(El,we),El.forEach(c),ls.forEach(c),ue=$(dt),Ee=h(dt,"BUTTON",{class:!0});var Vl=p(Ee);Me=h(Vl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(Me)!=="svelte-1t9ru36"&&(Me.innerHTML=Ge),ee=$(Vl),me=h(Vl,"DIV",{class:!0});var il=p(me);Ne=H(il,ge),il.forEach(c),Vl.forEach(c),ze=$(dt),Ce=h(dt,"BUTTON",{class:!0});var et=p(Ce);Le=h(et,"DIV",{class:!0,"data-svelte-h":!0}),Wt(Le)!=="svelte-b77hoq"&&(Le.innerHTML=Ke),re=$(et),$e=h(et,"DIV",{class:!0});var gt=p($e);ft=H(gt,ut),gt.forEach(c),et.forEach(c),Be=$(dt),Ve=h(dt,"BUTTON",{class:!0});var yl=p(Ve);je=h(yl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(je)!=="svelte-1i52rm6"&&(je.innerHTML=Rt),Ot=$(yl),_t=h(yl,"DIV",{class:!0});var Oe=p(_t);At=H(Oe,Et),Oe.forEach(c),yl.forEach(c),Ut=$(dt),rt=h(dt,"BUTTON",{class:!0});var tt=p(rt);bt=h(tt,"DIV",{class:!0,"data-svelte-h":!0}),Wt(bt)!=="svelte-sf0iba"&&(bt.innerHTML=lt),He=$(tt),at=h(tt,"DIV",{class:!0});var fl=p(at);Qe=H(fl,Vt),fl.forEach(c),tt.forEach(c),wt=$(dt),vt=h(dt,"BUTTON",{class:!0});var jt=p(vt);It=h(jt,"DIV",{class:!0,"data-svelte-h":!0}),Wt(It)!=="svelte-1gc3odz"&&(It.innerHTML=el),Kt=$(jt),Lt=h(jt,"DIV",{class:!0});var Yl=p(Lt);Tl=H(Yl,ol),Yl.forEach(c),jt.forEach(c),De=$(dt),Pe=h(dt,"BUTTON",{class:!0});var Ml=p(Pe);kt=h(Ml,"DIV",{class:!0,"data-svelte-h":!0}),Wt(kt)!=="svelte-1q46caf"&&(kt.innerHTML=We),it=$(Ml),Mt=h(Ml,"DIV",{class:!0});var Wl=p(Mt);mt=H(Wl,xe),Wl.forEach(c),Ml.forEach(c),Ze=$(dt),nt=h(dt,"BUTTON",{class:!0});var Fl=p(nt);Yt=h(Fl,"DIV",{class:!0,"data-svelte-h":!0}),Wt(Yt)!=="svelte-35c53k"&&(Yt.innerHTML=tl),Qt=$(Fl),al=h(Fl,"DIV",{class:!0});var Bl=p(al);Zt=H(Bl,St),Bl.forEach(c),Fl.forEach(c),dt.forEach(c),hl=$($t),cl=h($t,"DIV",{class:!0});var as=p(cl);zt&&zt.l(as),as.forEach(c),$t.forEach(c),this.h()},h(){u(n,"class","self-center mr-2"),u(f,"class","self-center"),u(s,"class",E="px-0.5 py-1 min-w-fit rounded-lg flex-1 lg:flex-none flex text-right transition "+(l[0]==="general"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(g,"class","self-center mr-2"),u(A,"class","self-center"),u(v,"class",T="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="connections"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(y,"class","self-center mr-2"),u(D,"class","self-center"),u(O,"class",Y="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="models"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(U,"class","self-center mr-2"),u(Z,"class","self-center"),u(V,"class",fe="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="evaluations"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(oe,"class","self-center mr-2"),u(ae,"class","self-center"),u(x,"class",q="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="tools"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(be,"class","self-center mr-2"),u(Ue,"class","self-center"),u(Ie,"class",Re="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="documents"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(Me,"class","self-center mr-2"),u(me,"class","self-center"),u(Ee,"class",ye="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="web"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(Le,"class","self-center mr-2"),u($e,"class","self-center"),u(Ce,"class",ct="px-0.5 py-1 min-w-fit roun
141ded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="code-execution"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(je,"class","self-center mr-2"),u(_t,"class","self-center"),u(Ve,"class",Tt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="interface"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(bt,"class","self-center mr-2"),u(at,"class","self-center"),u(rt,"class",yt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="audio"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(It,"class","self-center mr-2"),u(Lt,"class","self-center"),u(vt,"class",Se="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="images"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(kt,"class","self-center mr-2"),u(Mt,"class","self-center"),u(Pe,"class",Bt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="pipelines"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(Yt,"class","self-center mr-2"),u(al,"class","self-center"),u(nt,"class",Xt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(l[0]==="db"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")),u(t,"id","admin-settings-tabs-container"),u(t,"class","tabs flex flex-row overflow-x-auto gap-2.5 max-w-full lg:gap-1 lg:flex-col lg:flex-none lg:w-40 dark:text-gray-200 text-sm font-medium text-left scrollbar-none"),u(cl,"class","flex-1 mt-3 lg:mt-0 overflow-y-scroll pr-1 scrollbar-hidden"),u(e,"class","flex flex-col lg:flex-row w-full h-full pb-2 lg:space-x-4")},m(ot,$t){M(ot,e,$t),r(e,t),r(t,s),r(s,n),r(s,a),r(s,f),r(f,d),r(t,m),r(t,v),r(v,g),r(v,w),r(v,A),r(A,k),r(t,R),r(t,O),r(O,y),r(O,P),r(O,D),r(D,K),r(t,C),r(t,V),r(V,U),_e(F,U,null),r(V,X),r(V,Z),r(Z,ie),r(t,le),r(t,x),r(x,oe),r(x,te),r(x,ae),r(ae,ve),r(t,ne),r(t,Ie),r(Ie,be),r(Ie,ke),r(Ie,Ue),r(Ue,Ae),r(t,ue),r(t,Ee),r(Ee,Me),r(Ee,ee),r(Ee,me),r(me,Ne),r(t,ze),r(t,Ce),r(Ce,Le),r(Ce,re),r(Ce,$e),r($e,ft),r(t,Be),r(t,Ve),r(Ve,je),r(Ve,Ot),r(Ve,_t),r(_t,At),r(t,Ut),r(t,rt),r(rt,bt),r(rt,He),r(rt,at),r(at,Qe),r(t,wt),r(t,vt),r(vt,It),r(vt,Kt),r(vt,Lt),r(Lt,Tl),r(t,De),r(t,Pe),r(Pe,kt),r(Pe,it),r(Pe,Mt),r(Mt,mt),r(t,Ze),r(t,nt),r(nt,Yt),r(nt,Qt),r(nt,al),r(al,Zt),r(e,hl),r(e,cl),~Jt&&Pt[Jt].m(cl,null),Nt=!0,Al||(Rl=[pe(s,"click",l[3]),pe(v,"click",l[4]),pe(O,"click",l[5]),pe(V,"click",l[6]),pe(x,"click",l[7]),pe(Ie,"click",l[8]),pe(Ee,"click",l[9]),pe(Ce,"click",l[10]),pe(Ve,"click",l[11]),pe(rt,"click",l[12]),pe(vt,"click",l[13]),pe(Pe,"click",l[14]),pe(nt,"click",l[15])],Al=!0)},p(ot,[$t]){(!Nt||$t&2)&&o!==(o=ot[1].t("General")+"")&&j(d,o),(!Nt||$t&1&&E!==(E="px-0.5 py-1 min-w-fit rounded-lg flex-1 lg:flex-none flex text-right transition "+(ot[0]==="general"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(s,"class",E),(!Nt||$t&2)&&I!==(I=ot[1].t("Connections")+"")&&j(k,I),(!Nt||$t&1&&T!==(T="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="connections"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(v,"class",T),(!Nt||$t&2)&&S!==(S=ot[1].t("Models")+"")&&j(K,S),(!Nt||$t&1&&Y!==(Y="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="models"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(O,"class",Y),(!Nt||$t&2)&&J!==(J=ot[1].t("Evaluations")+"")&&j(ie,J),(!Nt||$t&1&&fe!==(fe="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="evaluations"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(V,"class",fe),(!Nt||$t&2)&&Te!==(Te=ot[1].t("Tools")+"")&&j(ve,Te),(!Nt||$t&1&&q!==(q="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="tools"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(x,"class",q),(!Nt||$t&2)&&we!==(we=ot[1].t("Documents")+"")&&j(Ae,we),(!Nt||$t&1&&Re!==(Re="px-0.5 py-1 min-w-fit roun
141ded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="documents"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(Ie,"class",Re),(!Nt||$t&2)&&ge!==(ge=ot[1].t("Web Search")+"")&&j(Ne,ge),(!Nt||$t&1&&ye!==(ye="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="web"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(Ee,"class",ye),(!Nt||$t&2)&&ut!==(ut=ot[1].t("Code Execution")+"")&&j(ft,ut),(!Nt||$t&1&&ct!==(ct="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="code-execution"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(Ce,"class",ct),(!Nt||$t&2)&&Et!==(Et=ot[1].t("Interface")+"")&&j(At,Et),(!Nt||$t&1&&Tt!==(Tt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="interface"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(Ve,"class",Tt),(!Nt||$t&2)&&Vt!==(Vt=ot[1].t("Audio")+"")&&j(Qe,Vt),(!Nt||$t&1&&yt!==(yt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="audio"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(rt,"class",yt),(!Nt||$t&2)&&ol!==(ol=ot[1].t("Images")+"")&&j(Tl,ol),(!Nt||$t&1&&Se!==(Se="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="images"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(vt,"class",Se),(!Nt||$t&2)&&xe!==(xe=ot[1].t("Pipelines")+"")&&j(mt,xe),(!Nt||$t&1&&Bt!==(Bt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="pipelines"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(Pe,"class",Bt),(!Nt||$t&2)&&St!==(St=ot[1].t("Database")+"")&&j(Zt,St),(!Nt||$t&1&&Xt!==(Xt="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition "+(ot[0]==="db"?"":" text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white")))&&u(nt,"class",Xt);let dt=Jt;Jt=gl(ot),Jt===dt?~Jt&&Pt[Jt].p(ot,$t):(zt&&(ht(),W(Pt[dt],1,1,()=>{Pt[dt]=null}),pt()),~Jt?(zt=Pt[Jt],zt?zt.p(ot,$t):(zt=Pt[Jt]=dl[Jt](ot),zt.c()),G(zt,1),zt.m(cl,null)):zt=null)},i(ot){Nt||(G(F.$$.fragment,ot),G(zt),Nt=!0)},o(ot){W(F.$$.fragment,ot),W(zt),Nt=!1},d(ot){ot&&c(e),he(F),~Jt&&Pt[Jt].d(),Al=!1,ml(Rl)}}}function Qh(l,e,t){let s;const n=Ul("i18n");qt(l,n,C=>t(1,s=C));let i="general";return rs(()=>{const C=document.getElementById("admin-settings-tabs-container");C&&C.addEventListener("wheel",function(V){V.deltaY!==0&&(C.scrollLeft+=V.deltaY)})}),[i,s,n,()=>{t(0,i="general")},()=>{t(0,i="connections")},()=>{t(0,i="models")},()=>{t(0,i="evaluations")},()=>{t(0,i="tools")},()=>{t(0,i="documents")},()=>{t(0,i="web")},()=>{t(0,i="code-execution")},()=>{t(0,i="interface")},()=>{t(0,i="audio")},()=>{t(0,i="images")},()=>{t(0,i="pipelines")},()=>{t(0,i="db")},async()=>{Je.success(s.t("Settings saved successfully!")),await ln(),await fs.set(await Xs())},()=>{Je.success(s.t("Settings saved successfully!"))},async()=>{Je.success(s.t("Settings saved successfully!")),await ln(),await fs.set(await Xs())},async()=>{Je.success(s.t("Settings saved successfully!")),await ln(),await fs.set(await Xs())},async()=>{Je.success(s.t("Settings saved successfully!")),await ln(),await fs.set(await Xs())},()=>{Je.success(s.t("Settings saved successfully!"))},()=>{Je.success(s.t("Settings saved successfully!"))},()=>{Je.success(s.t("Settings saved successfully!"))},()=>{Je.success(s.t("Settings saved successfully!"))},()=>{Je.success(s.t("Settings saved successfully!"))}]}class xh extends Sl{constructor(e){super(),Pl(this,e,Qh,zh,Ol,{})}}function e0(l){let e,t;return e=new xh({}),{c(){ce(e.$$.fragment)},l(s){de(e.$$.fragment,s)},m(s,n){_e(e,s,n),t=!0},p:st,i(s){t||(G(e.$$.fragment,s),t=!0)},o(s){W(e.$$.fragment,s),t=!1},d(s){he(e,s)}}}class W0 extends Sl{constructor(e){super(),Pl(this,e,null,e0,Ol,{})}}export{W0 as component};
142//# sourceMappingURL=13.DIfvdpEL.js.map

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.