import{s as W,j as R,p as X,q as oe,r as Me,v as je,w as Be,x as xe,e as b,c as w,a as k,d as v,f as p,i as D,l as de,J as Y,t as x,b as H,g,h as O,n as he,k as M,o as j,y as F,z as S,B as He,E as Oe,A as Ze,u as Fe}from"./scheduler.DB3Sqaa-.js";import{S as ee,i as te,b as q,d as N,m as K,t as E,a as I,e as U,g as G,c as P,f as Se}from"./index.CidI1d1E.js";import{e as z}from"./each.cN4tVpvB.js";import{T as ce,m as ve}from"./create.DJSy4-Dz.js";import{D as ze,M as Le}from"./Dropdown.6Kb6OfAV.js";import{b as qe}from"./menu-trigger.Syw7IYi9.js";import{n as Ne}from"./index.DPWiq6NR.js";import{f as Ke}from"./index.DMdt0oYD.js";import{C as ie}from"./Checkbox.BgvkeQEA.js";function _e(o,e,s){const l=o.slice();return l[10]=e[s],l}function Ue(o){let e;const s=o[5].default,l=Me(s,o,o[8],null);return{c(){l&&l.c()},l(t){l&&l.l(t)},m(t,i){l&&l.m(t,i),e=!0},p(t,i){l&&l.p&&(!e||i&256)&&je(l,s,t,t[8],e?xe(s,t[8],i,null):Be(t[8]),null)},i(t){e||(E(l,t),e=!0)},o(t){I(l,t),e=!1},d(t){l&&l.d(t)}}}function Je(o){let e,s,l=z(o[2]),t=[];for(let n=0;nI(t[n],1,1,()=>{t[n]=null});return{c(){for(let n=0;n{n[u]=null}),P(),l=n[s],l?l.p(r,f):(l=n[s]=i[s](r),l.c()),E(l,1),l.m(e,null))},i(r){t||(E(l),t=!0)},o(r){I(l),t=!1},d(r){r&&v(e),n[s].d()}}}function Xe(o){let e,s,l;return s=new qe({props:{class:"w-full max-w-[300px] rounded-lg 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-lg",sideOffset:8,side:"bottom",align:"start",transition:Ke,$$slots:{default:[We]},$$scope:{ctx:o}}}),{c(){e=b("div"),q(s.$$.fragment),this.h()},l(t){e=w(t,"DIV",{slot:!0});var i=k(e);N(s.$$.fragment,i),i.forEach(v),this.h()},h(){p(e,"slot","content")},m(t,i){D(t,e,i),K(s,e,null),l=!0},p(t,i){const n={};i&269&&(n.$$scope={dirty:i,ctx:t}),s.$set(n)},i(t){l||(E(s.$$.fragment,t),l=!0)},o(t){I(s.$$.fragment,t),l=!1},d(t){t&&v(e),U(s)}}}function Ye(o){let e,s;return e=new ze({props:{$$slots:{content:[Xe],default:[Ue]},$$scope:{ctx:o}}}),e.$on("change",o[7]),{c(){q(e.$$.fragment)},l(l){N(e.$$.fragment,l)},m(l,t){K(e,l,t),s=!0},p(l,[t]){const i={};t&269&&(i.$$scope={dirty:t,ctx:l}),e.$set(i)},i(l){s||(E(e.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),s=!1},d(l){U(e,l)}}}function et(o,e,s){let l,t;R(o,Ne,a=>s(9,l=a));let{$$slots:i={},$$scope:n}=e;const c=X("i18n");R(o,c,a=>s(3,t=a));let{onClose:r=()=>{}}=e,{knowledge:f=[]}=e,u=[];oe(()=>{let a=[...l.length>0?[{name:"All Documents",type:"collection",title:t.t("All Documents"),collection_names:l.map(d=>d.collection_name)}]:[],...l.reduce((d,m,y,$)=>{var V;return[...new Set([...d,...(((V=m==null?void 0:m.content)==null?void 0:V.tags)??[]).map(T=>T.name)])]},[]).map(d=>({name:d,type:"collection",collection_names:l.filter(m=>{var y;return(((y=m==null?void 0:m.content)==null?void 0:y.tags)??[]).map($=>$.name).includes(d)}).map(m=>m.collection_name)}))];s(2,u=[...a,...l])});const h=a=>{f.find(d=>d.name===a.name)||s(0,f=[...f,{...a,type:(a==null?void 0:a.type)??"doc"}])},_=a=>{a.detail===!1&&r()};return o.$$set=a=>{"onClose"in a&&s(1,r=a.onClose),"knowledge"in a&&s(0,f=a.knowledge),"$$scope"in a&&s(8,n=a.$$scope)},[f,r,u,t,c,i,h,_,n]}class tt extends ee{constructor(e){super(),te(this,e,et,Ye,W,{onClose:1,knowledge:0})}}function ge(o,e,s){const l=o.slice();return l[5]=e[s],l[7]=s,l}function pe(o){let e,s=z(o[0]),l=[];for(let t=0;t0&&pe(o);function V(A){o[4](A)}let T={$$slots:{default:[nt]},$$scope:{ctx:o}};return o[0]!==void 0&&(T.knowledge=o[0]),d=new tt({props:T}),He.push(()=>Se(d,"knowledge",V)),{c(){e=b("div"),s=b("div"),l=b("div"),i=x(t),n=M(),c=b("div"),f=x(r),u=M(),h=b("div"),$&&$.c(),_=M(),a=b("div"),q(d.$$.fragment),this.h()},l(A){e=w(A,"DIV",{});var C=k(e);s=w(C,"DIV",{class:!0});var B=k(s);l=w(B,"DIV",{class:!0});var ne=k(l);i=H(ne,t),ne.forEach(v),B.forEach(v),n=j(C),c=w(C,"DIV",{class:!0});var le=k(c);f=H(le,r),le.forEach(v),u=j(C),h=w(C,"DIV",{class:!0});var Q=k(h);$&&$.l(Q),_=j(Q),a=w(Q,"DIV",{class:!0});var Z=k(a);N(d.$$.fragment,Z),Z.forEach(v),Q.forEach(v),C.forEach(v),this.h()},h(){p(l,"class","self-center text-sm font-semibold"),p(s,"class","flex w-full justify-between mb-1"),p(c,"class","text-xs dark:text-gray-500"),p(a,"class","flex flex-wrap text-sm font-medium gap-1.5 mt-2"),p(h,"class","flex flex-col")},m(A,C){D(A,e,C),g(e,s),g(s,l),g(l,i),g(e,n),g(e,c),g(c,f),g(e,u),g(e,h),$&&$.m(h,null),g(h,_),g(h,a),K(d,a,null),y=!0},p(A,[C]){(!y||C&2)&&t!==(t=A[1].t("Knowledge")+"")&&O(i,t),(!y||C&2)&&r!==(r=A[1].t('To add documents here, upload them to the "Documents" workspace first.')+"")&&O(f,r),A[0].length>0?$?$.p(A,C):($=pe(A),$.c(),$.m(h,_)):$&&($.d(1),$=null);const B={};C&258&&(B.$$scope={dirty:C,ctx:A}),!m&&C&1&&(m=!0,B.knowledge=A[0],Oe(()=>m=!1)),d.$set(B)},i(A){y||(E(d.$$.fragment,A),y=!0)},o(A){I(d.$$.fragment,A),y=!1},d(A){A&&v(e),$&&$.d(),U(d)}}}function ot(o,e,s){let l,{knowledge:t=[]}=e;const i=X("i18n");R(o,i,r=>s(1,l=r));const n=r=>{t.splice(r,1),s(0,t)};function c(r){t=r,s(0,t)}return o.$$set=r=>{"knowledge"in r&&s(0,t=r.knowledge)},[t,l,i,n,c]}class yt extends ee{constructor(e){super(),te(this,e,ot,rt,W,{knowledge:0})}}function be(o,e,s){const l=o.slice();return l[6]=e[s],l[8]=s,l}function we(o){let e,s,l=z(Object.keys(o[2])),t=[];for(let n=0;nI(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n0&&we(o);return{c(){e=b("div"),s=b("div"),l=b("div"),i=x(t),n=M(),c=b("div"),f=x(r),u=M(),h=b("div"),a&&a.c(),this.h()},l(d){e=w(d,"DIV",{});var m=k(e);s=w(m,"DIV",{class:!0});var y=k(s);l=w(y,"DIV",{class:!0});var $=k(l);i=H($,t),$.forEach(v),y.forEach(v),n=j(m),c=w(m,"DIV",{class:!0});var V=k(c);f=H(V,r),V.forEach(v),u=j(m),h=w(m,"DIV",{class:!0});var T=k(h);a&&a.l(T),T.forEach(v),m.forEach(v),this.h()},h(){p(l,"class","self-center text-sm font-semibold"),p(s,"class","flex w-full justify-between mb-1"),p(c,"class","text-xs dark:text-gray-500"),p(h,"class","flex flex-col")},m(d,m){D(d,e,m),g(e,s),g(s,l),g(l,i),g(e,n),g(e,c),g(c,f),g(e,u),g(e,h),a&&a.m(h,null),_=!0},p(d,[m]){(!_||m&8)&&t!==(t=d[3].t("Tools")+"")&&O(i,t),(!_||m&8)&&r!==(r=d[3].t('To select toolkits here, add them to the "Tools" workspace first.')+"")&&O(f,r),d[1].length>0?a?(a.p(d,m),m&2&&E(a,1)):(a=we(d),a.c(),E(a,1),a.m(h,null)):a&&(G(),I(a,1,1,()=>{a=null}),P())},i(d){_||(E(a),_=!0)},o(d){I(a),_=!1},d(d){d&&v(e),a&&a.d()}}}function ct(o,e,s){let l,{tools:t=[]}=e,i={},{selectedToolIds:n=[]}=e;const c=X("i18n");R(o,c,f=>s(3,l=f)),oe(()=>{s(2,i=t.reduce((f,u)=>(f[u.id]={...u,selected:n.includes(u.id)},f),{}))});const r=(f,u)=>{s(2,i[f].selected=u.detail==="checked",i),s(0,n=Object.keys(i).filter(h=>i[h].selected))};return o.$$set=f=>{"tools"in f&&s(1,t=f.tools),"selectedToolIds"in f&&s(0,n=f.selectedToolIds)},[n,t,i,l,c,r]}class At extends ee{constructor(e){super(),te(this,e,ct,it,W,{tools:1,selectedToolIds:0})}}function Ee(o,e,s){const l=o.slice();return l[6]=e[s],l[8]=s,l}function De(o){let e,s,l=z(Object.keys(o[2])),t=[];for(let n=0;nI(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n0&&De(o);return{c(){e=b("div"),s=b("div"),l=b("div"),i=x(t),n=M(),c=b("div"),f=x(r),u=M(),h=b("div"),a&&a.c(),this.h()},l(d){e=w(d,"DIV",{});var m=k(e);s=w(m,"DIV",{class:!0});var y=k(s);l=w(y,"DIV",{class:!0});var $=k(l);i=H($,t),$.forEach(v),y.forEach(v),n=j(m),c=w(m,"DIV",{class:!0});var V=k(c);f=H(V,r),V.forEach(v),u=j(m),h=w(m,"DIV",{class:!0});var T=k(h);a&&a.l(T),T.forEach(v),m.forEach(v),this.h()},h(){p(l,"class","self-center text-sm font-semibold"),p(s,"class","flex w-full justify-between mb-1"),p(c,"class","text-xs dark:text-gray-500"),p(h,"class","flex flex-col")},m(d,m){D(d,e,m),g(e,s),g(s,l),g(l,i),g(e,n),g(e,c),g(c,f),g(e,u),g(e,h),a&&a.m(h,null),_=!0},p(d,[m]){(!_||m&8)&&t!==(t=d[3].t("Filters")+"")&&O(i,t),(!_||m&8)&&r!==(r=d[3].t('To select filters here, add them to the "Functions" workspace first.')+"")&&O(f,r),d[1].length>0?a?(a.p(d,m),m&2&&E(a,1)):(a=De(d),a.c(),E(a,1),a.m(h,null)):a&&(G(),I(a,1,1,()=>{a=null}),P())},i(d){_||(E(a),_=!0)},o(d){I(a),_=!1},d(d){d&&v(e),a&&a.d()}}}function ut(o,e,s){let l;const t=X("i18n");R(o,t,f=>s(3,l=f));let{filters:i=[]}=e,{selectedFilterIds:n=[]}=e,c={};oe(()=>{s(2,c=i.reduce((f,u)=>(f[u.id]={...u,selected:n.includes(u.id)},f),{}))});const r=(f,u)=>{s(2,c[f].selected=u.detail==="checked",c),s(0,n=Object.keys(c).filter(h=>c[h].selected))};return o.$$set=f=>{"filters"in f&&s(1,i=f.filters),"selectedFilterIds"in f&&s(0,n=f.selectedFilterIds)},[n,i,c,l,t,r]}class Tt extends ee{constructor(e){super(),te(this,e,ut,ft,W,{filters:1,selectedFilterIds:0})}}function Ve(o,e,s){const l=o.slice();return l[6]=e[s],l[8]=s,l}function ye(o){let e,s,l=z(Object.keys(o[2])),t=[];for(let n=0;nI(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n0&&ye(o);return{c(){e=b("div"),s=b("div"),l=b("div"),i=x(t),n=M(),c=b("div"),f=x(r),u=M(),h=b("div"),a&&a.c(),this.h()},l(d){e=w(d,"DIV",{});var m=k(e);s=w(m,"DIV",{class:!0});var y=k(s);l=w(y,"DIV",{class:!0});var $=k(l);i=H($,t),$.forEach(v),y.forEach(v),n=j(m),c=w(m,"DIV",{class:!0});var V=k(c);f=H(V,r),V.forEach(v),u=j(m),h=w(m,"DIV",{class:!0});var T=k(h);a&&a.l(T),T.forEach(v),m.forEach(v),this.h()},h(){p(l,"class","self-center text-sm font-semibold"),p(s,"class","flex w-full justify-between mb-1"),p(c,"class","text-xs dark:text-gray-500"),p(h,"class","flex flex-col")},m(d,m){D(d,e,m),g(e,s),g(s,l),g(l,i),g(e,n),g(e,c),g(c,f),g(e,u),g(e,h),a&&a.m(h,null),_=!0},p(d,[m]){(!_||m&8)&&t!==(t=d[3].t("Actions")+"")&&O(i,t),(!_||m&8)&&r!==(r=d[3].t('To select actions here, add them to the "Functions" workspace first.')+"")&&O(f,r),d[1].length>0?a?(a.p(d,m),m&2&&E(a,1)):(a=ye(d),a.c(),E(a,1),a.m(h,null)):a&&(G(),I(a,1,1,()=>{a=null}),P())},i(d){_||(E(a),_=!0)},o(d){I(a),_=!1},d(d){d&&v(e),a&&a.d()}}}function vt(o,e,s){let l;const t=X("i18n");R(o,t,f=>s(3,l=f));let{actions:i=[]}=e,{selectedActionIds:n=[]}=e,c={};oe(()=>{s(2,c=i.reduce((f,u)=>(f[u.id]={...u,selected:n.includes(u.id)},f),{}))});const r=(f,u)=>{s(2,c[f].selected=u.detail==="checked",c),s(0,n=Object.keys(c).filter(h=>c[h].selected))};return o.$$set=f=>{"actions"in f&&s(1,i=f.actions),"selectedActionIds"in f&&s(0,n=f.selectedActionIds)},[n,i,c,l,t,r]}class Ct extends ee{constructor(e){super(),te(this,e,vt,ht,W,{actions:1,selectedActionIds:0})}}function Te(o,e,s){const l=o.slice();return l[5]=e[s],l}function _t(o){let e=o[1].t(o[5])+"",s;return{c(){s=x(e)},l(l){s=H(l,e)},m(l,t){D(l,s,t)},p(l,t){t&3&&e!==(e=l[1].t(l[5])+"")&&O(s,e)},d(l){l&&v(s)}}}function Ce(o){let e,s,l,t,i,n,c;function r(...f){return o[4](o[5],...f)}return s=new ie({props:{state:o[0][o[5]]?"checked":"unchecked"}}),s.$on("change",r),i=new ce({props:{content:ve.parse(o[3][o[5]]),$$slots:{default:[_t]},$$scope:{ctx:o}}}),{c(){e=b("div"),q(s.$$.fragment),l=M(),t=b("div"),q(i.$$.fragment),n=M(),this.h()},l(f){e=w(f,"DIV",{class:!0});var u=k(e);N(s.$$.fragment,u),l=j(u),t=w(u,"DIV",{class:!0});var h=k(t);N(i.$$.fragment,h),h.forEach(v),n=j(u),u.forEach(v),this.h()},h(){p(t,"class","py-0.5 text-sm capitalize"),p(e,"class","flex items-center gap-2")},m(f,u){D(f,e,u),K(s,e,null),g(e,l),g(e,t),K(i,t,null),g(e,n),c=!0},p(f,u){o=f;const h={};u&1&&(h.state=o[0][o[5]]?"checked":"unchecked"),s.$set(h);const _={};u&1&&(_.content=ve.parse(o[3][o[5]])),u&259&&(_.$$scope={dirty:u,ctx:o}),i.$set(_)},i(f){c||(E(s.$$.fragment,f),E(i.$$.fragment,f),c=!0)},o(f){I(s.$$.fragment,f),I(i.$$.fragment,f),c=!1},d(f){f&&v(e),U(s),U(i)}}}function mt(o){let e,s,l,t=o[1].t("Capabilities")+"",i,n,c,r,f=z(Object.keys(o[0])),u=[];for(let _=0;_I(u[_],1,1,()=>{u[_]=null});return{c(){e=b("div"),s=b("div"),l=b("div"),i=x(t),n=M(),c=b("div");for(let _=0;_s(1,l=r));const i={vision:l.t("Model accepts image inputs"),usage:l.t("Sends `stream_options: { include_usage: true }` in the request.\nSupported providers will return token usage information in the response when set.")};let{capabilities:n={}}=e;const c=(r,f)=>{s(0,n[r]=f.detail==="checked",n)};return o.$$set=r=>{"capabilities"in r&&s(0,n=r.capabilities)},[n,l,t,i,c]}class Mt extends ee{constructor(e){super(),te(this,e,gt,mt,W,{capabilities:0})}}export{Ct as A,Mt as C,Tt as F,yt as K,At as T}; //# sourceMappingURL=Capabilities.DvrArZz1.js.map