Graduation / ui /build /_app /immutable /chunks /Capabilities.DvrArZz1.js
DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
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;n<l.length;n+=1)t[n]=me(_e(o,l,n));const i=n=>I(t[n],1,1,()=>{t[n]=null});return{c(){for(let n=0;n<t.length;n+=1)t[n].c();e=de()},l(n){for(let c=0;c<t.length;c+=1)t[c].l(n);e=de()},m(n,c){for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(n,c);D(n,e,c),s=!0},p(n,c){if(c&5){l=z(n[2]);let r;for(r=0;r<l.length;r+=1){const f=_e(n,l,r);t[r]?(t[r].p(f,c),E(t[r],1)):(t[r]=me(f),t[r].c(),E(t[r],1),t[r].m(e.parentNode,e))}for(G(),r=l.length;r<t.length;r+=1)i(r);P()}},i(n){if(!s){for(let c=0;c<l.length;c+=1)E(t[c]);s=!0}},o(n){t=t.filter(Boolean);for(let c=0;c<t.length;c+=1)I(t[c]);s=!1},d(n){n&&v(e),Y(t,n)}}}function Ge(o){let e,s=o[3].t("No documents found")+"",l;return{c(){e=b("div"),l=x(s),this.h()},l(t){e=w(t,"DIV",{class:!0});var i=k(e);l=H(i,s),i.forEach(v),this.h()},h(){p(e,"class","text-center text-sm text-gray-500 dark:text-gray-400")},m(t,i){D(t,e,i),g(e,l)},p(t,i){i&8&&s!==(s=t[3].t("No documents found")+"")&&O(l,s)},i:he,o:he,d(t){t&&v(e)}}}function Pe(o){let e,s,l;return{c(){e=F("svg"),s=F("path"),l=F("path"),this.h()},l(t){e=S(t,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=k(e);s=S(i,"path",{d:!0}),k(s).forEach(v),l=S(i,"path",{d:!0}),k(l).forEach(v),i.forEach(v),this.h()},h(){p(s,"d","M7.5 3.375c0-1.036.84-1.875 1.875-1.875h.375a3.75 3.75 0 0 1 3.75 3.75v1.875C13.5 8.161 14.34 9 15.375 9h1.875A3.75 3.75 0 0 1 21 12.75v3.375C21 17.16 20.16 18 19.125 18h-9.75A1.875 1.875 0 0 1 7.5 16.125V3.375Z"),p(l,"d","M15 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 17.25 7.5h-1.875A.375.375 0 0 1 15 7.125V5.25ZM4.875 6H6v10.125A3.375 3.375 0 0 0 9.375 19.5H16.5v1.125c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V7.875C3 6.839 3.84 6 4.875 6Z"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"viewBox","0 0 24 24"),p(e,"fill","currentColor"),p(e,"class","size-4")},m(t,i){D(t,e,i),g(e,s),g(e,l)},d(t){t&&v(e)}}}function Qe(o){let e,s,l;return{c(){e=F("svg"),s=F("path"),l=F("path"),this.h()},l(t){e=S(t,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=k(e);s=S(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),k(s).forEach(v),l=S(i,"path",{d:!0}),k(l).forEach(v),i.forEach(v),this.h()},h(){p(s,"fill-rule","evenodd"),p(s,"d","M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z"),p(s,"clip-rule","evenodd"),p(l,"d","M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"viewBox","0 0 24 24"),p(e,"fill","currentColor"),p(e,"class","w-4")},m(t,i){D(t,e,i),g(e,s),g(e,l)},d(t){t&&v(e)}}}function Re(o){var y;let e,s,l,t,i,n=(((y=o[10])==null?void 0:y.type)??"Document")+"",c,r,f,u=o[10].name+"",h,_;function a($,V){var T;if((((T=$[10])==null?void 0:T.type)??"doc")==="doc")return Qe;if($[10].type==="collection")return Pe}let d=a(o),m=d&&d(o);return{c(){e=b("div"),m&&m.c(),s=M(),l=b("div"),t=b("div"),i=b("div"),c=x(n),r=M(),f=b("div"),h=x(u),_=M(),this.h()},l($){e=w($,"DIV",{class:!0});var V=k(e);m&&m.l(V),V.forEach(v),s=j($),l=w($,"DIV",{class:!0});var T=k(l);t=w(T,"DIV",{class:!0});var A=k(t);i=w(A,"DIV",{class:!0});var C=k(i);c=H(C,n),C.forEach(v),r=j(A),f=w(A,"DIV",{class:!0});var B=k(f);h=H(B,u),B.forEach(v),A.forEach(v),T.forEach(v),_=j($),this.h()},h(){p(e,"class","flex self-start"),p(i,"class","w-fit text-xs font-bold px-1 rounded uppercase line-clamp-1 bg-gray-500/20 text-gray-700 dark:text-gray-200"),p(f,"class","line-clamp-1 font-medium pr-0.5"),p(t,"class","flex flex-col"),p(l,"class","flex items-center")},m($,V){D($,e,V),m&&m.m(e,null),D($,s,V),D($,l,V),g(l,t),g(t,i),g(i,c),g(t,r),g(t,f),g(f,h),D($,_,V)},p($,V){var T;d!==(d=a($))&&(m&&m.d(1),m=d&&d($),m&&(m.c(),m.m(e,null))),V&4&&n!==(n=(((T=$[10])==null?void 0:T.type)??"Document")+"")&&O(c,n),V&4&&u!==(u=$[10].name+"")&&O(h,u)},d($){$&&(v(e),v(s),v(l),v(_)),m&&m.d()}}}function me(o){let e,s;function l(){return o[6](o[10])}return e=new Le({props:{class:"flex gap-2.5 items-center px-3 py-2 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-md",$$slots:{default:[Re]},$$scope:{ctx:o}}}),e.$on("click",l),{c(){q(e.$$.fragment)},l(t){N(e.$$.fragment,t)},m(t,i){K(e,t,i),s=!0},p(t,i){o=t;const n={};i&260&&(n.$$scope={dirty:i,ctx:o}),e.$set(n)},i(t){s||(E(e.$$.fragment,t),s=!0)},o(t){I(e.$$.fragment,t),s=!1},d(t){U(e,t)}}}function We(o){let e,s,l,t;const i=[Ge,Je],n=[];function c(r,f){return r[2].length===0?0:1}return s=c(o),l=n[s]=i[s](o),{c(){e=b("div"),l.c(),this.h()},l(r){e=w(r,"DIV",{class:!0});var f=k(e);l.l(f),f.forEach(v),this.h()},h(){p(e,"class","max-h-[10rem] overflow-y-scroll")},m(r,f){D(r,e,f),n[s].m(e,null),t=!0},p(r,f){let u=s;s=c(r),s===u?n[s].p(r,f):(G(),I(n[u],1,1,()=>{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;t<s.length;t+=1)l[t]=ke(ge(o,s,t));return{c(){e=b("div");for(let t=0;t<l.length;t+=1)l[t].c();this.h()},l(t){e=w(t,"DIV",{class:!0});var i=k(e);for(let n=0;n<l.length;n+=1)l[n].l(i);i.forEach(v),this.h()},h(){p(e,"class","flex items-center gap-2 mt-2")},m(t,i){D(t,e,i);for(let n=0;n<l.length;n+=1)l[n]&&l[n].m(e,null)},p(t,i){if(i&3){s=z(t[0]);let n;for(n=0;n<s.length;n+=1){const c=ge(t,s,n);l[n]?l[n].p(c,i):(l[n]=ke(c),l[n].c(),l[n].m(e,null))}for(;n<l.length;n+=1)l[n].d(1);l.length=s.length}},d(t){t&&v(e),Y(l,t)}}}function lt(o){let e,s,l;return{c(){e=F("svg"),s=F("path"),l=F("path"),this.h()},l(t){e=S(t,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=k(e);s=S(i,"path",{d:!0}),k(s).forEach(v),l=S(i,"path",{d:!0}),k(l).forEach(v),i.forEach(v),this.h()},h(){p(s,"d","M7.5 3.375c0-1.036.84-1.875 1.875-1.875h.375a3.75 3.75 0 0 1 3.75 3.75v1.875C13.5 8.161 14.34 9 15.375 9h1.875A3.75 3.75 0 0 1 21 12.75v3.375C21 17.16 20.16 18 19.125 18h-9.75A1.875 1.875 0 0 1 7.5 16.125V3.375Z"),p(l,"d","M15 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 17.25 7.5h-1.875A.375.375 0 0 1 15 7.125V5.25ZM4.875 6H6v10.125A3.375 3.375 0 0 0 9.375 19.5H16.5v1.125c0 1.035-.84 1.875-1.875 1.875h-9.75A1.875 1.875 0 0 1 3 20.625V7.875C3 6.839 3.84 6 4.875 6Z"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"viewBox","0 0 24 24"),p(e,"fill","currentColor"),p(e,"class","size-6")},m(t,i){D(t,e,i),g(e,s),g(e,l)},d(t){t&&v(e)}}}function st(o){let e,s,l;return{c(){e=F("svg"),s=F("path"),l=F("path"),this.h()},l(t){e=S(t,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var i=k(e);s=S(i,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),k(s).forEach(v),l=S(i,"path",{d:!0}),k(l).forEach(v),i.forEach(v),this.h()},h(){p(s,"fill-rule","evenodd"),p(s,"d","M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z"),p(s,"clip-rule","evenodd"),p(l,"d","M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"),p(e,"xmlns","http://www.w3.org/2000/svg"),p(e,"viewBox","0 0 24 24"),p(e,"fill","currentColor"),p(e,"class","size-6")},m(t,i){D(t,e,i),g(e,s),g(e,l)},d(t){t&&v(e)}}}function ke(o){var le,Q;let e,s,l,t,i,n,c=(((le=o[5])==null?void 0:le.title)??`#${o[5].name}`)+"",r,f,u,h=o[1].t(((Q=o[5])==null?void 0:Q.type)??"Document")+"",_,a,d,m,y='<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>',$,V,T;function A(Z,L){var J;if((((J=Z[5])==null?void 0:J.type)??"doc")==="doc")return st;if(Z[5].type==="collection")return lt}let C=A(o),B=C&&C(o);function ne(){return o[3](o[7])}return{c(){e=b("div"),s=b("div"),l=b("div"),B&&B.c(),t=M(),i=b("div"),n=b("div"),r=x(c),f=M(),u=b("div"),_=x(h),a=M(),d=b("div"),m=b("button"),m.innerHTML=y,$=M(),this.h()},l(Z){e=w(Z,"DIV",{class:!0});var L=k(e);s=w(L,"DIV",{class:!0});var J=k(s);l=w(J,"DIV",{class:!0});var se=k(l);B&&B.l(se),se.forEach(v),t=j(J),i=w(J,"DIV",{class:!0});var re=k(i);n=w(re,"DIV",{class:!0});var ae=k(n);r=H(ae,c),ae.forEach(v),f=j(re),u=w(re,"DIV",{class:!0});var fe=k(u);_=H(fe,h),fe.forEach(v),re.forEach(v),J.forEach(v),a=j(L),d=w(L,"DIV",{class:!0});var ue=k(d);m=w(ue,"BUTTON",{class:!0,type:!0,"data-svelte-h":!0}),Ze(m)!=="svelte-v6mhqq"&&(m.innerHTML=y),ue.forEach(v),$=j(L),L.forEach(v),this.h()},h(){p(l,"class","p-2.5 bg-red-400 text-white rounded-lg"),p(n,"class","dark:text-gray-100 text-sm font-medium line-clamp-1"),p(u,"class","text-gray-500 text-sm"),p(i,"class","flex flex-col justify-center -space-y-0.5"),p(s,"class","h-16 w-[15rem] flex items-center space-x-3 px-2.5 dark:bg-gray-600 rounded-xl border border-gray-200 dark:border-none"),p(m,"class","bg-gray-400 text-white border border-white rounded-full group-hover:visible invisible transition"),p(m,"type","button"),p(d,"class","absolute -top-1 -right-1"),p(e,"class","relative group")},m(Z,L){D(Z,e,L),g(e,s),g(s,l),B&&B.m(l,null),g(s,t),g(s,i),g(i,n),g(n,r),g(i,f),g(i,u),g(u,_),g(e,a),g(e,d),g(d,m),g(e,$),V||(T=Fe(m,"click",ne),V=!0)},p(Z,L){var J,se;o=Z,C!==(C=A(o))&&(B&&B.d(1),B=C&&C(o),B&&(B.c(),B.m(l,null))),L&1&&c!==(c=(((J=o[5])==null?void 0:J.title)??`#${o[5].name}`)+"")&&O(r,c),L&3&&h!==(h=o[1].t(((se=o[5])==null?void 0:se.type)??"Document")+"")&&O(_,h)},d(Z){Z&&v(e),B&&B.d(),V=!1,T()}}}function nt(o){let e,s=o[1].t("Select Documents")+"",l;return{c(){e=b("button"),l=x(s),this.h()},l(t){e=w(t,"BUTTON",{class:!0,type:!0});var i=k(e);l=H(i,s),i.forEach(v),this.h()},h(){p(e,"class","px-3.5 py-1.5 font-medium hover:bg-black/5 dark:hover:bg-white/5 outline outline-1 outline-gray-300 dark:outline-gray-800 rounded-3xl"),p(e,"type","button")},m(t,i){D(t,e,i),g(e,l)},p(t,i){i&2&&s!==(s=t[1].t("Select Documents")+"")&&O(l,s)},d(t){t&&v(e)}}}function rt(o){let e,s,l,t=o[1].t("Knowledge")+"",i,n,c,r=o[1].t('To add documents here, upload them to the "Documents" workspace first.')+"",f,u,h,_,a,d,m,y,$=o[0].length>0&&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;n<l.length;n+=1)t[n]=$e(be(o,l,n));const i=n=>I(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n<t.length;n+=1)t[n].c();this.h()},l(n){e=w(n,"DIV",{class:!0});var c=k(e);for(let r=0;r<t.length;r+=1)t[r].l(c);c.forEach(v),this.h()},h(){p(e,"class","flex items-center mt-2 flex-wrap")},m(n,c){D(n,e,c);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null);s=!0},p(n,c){if(c&5){l=z(Object.keys(n[2]));let r;for(r=0;r<l.length;r+=1){const f=be(n,l,r);t[r]?(t[r].p(f,c),E(t[r],1)):(t[r]=$e(f),t[r].c(),E(t[r],1),t[r].m(e,null))}for(G(),r=l.length;r<t.length;r+=1)i(r);P()}},i(n){if(!s){for(let c=0;c<l.length;c+=1)E(t[c]);s=!0}},o(n){t=t.filter(Boolean);for(let c=0;c<t.length;c+=1)I(t[c]);s=!1},d(n){n&&v(e),Y(t,n)}}}function $e(o){let e,s,l,t,i,n=o[2][o[6]].name+"",c,r,f;function u(...h){return o[5](o[6],...h)}return l=new ie({props:{state:o[2][o[6]].selected?"checked":"unchecked"}}),l.$on("change",u),{c(){e=b("div"),s=b("div"),q(l.$$.fragment),t=M(),i=b("div"),c=x(n),r=M(),this.h()},l(h){e=w(h,"DIV",{class:!0});var _=k(e);s=w(_,"DIV",{class:!0});var a=k(s);N(l.$$.fragment,a),a.forEach(v),t=j(_),i=w(_,"DIV",{class:!0});var d=k(i);c=H(d,n),d.forEach(v),r=j(_),_.forEach(v),this.h()},h(){p(s,"class","self-center flex items-center"),p(i,"class","py-0.5 text-sm w-full capitalize font-medium"),p(e,"class","flex items-center gap-2 mr-3")},m(h,_){D(h,e,_),g(e,s),K(l,s,null),g(e,t),g(e,i),g(i,c),g(e,r),f=!0},p(h,_){o=h;const a={};_&4&&(a.state=o[2][o[6]].selected?"checked":"unchecked"),l.$set(a),(!f||_&4)&&n!==(n=o[2][o[6]].name+"")&&O(c,n)},i(h){f||(E(l.$$.fragment,h),f=!0)},o(h){I(l.$$.fragment,h),f=!1},d(h){h&&v(e),U(l)}}}function it(o){let e,s,l,t=o[3].t("Tools")+"",i,n,c,r=o[3].t('To select toolkits here, add them to the "Tools" workspace first.')+"",f,u,h,_,a=o[1].length>0&&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;n<l.length;n+=1)t[n]=Ie(Ee(o,l,n));const i=n=>I(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n<t.length;n+=1)t[n].c();this.h()},l(n){e=w(n,"DIV",{class:!0});var c=k(e);for(let r=0;r<t.length;r+=1)t[r].l(c);c.forEach(v),this.h()},h(){p(e,"class","flex items-center mt-2 flex-wrap")},m(n,c){D(n,e,c);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null);s=!0},p(n,c){if(c&5){l=z(Object.keys(n[2]));let r;for(r=0;r<l.length;r+=1){const f=Ee(n,l,r);t[r]?(t[r].p(f,c),E(t[r],1)):(t[r]=Ie(f),t[r].c(),E(t[r],1),t[r].m(e,null))}for(G(),r=l.length;r<t.length;r+=1)i(r);P()}},i(n){if(!s){for(let c=0;c<l.length;c+=1)E(t[c]);s=!0}},o(n){t=t.filter(Boolean);for(let c=0;c<t.length;c+=1)I(t[c]);s=!1},d(n){n&&v(e),Y(t,n)}}}function at(o){let e=o[2][o[6]].name+"",s;return{c(){s=x(e)},l(l){s=H(l,e)},m(l,t){D(l,s,t)},p(l,t){t&4&&e!==(e=l[2][l[6]].name+"")&&O(s,e)},d(l){l&&v(s)}}}function Ie(o){let e,s,l,t,i,n,c,r;function f(...u){return o[5](o[6],...u)}return l=new ie({props:{state:o[2][o[6]].selected?"checked":"unchecked"}}),l.$on("change",f),n=new ce({props:{content:o[2][o[6]].meta.description,$$slots:{default:[at]},$$scope:{ctx:o}}}),{c(){e=b("div"),s=b("div"),q(l.$$.fragment),t=M(),i=b("div"),q(n.$$.fragment),c=M(),this.h()},l(u){e=w(u,"DIV",{class:!0});var h=k(e);s=w(h,"DIV",{class:!0});var _=k(s);N(l.$$.fragment,_),_.forEach(v),t=j(h),i=w(h,"DIV",{class:!0});var a=k(i);N(n.$$.fragment,a),a.forEach(v),c=j(h),h.forEach(v),this.h()},h(){p(s,"class","self-center flex items-center"),p(i,"class","py-0.5 text-sm w-full capitalize font-medium"),p(e,"class","flex items-center gap-2 mr-3")},m(u,h){D(u,e,h),g(e,s),K(l,s,null),g(e,t),g(e,i),K(n,i,null),g(e,c),r=!0},p(u,h){o=u;const _={};h&4&&(_.state=o[2][o[6]].selected?"checked":"unchecked"),l.$set(_);const a={};h&4&&(a.content=o[2][o[6]].meta.description),h&516&&(a.$$scope={dirty:h,ctx:o}),n.$set(a)},i(u){r||(E(l.$$.fragment,u),E(n.$$.fragment,u),r=!0)},o(u){I(l.$$.fragment,u),I(n.$$.fragment,u),r=!1},d(u){u&&v(e),U(l),U(n)}}}function ft(o){let e,s,l,t=o[3].t("Filters")+"",i,n,c,r=o[3].t('To select filters here, add them to the "Functions" workspace first.')+"",f,u,h,_,a=o[1].length>0&&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;n<l.length;n+=1)t[n]=Ae(Ve(o,l,n));const i=n=>I(t[n],1,1,()=>{t[n]=null});return{c(){e=b("div");for(let n=0;n<t.length;n+=1)t[n].c();this.h()},l(n){e=w(n,"DIV",{class:!0});var c=k(e);for(let r=0;r<t.length;r+=1)t[r].l(c);c.forEach(v),this.h()},h(){p(e,"class","flex items-center mt-2 flex-wrap")},m(n,c){D(n,e,c);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null);s=!0},p(n,c){if(c&5){l=z(Object.keys(n[2]));let r;for(r=0;r<l.length;r+=1){const f=Ve(n,l,r);t[r]?(t[r].p(f,c),E(t[r],1)):(t[r]=Ae(f),t[r].c(),E(t[r],1),t[r].m(e,null))}for(G(),r=l.length;r<t.length;r+=1)i(r);P()}},i(n){if(!s){for(let c=0;c<l.length;c+=1)E(t[c]);s=!0}},o(n){t=t.filter(Boolean);for(let c=0;c<t.length;c+=1)I(t[c]);s=!1},d(n){n&&v(e),Y(t,n)}}}function dt(o){let e=o[2][o[6]].name+"",s;return{c(){s=x(e)},l(l){s=H(l,e)},m(l,t){D(l,s,t)},p(l,t){t&4&&e!==(e=l[2][l[6]].name+"")&&O(s,e)},d(l){l&&v(s)}}}function Ae(o){let e,s,l,t,i,n,c,r;function f(...u){return o[5](o[6],...u)}return l=new ie({props:{state:o[2][o[6]].selected?"checked":"unchecked"}}),l.$on("change",f),n=new ce({props:{content:o[2][o[6]].meta.description,$$slots:{default:[dt]},$$scope:{ctx:o}}}),{c(){e=b("div"),s=b("div"),q(l.$$.fragment),t=M(),i=b("div"),q(n.$$.fragment),c=M(),this.h()},l(u){e=w(u,"DIV",{class:!0});var h=k(e);s=w(h,"DIV",{class:!0});var _=k(s);N(l.$$.fragment,_),_.forEach(v),t=j(h),i=w(h,"DIV",{class:!0});var a=k(i);N(n.$$.fragment,a),a.forEach(v),c=j(h),h.forEach(v),this.h()},h(){p(s,"class","self-center flex items-center"),p(i,"class","py-0.5 text-sm w-full capitalize font-medium"),p(e,"class","flex items-center gap-2 mr-3")},m(u,h){D(u,e,h),g(e,s),K(l,s,null),g(e,t),g(e,i),K(n,i,null),g(e,c),r=!0},p(u,h){o=u;const _={};h&4&&(_.state=o[2][o[6]].selected?"checked":"unchecked"),l.$set(_);const a={};h&4&&(a.content=o[2][o[6]].meta.description),h&516&&(a.$$scope={dirty:h,ctx:o}),n.$set(a)},i(u){r||(E(l.$$.fragment,u),E(n.$$.fragment,u),r=!0)},o(u){I(l.$$.fragment,u),I(n.$$.fragment,u),r=!1},d(u){u&&v(e),U(l),U(n)}}}function ht(o){let e,s,l,t=o[3].t("Actions")+"",i,n,c,r=o[3].t('To select actions here, add them to the "Functions" workspace first.')+"",f,u,h,_,a=o[1].length>0&&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;_<f.length;_+=1)u[_]=Ce(Te(o,f,_));const h=_=>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;_<u.length;_+=1)u[_].c();this.h()},l(_){e=w(_,"DIV",{});var a=k(e);s=w(a,"DIV",{class:!0});var d=k(s);l=w(d,"DIV",{class:!0});var m=k(l);i=H(m,t),m.forEach(v),d.forEach(v),n=j(a),c=w(a,"DIV",{class:!0});var y=k(c);for(let $=0;$<u.length;$+=1)u[$].l(y);y.forEach(v),a.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","flex flex-col")},m(_,a){D(_,e,a),g(e,s),g(s,l),g(l,i),g(e,n),g(e,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(c,null);r=!0},p(_,[a]){if((!r||a&2)&&t!==(t=_[1].t("Capabilities")+"")&&O(i,t),a&11){f=z(Object.keys(_[0]));let d;for(d=0;d<f.length;d+=1){const m=Te(_,f,d);u[d]?(u[d].p(m,a),E(u[d],1)):(u[d]=Ce(m),u[d].c(),E(u[d],1),u[d].m(c,null))}for(G(),d=f.length;d<u.length;d+=1)h(d);P()}},i(_){if(!r){for(let a=0;a<f.length;a+=1)E(u[a]);r=!0}},o(_){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)I(u[a]);r=!1},d(_){_&&v(e),Y(u,_)}}}function gt(o,e,s){let l;const t=X("i18n");R(o,t,r=>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