Omnitopia's picture
Upload folder using huggingface_hub
658460c verified
import{$ as _i,s as fi,l as br,y as vr,d as kr,t as zi,z as $r,A as wr,c as yr,p as Ni,B as Ti,w as Cr}from"./index-CKzrTzGp.js";import{B as Sl}from"./Button-CYSUbtUZ.js";import{L as Co}from"./index-DhCLfoKh.js";/* empty css */import"./MarkdownCode.svelte_svelte_type_style_lang-CF3ptt4z.js";import"./StreamingBar.svelte_svelte_type_style_lang-DlRzv56K.js";import{B as Gt}from"./Block-CJdXVpa7.js";import{c as Sr}from"./Dropdown-BJOE3R5S.js";/* empty css */import{C as Li}from"./Checkbox-1fK2t2Mh.js";import{T as Er}from"./Toast-BgmbqkKw.js";import{G as qr}from"./utils-BsGrhMNe.js";import"./svelte/svelte.js";import"./Image-CnqB5dbD.js";import"./file-url-DoxvUUVV.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";/* empty css */import"./IconButton-C_HS7fTi.js";import"./Clear-By3xiIwg.js";import"./prism-python-DuIBek8H.js";import"./index-DtO3d7FT.js";import"./BlockTitle-BgPPySHJ.js";import"./Info-wHS0SDPw.js";import"./MarkdownCode-nfbL_kSJ.js";import"./DropdownArrow-DYWFcSFn.js";const{SvelteComponent:Mr,append:Ul,attr:Et,detach:zr,init:Nr,insert:Tr,noop:Gl,safe_not_equal:Lr,set_style:Ln,svg_element:Kn}=window.__gradio__svelte__internal;function jr(l){let e,t,n,i;return{c(){e=Kn("svg"),t=Kn("g"),n=Kn("path"),i=Kn("path"),Et(n,"d","M3.789,0.09C3.903,-0.024 4.088,-0.024 4.202,0.09L4.817,0.705C4.931,0.819 4.931,1.004 4.817,1.118L1.118,4.817C1.004,4.931 0.819,4.931 0.705,4.817L0.09,4.202C-0.024,4.088 -0.024,3.903 0.09,3.789L3.789,0.09Z"),Et(i,"d","M4.825,3.797C4.934,3.907 4.934,4.084 4.825,4.193L4.193,4.825C4.084,4.934 3.907,4.934 3.797,4.825L0.082,1.11C-0.027,1.001 -0.027,0.823 0.082,0.714L0.714,0.082C0.823,-0.027 1.001,-0.027 1.11,0.082L4.825,3.797Z"),Et(e,"width","100%"),Et(e,"height","100%"),Et(e,"viewBox","0 0 5 5"),Et(e,"version","1.1"),Et(e,"xmlns","http://www.w3.org/2000/svg"),Et(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),Et(e,"xml:space","preserve"),Ln(e,"fill","currentColor"),Ln(e,"fill-rule","evenodd"),Ln(e,"clip-rule","evenodd"),Ln(e,"stroke-linejoin","round"),Ln(e,"stroke-miterlimit","2")},m(s,o){Tr(s,e,o),Ul(e,t),Ul(t,n),Ul(t,i)},p:Gl,i:Gl,o:Gl,d(s){s&&zr(e)}}}class di extends Mr{constructor(e){super(),Nr(this,e,null,jr,Lr,{})}}const{SvelteComponent:Pr,append:Ot,attr:Xn,create_component:Ar,destroy_component:Rr,detach:Vl,element:pn,flush:Or,init:Dr,insert:Hl,listen:Ir,mount_component:Fr,safe_not_equal:Br,set_data:Ur,space:Wl,text:ji,transition_in:Gr,transition_out:Vr}=window.__gradio__svelte__internal,{createEventDispatcher:Hr}=window.__gradio__svelte__internal;function Wr(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b;return _=new di({}),{c(){e=pn("div"),t=pn("h1"),t.textContent="API Docs",n=Wl(),i=pn("p"),s=ji(`No API Routes found for
`),o=pn("code"),c=ji(l[0]),a=Wl(),r=pn("p"),r.innerHTML=`To expose an API endpoint of your app in this page, set the <code>api_name</code>
parameter of the event listener.
<br/>
For more information, visit the
<a href="https://gradio.app/sharing_your_app/#api-page" target="_blank">API Page guide</a>
. To hide the API documentation button and this page, set
<code>show_api=False</code>
in the
<code>Blocks.launch()</code>
method.`,u=Wl(),f=pn("button"),Ar(_.$$.fragment),Xn(o,"class","svelte-e1ha0f"),Xn(i,"class","attention svelte-e1ha0f"),Xn(e,"class","wrap prose svelte-e1ha0f"),Xn(f,"class","svelte-e1ha0f")},m(k,p){Hl(k,e,p),Ot(e,t),Ot(e,n),Ot(e,i),Ot(i,s),Ot(i,o),Ot(o,c),Ot(e,a),Ot(e,r),Hl(k,u,p),Hl(k,f,p),Fr(_,f,null),d=!0,h||(b=Ir(f,"click",l[2]),h=!0)},p(k,[p]){(!d||p&1)&&Ur(c,k[0])},i(k){d||(Gr(_.$$.fragment,k),d=!0)},o(k){Vr(_.$$.fragment,k),d=!1},d(k){k&&(Vl(e),Vl(u),Vl(f)),Rr(_),h=!1,b()}}}function Zr(l,e,t){const n=Hr();let{root:i}=e;const s=()=>n("close");return l.$$set=o=>{"root"in o&&t(0,i=o.root)},[i,n,s]}class Jr extends Pr{constructor(e){super(),Dr(this,e,Zr,Wr,Br,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Or()}}const So="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26.9425%202.94265C27.4632%202.42195%2027.4632%201.57773%2026.9425%201.05703C26.4218%200.536329%2025.5776%200.536329%2025.0569%201.05703L22.5713%203.54256C21.1213%202.59333%2019.5367%202.43378%2018.1753%202.64006C16.5495%202.88638%2015.1127%203.66838%2014.3905%204.39053L12.3905%206.39053C12.1405%206.64058%2012%206.97972%2012%207.33334C12%207.68697%2012.1405%208.0261%2012.3905%208.27615L19.7239%2015.6095C20.2446%2016.1302%2021.0888%2016.1302%2021.6095%2015.6095L23.6095%2013.6095C24.3316%2012.8873%2025.1136%2011.4505%2025.36%209.82475C25.5663%208.46312%2025.4066%206.87827%2024.4571%205.42807L26.9425%202.94265Z'%20fill='%233c4555'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.276%2012.9426C12.7967%2012.4219%2012.7967%2011.5777%2012.276%2011.057C11.7553%2010.5363%2010.9111%2010.5363%2010.3904%2011.057L8.66651%2012.7809L8.27615%2012.3905C8.0261%2012.1405%207.68697%2012%207.33334%2012C6.97972%2012%206.64058%2012.1405%206.39053%2012.3905L4.39053%2014.3905C3.66838%2015.1127%202.88638%2016.5495%202.64006%2018.1753C2.43377%2019.5367%202.59333%2021.1214%203.54262%2022.5714L1.05703%2025.057C0.536329%2025.5777%200.536329%2026.4219%201.05703%2026.9426C1.57773%2027.4633%202.42195%2027.4633%202.94265%2026.9426L5.42817%2024.4571C6.87835%2025.4066%208.46315%2025.5663%209.82475%2025.36C11.4505%2025.1136%2012.8873%2024.3316%2013.6095%2023.6095L15.6095%2021.6095C16.1302%2021.0888%2016.1302%2020.2446%2015.6095%2019.7239L15.2188%2019.3332L16.9426%2017.6093C17.4633%2017.0886%2017.4633%2016.2444%2016.9426%2015.7237C16.4219%2015.203%2015.5777%2015.203%2015.057%2015.7237L13.3332%2017.4475L10.5521%2014.6665L12.276%2012.9426Z'%20fill='%23FF7C00'/%3e%3c/svg%3e",{SvelteComponent:Qr,append:He,attr:ht,check_outros:Yr,create_component:Eo,destroy_component:qo,detach:zt,element:gt,empty:Kr,flush:Zl,group_outros:Xr,init:xr,insert:Nt,listen:ea,mount_component:Mo,noop:ta,safe_not_equal:na,set_data:Pi,space:hn,src_url_equal:la,text:kn,transition_in:On,transition_out:ul}=window.__gradio__svelte__internal,{createEventDispatcher:ia}=window.__gradio__svelte__internal;function Ai(l){let e,t;return e=new Sl({props:{size:"sm",variant:"secondary",elem_id:"start-api-recorder",$$slots:{default:[sa]},$$scope:{ctx:l}}}),e.$on("click",l[4]),{c(){Eo(e.$$.fragment)},m(n,i){Mo(e,n,i),t=!0},p(n,i){const s={};i&64&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(On(e.$$.fragment,n),t=!0)},o(n){ul(e.$$.fragment,n),t=!1},d(n){qo(e,n)}}}function sa(l){let e,t,n;return{c(){e=gt("div"),t=hn(),n=gt("p"),n.textContent="API Recorder",ht(e,"class","loading-dot self-baseline svelte-1i1gjw2"),ht(n,"class","self-baseline btn-text svelte-1i1gjw2")},m(i,s){Nt(i,e,s),Nt(i,t,s),Nt(i,n,s)},p:ta,d(i){i&&(zt(e),zt(t),zt(n))}}}function oa(l){let e;return{c(){e=kn("MCP Tool")},m(t,n){Nt(t,e,n)},d(t){t&&zt(e)}}}function ra(l){let e;return{c(){e=kn("API endpoint")},m(t,n){Nt(t,e,n)},d(t){t&&zt(e)}}}function Ri(l){let e;return{c(){e=kn("s")},m(t,n){Nt(t,e,n)},d(t){t&&zt(e)}}}function aa(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b,k,p,w,g,v,m,C,y,L=l[2]!=="mcp"&&Ai(l);function E(q,R){return q[2]!=="mcp"?ra:oa}let M=E(l),$=M(l),T=l[1]>1&&Ri();return v=new di({}),{c(){e=gt("h2"),t=gt("img"),i=hn(),s=gt("div"),o=kn(`API documentation
`),c=gt("div"),a=kn(l[0]),r=hn(),u=gt("span"),L&&L.c(),f=hn(),_=gt("p"),d=gt("span"),h=kn(l[1]),b=hn(),$.c(),k=Kr(),T&&T.c(),p=gt("br"),w=hn(),g=gt("button"),Eo(v.$$.fragment),la(t.src,n=So)||ht(t,"src",n),ht(t,"alt",""),ht(t,"class","svelte-1i1gjw2"),ht(c,"class","url svelte-1i1gjw2"),ht(s,"class","title svelte-1i1gjw2"),ht(d,"class","url svelte-1i1gjw2"),ht(u,"class","counts svelte-1i1gjw2"),ht(e,"class","svelte-1i1gjw2"),ht(g,"class","svelte-1i1gjw2")},m(q,R){Nt(q,e,R),He(e,t),He(e,i),He(e,s),He(s,o),He(s,c),He(c,a),He(e,r),He(e,u),L&&L.m(u,null),He(u,f),He(u,_),He(_,d),He(d,h),He(_,b),$.m(_,null),He(_,k),T&&T.m(_,null),He(_,p),Nt(q,w,R),Nt(q,g,R),Mo(v,g,null),m=!0,C||(y=ea(g,"click",l[5]),C=!0)},p(q,[R]){(!m||R&1)&&Pi(a,q[0]),q[2]!=="mcp"?L?(L.p(q,R),R&4&&On(L,1)):(L=Ai(q),L.c(),On(L,1),L.m(u,f)):L&&(Xr(),ul(L,1,1,()=>{L=null}),Yr()),(!m||R&2)&&Pi(h,q[1]),M!==(M=E(q))&&($.d(1),$=M(q),$&&($.c(),$.m(_,k))),q[1]>1?T||(T=Ri(),T.c(),T.m(_,p)):T&&(T.d(1),T=null)},i(q){m||(On(L),On(v.$$.fragment,q),m=!0)},o(q){ul(L),ul(v.$$.fragment,q),m=!1},d(q){q&&(zt(e),zt(w),zt(g)),L&&L.d(),$.d(),T&&T.d(),qo(v),C=!1,y()}}}function ca(l,e,t){let{root:n}=e,{api_count:i}=e,{current_language:s="python"}=e;const o=ia(),c=()=>o("close",{api_recorder_visible:!0}),a=()=>o("close");return l.$$set=r=>{"root"in r&&t(0,n=r.root),"api_count"in r&&t(1,i=r.api_count),"current_language"in r&&t(2,s=r.current_language)},[n,i,s,o,c,a]}class ua extends Qr{constructor(e){super(),xr(this,e,ca,aa,na,{root:0,api_count:1,current_language:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Zl()}get api_count(){return this.$$.ctx[1]}set api_count(e){this.$$set({api_count:e}),Zl()}get current_language(){return this.$$.ctx[2]}set current_language(e){this.$$set({current_language:e}),Zl()}}function ut(l,e,t=null){return e===void 0?t==="py"?"None":null:l===null&&t==="py"?"None":e==="string"||e==="str"?t===null?l:'"'+l+'"':e==="number"?t===null?parseFloat(l):l:e==="boolean"||e=="bool"?t==="py"?(l=String(l),l==="true"?"True":"False"):t==="js"||t==="bash"?l:l==="true":e==="List[str]"?(l=JSON.stringify(l),l):e.startsWith("Literal['")?'"'+l+'"':t===null?l===""?null:JSON.parse(l):typeof l=="string"?l===""?t==="py"?"None":"null":l:(t==="bash"&&(l=ni(l)),t==="py"&&(l=li(l)),_a(l))}function zo(l){if(typeof l=="object"&&l!==null&&l.hasOwnProperty("url")&&l.hasOwnProperty("meta")&&typeof l.meta=="object"&&l.meta!==null&&l.meta._type==="gradio.FileData")return!0;if(typeof l=="object"&&l!==null){for(let e in l)if(typeof l[e]=="object"&&zo(l[e]))return!0}return!1}function ni(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?{path:l.url,meta:{_type:"gradio.FileData"}}:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=ni(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=ni(l[e])}),l)}function li(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&"url"in l&&l.url&&"meta"in l&&l.meta?._type==="gradio.FileData"?`handle_file('${l.url}')`:(Array.isArray(l)?l.forEach((e,t)=>{typeof e=="object"&&e!==null&&(l[t]=li(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=li(l[e])}),l)}function _a(l){let e=JSON.stringify(l,(i,s)=>s===null?"UNQUOTEDNone":typeof s=="string"&&s.startsWith("handle_file(")&&s.endsWith(")")?`UNQUOTED${s}`:s);const t=/"UNQUOTEDhandle_file\(([^)]*)\)"/g;e=e.replace(t,(i,s)=>`handle_file(${s})`);const n=/"UNQUOTEDNone"/g;return e.replace(n,"None")}const{SvelteComponent:fa,append:ye,attr:It,check_outros:da,create_component:pa,destroy_component:ma,destroy_each:ha,detach:De,element:it,empty:No,ensure_array_like:Oi,flush:xn,group_outros:ga,init:ba,insert:Ie,mount_component:va,noop:ka,safe_not_equal:$a,set_data:Ft,set_style:tn,space:nn,text:Ue,toggle_class:Di,transition_in:_l,transition_out:ii}=window.__gradio__svelte__internal;function Ii(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].python_type,n[6]=e[t].component,n[7]=e[t].parameter_name,n[8]=e[t].parameter_has_default,n[9]=e[t].parameter_default,n[11]=t,n}function Fi(l){let e;return{c(){e=Ue("s")},m(t,n){Ie(t,e,n)},d(t){t&&De(e)}}}function wa(l){let e=(l[2][l[11]].type||"any")+"",t;return{c(){t=Ue(e)},m(n,i){Ie(n,t,i)},p(n,i){i&4&&e!==(e=(n[2][n[11]].type||"any")+"")&&Ft(t,e)},d(n){n&&De(t)}}}function ya(l){let e=l[5].type+"",t,n,i=l[8]&&l[9]===null&&Bi();return{c(){t=Ue(e),i&&i.c(),n=No()},m(s,o){Ie(s,t,o),i&&i.m(s,o),Ie(s,n,o)},p(s,o){o&2&&e!==(e=s[5].type+"")&&Ft(t,e),s[8]&&s[9]===null?i||(i=Bi(),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(s){s&&(De(t),De(n)),i&&i.d(s)}}}function Bi(l){let e;return{c(){e=Ue(` |
None`)},m(t,n){Ie(t,e,n)},d(t){t&&De(e)}}}function Ca(l){let e,t,n=ut(l[9],l[5].type,"py")+"",i;return{c(){e=it("span"),e.textContent="Default: ",t=it("span"),i=Ue(n),It(t,"class","code svelte-1yt946s"),tn(t,"font-size","var(--text-sm)")},m(s,o){Ie(s,e,o),Ie(s,t,o),ye(t,i)},p(s,o){o&2&&n!==(n=ut(s[9],s[5].type,"py")+"")&&Ft(i,n)},d(s){s&&(De(e),De(t))}}}function Sa(l){let e;return{c(){e=it("span"),e.textContent="Required",tn(e,"font-weight","bold")},m(t,n){Ie(t,e,n)},p:ka,d(t){t&&De(e)}}}function Ui(l){let e,t,n,i,s,o=(l[3]!=="bash"&&l[7]?l[7]:"["+l[11]+"]")+"",c,a,r,u,f,_,d,h=l[4]+"",b,k,p=l[6]+"",w,g,v=l[5].description+"",m,C;function y(q,R){return q[3]==="python"?ya:wa}let L=y(l),E=L(l);function M(q,R){return!q[8]||q[3]=="bash"?Sa:Ca}let $=M(l),T=$(l);return{c(){e=it("hr"),t=nn(),n=it("div"),i=it("p"),s=it("span"),c=Ue(o),a=nn(),r=it("span"),E.c(),u=nn(),T.c(),f=nn(),_=it("p"),d=Ue('The input value that is provided in the "'),b=Ue(h),k=Ue('" '),w=Ue(p),g=Ue(`
component. `),m=Ue(v),C=nn(),It(e,"class","hr svelte-1yt946s"),It(s,"class","code svelte-1yt946s"),tn(s,"margin-right","10px"),It(r,"class","code highlight svelte-1yt946s"),tn(r,"margin-right","10px"),tn(i,"white-space","nowrap"),tn(i,"overflow-x","auto"),It(_,"class","desc svelte-1yt946s"),tn(n,"margin","10px")},m(q,R){Ie(q,e,R),Ie(q,t,R),Ie(q,n,R),ye(n,i),ye(i,s),ye(s,c),ye(i,a),ye(i,r),E.m(r,null),ye(i,u),T.m(i,null),ye(n,f),ye(n,_),ye(_,d),ye(_,b),ye(_,k),ye(_,w),ye(_,g),ye(_,m),ye(n,C)},p(q,R){R&10&&o!==(o=(q[3]!=="bash"&&q[7]?q[7]:"["+q[11]+"]")+"")&&Ft(c,o),L===(L=y(q))&&E?E.p(q,R):(E.d(1),E=L(q),E&&(E.c(),E.m(r,null))),$===($=M(q))&&T?T.p(q,R):(T.d(1),T=$(q),T&&(T.c(),T.m(i,null))),R&2&&h!==(h=q[4]+"")&&Ft(b,h),R&2&&p!==(p=q[6]+"")&&Ft(w,p),R&2&&v!==(v=q[5].description+"")&&Ft(m,v)},d(q){q&&(De(e),De(t),De(n)),E.d(),T.d()}}}function Gi(l){let e,t,n;return t=new Co({props:{margin:!1}}),{c(){e=it("div"),pa(t.$$.fragment),It(e,"class","load-wrap")},m(i,s){Ie(i,e,s),va(t,e,null),n=!0},i(i){n||(_l(t.$$.fragment,i),n=!0)},o(i){ii(t.$$.fragment,i),n=!1},d(i){i&&De(e),ma(t)}}}function Ea(l){let e,t,n,i=l[1].length+"",s,o,c,a,r,u,f,_,d=l[1].length!=1&&Fi(),h=Oi(l[1]),b=[];for(let p=0;p<h.length;p+=1)b[p]=Ui(Ii(l,h,p));let k=l[0]&&Gi();return{c(){e=it("h4"),t=it("div"),t.innerHTML='<div class="toggle-dot svelte-1yt946s"></div>',n=Ue(`
Accepts `),s=Ue(i),o=Ue(" parameter"),d&&d.c(),c=Ue(":"),a=nn(),r=it("div");for(let p=0;p<b.length;p+=1)b[p].c();u=nn(),k&&k.c(),f=No(),It(t,"class","toggle-icon svelte-1yt946s"),It(e,"class","svelte-1yt946s"),Di(r,"hide",l[0])},m(p,w){Ie(p,e,w),ye(e,t),ye(e,n),ye(e,s),ye(e,o),d&&d.m(e,null),ye(e,c),Ie(p,a,w),Ie(p,r,w);for(let g=0;g<b.length;g+=1)b[g]&&b[g].m(r,null);Ie(p,u,w),k&&k.m(p,w),Ie(p,f,w),_=!0},p(p,[w]){if((!_||w&2)&&i!==(i=p[1].length+"")&&Ft(s,i),p[1].length!=1?d||(d=Fi(),d.c(),d.m(e,c)):d&&(d.d(1),d=null),w&14){h=Oi(p[1]);let g;for(g=0;g<h.length;g+=1){const v=Ii(p,h,g);b[g]?b[g].p(v,w):(b[g]=Ui(v),b[g].c(),b[g].m(r,null))}for(;g<b.length;g+=1)b[g].d(1);b.length=h.length}(!_||w&1)&&Di(r,"hide",p[0]),p[0]?k?w&1&&_l(k,1):(k=Gi(),k.c(),_l(k,1),k.m(f.parentNode,f)):k&&(ga(),ii(k,1,1,()=>{k=null}),da())},i(p){_||(_l(k),_=!0)},o(p){ii(k),_=!1},d(p){p&&(De(e),De(a),De(r),De(u),De(f)),d&&d.d(),ha(b,p),k&&k.d(p)}}}function qa(l,e,t){let{is_running:n}=e,{endpoint_returns:i}=e,{js_returns:s}=e,{current_language:o}=e;return l.$$set=c=>{"is_running"in c&&t(0,n=c.is_running),"endpoint_returns"in c&&t(1,i=c.endpoint_returns),"js_returns"in c&&t(2,s=c.js_returns),"current_language"in c&&t(3,o=c.current_language)},[n,i,s,o]}class Ma extends fa{constructor(e){super(),ba(this,e,qa,Ea,$a,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),xn()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),xn()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),xn()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),xn()}}const{SvelteComponent:za,create_component:Na,destroy_component:Ta,detach:La,flush:ja,init:Pa,insert:Aa,mount_component:Ra,safe_not_equal:Oa,set_data:Da,text:Ia,transition_in:Fa,transition_out:Ba}=window.__gradio__svelte__internal;function Ua(l){let e;return{c(){e=Ia(l[0])},m(t,n){Aa(t,e,n)},p(t,n){n&1&&Da(e,t[0])},d(t){t&&La(e)}}}function Ga(l){let e,t;return e=new Sl({props:{size:"sm",$$slots:{default:[Ua]},$$scope:{ctx:l}}}),e.$on("click",l[1]),{c(){Na(e.$$.fragment)},m(n,i){Ra(e,n,i),t=!0},p(n,[i]){const s={};i&9&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Fa(e.$$.fragment,n),t=!0)},o(n){Ba(e.$$.fragment,n),t=!1},d(n){Ta(e,n)}}}function Va(l,e,t){let{code:n}=e,i="copy";function s(){navigator.clipboard.writeText(n),t(0,i="copied!"),setTimeout(()=>{t(0,i="copy")},1500)}return l.$$set=o=>{"code"in o&&t(2,n=o.code)},[i,s,n]}class dt extends za{constructor(e){super(),Pa(this,e,Va,Ga,Oa,{code:2})}get code(){return this.$$.ctx[2]}set code(e){this.$$set({code:e}),ja()}}const{SvelteComponent:Ha,append:pi,attr:cn,check_outros:Wa,create_component:El,destroy_component:ql,detach:wt,element:yt,flush:Za,group_outros:Ja,init:Qa,insert:Ct,mount_component:Ml,noop:mi,safe_not_equal:Ya,space:hi,transition_in:yn,transition_out:Cn}=window.__gradio__svelte__internal;function Ka(l){let e,t,n,i,s,o;return t=new dt({props:{code:Wi}}),{c(){e=yt("div"),El(t.$$.fragment),n=hi(),i=yt("div"),s=yt("pre"),s.textContent=`$ ${Wi}`,cn(e,"class","copy svelte-hq8ezf"),cn(s,"class","svelte-hq8ezf")},m(c,a){Ct(c,e,a),Ml(t,e,null),Ct(c,n,a),Ct(c,i,a),pi(i,s),o=!0},p:mi,i(c){o||(yn(t.$$.fragment,c),o=!0)},o(c){Cn(t.$$.fragment,c),o=!1},d(c){c&&(wt(e),wt(n),wt(i)),ql(t)}}}function Xa(l){let e,t,n,i,s,o;return t=new dt({props:{code:Hi}}),{c(){e=yt("div"),El(t.$$.fragment),n=hi(),i=yt("div"),s=yt("pre"),s.textContent=`$ ${Hi}`,cn(e,"class","copy svelte-hq8ezf"),cn(s,"class","svelte-hq8ezf")},m(c,a){Ct(c,e,a),Ml(t,e,null),Ct(c,n,a),Ct(c,i,a),pi(i,s),o=!0},p:mi,i(c){o||(yn(t.$$.fragment,c),o=!0)},o(c){Cn(t.$$.fragment,c),o=!1},d(c){c&&(wt(e),wt(n),wt(i)),ql(t)}}}function xa(l){let e,t,n,i,s,o;return t=new dt({props:{code:Vi}}),{c(){e=yt("div"),El(t.$$.fragment),n=hi(),i=yt("div"),s=yt("pre"),s.textContent=`$ ${Vi}`,cn(e,"class","copy svelte-hq8ezf"),cn(s,"class","svelte-hq8ezf")},m(c,a){Ct(c,e,a),Ml(t,e,null),Ct(c,n,a),Ct(c,i,a),pi(i,s),o=!0},p:mi,i(c){o||(yn(t.$$.fragment,c),o=!0)},o(c){Cn(t.$$.fragment,c),o=!1},d(c){c&&(wt(e),wt(n),wt(i)),ql(t)}}}function ec(l){let e,t,n,i;const s=[xa,Xa,Ka],o=[];function c(a,r){return a[0]==="python"?0:a[0]==="javascript"?1:a[0]==="bash"?2:-1}return~(t=c(l))&&(n=o[t]=s[t](l)),{c(){e=yt("code"),n&&n.c(),cn(e,"class","svelte-hq8ezf")},m(a,r){Ct(a,e,r),~t&&o[t].m(e,null),i=!0},p(a,r){let u=t;t=c(a),t===u?~t&&o[t].p(a,r):(n&&(Ja(),Cn(o[u],1,1,()=>{o[u]=null}),Wa()),~t?(n=o[t],n?n.p(a,r):(n=o[t]=s[t](a),n.c()),yn(n,1),n.m(e,null)):n=null)},i(a){i||(yn(n),i=!0)},o(a){Cn(n),i=!1},d(a){a&&wt(e),~t&&o[t].d()}}}function tc(l){let e,t;return e=new Gt({props:{$$slots:{default:[ec]},$$scope:{ctx:l}}}),{c(){El(e.$$.fragment)},m(n,i){Ml(e,n,i),t=!0},p(n,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(yn(e.$$.fragment,n),t=!0)},o(n){Cn(e.$$.fragment,n),t=!1},d(n){ql(e,n)}}}let Vi="pip install gradio_client",Hi="npm i -D @gradio/client",Wi="curl --version";function nc(l,e,t){let{current_language:n}=e;return l.$$set=i=>{"current_language"in i&&t(0,n=i.current_language)},[n]}class lc extends Ha{constructor(e){super(),Qa(this,e,nc,tc,Ya,{current_language:0})}get current_language(){return this.$$.ctx[0]}set current_language(e){this.$$set({current_language:e}),Za()}}const{SvelteComponent:ic,append:$n,attr:gl,detach:gi,element:bl,empty:sc,flush:Jl,init:oc,insert:bi,noop:Zi,safe_not_equal:rc,set_data:To,text:vl}=window.__gradio__svelte__internal;function ac(l){let e,t,n,i;return{c(){e=bl("h3"),t=vl(`fn_index:
`),n=bl("span"),i=vl(l[1]),gl(n,"class","post svelte-41kcm6"),gl(e,"class","svelte-41kcm6")},m(s,o){bi(s,e,o),$n(e,t),$n(e,n),$n(n,i)},p(s,o){o&2&&To(i,s[1])},d(s){s&&gi(e)}}}function cc(l){let e,t,n,i="/"+l[0],s;return{c(){e=bl("h3"),t=vl(`api_name:
`),n=bl("span"),s=vl(i),gl(n,"class","post svelte-41kcm6"),gl(e,"class","svelte-41kcm6")},m(o,c){bi(o,e,c),$n(e,t),$n(e,n),$n(n,s)},p(o,c){c&1&&i!==(i="/"+o[0])&&To(s,i)},d(o){o&&gi(e)}}}function uc(l){let e;function t(s,o){return s[2]?cc:ac}let n=t(l),i=n(l);return{c(){i.c(),e=sc()},m(s,o){i.m(s,o),bi(s,e,o)},p(s,[o]){n===(n=t(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Zi,o:Zi,d(s){s&&gi(e),i.d(s)}}}function _c(l,e,t){let{api_name:n=null}=e,{fn_index:i=null}=e,{named:s}=e;return l.$$set=o=>{"api_name"in o&&t(0,n=o.api_name),"fn_index"in o&&t(1,i=o.fn_index),"named"in o&&t(2,s=o.named)},[n,i,s]}class Lo extends ic{constructor(e){super(),oc(this,e,_c,uc,rc,{api_name:0,fn_index:1,named:2})}get api_name(){return this.$$.ctx[0]}set api_name(e){this.$$set({api_name:e}),Jl()}get fn_index(){return this.$$.ctx[1]}set fn_index(e){this.$$set({fn_index:e}),Jl()}get named(){return this.$$.ctx[2]}set named(e){this.$$set({named:e}),Jl()}}const{SvelteComponent:fc,append:F,attr:Ce,binding_callbacks:Ql,check_outros:Ji,create_component:Zt,destroy_component:Jt,destroy_each:kl,detach:te,element:ge,empty:jo,ensure_array_like:Bt,flush:qt,group_outros:Qi,init:dc,insert:ne,mount_component:Qt,noop:pc,safe_not_equal:mc,set_data:Ne,space:zl,text:A,transition_in:_t,transition_out:ft}=window.__gradio__svelte__internal;function Yi(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function Ki(l,e,t){const n=l.slice();return n[28]=e[t].label,n[23]=e[t].parameter_name,n[29]=e[t].type,n[21]=e[t].python_type,n[30]=e[t].component,n[22]=e[t].example_input,n[31]=e[t].serializer,n[27]=t,n}function Xi(l,e,t){const n=l.slice();return n[30]=e[t].component,n[22]=e[t].example_input,n[27]=t,n}function xi(l,e,t){const n=l.slice();return n[21]=e[t].python_type,n[22]=e[t].example_input,n[23]=e[t].parameter_name,n[24]=e[t].parameter_has_default,n[25]=e[t].parameter_default,n[27]=t,n}function hc(l){let e,t;return e=new Lo({props:{named:l[5],fn_index:l[1]}}),{c(){Zt(e.$$.fragment)},m(n,i){Qt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.named=n[5]),i[0]&2&&(s.fn_index=n[1]),e.$set(s)},i(n){t||(_t(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){Jt(e,n)}}}function gc(l){let e,t;return e=new Lo({props:{named:l[5],api_name:l[0].api_name}}),{c(){Zt(e.$$.fragment)},m(n,i){Qt(e,n,i),t=!0},p(n,i){const s={};i[0]&32&&(s.named=n[5]),i[0]&1&&(s.api_name=n[0].api_name),e.$set(s)},i(n){t||(_t(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){Jt(e,n)}}}function bc(l){let e,t;return e=new Gt({props:{$$slots:{default:[$c]},$$scope:{ctx:l}}}),{c(){Zt(e.$$.fragment)},m(n,i){Qt(e,n,i),t=!0},p(n,i){const s={};i[0]&7185|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(_t(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){Jt(e,n)}}}function vc(l){let e,t;return e=new Gt({props:{$$slots:{default:[Ec]},$$scope:{ctx:l}}}),{c(){Zt(e.$$.fragment)},m(n,i){Qt(e,n,i),t=!0},p(n,i){const s={};i[0]&639|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(_t(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){Jt(e,n)}}}function kc(l){let e,t;return e=new Gt({props:{$$slots:{default:[Mc]},$$scope:{ctx:l}}}),{c(){Zt(e.$$.fragment)},m(n,i){Qt(e,n,i),t=!0},p(n,i){const s={};i[0]&349|i[1]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(_t(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){Jt(e,n)}}}function es(l){let e;return{c(){e=A(",")},m(t,n){ne(t,e,n)},d(t){t&&te(e)}}}function ts(l){let e,t=ut(l[22],l[21].type,"bash")+"",n,i,s=l[27]<l[4].length-1&&es();return{c(){e=A(`
`),n=A(t),s&&s.c(),i=jo()},m(o,c){ne(o,e,c),ne(o,n,c),s&&s.m(o,c),ne(o,i,c)},p(o,c){c[0]&16&&t!==(t=ut(o[22],o[21].type,"bash")+"")&&Ne(n,t),o[27]<o[4].length-1?s||(s=es(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&(te(e),te(n),te(i)),s&&s.d(o)}}}function $c(l){let e,t,n,i,s,o,c,a,r,u,f=l[0].api_name+"",_,d,h="{",b,k,p,w="}",g,v,m="{",C,y,L="}",E,M,$,T,q,R=l[0].api_name+"",J,Q,G;n=new dt({props:{code:l[10]?.innerText}});let O=Bt(l[4]),j=[];for(let P=0;P<O.length;P+=1)j[P]=ts(Yi(l,O,P));return{c(){e=ge("code"),t=ge("div"),Zt(n.$$.fragment),i=zl(),s=ge("div"),o=ge("pre"),c=A("curl -X POST "),a=A(l[11]),r=A(l[12]),u=A("/call/"),_=A(f),d=A(` -s -H "Content-Type: application/json" -d '`),b=A(h),k=A(`
"data": [`);for(let P=0;P<j.length;P+=1)j[P].c();p=A(`
]`),g=A(w),v=A(`' \\
| awk -F'"' '`),C=A(m),y=A(" print $4"),E=A(L),M=A(`' \\
| read EVENT_ID; curl -N `),$=A(l[11]),T=A(l[12]),q=A("/call/"),J=A(R),Q=A("/$EVENT_ID"),Ce(t,"class","copy svelte-114qcyq"),Ce(o,"class","svelte-114qcyq"),Ce(e,"class","svelte-114qcyq")},m(P,ee){ne(P,e,ee),F(e,t),Qt(n,t,null),F(e,i),F(e,s),F(s,o),F(o,c),F(o,a),F(o,r),F(o,u),F(o,_),F(o,d),F(o,b),F(o,k);for(let Pe=0;Pe<j.length;Pe+=1)j[Pe]&&j[Pe].m(o,null);F(o,p),F(o,g),F(o,v),F(o,C),F(o,y),F(o,E),F(o,M),F(o,$),F(o,T),F(o,q),F(o,J),F(o,Q),l[19](s),G=!0},p(P,ee){const Pe={};if(ee[0]&1024&&(Pe.code=P[10]?.innerText),n.$set(Pe),(!G||ee[0]&2048)&&Ne(a,P[11]),(!G||ee[0]&4096)&&Ne(r,P[12]),(!G||ee[0]&1)&&f!==(f=P[0].api_name+"")&&Ne(_,f),ee[0]&16){O=Bt(P[4]);let me;for(me=0;me<O.length;me+=1){const be=Yi(P,O,me);j[me]?j[me].p(be,ee):(j[me]=ts(be),j[me].c(),j[me].m(o,p))}for(;me<j.length;me+=1)j[me].d(1);j.length=O.length}(!G||ee[0]&2048)&&Ne($,P[11]),(!G||ee[0]&4096)&&Ne(T,P[12]),(!G||ee[0]&1)&&R!==(R=P[0].api_name+"")&&Ne(J,R)},i(P){G||(_t(n.$$.fragment,P),G=!0)},o(P){ft(n.$$.fragment,P),G=!1},d(P){P&&te(e),Jt(n),kl(j,P),l[19](null)}}}function ns(l){let e,t,n,i=l[22].url+"",s,o,c=l[30]+"",a,r,u,f;return{c(){e=A(`
const response_`),t=A(l[27]),n=A(' = await fetch("'),s=A(i),o=A(`");
const example`),a=A(c),r=A(" = await response_"),u=A(l[27]),f=A(`.blob();
`)},m(_,d){ne(_,e,d),ne(_,t,d),ne(_,n,d),ne(_,s,d),ne(_,o,d),ne(_,a,d),ne(_,r,d),ne(_,u,d),ne(_,f,d)},p:pc,d(_){_&&(te(e),te(t),te(n),te(s),te(o),te(a),te(r),te(u),te(f))}}}function ls(l){let e,t,n;return{c(){e=A(', {auth: ["'),t=A(l[6]),n=A('", **password**]}')},m(i,s){ne(i,e,s),ne(i,t,s),ne(i,n,s)},p(i,s){s[0]&64&&Ne(t,i[6])},d(i){i&&(te(e),te(t),te(n))}}}function wc(l){let e;return{c(){e=A(l[1])},m(t,n){ne(t,e,n)},p(t,n){n[0]&2&&Ne(e,t[1])},d(t){t&&te(e)}}}function yc(l){let e,t,n=l[0].api_name+"",i,s;return{c(){e=ge("span"),t=A('"/'),i=A(n),s=A('"'),Ce(e,"class","api-name svelte-114qcyq")},m(o,c){ne(o,e,c),F(e,t),F(e,i),F(e,s)},p(o,c){c[0]&1&&n!==(n=o[0].api_name+"")&&Ne(i,n)},d(o){o&&te(e)}}}function Cc(l){let e,t,n=l[23]+"",i,s,o=ut(l[22],l[21].type,"js")+"",c,a;return{c(){e=A(`
`),t=ge("span"),i=A(n),s=A(": "),c=A(o),a=A(", "),Ce(t,"class","example-inputs")},m(r,u){ne(r,e,u),ne(r,t,u),F(t,i),F(t,s),F(t,c),ne(r,a,u)},p(r,u){u[0]&16&&n!==(n=r[23]+"")&&Ne(i,n),u[0]&16&&o!==(o=ut(r[22],r[21].type,"js")+"")&&Ne(c,o)},d(r){r&&(te(e),te(t),te(a))}}}function Sc(l){let e,t,n=l[23]+"",i,s,o=l[30]+"",c,a,r;return{c(){e=A(`
`),t=ge("span"),i=A(n),s=A(": example"),c=A(o),a=A(", "),r=ge("span"),r.innerHTML="",Ce(t,"class","example-inputs"),Ce(r,"class","desc svelte-114qcyq")},m(u,f){ne(u,e,f),ne(u,t,f),F(t,i),F(t,s),F(t,c),ne(u,a,f),ne(u,r,f)},p(u,f){f[0]&16&&n!==(n=u[23]+"")&&Ne(i,n),f[0]&16&&o!==(o=u[30]+"")&&Ne(c,o)},d(u){u&&(te(e),te(t),te(a),te(r))}}}function is(l){let e,t;function n(o,c){return c[0]&16&&(e=null),e==null&&(e=!!o[14].includes(o[30])),e?Sc:Cc}let i=n(l,[-1,-1]),s=i(l);return{c(){s.c(),t=jo()},m(o,c){s.m(o,c),ne(o,t,c)},p(o,c){i===(i=n(o,c))&&s?s.p(o,c):(s.d(1),s=i(o),s&&(s.c(),s.m(t.parentNode,t)))},d(o){o&&te(t),s.d(o)}}}function Ec(l){let e,t,n,i,s,o,c,a,r,u,f=(l[3]||l[2])+"",_,d,h,b,k,p;n=new dt({props:{code:l[9]?.innerText}});let w=Bt(l[15]),g=[];for(let M=0;M<w.length;M+=1)g[M]=ns(Xi(l,w,M));let v=l[6]!==null&&ls(l);function m(M,$){return M[5]?yc:wc}let C=m(l),y=C(l),L=Bt(l[4]),E=[];for(let M=0;M<L.length;M+=1)E[M]=is(Ki(l,L,M));return{c(){e=ge("code"),t=ge("div"),Zt(n.$$.fragment),i=zl(),s=ge("div"),o=ge("pre"),c=A(`import { Client } from "@gradio/client";
`);for(let M=0;M<g.length;M+=1)g[M].c();a=A(`
const client = await Client.connect(`),r=ge("span"),u=A('"'),_=A(f),d=A('"'),v&&v.c(),h=A(`);
const result = await client.predict(`),y.c(),b=A(", { ");for(let M=0;M<E.length;M+=1)E[M].c();k=A(`
});
console.log(result.data);
`),Ce(t,"class","copy svelte-114qcyq"),Ce(r,"class","token string svelte-114qcyq"),Ce(o,"class","svelte-114qcyq"),Ce(e,"class","svelte-114qcyq")},m(M,$){ne(M,e,$),F(e,t),Qt(n,t,null),F(e,i),F(e,s),F(s,o),F(o,c);for(let T=0;T<g.length;T+=1)g[T]&&g[T].m(o,null);F(o,a),F(o,r),F(r,u),F(r,_),F(r,d),v&&v.m(o,null),F(o,h),y.m(o,null),F(o,b);for(let T=0;T<E.length;T+=1)E[T]&&E[T].m(o,null);F(o,k),l[18](s),p=!0},p(M,$){const T={};if($[0]&512&&(T.code=M[9]?.innerText),n.$set(T),$[0]&32768){w=Bt(M[15]);let q;for(q=0;q<w.length;q+=1){const R=Xi(M,w,q);g[q]?g[q].p(R,$):(g[q]=ns(R),g[q].c(),g[q].m(o,a))}for(;q<g.length;q+=1)g[q].d(1);g.length=w.length}if((!p||$[0]&12)&&f!==(f=(M[3]||M[2])+"")&&Ne(_,f),M[6]!==null?v?v.p(M,$):(v=ls(M),v.c(),v.m(o,h)):v&&(v.d(1),v=null),C===(C=m(M))&&y?y.p(M,$):(y.d(1),y=C(M),y&&(y.c(),y.m(o,b))),$[0]&16400){L=Bt(M[4]);let q;for(q=0;q<L.length;q+=1){const R=Ki(M,L,q);E[q]?E[q].p(R,$):(E[q]=is(R),E[q].c(),E[q].m(o,k))}for(;q<E.length;q+=1)E[q].d(1);E.length=L.length}},i(M){p||(_t(n.$$.fragment,M),p=!0)},o(M){ft(n.$$.fragment,M),p=!1},d(M){M&&te(e),Jt(n),kl(g,M),v&&v.d(),y.d(),kl(E,M),l[18](null)}}}function qc(l){let e;return{c(){e=A(", handle_file")},m(t,n){ne(t,e,n)},d(t){t&&te(e)}}}function ss(l){let e,t,n;return{c(){e=A(', auth=("'),t=A(l[6]),n=A('", **password**)')},m(i,s){ne(i,e,s),ne(i,t,s),ne(i,n,s)},p(i,s){s[0]&64&&Ne(t,i[6])},d(i){i&&(te(e),te(t),te(n))}}}function os(l){let e,t=l[23]?l[23]+"=":"",n,i,s=ut(l[24]?l[25]:l[22],l[21].type,"py")+"",o,c;return{c(){e=A(`
`),n=A(t),i=ge("span"),o=A(s),c=A(",")},m(a,r){ne(a,e,r),ne(a,n,r),ne(a,i,r),F(i,o),ne(a,c,r)},p(a,r){r[0]&16&&t!==(t=a[23]?a[23]+"=":"")&&Ne(n,t),r[0]&16&&s!==(s=ut(a[24]?a[25]:a[22],a[21].type,"py")+"")&&Ne(o,s)},d(a){a&&(te(e),te(n),te(i),te(c))}}}function Mc(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h=(l[3]||l[2])+"",b,k,p,w,g,v,m,C,y=l[0].api_name+"",L,E,M,$,T,q;n=new dt({props:{code:l[8]?.innerText}});let R=l[13]&&qc(),J=l[6]!==null&&ss(l),Q=Bt(l[4]),G=[];for(let O=0;O<Q.length;O+=1)G[O]=os(xi(l,Q,O));return{c(){e=ge("code"),t=ge("div"),Zt(n.$$.fragment),i=zl(),s=ge("div"),o=ge("pre"),c=ge("span"),c.textContent="from",a=A(" gradio_client "),r=ge("span"),r.textContent="import",u=A(" Client"),R&&R.c(),f=A(`
client = Client(`),_=ge("span"),d=A('"'),b=A(h),k=A('"'),J&&J.c(),p=A(`)
result = client.`),w=ge("span"),w.textContent="predict",g=A("(");for(let O=0;O<G.length;O+=1)G[O].c();v=A(`
api_name=`),m=ge("span"),C=A('"/'),L=A(y),E=A('"'),M=A(`
)
`),$=ge("span"),$.textContent="print",T=A("(result)"),Ce(t,"class","copy svelte-114qcyq"),Ce(c,"class","highlight"),Ce(r,"class","highlight"),Ce(_,"class","token string svelte-114qcyq"),Ce(w,"class","highlight"),Ce(m,"class","api-name svelte-114qcyq"),Ce($,"class","highlight"),Ce(o,"class","svelte-114qcyq"),Ce(e,"class","svelte-114qcyq")},m(O,j){ne(O,e,j),F(e,t),Qt(n,t,null),F(e,i),F(e,s),F(s,o),F(o,c),F(o,a),F(o,r),F(o,u),R&&R.m(o,null),F(o,f),F(o,_),F(_,d),F(_,b),F(_,k),J&&J.m(o,null),F(o,p),F(o,w),F(o,g);for(let P=0;P<G.length;P+=1)G[P]&&G[P].m(o,null);F(o,v),F(o,m),F(m,C),F(m,L),F(m,E),F(o,M),F(o,$),F(o,T),l[17](s),q=!0},p(O,j){const P={};if(j[0]&256&&(P.code=O[8]?.innerText),n.$set(P),(!q||j[0]&12)&&h!==(h=(O[3]||O[2])+"")&&Ne(b,h),O[6]!==null?J?J.p(O,j):(J=ss(O),J.c(),J.m(o,p)):J&&(J.d(1),J=null),j[0]&16){Q=Bt(O[4]);let ee;for(ee=0;ee<Q.length;ee+=1){const Pe=xi(O,Q,ee);G[ee]?G[ee].p(Pe,j):(G[ee]=os(Pe),G[ee].c(),G[ee].m(o,v))}for(;ee<G.length;ee+=1)G[ee].d(1);G.length=Q.length}(!q||j[0]&1)&&y!==(y=O[0].api_name+"")&&Ne(L,y)},i(O){q||(_t(n.$$.fragment,O),q=!0)},o(O){ft(n.$$.fragment,O),q=!1},d(O){O&&te(e),Jt(n),R&&R.d(),J&&J.d(),kl(G,O),l[17](null)}}}function zc(l){let e,t,n,i,s,o,c;const a=[gc,hc],r=[];function u(h,b){return h[5]?0:1}t=u(l),n=r[t]=a[t](l);const f=[kc,vc,bc],_=[];function d(h,b){return h[7]==="python"?0:h[7]==="javascript"?1:h[7]==="bash"?2:-1}return~(s=d(l))&&(o=_[s]=f[s](l)),{c(){e=ge("div"),n.c(),i=zl(),o&&o.c(),Ce(e,"class","container svelte-114qcyq")},m(h,b){ne(h,e,b),r[t].m(e,null),F(e,i),~s&&_[s].m(e,null),c=!0},p(h,b){let k=t;t=u(h),t===k?r[t].p(h,b):(Qi(),ft(r[k],1,1,()=>{r[k]=null}),Ji(),n=r[t],n?n.p(h,b):(n=r[t]=a[t](h),n.c()),_t(n,1),n.m(e,i));let p=s;s=d(h),s===p?~s&&_[s].p(h,b):(o&&(Qi(),ft(_[p],1,1,()=>{_[p]=null}),Ji()),~s?(o=_[s],o?o.p(h,b):(o=_[s]=f[s](h),o.c()),_t(o,1),o.m(e,null)):o=null)},i(h){c||(_t(n),_t(o),c=!0)},o(h){ft(n),ft(o),c=!1},d(h){h&&te(e),r[t].d(),~s&&_[s].d()}}}function Nc(l,e,t){let n,i,{dependency:s}=e,{dependency_index:o}=e,{root:c}=e,{api_prefix:a}=e,{space_id:r}=e,{endpoint_parameters:u}=e,{named:f}=e,{username:_}=e,{current_language:d}=e,h,b,k,p=u.some(y=>zo(y.example_input)),w=["Audio","File","Image","Video"],g=u.filter(y=>w.includes(y.component));function v(y){Ql[y?"unshift":"push"](()=>{h=y,t(8,h)})}function m(y){Ql[y?"unshift":"push"](()=>{b=y,t(9,b)})}function C(y){Ql[y?"unshift":"push"](()=>{k=y,t(10,k)})}return l.$$set=y=>{"dependency"in y&&t(0,s=y.dependency),"dependency_index"in y&&t(1,o=y.dependency_index),"root"in y&&t(2,c=y.root),"api_prefix"in y&&t(16,a=y.api_prefix),"space_id"in y&&t(3,r=y.space_id),"endpoint_parameters"in y&&t(4,u=y.endpoint_parameters),"named"in y&&t(5,f=y.named),"username"in y&&t(6,_=y.username),"current_language"in y&&t(7,d=y.current_language)},l.$$.update=()=>{l.$$.dirty[0]&65536&&t(12,n=a||"/"),l.$$.dirty[0]&4&&t(11,i=c.replace(/\/$/,""))},[s,o,c,r,u,f,_,d,h,b,k,i,n,p,w,g,a,v,m,C]}class Tc extends fc{constructor(e){super(),dc(this,e,Nc,zc,mc,{dependency:0,dependency_index:1,root:2,api_prefix:16,space_id:3,endpoint_parameters:4,named:5,username:6,current_language:7},null,[-1,-1])}get dependency(){return this.$$.ctx[0]}set dependency(e){this.$$set({dependency:e}),qt()}get dependency_index(){return this.$$.ctx[1]}set dependency_index(e){this.$$set({dependency_index:e}),qt()}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),qt()}get api_prefix(){return this.$$.ctx[16]}set api_prefix(e){this.$$set({api_prefix:e}),qt()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),qt()}get endpoint_parameters(){return this.$$.ctx[4]}set endpoint_parameters(e){this.$$set({endpoint_parameters:e}),qt()}get named(){return this.$$.ctx[5]}set named(e){this.$$set({named:e}),qt()}get username(){return this.$$.ctx[6]}set username(e){this.$$set({username:e}),qt()}get current_language(){return this.$$.ctx[7]}set current_language(e){this.$$set({current_language:e}),qt()}}const{SvelteComponent:Lc,append:V,attr:Oe,binding_callbacks:Yl,check_outros:jc,create_component:Nl,destroy_component:Tl,destroy_each:vi,detach:qe,element:Ee,empty:Pc,ensure_array_like:Sn,flush:Yt,group_outros:Ac,init:Rc,insert:Me,mount_component:Ll,safe_not_equal:Oc,set_data:st,space:jl,text:W,transition_in:En,transition_out:qn}=window.__gradio__svelte__internal,{onMount:Dc,tick:Ic}=window.__gradio__svelte__internal;function rs(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function as(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function cs(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Fc(l){let e,t,n,i,s,o;n=new dt({props:{code:l[6]?.innerText}});let c=Sn(l[9]),a=[];for(let r=0;r<c.length;r+=1)a[r]=us(rs(l,c,r));return{c(){e=Ee("code"),t=Ee("div"),Nl(n.$$.fragment),i=jl(),s=Ee("div");for(let r=0;r<a.length;r+=1)a[r].c();Oe(t,"class","copy svelte-j71ub0"),Oe(e,"class","svelte-j71ub0")},m(r,u){Me(r,e,u),V(e,t),Ll(n,t,null),V(e,i),V(e,s);for(let f=0;f<a.length;f+=1)a[f]&&a[f].m(s,null);l[16](s),o=!0},p(r,u){const f={};if(u&64&&(f.code=r[6]?.innerText),n.$set(f),u&513){c=Sn(r[9]);let _;for(_=0;_<c.length;_+=1){const d=rs(r,c,_);a[_]?a[_].p(d,u):(a[_]=us(d),a[_].c(),a[_].m(s,null))}for(;_<a.length;_+=1)a[_].d(1);a.length=c.length}},i(r){o||(En(n.$$.fragment,r),o=!0)},o(r){qn(n.$$.fragment,r),o=!1},d(r){r&&qe(e),Tl(n),vi(a,r),l[16](null)}}}function Bc(l){let e,t,n,i,s,o,c,a,r,u,f,_,d;n=new dt({props:{code:l[5]?.innerText}});let h=l[2]!==null&&_s(l),b=Sn(l[8]),k=[];for(let p=0;p<b.length;p+=1)k[p]=ds(as(l,b,p));return{c(){e=Ee("code"),t=Ee("div"),Nl(n.$$.fragment),i=jl(),s=Ee("div"),o=Ee("pre"),c=W(`import { Client } from "@gradio/client";
const app = await Client.connect(`),a=Ee("span"),r=W('"'),u=W(l[0]),f=W('"'),h&&h.c(),_=W(`);
`);for(let p=0;p<k.length;p+=1)k[p].c();Oe(t,"class","copy svelte-j71ub0"),Oe(a,"class","token string svelte-j71ub0"),Oe(o,"class","svelte-j71ub0"),Oe(e,"class","svelte-j71ub0")},m(p,w){Me(p,e,w),V(e,t),Ll(n,t,null),V(e,i),V(e,s),V(s,o),V(o,c),V(o,a),V(a,r),V(a,u),V(a,f),h&&h.m(o,null),V(o,_);for(let g=0;g<k.length;g+=1)k[g]&&k[g].m(o,null);l[15](s),d=!0},p(p,w){const g={};if(w&32&&(g.code=p[5]?.innerText),n.$set(g),(!d||w&1)&&st(u,p[0]),p[2]!==null?h?h.p(p,w):(h=_s(p),h.c(),h.m(o,_)):h&&(h.d(1),h=null),w&256){b=Sn(p[8]);let v;for(v=0;v<b.length;v+=1){const m=as(p,b,v);k[v]?k[v].p(m,w):(k[v]=ds(m),k[v].c(),k[v].m(o,null))}for(;v<k.length;v+=1)k[v].d(1);k.length=b.length}},i(p){d||(En(n.$$.fragment,p),d=!0)},o(p){qn(n.$$.fragment,p),d=!1},d(p){p&&qe(e),Tl(n),h&&h.d(),vi(k,p),l[15](null)}}}function Uc(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b,k;n=new dt({props:{code:l[4]}});let p=l[2]!==null&&ps(l),w=Sn(l[7]),g=[];for(let v=0;v<w.length;v+=1)g[v]=ms(cs(l,w,v));return{c(){e=Ee("code"),t=Ee("div"),Nl(n.$$.fragment),i=jl(),s=Ee("div"),o=Ee("pre"),c=Ee("span"),c.textContent="from",a=W(" gradio_client "),r=Ee("span"),r.textContent="import",u=W(` Client, file
client = Client(`),f=Ee("span"),_=W('"'),d=W(l[0]),h=W('"'),p&&p.c(),b=W(`)
`);for(let v=0;v<g.length;v+=1)g[v].c();Oe(t,"class","copy svelte-j71ub0"),Oe(c,"class","highlight"),Oe(r,"class","highlight"),Oe(f,"class","token string svelte-j71ub0"),Oe(o,"class","svelte-j71ub0"),Oe(e,"class","svelte-j71ub0")},m(v,m){Me(v,e,m),V(e,t),Ll(n,t,null),V(e,i),V(e,s),V(s,o),V(o,c),V(o,a),V(o,r),V(o,u),V(o,f),V(f,_),V(f,d),V(f,h),p&&p.m(o,null),V(o,b);for(let C=0;C<g.length;C+=1)g[C]&&g[C].m(o,null);l[14](s),k=!0},p(v,m){const C={};if(m&16&&(C.code=v[4]),n.$set(C),(!k||m&1)&&st(d,v[0]),v[2]!==null?p?p.p(v,m):(p=ps(v),p.c(),p.m(o,b)):p&&(p.d(1),p=null),m&128){w=Sn(v[7]);let y;for(y=0;y<w.length;y+=1){const L=cs(v,w,y);g[y]?g[y].p(L,m):(g[y]=ms(L),g[y].c(),g[y].m(o,null))}for(;y<g.length;y+=1)g[y].d(1);g.length=w.length}},i(v){k||(En(n.$$.fragment,v),k=!0)},o(v){qn(n.$$.fragment,v),k=!1},d(v){v&&qe(e),Tl(n),p&&p.d(),vi(g,v),l[14](null)}}}function us(l){let e,t,n,i,s=l[21]+"",o,c,a="{",r,u,f=l[20]+"",_,d,h="}",b,k,p="{",w,g,v="}",m,C,y,L,E=l[21]+"",M,$,T,q;return{c(){e=Ee("pre"),t=W("curl -X POST "),n=W(l[0]),i=W("call/"),o=W(s),c=W(` -s -H "Content-Type: application/json" -d '`),r=W(a),u=W(`
"data": [`),_=W(f),d=W("]"),b=W(h),k=W(`' \\
| awk -F'"' '`),w=W(p),g=W(" print $4"),m=W(v),C=W(`' \\
| read EVENT_ID; curl -N `),y=W(l[0]),L=W("call/"),M=W(E),$=W("/$EVENT_ID"),T=jl(),q=Ee("br"),Oe(e,"class","svelte-j71ub0")},m(R,J){Me(R,e,J),V(e,t),V(e,n),V(e,i),V(e,o),V(e,c),V(e,r),V(e,u),V(e,_),V(e,d),V(e,b),V(e,k),V(e,w),V(e,g),V(e,m),V(e,C),V(e,y),V(e,L),V(e,M),V(e,$),Me(R,T,J),Me(R,q,J)},p(R,J){J&1&&st(n,R[0]),J&512&&s!==(s=R[21]+"")&&st(o,s),J&512&&f!==(f=R[20]+"")&&st(_,f),J&1&&st(y,R[0]),J&512&&E!==(E=R[21]+"")&&st(M,E)},d(R){R&&(qe(e),qe(T),qe(q))}}}function _s(l){let e,t,n;return{c(){e=W(', {auth: ["'),t=W(l[2]),n=W('", **password**]}')},m(i,s){Me(i,e,s),Me(i,t,s),Me(i,n,s)},p(i,s){s&4&&st(t,i[2])},d(i){i&&(qe(e),qe(t),qe(n))}}}function fs(l){let e,t=l[20]+"",n;return{c(){e=W(", "),n=W(t)},m(i,s){Me(i,e,s),Me(i,n,s)},p(i,s){s&256&&t!==(t=i[20]+"")&&st(n,t)},d(i){i&&(qe(e),qe(n))}}}function ds(l){let e,t,n,i=l[21]+"",s,o,c,a=l[20]&&fs(l);return{c(){e=W(`
await client.predict(`),t=Ee("span"),n=W(`
"/`),s=W(i),o=W('"'),a&&a.c(),c=W(`);
`),Oe(t,"class","api-name svelte-j71ub0")},m(r,u){Me(r,e,u),Me(r,t,u),V(t,n),V(t,s),V(t,o),a&&a.m(r,u),Me(r,c,u)},p(r,u){u&256&&i!==(i=r[21]+"")&&st(s,i),r[20]?a?a.p(r,u):(a=fs(r),a.c(),a.m(c.parentNode,c)):a&&(a.d(1),a=null)},d(r){r&&(qe(e),qe(t),qe(c)),a&&a.d(r)}}}function ps(l){let e,t,n;return{c(){e=W(', auth=("'),t=W(l[2]),n=W('", **password**)')},m(i,s){Me(i,e,s),Me(i,t,s),Me(i,n,s)},p(i,s){s&4&&st(t,i[2])},d(i){i&&(qe(e),qe(t),qe(n))}}}function ms(l){let e,t,n,i=l[20]+"",s,o,c,a,r=l[21]+"",u,f,_;return{c(){e=W(`
client.`),t=Ee("span"),n=W(`predict(
`),s=W(i),o=W(" api_name="),c=Ee("span"),a=W('"/'),u=W(r),f=W('"'),_=W(`
)
`),Oe(c,"class","api-name svelte-j71ub0"),Oe(t,"class","highlight")},m(d,h){Me(d,e,h),Me(d,t,h),V(t,n),V(t,s),V(t,o),V(t,c),V(c,a),V(c,u),V(c,f),V(t,_)},p(d,h){h&128&&i!==(i=d[20]+"")&&st(s,i),h&128&&r!==(r=d[21]+"")&&st(u,r)},d(d){d&&(qe(e),qe(t))}}}function Gc(l){let e,t,n,i;const s=[Uc,Bc,Fc],o=[];function c(a,r){return a[1]==="python"?0:a[1]==="javascript"?1:a[1]==="bash"?2:-1}return~(e=c(l))&&(t=o[e]=s[e](l)),{c(){t&&t.c(),n=Pc()},m(a,r){~e&&o[e].m(a,r),Me(a,n,r),i=!0},p(a,r){let u=e;e=c(a),e===u?~e&&o[e].p(a,r):(t&&(Ac(),qn(o[u],1,1,()=>{o[u]=null}),jc()),~e?(t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),En(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(En(t),i=!0)},o(a){qn(t),i=!1},d(a){a&&qe(n),~e&&o[e].d(a)}}}function Vc(l){let e,t,n;return t=new Gt({props:{border_mode:"focus",$$slots:{default:[Gc]},$$scope:{ctx:l}}}),{c(){e=Ee("div"),Nl(t.$$.fragment),Oe(e,"class","container svelte-j71ub0")},m(i,s){Me(i,e,s),Ll(t,e,null),n=!0},p(i,[s]){const o={};s&268436479&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(En(t.$$.fragment,i),n=!0)},o(i){qn(t.$$.fragment,i),n=!1},d(i){i&&qe(e),Tl(t)}}}function Hc(l,e,t){let{dependencies:n}=e,{short_root:i}=e,{root:s}=e,{api_prefix:o=""}=e,{current_language:c}=e,{username:a}=e,r,u,f,_,{api_calls:d=[]}=e;async function h(){return await(await fetch(s.replace(/\/$/,"")+o+"/info/?all_endpoints=true")).json()}let b,k=[],p=[],w=[];function g(y,L){const E=`/${n[y.fn_index].api_name}`,$=y.data.filter(T=>typeof T<"u").map((T,q)=>{if(b[E]){const R=b[E].parameters[q];if(!R)return;const J=R.parameter_name,Q=R.python_type.type;if(L==="py")return` ${J}=${ut(T,Q,"py")}`;if(L==="js")return` ${J}: ${ut(T,Q,"js")}`;if(L==="bash")return` ${ut(T,Q,"bash")}`}return` ${ut(T,void 0,L)}`}).filter(T=>typeof T<"u").join(`,
`);if($){if(L==="py")return`${$},
`;if(L==="js")return`{
${$},
}`;if(L==="bash")return`
${$}
`}return L==="py"?"":`
`}Dc(async()=>{b=(await h()).named_endpoints;let L=d.map(T=>g(T,"py")),E=d.map(T=>g(T,"js")),M=d.map(T=>g(T,"bash")),$=d.map(T=>n[T.fn_index].api_name||"");t(7,k=L.map((T,q)=>({call:T,api_name:$[q]}))),t(8,p=E.map((T,q)=>({call:T,api_name:$[q]}))),t(9,w=M.map((T,q)=>({call:T,api_name:$[q]}))),await Ic(),t(4,u=r.innerText)});function v(y){Yl[y?"unshift":"push"](()=>{r=y,t(3,r)})}function m(y){Yl[y?"unshift":"push"](()=>{f=y,t(5,f)})}function C(y){Yl[y?"unshift":"push"](()=>{_=y,t(6,_)})}return l.$$set=y=>{"dependencies"in y&&t(10,n=y.dependencies),"short_root"in y&&t(0,i=y.short_root),"root"in y&&t(11,s=y.root),"api_prefix"in y&&t(12,o=y.api_prefix),"current_language"in y&&t(1,c=y.current_language),"username"in y&&t(2,a=y.username),"api_calls"in y&&t(13,d=y.api_calls)},[i,c,a,r,u,f,_,k,p,w,n,s,o,d,v,m,C]}class Wc extends Lc{constructor(e){super(),Rc(this,e,Hc,Vc,Oc,{dependencies:10,short_root:0,root:11,api_prefix:12,current_language:1,username:2,api_calls:13})}get dependencies(){return this.$$.ctx[10]}set dependencies(e){this.$$set({dependencies:e}),Yt()}get short_root(){return this.$$.ctx[0]}set short_root(e){this.$$set({short_root:e}),Yt()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),Yt()}get api_prefix(){return this.$$.ctx[12]}set api_prefix(e){this.$$set({api_prefix:e}),Yt()}get current_language(){return this.$$.ctx[1]}set current_language(e){this.$$set({current_language:e}),Yt()}get username(){return this.$$.ctx[2]}set username(e){this.$$set({username:e}),Yt()}get api_calls(){return this.$$.ctx[13]}set api_calls(e){this.$$set({api_calls:e}),Yt()}}const Zc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3cpath%20d='M15.84.5a16.4,16.4,0,0,0-3.57.32C9.1,1.39,8.53,2.53,8.53,4.64V7.48H16v1H5.77a4.73,4.73,0,0,0-4.7,3.74,14.82,14.82,0,0,0,0,7.54c.57,2.28,1.86,3.82,4,3.82h2.6V20.14a4.73,4.73,0,0,1,4.63-4.63h7.38a3.72,3.72,0,0,0,3.73-3.73V4.64A4.16,4.16,0,0,0,19.65.82,20.49,20.49,0,0,0,15.84.5ZM11.78,2.77a1.39,1.39,0,0,1,1.38,1.46,1.37,1.37,0,0,1-1.38,1.38A1.42,1.42,0,0,1,10.4,4.23,1.44,1.44,0,0,1,11.78,2.77Z'%20fill='%235a9fd4'%20%3e%3c/path%3e%3cpath%20d='M16.16,31.5a16.4,16.4,0,0,0,3.57-.32c3.17-.57,3.74-1.71,3.74-3.82V24.52H16v-1H26.23a4.73,4.73,0,0,0,4.7-3.74,14.82,14.82,0,0,0,0-7.54c-.57-2.28-1.86-3.82-4-3.82h-2.6v3.41a4.73,4.73,0,0,1-4.63,4.63H12.35a3.72,3.72,0,0,0-3.73,3.73v7.14a4.16,4.16,0,0,0,3.73,3.82A20.49,20.49,0,0,0,16.16,31.5Zm4.06-2.27a1.39,1.39,0,0,1-1.38-1.46,1.37,1.37,0,0,1,1.38-1.38,1.42,1.42,0,0,1,1.38,1.38A1.44,1.44,0,0,1,20.22,29.23Z'%20fill='%23ffd43b'%20%3e%3c/path%3e%3c/svg%3e",Jc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20focusable='false'%20role='img'%20width='1em'%20height='1em'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%2032%2032'%20%3e%3crect%20width='32'%20height='32'%20fill='%23f7df1e'%3e%3c/rect%3e%3cpath%20d='M21.5,25a3.27,3.27,0,0,0,3,1.83c1.25,0,2-.63,2-1.49,0-1-.81-1.39-2.19-2L23.56,23C21.39,22.1,20,20.94,20,18.49c0-2.25,1.72-4,4.41-4a4.44,4.44,0,0,1,4.27,2.41l-2.34,1.5a2,2,0,0,0-1.93-1.29,1.31,1.31,0,0,0-1.44,1.29c0,.9.56,1.27,1.85,1.83l.75.32c2.55,1.1,4,2.21,4,4.72,0,2.71-2.12,4.19-5,4.19a5.78,5.78,0,0,1-5.48-3.07Zm-10.63.26c.48.84.91,1.55,1.94,1.55s1.61-.39,1.61-1.89V14.69h3V25c0,3.11-1.83,4.53-4.49,4.53a4.66,4.66,0,0,1-4.51-2.75Z'%20%3e%3c/path%3e%3c/svg%3e",Qc="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20version='1.1'%20id='Layer_1'%20x='0px'%20y='0px'%20viewBox='0%200%20150%20150'%20style='enable-background:new%200%200%20150%20150;%20background-color:%20%2372a824;'%20xml:space='preserve'%3e%3cscript%20xmlns=''/%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23FFFFFF;}%20%3c/style%3e%3cg%3e%3cpath%20class='st0'%20d='M118.9,40.3L81.7,18.2c-2.2-1.3-4.7-2-7.2-2s-5,0.7-7.2,2L30.1,40.3c-4.4,2.6-7.2,7.5-7.2,12.8v44.2%20c0,5.3,2.7,10.1,7.2,12.8l37.2,22.1c2.2,1.3,4.7,2,7.2,2c2.5,0,5-0.7,7.2-2l37.2-22.1c4.4-2.6,7.2-7.5,7.2-12.8V53%20C126.1,47.8,123.4,42.9,118.9,40.3z%20M90.1,109.3l0.1,3.2c0,0.4-0.2,0.8-0.5,1l-1.9,1.1c-0.3,0.2-0.5,0-0.6-0.4l0-3.1%20c-1.6,0.7-3.2,0.8-4.3,0.4c-0.2-0.1-0.3-0.4-0.2-0.7l0.7-2.9c0.1-0.2,0.2-0.5,0.3-0.6c0.1-0.1,0.1-0.1,0.2-0.1%20c0.1-0.1,0.2-0.1,0.3,0c1.1,0.4,2.6,0.2,3.9-0.5c1.8-0.9,2.9-2.7,2.9-4.5c0-1.6-0.9-2.3-3-2.3c-2.7,0-5.2-0.5-5.3-4.5%20c0-3.3,1.7-6.7,4.4-8.8l0-3.2c0-0.4,0.2-0.8,0.5-1l1.8-1.2c0.3-0.2,0.5,0,0.6,0.4l0,3.2c1.3-0.5,2.5-0.7,3.6-0.4%20c0.2,0.1,0.3,0.4,0.2,0.7l-0.7,2.8c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.2,0.1-0.3,0%20c-0.5-0.1-1.6-0.4-3.4,0.6c-1.9,1-2.6,2.6-2.5,3.8c0,1.5,0.8,1.9,3.3,1.9c3.4,0.1,4.9,1.6,5,5C94.7,103.4,92.9,107,90.1,109.3z%20M109.6,103.9c0,0.3,0,0.6-0.3,0.7l-9.4,5.7c-0.2,0.1-0.4,0-0.4-0.3v-2.4c0-0.3,0.2-0.5,0.4-0.6l9.3-5.5c0.2-0.1,0.4,0,0.4,0.3%20V103.9z%20M116.1,49.6L80.9,71.3c-4.4,2.6-7.6,5.4-7.6,10.7v43.4c0,3.2,1.3,5.2,3.2,5.8c-0.6,0.1-1.3,0.2-2,0.2%20c-2.1,0-4.1-0.6-5.9-1.6l-37.2-22.1c-3.6-2.2-5.9-6.2-5.9-10.5V53c0-4.3,2.3-8.4,5.9-10.5l37.2-22.1c1.8-1.1,3.8-1.6,5.9-1.6%20s4.1,0.6,5.9,1.6l37.2,22.1c3.1,1.8,5.1,5,5.7,8.5C122.1,48.4,119.3,47.7,116.1,49.6z'/%3e%3c/g%3e%3c/svg%3e",{SvelteComponent:Yc,append:lt,attr:an,check_outros:Kc,create_component:Xc,destroy_component:xc,destroy_each:eu,detach:Fe,element:kt,empty:tu,ensure_array_like:hs,flush:el,group_outros:nu,init:lu,insert:Be,mount_component:iu,noop:su,safe_not_equal:ou,set_data:Mn,set_style:ru,space:gn,text:ot,toggle_class:gs,transition_in:fl,transition_out:si}=window.__gradio__svelte__internal;function bs(l,e,t){const n=l.slice();return n[4]=e[t].label,n[5]=e[t].type,n[6]=e[t].python_type,n[7]=e[t].component,n[8]=e[t].serializer,n[10]=t,n}function au(l){let e;return{c(){e=ot("1 element")},m(t,n){Be(t,e,n)},p:su,d(t){t&&Fe(e)}}}function cu(l){let e=l[3]=="python"?"tuple":"list",t,n,i=l[1].length+"",s,o;return{c(){t=ot(e),n=ot(" of "),s=ot(i),o=ot(`
elements`)},m(c,a){Be(c,t,a),Be(c,n,a),Be(c,s,a),Be(c,o,a)},p(c,a){a&8&&e!==(e=c[3]=="python"?"tuple":"list")&&Mn(t,e),a&2&&i!==(i=c[1].length+"")&&Mn(s,i)},d(c){c&&(Fe(t),Fe(n),Fe(s),Fe(o))}}}function vs(l){let e;return{c(){e=kt("span"),e.textContent=`[${l[10]}]`,an(e,"class","code svelte-16h224k")},m(t,n){Be(t,e,n)},d(t){t&&Fe(e)}}}function uu(l){let e=l[2][l[10]].type+"",t;return{c(){t=ot(e)},m(n,i){Be(n,t,i)},p(n,i){i&4&&e!==(e=n[2][n[10]].type+"")&&Mn(t,e)},d(n){n&&Fe(t)}}}function _u(l){let e=l[6].type+"",t;return{c(){t=ot(e)},m(n,i){Be(n,t,i)},p(n,i){i&2&&e!==(e=n[6].type+"")&&Mn(t,e)},d(n){n&&Fe(t)}}}function ks(l){let e,t,n,i,s,o,c,a,r,u=l[4]+"",f,_,d=l[7]+"",h,b,k,p=l[1].length>1&&vs(l);function w(m,C){return m[3]==="python"?_u:uu}let g=w(l),v=g(l);return{c(){e=kt("hr"),t=gn(),n=kt("div"),i=kt("p"),p&&p.c(),s=gn(),o=kt("span"),v.c(),c=gn(),a=kt("p"),r=ot('The output value that appears in the "'),f=ot(u),_=ot('" '),h=ot(d),b=ot(`
component.`),k=gn(),an(e,"class","hr svelte-16h224k"),an(o,"class","code highlight svelte-16h224k"),an(a,"class","desc svelte-16h224k"),ru(n,"margin","10px")},m(m,C){Be(m,e,C),Be(m,t,C),Be(m,n,C),lt(n,i),p&&p.m(i,null),lt(i,s),lt(i,o),v.m(o,null),lt(n,c),lt(n,a),lt(a,r),lt(a,f),lt(a,_),lt(a,h),lt(a,b),lt(n,k)},p(m,C){m[1].length>1?p||(p=vs(m),p.c(),p.m(i,s)):p&&(p.d(1),p=null),g===(g=w(m))&&v?v.p(m,C):(v.d(1),v=g(m),v&&(v.c(),v.m(o,null))),C&2&&u!==(u=m[4]+"")&&Mn(f,u),C&2&&d!==(d=m[7]+"")&&Mn(h,d)},d(m){m&&(Fe(e),Fe(t),Fe(n)),p&&p.d(),v.d()}}}function $s(l){let e,t,n;return t=new Co({props:{margin:!1}}),{c(){e=kt("div"),Xc(t.$$.fragment),an(e,"class","load-wrap")},m(i,s){Be(i,e,s),iu(t,e,null),n=!0},i(i){n||(fl(t.$$.fragment,i),n=!0)},o(i){si(t.$$.fragment,i),n=!1},d(i){i&&Fe(e),xc(t)}}}function fu(l){let e,t,n,i,s,o,c,a;function r(b,k){return b[1].length>1?cu:au}let u=r(l),f=u(l),_=hs(l[1]),d=[];for(let b=0;b<_.length;b+=1)d[b]=ks(bs(l,_,b));let h=l[0]&&$s();return{c(){e=kt("h4"),t=kt("div"),t.innerHTML='<div class="toggle-dot toggle-right svelte-16h224k"></div>',n=ot(`
Returns `),f.c(),i=gn(),s=kt("div");for(let b=0;b<d.length;b+=1)d[b].c();o=gn(),h&&h.c(),c=tu(),an(t,"class","toggle-icon svelte-16h224k"),an(e,"class","svelte-16h224k"),gs(s,"hide",l[0])},m(b,k){Be(b,e,k),lt(e,t),lt(e,n),f.m(e,null),Be(b,i,k),Be(b,s,k);for(let p=0;p<d.length;p+=1)d[p]&&d[p].m(s,null);Be(b,o,k),h&&h.m(b,k),Be(b,c,k),a=!0},p(b,[k]){if(u===(u=r(b))&&f?f.p(b,k):(f.d(1),f=u(b),f&&(f.c(),f.m(e,null))),k&14){_=hs(b[1]);let p;for(p=0;p<_.length;p+=1){const w=bs(b,_,p);d[p]?d[p].p(w,k):(d[p]=ks(w),d[p].c(),d[p].m(s,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=_.length}(!a||k&1)&&gs(s,"hide",b[0]),b[0]?h?k&1&&fl(h,1):(h=$s(),h.c(),fl(h,1),h.m(c.parentNode,c)):h&&(nu(),si(h,1,1,()=>{h=null}),Kc())},i(b){a||(fl(h),a=!0)},o(b){si(h),a=!1},d(b){b&&(Fe(e),Fe(i),Fe(s),Fe(o),Fe(c)),f.d(),eu(d,b),h&&h.d(b)}}}function du(l,e,t){let{is_running:n}=e,{endpoint_returns:i}=e,{js_returns:s}=e,{current_language:o}=e;return l.$$set=c=>{"is_running"in c&&t(0,n=c.is_running),"endpoint_returns"in c&&t(1,i=c.endpoint_returns),"js_returns"in c&&t(2,s=c.js_returns),"current_language"in c&&t(3,o=c.current_language)},[n,i,s,o]}class pu extends Yc{constructor(e){super(),lu(this,e,du,fu,ou,{is_running:0,endpoint_returns:1,js_returns:2,current_language:3})}get is_running(){return this.$$.ctx[0]}set is_running(e){this.$$set({is_running:e}),el()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),el()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),el()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),el()}}const mu=""+new URL("mcp-DNm9doVd.svg",import.meta.url).href,{SvelteComponent:hu,append:D,attr:B,bubble:ws,check_outros:Vt,create_component:Ke,destroy_component:Xe,destroy_each:Pl,detach:z,element:I,empty:Nn,ensure_array_like:Ht,flush:Kt,group_outros:Wt,init:gu,insert:N,listen:Po,mount_component:xe,noop:rt,safe_not_equal:bu,set_data:$t,set_style:en,space:ie,src_url_equal:vu,text:H,transition_in:se,transition_out:ae}=window.__gradio__svelte__internal,{onMount:ku,createEventDispatcher:$u}=window.__gradio__svelte__internal;function ys(l,e,t){const n=l.slice();return n[24]=e[t],n[26]=t,n}function Cs(l,e,t){const n=l.slice();return n[27]=e[t],n[28]=e,n[29]=t,n}function Ss(l,e,t){const n=l.slice();return n[30]=e[t][0],n[31]=e[t][1],n}function Es(l,e,t){const n=l.slice();return n[34]=e[t][0],n[35]=e[t][1],n[36]=e[t][2],n}function qs(l){let e,t,n,i;const s=[yu,wu],o=[];function c(a,r){return a[11]?0:1}return e=c(l),t=o[e]=s[e](l),{c(){t.c(),n=Nn()},m(a,r){o[e].m(a,r),N(a,n,r),i=!0},p(a,r){t.p(a,r)},i(a){i||(se(t),i=!0)},o(a){ae(t),i=!1},d(a){a&&z(n),o[e].d(a)}}}function wu(l){let e,t;return e=new Jr({props:{root:l[0]}}),e.$on("close",l[20]),{c(){Ke(e.$$.fragment)},m(n,i){xe(e,n,i),t=!0},p(n,i){const s={};i[0]&1&&(s.root=n[0]),e.$set(s)},i(n){t||(se(e.$$.fragment,n),t=!0)},o(n){ae(e.$$.fragment,n),t=!1},d(n){Xe(e,n)}}}function yu(l){let e,t,n,i,s,o,c,a,r,u,f,_,d;t=new ua({props:{root:l[3]||l[0],api_count:l[11],current_language:l[6]}}),t.$on("close",l[16]);let h=Ht(l[12]),b=[];for(let v=0;v<h.length;v+=1)b[v]=Ms(Es(l,h,v));const k=[Su,Cu],p=[];function w(v,m){return v[5].length?0:1}u=w(l),f=p[u]=k[u](l);let g=l[6]!=="mcp"&&Rs(l);return{c(){e=I("div"),Ke(t.$$.fragment),n=ie(),i=I("div"),s=I("div"),s.innerHTML='<p style="font-size: var(--text-lg);">Choose one of the following ways to interact with the API.</p>',o=ie(),c=I("div"),a=I("div");for(let v=0;v<b.length;v+=1)b[v].c();r=ie(),f.c(),_=ie(),g&&g.c(),B(e,"class","banner-wrap svelte-mko7us"),B(s,"class","client-doc svelte-mko7us"),B(a,"class","snippets svelte-mko7us"),B(c,"class","endpoint svelte-mko7us"),B(i,"class","docs-wrap svelte-mko7us")},m(v,m){N(v,e,m),xe(t,e,null),N(v,n,m),N(v,i,m),D(i,s),D(i,o),D(i,c),D(c,a);for(let C=0;C<b.length;C+=1)b[C]&&b[C].m(a,null);D(c,r),p[u].m(c,null),D(c,_),g&&g.m(c,null),d=!0},p(v,m){const C={};if(m[0]&9&&(C.root=v[3]||v[0]),m[0]&64&&(C.current_language=v[6]),t.$set(C),m[0]&4160){h=Ht(v[12]);let L;for(L=0;L<h.length;L+=1){const E=Es(v,h,L);b[L]?b[L].p(E,m):(b[L]=Ms(E),b[L].c(),b[L].m(a,null))}for(;L<b.length;L+=1)b[L].d(1);b.length=h.length}let y=u;u=w(v),u===y?p[u].p(v,m):(Wt(),ae(p[y],1,1,()=>{p[y]=null}),Vt(),f=p[u],f?f.p(v,m):(f=p[u]=k[u](v),f.c()),se(f,1),f.m(c,_)),v[6]!=="mcp"?g?(g.p(v,m),m[0]&64&&se(g,1)):(g=Rs(v),g.c(),se(g,1),g.m(c,null)):g&&(Wt(),ae(g,1,1,()=>{g=null}),Vt())},i(v){d||(se(t.$$.fragment,v),se(f),se(g),d=!0)},o(v){ae(t.$$.fragment,v),ae(f),ae(g),d=!1},d(v){v&&(z(e),z(n),z(i)),Xe(t),Pl(b,v),p[u].d(),g&&g.d()}}}function Ms(l){let e,t,n,i,s=l[35]+"",o,c,a,r,u;function f(){return l[17](l[34])}return{c(){e=I("li"),t=I("img"),i=ie(),o=H(s),c=ie(),vu(t.src,n=l[36])||B(t,"src",n),B(t,"alt",""),B(t,"class","svelte-mko7us"),B(e,"class",a="snippet "+(l[6]===l[34]?"current-lang":"inactive-lang")+" svelte-mko7us")},m(_,d){N(_,e,d),D(e,t),D(e,i),D(e,o),D(e,c),r||(u=Po(e,"click",f),r=!0)},p(_,d){l=_,d[0]&64&&a!==(a="snippet "+(l[6]===l[34]?"current-lang":"inactive-lang")+" svelte-mko7us")&&B(e,"class",a)},d(_){_&&z(e),r=!1,u()}}}function Cu(l){let e,t,n,i,s,o;const c=[Mu,qu,Eu],a=[];function r(f,_){return f[6]=="python"||f[6]=="javascript"?0:f[6]=="mcp"?1:2}t=r(l),n=a[t]=c[t](l);let u=l[6]!=="mcp"&&Ls(l);return{c(){e=I("p"),n.c(),i=ie(),u&&u.c(),s=Nn(),B(e,"class","padded svelte-mko7us")},m(f,_){N(f,e,_),a[t].m(e,null),N(f,i,_),u&&u.m(f,_),N(f,s,_),o=!0},p(f,_){let d=t;t=r(f),t===d?a[t].p(f,_):(Wt(),ae(a[d],1,1,()=>{a[d]=null}),Vt(),n=a[t],n?n.p(f,_):(n=a[t]=c[t](f),n.c()),se(n,1),n.m(e,null)),f[6]!=="mcp"?u?(u.p(f,_),_[0]&64&&se(u,1)):(u=Ls(f),u.c(),se(u,1),u.m(s.parentNode,s)):u&&(Wt(),ae(u,1,1,()=>{u=null}),Vt())},i(f){o||(se(n),se(u),o=!0)},o(f){ae(n),ae(u),o=!1},d(f){f&&(z(e),z(i),z(s)),a[t].d(),u&&u.d(f)}}}function Su(l){let e,t,n,i,s,o=l[5].length+"",c,a,r,u,f,_,d,h,b,k,p,w,g,v;return b=new Wc({props:{current_language:l[6],api_calls:l[5],dependencies:l[1],root:l[0],api_prefix:l[2].api_prefix,short_root:l[3]||l[0],username:l[4]}}),{c(){e=I("div"),t=I("p"),n=H("🪄 Recorded API Calls "),i=I("span"),s=H("["),c=H(o),a=H("]"),r=ie(),u=I("p"),f=H(`Here is the code snippet to replay the most recently recorded API
calls using the `),_=H(l[6]),d=H(`
client.`),h=ie(),Ke(b.$$.fragment),k=ie(),p=I("p"),p.textContent=`Note: Some API calls only affect the UI, so when using the
clients, the desired result may be achieved with only a subset of
the recorded calls.`,w=ie(),g=I("p"),g.textContent="API Documentation",B(i,"class","api-count svelte-mko7us"),B(t,"id","num-recorded-api-calls"),en(t,"font-size","var(--text-lg)"),en(t,"font-weight","bold"),en(t,"margin","10px 0px"),en(g,"font-size","var(--text-lg)"),en(g,"font-weight","bold"),en(g,"margin","30px 0px 10px")},m(m,C){N(m,e,C),D(e,t),D(t,n),D(t,i),D(i,s),D(i,c),D(i,a),D(e,r),D(e,u),D(u,f),D(u,_),D(u,d),D(e,h),xe(b,e,null),D(e,k),D(e,p),N(m,w,C),N(m,g,C),v=!0},p(m,C){(!v||C[0]&32)&&o!==(o=m[5].length+"")&&$t(c,o),(!v||C[0]&64)&&$t(_,m[6]);const y={};C[0]&64&&(y.current_language=m[6]),C[0]&32&&(y.api_calls=m[5]),C[0]&2&&(y.dependencies=m[1]),C[0]&1&&(y.root=m[0]),C[0]&4&&(y.api_prefix=m[2].api_prefix),C[0]&9&&(y.short_root=m[3]||m[0]),C[0]&16&&(y.username=m[4]),b.$set(y)},i(m){v||(se(b.$$.fragment,m),v=!0)},o(m){ae(b.$$.fragment,m),v=!1},d(m){m&&(z(e),z(w),z(g)),Xe(b)}}}function Eu(l){let e;return{c(){e=H("1. Confirm that you have cURL installed on your system.")},m(t,n){N(t,e,n)},p:rt,i:rt,o:rt,d(t){t&&z(e)}}}function qu(l){let e,t,n,i;const s=[Nu,zu],o=[];function c(a,r){return a[7]?0:1}return e=c(l),t=o[e]=s[e](l),{c(){t.c(),n=Nn()},m(a,r){o[e].m(a,r),N(a,n,r),i=!0},p(a,r){let u=e;e=c(a),e===u?o[e].p(a,r):(Wt(),ae(o[u],1,1,()=>{o[u]=null}),Vt(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),se(t,1),t.m(n.parentNode,n))},i(a){i||(se(t),i=!0)},o(a){ae(t),i=!1},d(a){a&&z(n),o[e].d(a)}}}function Mu(l){let e,t,n,i,s,o,c,a;return{c(){e=H(`1. Install the
`),t=I("span"),n=H(l[6]),i=H(`
client (`),s=I("a"),o=H("docs"),a=H(") if you don't already have it installed."),en(t,"text-transform","capitalize"),B(s,"href",c=l[6]=="python"?wl:$l),B(s,"target","_blank"),B(s,"class","svelte-mko7us")},m(r,u){N(r,e,u),N(r,t,u),D(t,n),N(r,i,u),N(r,s,u),D(s,o),N(r,a,u)},p(r,u){u[0]&64&&$t(n,r[6]),u[0]&64&&c!==(c=r[6]=="python"?wl:$l)&&B(s,"href",c)},i:rt,o:rt,d(r){r&&(z(e),z(t),z(i),z(s),z(a))}}}function zu(l){let e,t,n,i,s,o,c;return{c(){e=H(`This Gradio app can also serve as an MCP server, with an MCP
tool corresponding to each API endpoint. To enable this, launch
this Gradio app with `),t=I("code"),t.textContent=".launch(mcp_server=True)",n=H(` or
set the `),i=I("code"),i.textContent="GRADIO_MCP_SERVER",s=H(` env variable to
`),o=I("code"),o.textContent='"True"',c=H("."),B(t,"class","svelte-mko7us"),B(i,"class","svelte-mko7us"),B(o,"class","svelte-mko7us")},m(a,r){N(a,e,r),N(a,t,r),N(a,n,r),N(a,i,r),N(a,s,r),N(a,o,r),N(a,c,r)},p:rt,i:rt,o:rt,d(a){a&&(z(e),z(t),z(n),z(i),z(s),z(o),z(c))}}}function Nu(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b,k,p,w,g,v,m,C,y,L,E,M,$,T,q,R,J,Q;e=new Gt({props:{$$slots:{default:[Tu]},$$scope:{ctx:l}}});let G=Ht(l[10]),O=[];for(let j=0;j<G.length;j+=1)O[j]=Ts(Cs(l,G,j));return b=new Gt({props:{$$slots:{default:[Pu]},$$scope:{ctx:l}}}),E=new Gt({props:{$$slots:{default:[Au]},$$scope:{ctx:l}}}),{c(){Ke(e.$$.fragment),t=ie(),n=I("p"),n.textContent=" ",i=ie(),s=I("strong"),s.textContent="Available MCP Tools",o=ie(),c=I("div");for(let j=0;j<O.length;j+=1)O[j].c();a=ie(),r=I("p"),r.textContent=" ",u=ie(),f=I("strong"),f.textContent="Integration",_=H(`: To add this MCP to clients that
support SSE (e.g. Cursor, Windsurf, Cline), simply add the
following configuration to your MCP config:
`),d=I("p"),d.textContent=" ",h=ie(),Ke(b.$$.fragment),k=ie(),p=I("p"),p.textContent=" ",w=ie(),g=I("em"),g.textContent="Experimental stdio support",v=H(`: For clients that only
support stdio, first
`),m=I("a"),m.textContent="install Node.js",C=H(`. Then, you can use the following command:
`),y=I("p"),y.textContent=" ",L=ie(),Ke(E.$$.fragment),M=ie(),$=I("p"),$.textContent=" ",T=ie(),q=I("p"),R=I("a"),J=H("Read more about MCP in the Gradio docs"),B(c,"class","mcp-tools svelte-mko7us"),B(m,"href","https://nodejs.org/en/download/"),B(m,"target","_blank"),B(m,"class","svelte-mko7us"),B(R,"href",Du),B(R,"target","_blank"),B(R,"class","svelte-mko7us")},m(j,P){xe(e,j,P),N(j,t,P),N(j,n,P),N(j,i,P),N(j,s,P),N(j,o,P),N(j,c,P);for(let ee=0;ee<O.length;ee+=1)O[ee]&&O[ee].m(c,null);N(j,a,P),N(j,r,P),N(j,u,P),N(j,f,P),N(j,_,P),N(j,d,P),N(j,h,P),xe(b,j,P),N(j,k,P),N(j,p,P),N(j,w,P),N(j,g,P),N(j,v,P),N(j,m,P),N(j,C,P),N(j,y,P),N(j,L,P),xe(E,j,P),N(j,M,P),N(j,$,P),N(j,T,P),N(j,q,P),D(q,R),D(R,J),Q=!0},p(j,P){const ee={};if(P[1]&256&&(ee.$$scope={dirty:P,ctx:j}),e.$set(ee),P[0]&1024){G=Ht(j[10]);let be;for(be=0;be<G.length;be+=1){const et=Cs(j,G,be);O[be]?O[be].p(et,P):(O[be]=Ts(et),O[be].c(),O[be].m(c,null))}for(;be<O.length;be+=1)O[be].d(1);O.length=G.length}const Pe={};P[1]&256&&(Pe.$$scope={dirty:P,ctx:j}),b.$set(Pe);const me={};P[1]&256&&(me.$$scope={dirty:P,ctx:j}),E.$set(me)},i(j){Q||(se(e.$$.fragment,j),se(b.$$.fragment,j),se(E.$$.fragment,j),Q=!0)},o(j){ae(e.$$.fragment,j),ae(b.$$.fragment,j),ae(E.$$.fragment,j),Q=!1},d(j){j&&(z(t),z(n),z(i),z(s),z(o),z(c),z(a),z(r),z(u),z(f),z(_),z(d),z(h),z(k),z(p),z(w),z(g),z(v),z(m),z(C),z(y),z(L),z(M),z($),z(T),z(q)),Xe(e,j),Pl(O,j),Xe(b,j),Xe(E,j)}}}function Tu(l){let e,t,n,i,s,o,c,a;return c=new dt({props:{code:l[14]}}),{c(){e=I("div"),t=I("label"),t.innerHTML=`<span class="status-indicator active svelte-mko7us">●</span>MCP Server
URL`,n=ie(),i=I("div"),s=I("input"),o=ie(),Ke(c.$$.fragment),B(t,"class","svelte-mko7us"),B(s,"type","text"),s.readOnly=!0,s.value=l[14],B(s,"class","svelte-mko7us"),B(i,"class","textbox svelte-mko7us"),B(e,"class","mcp-url svelte-mko7us")},m(r,u){N(r,e,u),D(e,t),D(e,n),D(e,i),D(i,s),D(i,o),xe(c,i,null),a=!0},p:rt,i(r){a||(se(c.$$.fragment,r),a=!0)},o(r){ae(c.$$.fragment,r),a=!1},d(r){r&&z(e),Xe(c)}}}function zs(l){let e,t;function n(o,c){return c[0]&1024&&(t=null),t==null&&(t=Object.keys(o[27].parameters).length>0),t?ju:Lu}let i=n(l,[-1,-1]),s=i(l);return{c(){e=I("div"),s.c(),B(e,"class","tool-content svelte-mko7us")},m(o,c){N(o,e,c),s.m(e,null)},p(o,c){i===(i=n(o,c))&&s?s.p(o,c):(s.d(1),s=i(o),s&&(s.c(),s.m(e,null)))},d(o){o&&z(e),s.d()}}}function Lu(l){let e;return{c(){e=I("p"),e.textContent="Takes no input parameters"},m(t,n){N(t,e,n)},p:rt,d(t){t&&z(e)}}}function ju(l){let e,t=Ht(Object.entries(l[27].parameters)),n=[];for(let i=0;i<t.length;i+=1)n[i]=Ns(Ss(l,t,i));return{c(){e=I("div");for(let i=0;i<n.length;i+=1)n[i].c();B(e,"class","tool-parameters")},m(i,s){N(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s[0]&1024){t=Ht(Object.entries(i[27].parameters));let o;for(o=0;o<t.length;o+=1){const c=Ss(i,t,o);n[o]?n[o].p(c,s):(n[o]=Ns(c),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&z(e),Pl(n,i)}}}function Ns(l){let e,t,n=l[30]+"",i,s,o,c,a=l[31].type+"",r,u=l[31].default!==void 0?`, default: ${JSON.stringify(l[31].default)}`:"",f,_,d,h,b=(l[31].description?l[31].description:"⚠︎ No description for this parameter in function docstring")+"",k,p;return{c(){e=I("div"),t=I("code"),i=H(n),s=ie(),o=I("span"),c=H("("),r=H(a),f=H(u),_=H(")"),d=ie(),h=I("p"),k=H(b),p=ie(),B(t,"class","svelte-mko7us"),B(o,"class","parameter-type svelte-mko7us"),B(h,"class","parameter-description svelte-mko7us"),B(e,"class","parameter svelte-mko7us")},m(w,g){N(w,e,g),D(e,t),D(t,i),D(e,s),D(e,o),D(o,c),D(o,r),D(o,f),D(o,_),D(e,d),D(e,h),D(h,k),D(e,p)},p(w,g){g[0]&1024&&n!==(n=w[30]+"")&&$t(i,n),g[0]&1024&&a!==(a=w[31].type+"")&&$t(r,a),g[0]&1024&&u!==(u=w[31].default!==void 0?`, default: ${JSON.stringify(w[31].default)}`:"")&&$t(f,u),g[0]&1024&&b!==(b=(w[31].description?w[31].description:"⚠︎ No description for this parameter in function docstring")+"")&&$t(k,b)},d(w){w&&z(e)}}}function Ts(l){let e,t,n,i,s=l[27].name+"",o,c,a,r=(l[27].description?l[27].description:"⚠︎ No description provided in function docstring")+"",u,f,_,d=l[27].expanded?"▼":"▶",h,b,k,p,w;function g(){return l[18](l[27],l[28],l[29])}let v=l[27].expanded&&zs(l);return{c(){e=I("div"),t=I("button"),n=I("span"),i=I("span"),o=H(s),c=H(`  
`),a=I("span"),u=H(r),f=ie(),_=I("span"),h=H(d),b=ie(),v&&v.c(),k=ie(),B(i,"class","tool-name svelte-mko7us"),B(a,"class","tool-description svelte-mko7us"),B(_,"class","tool-arrow svelte-mko7us"),B(t,"class","tool-header svelte-mko7us"),B(e,"class","tool-item svelte-mko7us")},m(m,C){N(m,e,C),D(e,t),D(t,n),D(n,i),D(i,o),D(n,c),D(n,a),D(a,u),D(t,f),D(t,_),D(_,h),D(e,b),v&&v.m(e,null),D(e,k),p||(w=Po(t,"click",g),p=!0)},p(m,C){l=m,C[0]&1024&&s!==(s=l[27].name+"")&&$t(o,s),C[0]&1024&&r!==(r=(l[27].description?l[27].description:"⚠︎ No description provided in function docstring")+"")&&$t(u,r),C[0]&1024&&d!==(d=l[27].expanded?"▼":"▶")&&$t(h,d),l[27].expanded?v?v.p(l,C):(v=zs(l),v.c(),v.m(e,k)):v&&(v.d(1),v=null)},d(m){m&&z(e),v&&v.d(),p=!1,w()}}}function Pu(l){let e,t,n,i,s,o,c;return n=new dt({props:{code:JSON.stringify({mcpServers:{gradio:{url:l[14]}}},null,2)}}),{c(){e=I("code"),t=I("div"),Ke(n.$$.fragment),i=ie(),s=I("div"),o=I("pre"),o.textContent=`${JSON.stringify({mcpServers:{gradio:{url:l[14]}}},null,2)}`,B(t,"class","copy svelte-mko7us"),B(o,"class","svelte-mko7us"),B(e,"class","svelte-mko7us")},m(a,r){N(a,e,r),D(e,t),xe(n,t,null),D(e,i),D(e,s),D(s,o),c=!0},p:rt,i(a){c||(se(n.$$.fragment,a),c=!0)},o(a){ae(n.$$.fragment,a),c=!1},d(a){a&&z(e),Xe(n)}}}function Au(l){let e,t,n,i,s,o,c;return n=new dt({props:{code:JSON.stringify({mcpServers:{gradio:{command:"npx",args:["mcp-remote",l[14],"--transport","sse-only"]}}},null,2)}}),{c(){e=I("code"),t=I("div"),Ke(n.$$.fragment),i=ie(),s=I("div"),o=I("pre"),o.textContent=`${JSON.stringify({mcpServers:{gradio:{command:"npx",args:["mcp-remote",l[14],"--transport","sse-only"]}}},null,2)}`,B(t,"class","copy svelte-mko7us"),B(o,"class","svelte-mko7us"),B(e,"class","svelte-mko7us")},m(a,r){N(a,e,r),D(e,t),xe(n,t,null),D(e,i),D(e,s),D(s,o),c=!0},p:rt,i(a){c||(se(n.$$.fragment,a),c=!0)},o(a){ae(n.$$.fragment,a),c=!1},d(a){a&&z(e),Xe(n)}}}function Ls(l){let e,t,n,i,s,o,c,a;e=new lc({props:{current_language:l[6]}});let r=l[3]&&js(l);o=new Sl({props:{size:"sm",variant:"secondary",$$slots:{default:[Ru]},$$scope:{ctx:l}}}),o.$on("click",l[19]);let u=l[6]=="bash"&&Ps(l);return{c(){Ke(e.$$.fragment),t=ie(),n=I("p"),i=H(`2. Find the API endpoint below corresponding to your desired
function in the app. Copy the code snippet, replacing the
placeholder values with your own input data.
`),r&&r.c(),s=H(`
Or use the
`),Ke(o.$$.fragment),c=H(`
to automatically generate your API requests.
`),u&&u.c(),B(n,"class","padded svelte-mko7us")},m(f,_){xe(e,f,_),N(f,t,_),N(f,n,_),D(n,i),r&&r.m(n,null),D(n,s),xe(o,n,null),D(n,c),u&&u.m(n,null),a=!0},p(f,_){const d={};_[0]&64&&(d.current_language=f[6]),e.$set(d),f[3]?r?r.p(f,_):(r=js(f),r.c(),r.m(n,s)):r&&(r.d(1),r=null);const h={};_[1]&256&&(h.$$scope={dirty:_,ctx:f}),o.$set(h),f[6]=="bash"?u?u.p(f,_):(u=Ps(f),u.c(),u.m(n,null)):u&&(u.d(1),u=null)},i(f){a||(se(e.$$.fragment,f),se(o.$$.fragment,f),a=!0)},o(f){ae(e.$$.fragment,f),ae(o.$$.fragment,f),a=!1},d(f){f&&(z(t),z(n)),Xe(e,f),r&&r.d(),Xe(o),u&&u.d()}}}function js(l){let e,t,n,i,s;return{c(){e=H(`If this is a private Space, you may need to pass
your Hugging Face token as well (`),t=I("a"),n=H("read more"),s=H(")."),B(t,"href",i=l[6]=="python"?wl+tl:l[6]=="javascript"?$l+tl:oi),B(t,"class","underline svelte-mko7us"),B(t,"target","_blank")},m(o,c){N(o,e,c),N(o,t,c),D(t,n),N(o,s,c)},p(o,c){c[0]&64&&i!==(i=o[6]=="python"?wl+tl:o[6]=="javascript"?$l+tl:oi)&&B(t,"href",i)},d(o){o&&(z(e),z(t),z(s))}}}function Ru(l){let e,t,n;return{c(){e=I("div"),t=ie(),n=I("p"),n.textContent="API Recorder",B(e,"class","loading-dot svelte-mko7us"),B(n,"class","self-baseline svelte-mko7us")},m(i,s){N(i,e,s),N(i,t,s),N(i,n,s)},p:rt,d(i){i&&(z(e),z(t),z(n))}}}function Ps(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b,k,p,w,g,v,m,C,y,L,E=l[4]!==null&&As();return{c(){e=I("br"),t=H(" "),n=I("br"),i=H(`Making a
prediction and getting a result requires
`),s=I("strong"),s.textContent="2 requests",o=H(`: a
`),c=I("code"),c.textContent="POST",a=H(`
and a `),r=I("code"),r.textContent="GET",u=H(" request. The "),f=I("code"),f.textContent="POST",_=H(` request
returns an `),d=I("code"),d.textContent="EVENT_ID",h=H(`, which is used in the second
`),b=I("code"),b.textContent="GET",k=H(` request to fetch the results. In these
snippets, we've used `),p=I("code"),p.textContent="awk",w=H(" and "),g=I("code"),g.textContent="read",v=H(` to
parse the results, combining these two requests into one command
for ease of use. `),E&&E.c(),m=H(` See
`),C=I("a"),y=H("curl docs"),L=H("."),B(c,"class","svelte-mko7us"),B(r,"class","svelte-mko7us"),B(f,"class","svelte-mko7us"),B(d,"class","svelte-mko7us"),B(b,"class","svelte-mko7us"),B(p,"class","svelte-mko7us"),B(g,"class","svelte-mko7us"),B(C,"href",oi),B(C,"target","_blank"),B(C,"class","svelte-mko7us")},m(M,$){N(M,e,$),N(M,t,$),N(M,n,$),N(M,i,$),N(M,s,$),N(M,o,$),N(M,c,$),N(M,a,$),N(M,r,$),N(M,u,$),N(M,f,$),N(M,_,$),N(M,d,$),N(M,h,$),N(M,b,$),N(M,k,$),N(M,p,$),N(M,w,$),N(M,g,$),N(M,v,$),E&&E.m(M,$),N(M,m,$),N(M,C,$),D(C,y),N(M,L,$)},p(M,$){M[4]!==null?E||(E=As(),E.c(),E.m(m.parentNode,m)):E&&(E.d(1),E=null)},d(M){M&&(z(e),z(t),z(n),z(i),z(s),z(o),z(c),z(a),z(r),z(u),z(f),z(_),z(d),z(h),z(b),z(k),z(p),z(w),z(g),z(v),z(m),z(C),z(L)),E&&E.d(M)}}}function As(l){let e;return{c(){e=H(`Note: connecting to an authenticated app requires an
additional request.`)},m(t,n){N(t,e,n)},d(t){t&&z(e)}}}function Rs(l){let e,t,n=Ht(l[1]),i=[];for(let o=0;o<n.length;o+=1)i[o]=Ds(ys(l,n,o));const s=o=>ae(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=Nn()},m(o,c){for(let a=0;a<i.length;a+=1)i[a]&&i[a].m(o,c);N(o,e,c),t=!0},p(o,c){if(c[0]&863){n=Ht(o[1]);let a;for(a=0;a<n.length;a+=1){const r=ys(o,n,a);i[a]?(i[a].p(r,c),se(i[a],1)):(i[a]=Ds(r),i[a].c(),se(i[a],1),i[a].m(e.parentNode,e))}for(Wt(),a=n.length;a<i.length;a+=1)s(a);Vt()}},i(o){if(!t){for(let c=0;c<n.length;c+=1)se(i[c]);t=!0}},o(o){i=i.filter(Boolean);for(let c=0;c<i.length;c+=1)ae(i[c]);t=!1},d(o){o&&z(e),Pl(i,o)}}}function Os(l){let e,t,n,i,s,o,c,a;return t=new Tc({props:{named:!0,endpoint_parameters:l[8].named_endpoints["/"+l[24].api_name].parameters,dependency:l[24],dependency_index:l[26],current_language:l[6],root:l[0],space_id:l[3],username:l[4],api_prefix:l[2].api_prefix}}),i=new Ma({props:{endpoint_returns:l[8].named_endpoints["/"+l[24].api_name].parameters,js_returns:l[9].named_endpoints["/"+l[24].api_name].parameters,is_running:Is,current_language:l[6]}}),o=new pu({props:{endpoint_returns:l[8].named_endpoints["/"+l[24].api_name].returns,js_returns:l[9].named_endpoints["/"+l[24].api_name].returns,is_running:Is,current_language:l[6]}}),{c(){e=I("div"),Ke(t.$$.fragment),n=ie(),Ke(i.$$.fragment),s=ie(),Ke(o.$$.fragment),c=ie(),B(e,"class","endpoint-container svelte-mko7us")},m(r,u){N(r,e,u),xe(t,e,null),D(e,n),xe(i,e,null),D(e,s),xe(o,e,null),D(e,c),a=!0},p(r,u){const f={};u[0]&258&&(f.endpoint_parameters=r[8].named_endpoints["/"+r[24].api_name].parameters),u[0]&2&&(f.dependency=r[24]),u[0]&64&&(f.current_language=r[6]),u[0]&1&&(f.root=r[0]),u[0]&8&&(f.space_id=r[3]),u[0]&16&&(f.username=r[4]),u[0]&4&&(f.api_prefix=r[2].api_prefix),t.$set(f);const _={};u[0]&258&&(_.endpoint_returns=r[8].named_endpoints["/"+r[24].api_name].parameters),u[0]&514&&(_.js_returns=r[9].named_endpoints["/"+r[24].api_name].parameters),u[0]&64&&(_.current_language=r[6]),i.$set(_);const d={};u[0]&258&&(d.endpoint_returns=r[8].named_endpoints["/"+r[24].api_name].returns),u[0]&514&&(d.js_returns=r[9].named_endpoints["/"+r[24].api_name].returns),u[0]&64&&(d.current_language=r[6]),o.$set(d)},i(r){a||(se(t.$$.fragment,r),se(i.$$.fragment,r),se(o.$$.fragment,r),a=!0)},o(r){ae(t.$$.fragment,r),ae(i.$$.fragment,r),ae(o.$$.fragment,r),a=!1},d(r){r&&z(e),Xe(t),Xe(i),Xe(o)}}}function Ds(l){let e,t,n=l[24].show_api&&l[8].named_endpoints["/"+l[24].api_name]&&Os(l);return{c(){n&&n.c(),e=Nn()},m(i,s){n&&n.m(i,s),N(i,e,s),t=!0},p(i,s){i[24].show_api&&i[8].named_endpoints["/"+i[24].api_name]?n?(n.p(i,s),s[0]&258&&se(n,1)):(n=Os(i),n.c(),se(n,1),n.m(e.parentNode,e)):n&&(Wt(),ae(n,1,1,()=>{n=null}),Vt())},i(i){t||(se(n),t=!0)},o(i){ae(n),t=!1},d(i){i&&z(e),n&&n.d(i)}}}function Ou(l){let e,t,n=l[8]&&qs(l);return{c(){n&&n.c(),e=Nn()},m(i,s){n&&n.m(i,s),N(i,e,s),t=!0},p(i,s){i[8]?n?(n.p(i,s),s[0]&256&&se(n,1)):(n=qs(i),n.c(),se(n,1),n.m(e.parentNode,e)):n&&(Wt(),ae(n,1,1,()=>{n=null}),Vt())},i(i){t||(se(n),t=!0)},o(i){ae(n),t=!1},d(i){i&&z(e),n&&n.d(i)}}}const $l="https://www.gradio.app/guides/getting-started-with-the-js-client",wl="https://www.gradio.app/guides/getting-started-with-the-python-client",oi="https://www.gradio.app/guides/querying-gradio-apps-with-curl",tl="#connecting-to-a-hugging-face-space",Du="https://www.gradio.app/guides/building-mcp-server-with-gradio";let Is=!1;function Iu(l,e,t){let{dependencies:n}=e,{root:i}=e,{app:s}=e,{space_id:o}=e,{root_node:c}=e,{username:a}=e,r=n.filter($=>$.show_api).length;i===""&&(i=location.protocol+"//"+location.host+location.pathname),i.endsWith("/")||(i+="/");let{api_calls:u=[]}=e,f="python";const _=[["python","Python",Zc],["javascript","JavaScript",Jc],["bash","cURL",Qc],["mcp","MCP",mu]];let d=!1;async function h(){return await(await fetch(i.replace(/\/$/,"")+s.api_prefix+"/info")).json()}async function b(){return await s.view_api()}let k,p;h().then($=>{t(8,k=$)}),b().then($=>{t(9,p=$)});const w=$u(),g=`${i}gradio_api/mcp/sse`;let v=[];async function m(){try{const T=await(await fetch(`${i}gradio_api/mcp/schema`)).json();t(10,v=T.map(q=>({name:q.name,description:q.description||"",parameters:q.inputSchema?.properties||{},expanded:!1})))}catch($){console.error("Failed to fetch MCP tools:",$),t(10,v=[])}}ku(()=>(document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0),fetch(g).then($=>{t(7,d=$.ok),d&&m()}).catch(()=>{t(7,d=!1)}),()=>{document.body.style.overflow="auto"}));function C($){ws.call(this,l,$)}const y=$=>t(6,f=$),L=($,T,q)=>t(10,T[q].expanded=!$.expanded,v),E=()=>w("close",{api_recorder_visible:!0});function M($){ws.call(this,l,$)}return l.$$set=$=>{"dependencies"in $&&t(1,n=$.dependencies),"root"in $&&t(0,i=$.root),"app"in $&&t(2,s=$.app),"space_id"in $&&t(3,o=$.space_id),"root_node"in $&&t(15,c=$.root_node),"username"in $&&t(4,a=$.username),"api_calls"in $&&t(5,u=$.api_calls)},[i,n,s,o,a,u,f,d,k,p,v,r,_,w,g,c,C,y,L,E,M]}class Fu extends hu{constructor(e){super(),gu(this,e,Iu,Ou,bu,{dependencies:1,root:0,app:2,space_id:3,root_node:15,username:4,api_calls:5},null,[-1,-1])}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),Kt()}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Kt()}get app(){return this.$$.ctx[2]}set app(e){this.$$set({app:e}),Kt()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),Kt()}get root_node(){return this.$$.ctx[15]}set root_node(e){this.$$set({root_node:e}),Kt()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),Kt()}get api_calls(){return this.$$.ctx[5]}set api_calls(e){this.$$set({api_calls:e}),Kt()}}const{SvelteComponent:Bu,append:ln,attr:bn,create_component:Uu,destroy_component:Gu,detach:sn,element:vn,flush:Fs,init:Vu,insert:on,mount_component:Hu,safe_not_equal:Wu,set_data:Ao,space:Kl,text:In,transition_in:Zu,transition_out:Ju}=window.__gradio__svelte__internal;function Bs(l){let e,t,n=l[1][l[0][l[0].length-1].fn_index].api_name+"",i;return{c(){e=vn("span"),t=In("/"),i=In(n),bn(e,"class","api-name svelte-sy28j6")},m(s,o){on(s,e,o),ln(e,t),ln(e,i)},p(s,o){o&3&&n!==(n=s[1][s[0][s[0].length-1].fn_index].api_name+"")&&Ao(i,n)},d(s){s&&sn(e)}}}function Qu(l){let e,t,n,i,s,o,c,a=l[0].length+"",r,u,f,_=l[0].length>0&&Bs(l);return{c(){e=vn("div"),t=Kl(),n=vn("p"),n.textContent="Recording API Calls:",i=Kl(),s=vn("p"),o=vn("span"),c=In("["),r=In(a),u=In("]"),f=Kl(),_&&_.c(),bn(e,"class","loading-dot self-baseline svelte-sy28j6"),bn(n,"class","self-baseline svelte-sy28j6"),bn(o,"class","api-count svelte-sy28j6"),bn(s,"class","self-baseline api-section svelte-sy28j6")},m(d,h){on(d,e,h),on(d,t,h),on(d,n,h),on(d,i,h),on(d,s,h),ln(s,o),ln(o,c),ln(o,r),ln(o,u),ln(s,f),_&&_.m(s,null)},p(d,h){h&1&&a!==(a=d[0].length+"")&&Ao(r,a),d[0].length>0?_?_.p(d,h):(_=Bs(d),_.c(),_.m(s,null)):_&&(_.d(1),_=null)},d(d){d&&(sn(e),sn(t),sn(n),sn(i),sn(s)),_&&_.d()}}}function Yu(l){let e,t,n;return t=new Sl({props:{size:"sm",variant:"secondary",$$slots:{default:[Qu]},$$scope:{ctx:l}}}),{c(){e=vn("div"),Uu(t.$$.fragment),bn(e,"id","api-recorder")},m(i,s){on(i,e,s),Hu(t,e,null),n=!0},p(i,[s]){const o={};s&7&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(Zu(t.$$.fragment,i),n=!0)},o(i){Ju(t.$$.fragment,i),n=!1},d(i){i&&sn(e),Gu(t)}}}function Ku(l,e,t){let{api_calls:n=[]}=e,{dependencies:i}=e;return l.$$set=s=>{"api_calls"in s&&t(0,n=s.api_calls),"dependencies"in s&&t(1,i=s.dependencies)},[n,i]}class Xu extends Bu{constructor(e){super(),Vu(this,e,Ku,Yu,Wu,{api_calls:0,dependencies:1})}get api_calls(){return this.$$.ctx[0]}set api_calls(e){this.$$set({api_calls:e}),Fs()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),Fs()}}const Ro="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20Outer%20gear%20teeth%20(gray)%20--%3e%3cpath%20d='M19.14%2012.94c.04-.3.06-.61.06-.94%200-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24%200-.43.17-.47.41l-.36%202.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47%200-.59.22L2.74%208.87c-.12.21-.08.47.12.61l2.03%201.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03%201.58c-.18.14-.23.41-.12.61l1.92%203.32c.12.22.37.29.59.22l2.39-.96c.5.38%201.03.7%201.62.94l.36%202.54c.05.24.24.41.48.41h3.84c.24%200%20.44-.17.47-.41l.36-2.54c.59-.24%201.13-.56%201.62-.94l2.39.96c.22.08.47%200%20.59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12%2015.6c-1.98%200-3.6-1.62-3.6-3.6s1.62-3.6%203.6-3.6%203.6%201.62%203.6%203.6-1.62%203.6-3.6%203.6z'%20fill='%23808080'/%3e%3c!--%20Inner%20circle%20(now%20gray)%20--%3e%3ccircle%20cx='12'%20cy='12'%20r='2.5'%20fill='%23808080'/%3e%3c/svg%3e",{SvelteComponent:xu,append:Xt,attr:xt,component_subscribe:e_,create_component:t_,destroy_component:n_,detach:Xl,element:jn,flush:l_,init:i_,insert:xl,listen:s_,mount_component:o_,safe_not_equal:r_,set_data:Us,space:ei,src_url_equal:a_,text:Gs,transition_in:c_,transition_out:u_}=window.__gradio__svelte__internal,{createEventDispatcher:__}=window.__gradio__svelte__internal;function f_(l){let e,t,n,i,s,o=l[1]("common.settings")+"",c,a,r,u,f,_,d,h,b,k;return d=new di({}),{c(){e=jn("h2"),t=jn("img"),i=ei(),s=jn("div"),c=Gs(o),a=ei(),r=jn("div"),u=Gs(l[0]),f=ei(),_=jn("button"),t_(d.$$.fragment),a_(t.src,n=Ro)||xt(t,"src",n),xt(t,"alt",""),xt(t,"class","svelte-1b2d8fn"),xt(r,"class","url svelte-1b2d8fn"),xt(s,"class","title svelte-1b2d8fn"),xt(e,"class","svelte-1b2d8fn"),xt(_,"class","svelte-1b2d8fn")},m(p,w){xl(p,e,w),Xt(e,t),Xt(e,i),Xt(e,s),Xt(s,c),Xt(s,a),Xt(s,r),Xt(r,u),xl(p,f,w),xl(p,_,w),o_(d,_,null),h=!0,b||(k=s_(_,"click",l[3]),b=!0)},p(p,[w]){(!h||w&2)&&o!==(o=p[1]("common.settings")+"")&&Us(c,o),(!h||w&1)&&Us(u,p[0])},i(p){h||(c_(d.$$.fragment,p),h=!0)},o(p){u_(d.$$.fragment,p),h=!1},d(p){p&&(Xl(e),Xl(f),Xl(_)),n_(d),b=!1,k()}}}function d_(l,e,t){let n;e_(l,_i,c=>t(1,n=c));let{root:i}=e;const s=__();fi();const o=()=>s("close");return l.$$set=c=>{"root"in c&&t(0,i=c.root)},[i,n,s,o]}class p_ extends xu{constructor(e){super(),i_(this,e,d_,f_,r_,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),l_()}}const m_="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23808080'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",{SvelteComponent:h_,append:K,attr:fe,bubble:g_,component_subscribe:b_,create_component:nl,destroy_component:ll,detach:Ze,element:ce,flush:Pn,init:v_,insert:Je,listen:dl,mount_component:il,noop:k_,run_all:$_,safe_not_equal:w_,set_data:Fn,space:Qe,text:Ye,transition_in:sl,transition_out:ol}=window.__gradio__svelte__internal,{onMount:y_}=window.__gradio__svelte__internal,{createEventDispatcher:C_}=window.__gradio__svelte__internal;function Vs(l){let e,t,n=l[7]("common.display_theme")+"",i,s,o,c,a,r,u,f,_,d,h,b,k,p,w,g;return{c(){e=ce("div"),t=ce("h2"),i=Ye(n),s=Qe(),o=ce("p"),c=ce("li"),a=ce("button"),a.textContent="☀︎  Light",u=Qe(),f=ce("li"),_=ce("button"),_.textContent="⏾   Dark",h=Qe(),b=ce("li"),k=ce("button"),k.textContent="🖥︎  System",fe(t,"class","svelte-1asl00n"),fe(a,"class","svelte-1asl00n"),fe(c,"class",r="theme-button "+(l[6]==="light"?"current-theme":"inactive-theme")+" svelte-1asl00n"),fe(_,"class","svelte-1asl00n"),fe(f,"class",d="theme-button "+(l[6]==="dark"?"current-theme":"inactive-theme")+" svelte-1asl00n"),fe(k,"class","svelte-1asl00n"),fe(b,"class",p="theme-button "+(l[6]==="system"?"current-theme":"inactive-theme")+" svelte-1asl00n"),fe(o,"class","padded theme-buttons svelte-1asl00n"),fe(e,"class","banner-wrap svelte-1asl00n")},m(v,m){Je(v,e,m),K(e,t),K(t,i),K(e,s),K(e,o),K(o,c),K(c,a),K(o,u),K(o,f),K(f,_),K(o,h),K(o,b),K(b,k),w||(g=[dl(c,"click",l[14]),dl(f,"click",l[15]),dl(b,"click",l[16])],w=!0)},p(v,m){m&128&&n!==(n=v[7]("common.display_theme")+"")&&Fn(i,n),m&64&&r!==(r="theme-button "+(v[6]==="light"?"current-theme":"inactive-theme")+" svelte-1asl00n")&&fe(c,"class",r),m&64&&d!==(d="theme-button "+(v[6]==="dark"?"current-theme":"inactive-theme")+" svelte-1asl00n")&&fe(f,"class",d),m&64&&p!==(p="theme-button "+(v[6]==="system"?"current-theme":"inactive-theme")+" svelte-1asl00n")&&fe(b,"class",p)},d(v){v&&Ze(e),w=!1,$_(g)}}}function S_(l){let e,t,n;return{c(){e=Ye(`Progressive Web App is not enabled for this app. To enable it, start your
Gradio app with `),t=ce("code"),t.textContent="launch(pwa=True)",n=Ye(".")},m(i,s){Je(i,e,s),Je(i,t,s),Je(i,n,s)},p:k_,d(i){i&&(Ze(e),Ze(t),Ze(n))}}}function E_(l){let e,t,n,i;return{c(){e=Ye("You can install this app as a Progressive Web App on your device. Visit "),t=ce("a"),n=Ye(l[0]),i=Ye(" and click the install button in the URL address bar of your browser."),fe(t,"href",l[0]),fe(t,"target","_blank"),fe(t,"class","svelte-1asl00n")},m(s,o){Je(s,e,o),Je(s,t,o),K(t,n),Je(s,i,o)},p(s,o){o&1&&Fn(n,s[0]),o&1&&fe(t,"href",s[0])},d(s){s&&(Ze(e),Ze(t),Ze(i))}}}function q_(l){let e,t,n,i,s,o,c=l[7]("common.language")+"",a,r,u,f,_,d,h,b=l[7]("common.pwa")+"",k,p,w,g,v,m,C=l[7]("common.screen_studio")+"",y,L,E,M,$,T,q,R,J,Q,G,O,j,P,ee,Pe,me,be,et,Jn,at,Qn,pt,mt,Lt,jt;t=new p_({props:{root:l[0]}}),t.$on("close",l[13]);let Te=l[3]===null&&Vs(l);f=new Sr({props:{label:"Language",choices:br,show_label:!1,root:l[0],value:l[5]}}),f.$on("change",l[10]);function Pt(Y,de){return Y[4]?E_:S_}let bt=Pt(l),Ge=bt(l);return et=new Li({props:{label:"Include automatic zoom in/out",interactive:!0,value:l[1]}}),et.$on("change",l[11]),at=new Li({props:{label:"Include automatic video trimming",interactive:!0,value:l[2]}}),at.$on("change",l[12]),{c(){e=ce("div"),nl(t.$$.fragment),n=Qe(),Te&&Te.c(),i=Qe(),s=ce("div"),o=ce("h2"),a=Ye(c),r=Qe(),u=ce("p"),nl(f.$$.fragment),_=Qe(),d=ce("div"),h=ce("h2"),k=Ye(b),p=Qe(),w=ce("p"),Ge.c(),g=Qe(),v=ce("div"),m=ce("h2"),y=Ye(C),L=Qe(),E=ce("span"),E.textContent="beta",M=Qe(),$=ce("p"),T=Ye(`Screen Studio allows you to record your screen and generates a video of your
app with automatically adding zoom in and zoom out effects as well as
trimming the video to remove the prediction time.
`),q=ce("br"),R=ce("br"),J=Ye(`
Start recording by clicking the `),Q=ce("i"),Q.textContent="Start Recording",G=Ye(` button below and then
sharing the current browser tab of your Gradio demo. Use your app as you
would normally to generate a prediction.
`),O=ce("br"),j=Ye(`
Stop recording by clicking the `),P=ce("i"),P.textContent="Stop Recording",ee=Ye(` button in the footer of
the demo.
`),Pe=ce("br"),me=ce("br"),be=Qe(),nl(et.$$.fragment),Jn=Qe(),nl(at.$$.fragment),Qn=Qe(),pt=ce("button"),pt.innerHTML=`<img src="${m_}" alt="Start Recording" class="svelte-1asl00n"/>
Start Recording`,fe(e,"class","banner-wrap svelte-1asl00n"),fe(o,"class","svelte-1asl00n"),fe(u,"class","padded svelte-1asl00n"),fe(s,"class","banner-wrap svelte-1asl00n"),fe(h,"class","svelte-1asl00n"),fe(w,"class","padded svelte-1asl00n"),fe(d,"class","banner-wrap svelte-1asl00n"),fe(E,"class","beta-tag svelte-1asl00n"),fe(m,"class","svelte-1asl00n"),fe($,"class","padded svelte-1asl00n"),fe(pt,"class","record-button svelte-1asl00n"),fe(v,"class","banner-wrap svelte-1asl00n")},m(Y,de){Je(Y,e,de),il(t,e,null),Je(Y,n,de),Te&&Te.m(Y,de),Je(Y,i,de),Je(Y,s,de),K(s,o),K(o,a),K(s,r),K(s,u),il(f,u,null),Je(Y,_,de),Je(Y,d,de),K(d,h),K(h,k),K(d,p),K(d,w),Ge.m(w,null),Je(Y,g,de),Je(Y,v,de),K(v,m),K(m,y),K(m,L),K(m,E),K(v,M),K(v,$),K($,T),K($,q),K($,R),K($,J),K($,Q),K($,G),K($,O),K($,j),K($,P),K($,ee),K($,Pe),K($,me),K($,be),il(et,$,null),K($,Jn),il(at,$,null),K(v,Qn),K(v,pt),mt=!0,Lt||(jt=dl(pt,"click",l[17]),Lt=!0)},p(Y,[de]){const _n={};de&1&&(_n.root=Y[0]),t.$set(_n),Y[3]===null?Te?Te.p(Y,de):(Te=Vs(Y),Te.c(),Te.m(i.parentNode,i)):Te&&(Te.d(1),Te=null),(!mt||de&128)&&c!==(c=Y[7]("common.language")+"")&&Fn(a,c);const tt={};de&1&&(tt.root=Y[0]),de&32&&(tt.value=Y[5]),f.$set(tt),(!mt||de&128)&&b!==(b=Y[7]("common.pwa")+"")&&Fn(k,b),bt===(bt=Pt(Y))&&Ge?Ge.p(Y,de):(Ge.d(1),Ge=bt(Y),Ge&&(Ge.c(),Ge.m(w,null))),(!mt||de&128)&&C!==(C=Y[7]("common.screen_studio")+"")&&Fn(y,C);const ue={};de&2&&(ue.value=Y[1]),et.$set(ue);const nt={};de&4&&(nt.value=Y[2]),at.$set(nt)},i(Y){mt||(sl(t.$$.fragment,Y),sl(f.$$.fragment,Y),sl(et.$$.fragment,Y),sl(at.$$.fragment,Y),mt=!0)},o(Y){ol(t.$$.fragment,Y),ol(f.$$.fragment,Y),ol(et.$$.fragment,Y),ol(at.$$.fragment,Y),mt=!1},d(Y){Y&&(Ze(e),Ze(n),Ze(i),Ze(s),Ze(_),Ze(d),Ze(g),Ze(v)),ll(t),Te&&Te.d(Y),ll(f),Ge.d(),ll(et),ll(at),Lt=!1,jt()}}}function M_(l,e,t){let n;b_(l,_i,m=>t(7,n=m));let{root:i}=e,{space_id:s}=e,{pwa_enabled:o}=e;const c=C_();i===""&&(i=location.protocol+"//"+location.host+location.pathname),i.endsWith("/")||(i+="/");function a(m){const C=new URL(window.location.href);m==="system"?(C.searchParams.delete("__theme"),t(6,u="system")):(C.searchParams.set("__theme",m),t(6,u=m)),window.location.href=C.toString()}y_(()=>{document.body.style.overflow="hidden","parentIFrame"in window&&window.parentIFrame?.scrollTo(0,0);const C=new URL(window.location.href).searchParams.get("__theme");return t(6,u=C||"system"),()=>{document.body.style.overflow="auto"}});let r,u="system",{allow_zoom:f=!0}=e,{allow_video_trim:_=!0}=e;vr.subscribe(m=>{m&&t(5,r=m)});function d(m){const C=m.detail;kr(C)}function h(m){t(1,f=m.detail)}function b(m){t(2,_=m.detail)}fi();function k(m){g_.call(this,l,m)}const p=()=>a("light"),w=()=>a("dark"),g=()=>a("system"),v=()=>{c("close"),c("start_recording")};return l.$$set=m=>{"root"in m&&t(0,i=m.root),"space_id"in m&&t(3,s=m.space_id),"pwa_enabled"in m&&t(4,o=m.pwa_enabled),"allow_zoom"in m&&t(1,f=m.allow_zoom),"allow_video_trim"in m&&t(2,_=m.allow_video_trim)},[i,f,_,s,o,r,u,n,c,a,d,h,b,k,p,w,g,v]}class z_ extends h_{constructor(e){super(),v_(this,e,M_,q_,w_,{root:0,space_id:3,pwa_enabled:4,allow_zoom:1,allow_video_trim:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Pn()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),Pn()}get pwa_enabled(){return this.$$.ctx[4]}set pwa_enabled(e){this.$$set({pwa_enabled:e}),Pn()}get allow_zoom(){return this.$$.ctx[1]}set allow_zoom(e){this.$$set({allow_zoom:e}),Pn()}get allow_video_trim(){return this.$$.ctx[2]}set allow_video_trim(e){this.$$set({allow_video_trim:e}),Pn()}}const{SvelteComponent:N_,add_flush_callback:T_,assign:yl,bind:Hs,binding_callbacks:ri,bubble:L_,check_outros:j_,compute_rest_props:Ws,construct_svelte_component:Zs,create_component:Js,create_slot:P_,destroy_component:Qs,detach:A_,empty:R_,exclude_internal_props:O_,flush:vt,get_all_dirty_from_scope:D_,get_slot_changes:I_,get_spread_object:Ys,get_spread_update:Ks,group_outros:F_,init:B_,insert:U_,mount_component:Xs,not_equal:G_,transition_in:ai,transition_out:ci,update_slot_base:V_}=window.__gradio__svelte__internal,{bind:H_,binding_callbacks:W_}=window.__gradio__svelte__internal;function Z_(l){let e;const t=l[12].default,n=P_(t,l,l[16],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&65536)&&V_(n,t,i,i[16],e?I_(t,i[16],s,null):D_(i[16]),null)},i(i){e||(ai(n,i),e=!0)},o(i){ci(n,i),e=!1},d(i){n&&n.d(i)}}}function J_(l){let e,t,n,i;const s=[{elem_id:l[5]},{elem_classes:l[6]},{target:l[3]},{visible:l[7]},l[9],{theme_mode:l[4]},{root:l[2]}];function o(r){l[14](r)}var c=l[8];function a(r,u){let f={$$slots:{default:[Z_]},$$scope:{ctx:r}};for(let _=0;_<s.length;_+=1)f=yl(f,s[_]);return u!==void 0&&u&764&&(f=yl(f,Ks(s,[u&32&&{elem_id:r[5]},u&64&&{elem_classes:r[6]},u&8&&{target:r[3]},u&128&&{visible:r[7]},u&512&&Ys(r[9]),u&16&&{theme_mode:r[4]},u&4&&{root:r[2]}]))),r[0]!==void 0&&(f.value=r[0]),{props:f}}return c&&(e=Zs(c,a(l)),l[13](e),ri.push(()=>Hs(e,"value",o)),e.$on("prop_change",l[15])),{c(){e&&Js(e.$$.fragment),n=R_()},m(r,u){e&&Xs(e,r,u),U_(r,n,u),i=!0},p(r,[u]){if(c!==(c=r[8])){if(e){F_();const f=e;ci(f.$$.fragment,1,0,()=>{Qs(f,1)}),j_()}c?(e=Zs(c,a(r,u)),r[13](e),ri.push(()=>Hs(e,"value",o)),e.$on("prop_change",r[15]),Js(e.$$.fragment),ai(e.$$.fragment,1),Xs(e,n.parentNode,n)):e=null}else if(c){const f=u&764?Ks(s,[u&32&&{elem_id:r[5]},u&64&&{elem_classes:r[6]},u&8&&{target:r[3]},u&128&&{visible:r[7]},u&512&&Ys(r[9]),u&16&&{theme_mode:r[4]},u&4&&{root:r[2]}]):{};u&65536&&(f.$$scope={dirty:u,ctx:r}),!t&&u&1&&(t=!0,f.value=r[0],T_(()=>t=!1)),e.$set(f)}},i(r){i||(e&&ai(e.$$.fragment,r),i=!0)},o(r){e&&ci(e.$$.fragment,r),i=!1},d(r){r&&A_(n),l[13](null),e&&Qs(e,r)}}}function Q_(l,e,t){const n=["root","component","target","theme_mode","instance","value","elem_id","elem_classes","_id","visible"];let i=Ws(e,n),{$$slots:s={},$$scope:o}=e,{root:c}=e,{component:a}=e,{target:r}=e,{theme_mode:u}=e,{instance:f}=e,{value:_}=e,{elem_id:d}=e,{elem_classes:h}=e,{_id:b}=e,{visible:k}=e;const p=(E,M,$)=>new CustomEvent("prop_change",{detail:{id:E,prop:M,value:$}});function w(E){return new Proxy(E,{construct($,T){const q=new $(...T),R=Object.keys(q.$$.props);function J(Q){return function(G){if(!r)return;const O=p(b,Q,G);r.dispatchEvent(O)}}return R.forEach(Q=>{W_.push(()=>H_(q,Q,J(Q)))}),q}})}const g=w(a),v=["description","info","title","placeholder","value","label"];function m(E){for(const M in E)v.includes(M)&&(E[M]=zi(E[M]))}function C(E){ri[E?"unshift":"push"](()=>{f=E,t(1,f)})}function y(E){_=E,t(0,_)}function L(E){L_.call(this,l,E)}return l.$$set=E=>{e=yl(yl({},e),O_(E)),t(9,i=Ws(e,n)),"root"in E&&t(2,c=E.root),"component"in E&&t(10,a=E.component),"target"in E&&t(3,r=E.target),"theme_mode"in E&&t(4,u=E.theme_mode),"instance"in E&&t(1,f=E.instance),"value"in E&&t(0,_=E.value),"elem_id"in E&&t(5,d=E.elem_id),"elem_classes"in E&&t(6,h=E.elem_classes),"_id"in E&&t(11,b=E._id),"visible"in E&&t(7,k=E.visible),"$$scope"in E&&t(16,o=E.$$scope)},l.$$.update=()=>{m(i),l.$$.dirty&1&&t(0,_=zi(_))},[_,f,c,r,u,d,h,k,g,i,a,b,s,C,y,L,o]}class Y_ extends N_{constructor(e){super(),B_(this,e,Q_,J_,G_,{root:2,component:10,target:3,theme_mode:4,instance:1,value:0,elem_id:5,elem_classes:6,_id:11,visible:7})}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),vt()}get component(){return this.$$.ctx[10]}set component(e){this.$$set({component:e}),vt()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),vt()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),vt()}get instance(){return this.$$.ctx[1]}set instance(e){this.$$set({instance:e}),vt()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),vt()}get elem_id(){return this.$$.ctx[5]}set elem_id(e){this.$$set({elem_id:e}),vt()}get elem_classes(){return this.$$.ctx[6]}set elem_classes(e){this.$$set({elem_classes:e}),vt()}get _id(){return this.$$.ctx[11]}set _id(e){this.$$set({_id:e}),vt()}get visible(){return this.$$.ctx[7]}set visible(e){this.$$set({visible:e}),vt()}}const{SvelteComponent:K_,add_flush_callback:xs,assign:X_,bind:eo,binding_callbacks:to,bubble:no,check_outros:Oo,component_subscribe:x_,create_component:Do,destroy_component:Io,detach:ki,empty:$i,ensure_array_like:lo,flush:Mt,get_spread_object:ef,get_spread_update:tf,group_outros:Fo,init:nf,insert:wi,mount_component:Bo,outro_and_destroy_block:lf,safe_not_equal:sf,transition_in:wn,transition_out:Vn,update_keyed_each:of}=window.__gradio__svelte__internal,{onMount:rf,createEventDispatcher:af,setContext:cf}=window.__gradio__svelte__internal;function io(l,e,t){const n=l.slice();return n[16]=e[t],n}function so(l){let e=[],t=new Map,n,i,s=lo(l[0].children);const o=c=>c[16].id;for(let c=0;c<s.length;c+=1){let a=io(l,s,c),r=o(a);t.set(r,e[c]=oo(r,a))}return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=$i()},m(c,a){for(let r=0;r<e.length;r+=1)e[r]&&e[r].m(c,a);wi(c,n,a),i=!0},p(c,a){a&63&&(s=lo(c[0].children),Fo(),e=of(e,a,o,1,c,s,t,n.parentNode,lf,oo,n,io),Oo())},i(c){if(!i){for(let a=0;a<s.length;a+=1)wn(e[a]);i=!0}},o(c){for(let a=0;a<e.length;a+=1)Vn(e[a]);i=!1},d(c){c&&ki(n);for(let a=0;a<e.length;a+=1)e[a].d(c)}}}function oo(l,e){let t,n,i;return n=new Uo({props:{node:e[16],component:e[16].component,target:e[2],id:e[16].id,root:e[1],theme_mode:e[3],max_file_size:e[4],client:e[5]}}),n.$on("destroy",e[10]),n.$on("mount",e[11]),{key:l,first:null,c(){t=$i(),Do(n.$$.fragment),this.first=t},m(s,o){wi(s,t,o),Bo(n,s,o),i=!0},p(s,o){e=s;const c={};o&1&&(c.node=e[16]),o&1&&(c.component=e[16].component),o&4&&(c.target=e[2]),o&1&&(c.id=e[16].id),o&2&&(c.root=e[1]),o&8&&(c.theme_mode=e[3]),o&16&&(c.max_file_size=e[4]),o&32&&(c.client=e[5]),n.$set(c)},i(s){i||(wn(n.$$.fragment,s),i=!0)},o(s){Vn(n.$$.fragment,s),i=!1},d(s){s&&ki(t),Io(n,s)}}}function uf(l){let e,t,n=l[0].children&&l[0].children.length&&so(l);return{c(){n&&n.c(),e=$i()},m(i,s){n&&n.m(i,s),wi(i,e,s),t=!0},p(i,s){i[0].children&&i[0].children.length?n?(n.p(i,s),s&1&&wn(n,1)):(n=so(i),n.c(),wn(n,1),n.m(e.parentNode,e)):n&&(Fo(),Vn(n,1,1,()=>{n=null}),Oo())},i(i){t||(wn(n),t=!0)},o(i){Vn(n),t=!1},d(i){i&&ki(e),n&&n.d(i)}}}function _f(l){let e,t,n,i;const s=[{_id:l[0]?.id},{component:l[0].component},{elem_id:"elem_id"in l[0].props&&l[0].props.elem_id||`component-${l[0].id}`},{elem_classes:"elem_classes"in l[0].props&&l[0].props.elem_classes||[]},{target:l[2]},l[0].props,{theme_mode:l[3]},{root:l[1]},{visible:typeof l[0].props.visible=="boolean"?l[0].props.visible:!0}];function o(r){l[12](r)}function c(r){l[13](r)}let a={$$slots:{default:[uf]},$$scope:{ctx:l}};for(let r=0;r<s.length;r+=1)a=X_(a,s[r]);return l[0].instance!==void 0&&(a.instance=l[0].instance),l[0].props.value!==void 0&&(a.value=l[0].props.value),e=new Y_({props:a}),to.push(()=>eo(e,"instance",o)),to.push(()=>eo(e,"value",c)),{c(){Do(e.$$.fragment)},m(r,u){Bo(e,r,u),i=!0},p(r,[u]){const f=u&15?tf(s,[u&1&&{_id:r[0]?.id},u&1&&{component:r[0].component},u&1&&{elem_id:"elem_id"in r[0].props&&r[0].props.elem_id||`component-${r[0].id}`},u&1&&{elem_classes:"elem_classes"in r[0].props&&r[0].props.elem_classes||[]},u&4&&{target:r[2]},u&1&&ef(r[0].props),u&8&&{theme_mode:r[3]},u&2&&{root:r[1]},u&1&&{visible:typeof r[0].props.visible=="boolean"?r[0].props.visible:!0}]):{};u&524351&&(f.$$scope={dirty:u,ctx:r}),!t&&u&1&&(t=!0,f.instance=r[0].instance,xs(()=>t=!1)),!n&&u&1&&(n=!0,f.value=r[0].props.value,xs(()=>n=!1)),e.$set(f)},i(r){i||(wn(e.$$.fragment,r),i=!0)},o(r){Vn(e.$$.fragment,r),i=!1},d(r){Io(e,r)}}}function ff(l,e,t){let n;x_(l,$r,g=>t(9,n=g));let{root:i}=e,{node:s}=e,{parent:o=null}=e,{target:c}=e,{theme_mode:a}=e,{version:r}=e,{autoscroll:u}=e,{max_file_size:f}=e,{client:_}=e;const d=af();let h=[];rf(()=>{d("mount",s.id);for(const g of h)d("mount",g.id);return()=>{d("destroy",s.id);for(const g of h)d("mount",g.id)}}),cf("BLOCK_KEY",o);function b(g){no.call(this,l,g)}function k(g){no.call(this,l,g)}function p(g){l.$$.not_equal(s.instance,g)&&(s.instance=g,t(0,s),t(15,h),t(2,c),t(3,a),t(7,r),t(1,i),t(8,u),t(4,f),t(9,n),t(5,_))}function w(g){l.$$.not_equal(s.props.value,g)&&(s.props.value=g,t(0,s),t(15,h),t(2,c),t(3,a),t(7,r),t(1,i),t(8,u),t(4,f),t(9,n),t(5,_))}return l.$$set=g=>{"root"in g&&t(1,i=g.root),"node"in g&&t(0,s=g.node),"parent"in g&&t(6,o=g.parent),"target"in g&&t(2,c=g.target),"theme_mode"in g&&t(3,a=g.theme_mode),"version"in g&&t(7,r=g.version),"autoscroll"in g&&t(8,u=g.autoscroll),"max_file_size"in g&&t(4,f=g.max_file_size),"client"in g&&t(5,_=g.client)},l.$$.update=()=>{l.$$.dirty&1&&s&&t(0,s.children=s.children&&s.children.filter(g=>{const v=s.type!=="statustracker";return v||h.push(g),v}),s),l.$$.dirty&1&&s&&s.type==="form"&&(s.children?.every(g=>!g.props.visible)?t(0,s.props.visible=!1,s):t(0,s.props.visible=!0,s)),l.$$.dirty&959&&t(0,s.props.gradio=new qr(s.id,c,a,r,i,u,f,n,_,wr),s)},[s,i,c,a,f,_,o,r,u,n,b,k,p,w]}class Uo extends K_{constructor(e){super(),nf(this,e,ff,_f,sf,{root:1,node:0,parent:6,target:2,theme_mode:3,version:7,autoscroll:8,max_file_size:4,client:5})}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),Mt()}get node(){return this.$$.ctx[0]}set node(e){this.$$set({node:e}),Mt()}get parent(){return this.$$.ctx[6]}set parent(e){this.$$set({parent:e}),Mt()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),Mt()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),Mt()}get version(){return this.$$.ctx[7]}set version(e){this.$$set({version:e}),Mt()}get autoscroll(){return this.$$.ctx[8]}set autoscroll(e){this.$$set({autoscroll:e}),Mt()}get max_file_size(){return this.$$.ctx[4]}set max_file_size(e){this.$$set({max_file_size:e}),Mt()}get client(){return this.$$.ctx[5]}set client(e){this.$$set({client:e}),Mt()}}const{SvelteComponent:df,check_outros:pf,create_component:mf,destroy_component:hf,detach:gf,empty:bf,flush:Dt,group_outros:vf,init:kf,insert:$f,mount_component:wf,safe_not_equal:yf,transition_in:pl,transition_out:ui}=window.__gradio__svelte__internal,{onMount:Cf,createEventDispatcher:Sf}=window.__gradio__svelte__internal;function ro(l){let e,t;return e=new Uo({props:{node:l[0],root:l[1],target:l[2],theme_mode:l[3],version:l[4],autoscroll:l[5],max_file_size:l[6],client:l[7]}}),{c(){mf(e.$$.fragment)},m(n,i){wf(e,n,i),t=!0},p(n,i){const s={};i&1&&(s.node=n[0]),i&2&&(s.root=n[1]),i&4&&(s.target=n[2]),i&8&&(s.theme_mode=n[3]),i&16&&(s.version=n[4]),i&32&&(s.autoscroll=n[5]),i&64&&(s.max_file_size=n[6]),i&128&&(s.client=n[7]),e.$set(s)},i(n){t||(pl(e.$$.fragment,n),t=!0)},o(n){ui(e.$$.fragment,n),t=!1},d(n){hf(e,n)}}}function Ef(l){let e,t,n=l[0]&&ro(l);return{c(){n&&n.c(),e=bf()},m(i,s){n&&n.m(i,s),$f(i,e,s),t=!0},p(i,[s]){i[0]?n?(n.p(i,s),s&1&&pl(n,1)):(n=ro(i),n.c(),pl(n,1),n.m(e.parentNode,e)):n&&(vf(),ui(n,1,1,()=>{n=null}),pf())},i(i){t||(pl(n),t=!0)},o(i){ui(n),t=!1},d(i){i&&gf(e),n&&n.d(i)}}}function qf(l,e,t){let{rootNode:n}=e,{root:i}=e,{target:s}=e,{theme_mode:o}=e,{version:c}=e,{autoscroll:a}=e,{max_file_size:r=null}=e,{client:u}=e;const f=Sf();return Cf(()=>{f("mount")}),l.$$set=_=>{"rootNode"in _&&t(0,n=_.rootNode),"root"in _&&t(1,i=_.root),"target"in _&&t(2,s=_.target),"theme_mode"in _&&t(3,o=_.theme_mode),"version"in _&&t(4,c=_.version),"autoscroll"in _&&t(5,a=_.autoscroll),"max_file_size"in _&&t(6,r=_.max_file_size),"client"in _&&t(7,u=_.client)},[n,i,s,o,c,a,r,u]}class Mf extends df{constructor(e){super(),kf(this,e,qf,Ef,yf,{rootNode:0,root:1,target:2,theme_mode:3,version:4,autoscroll:5,max_file_size:6,client:7})}get rootNode(){return this.$$.ctx[0]}set rootNode(e){this.$$set({rootNode:e}),Dt()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),Dt()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),Dt()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),Dt()}get version(){return this.$$.ctx[4]}set version(e){this.$$set({version:e}),Dt()}get autoscroll(){return this.$$.ctx[5]}set autoscroll(e){this.$$set({autoscroll:e}),Dt()}get max_file_size(){return this.$$.ctx[6]}set max_file_size(e){this.$$set({max_file_size:e}),Dt()}get client(){return this.$$.ctx[7]}set client(e){this.$$set({client:e}),Dt()}}const zf="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='576'%20height='576'%20viewBox='0%200%20576%20576'%20fill='none'%3e%3cpath%20d='M287.5%20229L86%20344.5L287.5%20460L489%20344.5L287.5%20229Z'%20stroke='url(%23paint0_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M287.5%20116L86%20231.5L287.5%20347L489%20231.5L287.5%20116Z'%20stroke='url(%23paint1_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='round'/%3e%3cpath%20d='M86%20344L288%20229'%20stroke='url(%23paint2_linear_102_7)'%20stroke-width='59'%20stroke-linejoin='bevel'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_102_7'%20x1='60'%20y1='341'%20x2='429.5'%20y2='344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_102_7'%20x1='513.5'%20y1='231'%20x2='143.5'%20y2='231'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_102_7'%20x1='60'%20y1='344'%20x2='428.987'%20y2='341.811'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F9D100'/%3e%3cstop%20offset='1'%20stop-color='%23F97700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Nf="data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'%3e%3c/g%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3ctitle%3erecord%20[%23982]%3c/title%3e%3cdesc%3eCreated%20with%20Sketch.%3c/desc%3e%3cdefs%3e%3c/defs%3e%3cg%20id='Page-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Dribbble-Light-Preview'%20transform='translate(-380.000000,%20-3839.000000)'%20fill='%23FF0000'%3e%3cg%20id='icons'%20transform='translate(56.000000,%20160.000000)'%3e%3cpath%20d='M338,3689%20C338,3691.209%20336.209,3693%20334,3693%20C331.791,3693%20330,3691.209%20330,3689%20C330,3686.791%20331.791,3685%20334,3685%20C336.209,3685%20338,3686.791%20338,3689%20M334,3697%20C329.589,3697%20326,3693.411%20326,3689%20C326,3684.589%20329.589,3681%20334,3681%20C338.411,3681%20342,3684.589%20342,3689%20C342,3693.411%20338.411,3697%20334,3697%20M334,3679%20C328.477,3679%20324,3683.477%20324,3689%20C324,3694.523%20328.477,3699%20334,3699%20C339.523,3699%20344,3694.523%20344,3689%20C344,3683.477%20339.523,3679%20334,3679'%20id='record-[%23982]'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";let Tt=!1,rn=null,yi=[],Al=0,Ut={},Go,Cl,un=null,Bn=[];function Tf(l,e,t){Go=l,Cl=e,t&&(un=t)}async function Lf(){if(!Tt)try{const l=document.title;document.title="[Sharing] Gradio Tab";const e=await navigator.mediaDevices.getDisplayMedia({video:{width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},audio:!0,selfBrowserSurface:"include"});document.title=l;const t={videoBitsPerSecond:5e6};rn=new MediaRecorder(e,t),yi=[],Ut={},rn.ondataavailable=Of,rn.onstop=Df,rn.start(1e3),Tt=!0,un&&un(!0),Al=Date.now()}catch(l){Cl("Recording Error","Failed to start recording: "+l.message,"error")}}function jf(){!Tt||!rn||(rn.stop(),Tt=!1,un&&un(!1))}function Pf(){if(!Tt)return;const l=(Date.now()-Al)/1e3;Ut.start=l}function Af(){if(!Tt||Ut.start===void 0)return;const l=(Date.now()-Al)/1e3;Ut.end=l}function Rf(l,e){if(!Tt)return;const t=30,n=(Date.now()-Al)/1e3,i=Math.floor(l?(n-2)*t:n*t);if(e.boundingBox&&e.boundingBox.topLeft&&e.boundingBox.bottomRight&&e.boundingBox.topLeft.length===2&&e.boundingBox.bottomRight.length===2){const s=e.duration||2,o=i+Math.floor(s*t);Bn.some(a=>{const r=a.start_frame+Math.floor((a.duration||2)*t);return i>=a.start_frame&&i<=r||o>=a.start_frame&&o<=r||i<=a.start_frame&&o>=r})||Bn.push({boundingBox:e.boundingBox,start_frame:i,duration:s})}}function ao(l,e,t=2){if(Tt)try{setTimeout(()=>{if(!e||e.length===0)return;let n=1/0,i=1/0,s=0,o=0,c=!1;for(const p of e){const w=`#component-${p}`,g=document.querySelector(w);if(g){c=!0;const v=g.getBoundingClientRect();n=Math.min(n,v.left),i=Math.min(i,v.top),s=Math.max(s,v.right),o=Math.max(o,v.bottom)}}if(!c)return;const a=window.innerWidth,r=window.innerHeight,u=Math.min(s,a)-Math.max(0,n),f=Math.min(o,r)-Math.max(0,i),_=u/a,d=f/r;if(_>=.8||d>=.8)return;const h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let b=[Math.max(0,n)/a,Math.max(0,i)/r],k=[Math.min(s,a)/a,Math.min(o,r)/r];if(h){b[0]=Math.max(0,b[0]*.9),k[0]=Math.min(1,k[0]*.9);const p=k[0]-b[0],g=(b[0]+k[0])/2*.9;b[0]=Math.max(0,g-p/2),k[0]=Math.min(1,g+p/2)}b[0]=Math.max(0,b[0]),b[1]=Math.max(0,b[1]),k[0]=Math.min(1,k[0]),k[1]=Math.min(1,k[1]),Rf(l,{boundingBox:{topLeft:b,bottomRight:k},duration:t})},300)}catch{}}function Of(l){l.data.size>0&&yi.push(l.data)}function Df(){Tt=!1,un&&un(!1);const l=new Blob(yi,{type:"video/mp4"});If(l),(rn?.stream?.getTracks()||[]).forEach(t=>t.stop())}async function If(l){try{Cl("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",l,"recording.mp4"),Ut.start!==void 0&&Ut.end!==void 0&&(e.append("remove_segment_start",Ut.start.toString()),e.append("remove_segment_end",Ut.end.toString())),Bn.length>0&&e.append("zoom_effects",JSON.stringify(Bn));const t=await fetch(Go+"/gradio_api/process_recording",{method:"POST",body:e});if(!t.ok)throw new Error(`Server returned ${t.status}: ${t.statusText}`);const n=await t.blob(),i=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;co(n,i),Bn=[]}catch{Cl("Processing Error","Failed to process recording. Saving original version.","warning");const t=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;co(l,t)}}function co(l,e){const t=URL.createObjectURL(l),n=document.createElement("a");n.style.display="none",n.href=t,n.download=e,document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n),URL.revokeObjectURL(t)},100)}const{HtmlTag:Ff,SvelteComponent:Bf,add_flush_callback:uo,append:re,attr:le,bind:_o,binding_callbacks:fo,check_outros:An,component_subscribe:mn,create_component:Hn,destroy_component:Wn,detach:je,element:Se,empty:ml,flush:he,globals:Uf,group_outros:Rn,init:Gf,insert:Re,listen:zn,mount_component:Zn,noop:ti,run_all:Vf,safe_not_equal:Hf,set_data:Un,set_store_value:Wf,set_style:rl,space:Ae,src_url_equal:hl,text:Gn,toggle_class:al,transition_in:ze,transition_out:We}=window.__gradio__svelte__internal,{document:Dn}=Uf,{tick:cl,onMount:Zf}=window.__gradio__svelte__internal;function po(l){return Dn.title=l[2],{c:ti,m:ti,d:ti}}function mo(l){let e,t=`<style>${Ni(l[15],l[12])}</style>`,n;return{c(){e=new Ff(!1),n=ml(),e.a=n},m(i,s){e.m(t,i,s),Re(i,n,s)},p(i,s){s[0]&36864&&t!==(t=`<style>${Ni(i[15],i[12])}</style>`)&&e.p(t)},d(i){i&&(je(n),e.d())}}}function ho(l){let e,t;return e=new Mf({props:{rootNode:l[16],root:l[0],target:l[3],theme_mode:l[9],version:l[12],autoscroll:l[4],max_file_size:l[14],client:l[10]}}),e.$on("mount",l[34]),{c(){Hn(e.$$.fragment)},m(n,i){Zn(e,n,i),t=!0},p(n,i){const s={};i[0]&65536&&(s.rootNode=n[16]),i[0]&1&&(s.root=n[0]),i[0]&8&&(s.target=n[3]),i[0]&512&&(s.theme_mode=n[9]),i[0]&4096&&(s.version=n[12]),i[0]&16&&(s.autoscroll=n[4]),i[0]&16384&&(s.max_file_size=n[14]),i[0]&1024&&(s.client=n[10]),e.$set(s)},i(n){t||(ze(e.$$.fragment,n),t=!0)},o(n){We(e.$$.fragment,n),t=!1},d(n){Wn(e,n)}}}function go(l){let e,t,n,i=l[26]("common.built_with_gradio")+"",s,o,c,a,r,u,f,_,d,h=l[26]("common.stop_recording")+"",b,k,p,w,g,v,m,C,y,L=l[26]("common.settings")+"",E,M,$,T,q,R,J,Q=l[5]&&bo(l);return{c(){e=Se("footer"),Q&&Q.c(),t=Ae(),n=Se("a"),s=Gn(i),o=Ae(),c=Se("img"),u=Ae(),f=Se("div"),f.textContent="·",_=Ae(),d=Se("button"),b=Gn(h),k=Ae(),p=Se("img"),v=Ae(),m=Se("div"),m.textContent="·",C=Ae(),y=Se("button"),E=Gn(L),M=Ae(),$=Se("img"),hl(c.src,a=zf)||le(c,"src",a),le(c,"alt",r=l[26]("common.logo")),le(c,"class","svelte-czcr5b"),le(n,"href","https://gradio.app"),le(n,"class","built-with svelte-czcr5b"),le(n,"target","_blank"),le(n,"rel","noreferrer"),le(f,"class","divider svelte-czcr5b"),al(f,"hidden",!l[25]),hl(p.src,w=Nf)||le(p,"src",w),le(p,"alt",g=l[26]("common.stop_recording")),le(p,"class","svelte-czcr5b"),le(d,"class","record svelte-czcr5b"),al(d,"hidden",!l[25]),le(m,"class","divider svelte-czcr5b"),hl($.src,T=Ro)||le($,"src",T),le($,"alt",q=l[26]("common.settings")),le($,"class","svelte-czcr5b"),le(y,"class","settings svelte-czcr5b"),le(e,"class","svelte-czcr5b")},m(G,O){Re(G,e,O),Q&&Q.m(e,null),re(e,t),re(e,n),re(n,s),re(n,o),re(n,c),re(e,u),re(e,f),re(e,_),re(e,d),re(d,b),re(d,k),re(d,p),re(e,v),re(e,m),re(e,C),re(e,y),re(y,E),re(y,M),re(y,$),R||(J=[zn(d,"click",l[50]),zn(y,"click",l[51])],R=!0)},p(G,O){G[5]?Q?Q.p(G,O):(Q=bo(G),Q.c(),Q.m(e,t)):Q&&(Q.d(1),Q=null),O[0]&67108864&&i!==(i=G[26]("common.built_with_gradio")+"")&&Un(s,i),O[0]&67108864&&r!==(r=G[26]("common.logo"))&&le(c,"alt",r),O[0]&33554432&&al(f,"hidden",!G[25]),O[0]&67108864&&h!==(h=G[26]("common.stop_recording")+"")&&Un(b,h),O[0]&67108864&&g!==(g=G[26]("common.stop_recording"))&&le(p,"alt",g),O[0]&33554432&&al(d,"hidden",!G[25]),O[0]&67108864&&L!==(L=G[26]("common.settings")+"")&&Un(E,L),O[0]&67108864&&q!==(q=G[26]("common.settings"))&&le($,"alt",q)},d(G){G&&je(e),Q&&Q.d(),R=!1,Vf(J)}}}function bo(l){let e,t,n,i,s,o,c,a,r;function u(d,h){return d[10].config?.mcp_server?Qf:Jf}let f=u(l),_=f(l);return{c(){e=Se("button"),_.c(),t=Ae(),n=Se("img"),o=Ae(),c=Se("div"),c.textContent="·",hl(n.src,i=So)||le(n,"src",i),le(n,"alt",s=l[26]("common.logo")),le(n,"class","svelte-czcr5b"),le(e,"class","show-api svelte-czcr5b"),le(c,"class","divider show-api-divider svelte-czcr5b")},m(d,h){Re(d,e,h),_.m(e,null),re(e,t),re(e,n),Re(d,o,h),Re(d,c,h),a||(r=zn(e,"click",l[49]),a=!0)},p(d,h){f===(f=u(d))&&_?_.p(d,h):(_.d(1),_=f(d),_&&(_.c(),_.m(e,t))),h[0]&67108864&&s!==(s=d[26]("common.logo"))&&le(n,"alt",s)},d(d){d&&(je(e),je(o),je(c)),_.d(),a=!1,r()}}}function Jf(l){let e=l[26]("errors.use_via_api")+"",t;return{c(){t=Gn(e)},m(n,i){Re(n,t,i)},p(n,i){i[0]&67108864&&e!==(e=n[26]("errors.use_via_api")+"")&&Un(t,e)},d(n){n&&je(t)}}}function Qf(l){let e=l[26]("errors.use_via_api_or_mcp")+"",t;return{c(){t=Gn(e)},m(n,i){Re(n,t,i)},p(n,i){i[0]&67108864&&e!==(e=n[26]("errors.use_via_api_or_mcp")+"")&&Un(t,e)},d(n){n&&je(t)}}}function vo(l){let e,t,n,i,s;return t=new Xu({props:{api_calls:l[22],dependencies:l[1]}}),{c(){e=Se("div"),Hn(t.$$.fragment),le(e,"id","api-recorder-container"),le(e,"class","svelte-czcr5b")},m(o,c){Re(o,e,c),Zn(t,e,null),n=!0,i||(s=zn(e,"click",l[52]),i=!0)},p(o,c){const a={};c[0]&4194304&&(a.api_calls=o[22]),c[0]&2&&(a.dependencies=o[1]),t.$set(a)},i(o){n||(ze(t.$$.fragment,o),n=!0)},o(o){We(t.$$.fragment,o),n=!1},d(o){o&&je(e),Wn(t),i=!1,s()}}}function ko(l){let e,t,n,i,s,o,c,a;return s=new Fu({props:{root_node:l[16],dependencies:l[1],root:l[0],app:l[10],space_id:l[11],api_calls:l[22],username:l[13]}}),s.$on("close",l[54]),{c(){e=Se("div"),t=Se("div"),n=Ae(),i=Se("div"),Hn(s.$$.fragment),le(t,"class","backdrop svelte-czcr5b"),le(i,"class","api-docs-wrap svelte-czcr5b"),le(e,"class","api-docs svelte-czcr5b")},m(r,u){Re(r,e,u),re(e,t),re(e,n),re(e,i),Zn(s,i,null),o=!0,c||(a=zn(t,"click",l[53]),c=!0)},p(r,u){const f={};u[0]&65536&&(f.root_node=r[16]),u[0]&2&&(f.dependencies=r[1]),u[0]&1&&(f.root=r[0]),u[0]&1024&&(f.app=r[10]),u[0]&2048&&(f.space_id=r[11]),u[0]&4194304&&(f.api_calls=r[22]),u[0]&8192&&(f.username=r[13]),s.$set(f)},i(r){o||(ze(s.$$.fragment,r),o=!0)},o(r){We(s.$$.fragment,r),o=!1},d(r){r&&je(e),Wn(s),c=!1,a()}}}function $o(l){let e,t,n,i,s,o,c,a,r,u;function f(h){l[56](h)}function _(h){l[57](h)}let d={pwa_enabled:l[10].config.pwa,root:l[0],space_id:l[11]};return l[20]!==void 0&&(d.allow_zoom=l[20]),l[21]!==void 0&&(d.allow_video_trim=l[21]),s=new z_({props:d}),fo.push(()=>_o(s,"allow_zoom",f)),fo.push(()=>_o(s,"allow_video_trim",_)),s.$on("close",l[58]),s.$on("start_recording",l[59]),{c(){e=Se("div"),t=Se("div"),n=Ae(),i=Se("div"),Hn(s.$$.fragment),le(t,"class","backdrop svelte-czcr5b"),le(i,"class","api-docs-wrap svelte-czcr5b"),le(e,"class","api-docs svelte-czcr5b")},m(h,b){Re(h,e,b),re(e,t),re(e,n),re(e,i),Zn(s,i,null),a=!0,r||(u=zn(t,"click",l[55]),r=!0)},p(h,b){const k={};b[0]&1024&&(k.pwa_enabled=h[10].config.pwa),b[0]&1&&(k.root=h[0]),b[0]&2048&&(k.space_id=h[11]),!o&&b[0]&1048576&&(o=!0,k.allow_zoom=h[20],uo(()=>o=!1)),!c&&b[0]&2097152&&(c=!0,k.allow_video_trim=h[21],uo(()=>c=!1)),s.$set(k)},i(h){a||(ze(s.$$.fragment,h),a=!0)},o(h){We(s.$$.fragment,h),a=!1},d(h){h&&je(e),Wn(s),r=!1,u()}}}function wo(l){let e,t;return e=new Er({props:{messages:l[23]}}),e.$on("close",l[33]),{c(){Hn(e.$$.fragment)},m(n,i){Zn(e,n,i),t=!0},p(n,i){const s={};i[0]&8388608&&(s.messages=n[23]),e.$set(s)},i(n){t||(ze(e.$$.fragment,n),t=!0)},o(n){We(e.$$.fragment,n),t=!1},d(n){Wn(e,n)}}}function Yf(l){let e,t,n,i,s,o,c,a,r,u,f,_,d=l[7]&&po(l),h=l[15]&&mo(l),b=l[16]&&l[10].config&&l[24]&&ho(l),k=l[6]&&go(l),p=l[19]&&vo(l),w=l[17]&&l[16]&&ko(l),g=l[18]&&l[16]&&l[10].config&&$o(l),v=l[23]&&wo(l);return{c(){d&&d.c(),e=ml(),h&&h.c(),t=ml(),n=Ae(),i=Se("div"),s=Se("div"),b&&b.c(),o=Ae(),k&&k.c(),c=Ae(),p&&p.c(),a=Ae(),w&&w.c(),r=Ae(),g&&g.c(),u=Ae(),v&&v.c(),f=ml(),le(s,"class","contain svelte-czcr5b"),rl(s,"flex-grow",l[8]?"1":"auto"),le(i,"class","wrap svelte-czcr5b"),rl(i,"min-height",l[8]?"100%":"auto")},m(m,C){d&&d.m(Dn.head,null),re(Dn.head,e),h&&h.m(Dn.head,null),re(Dn.head,t),Re(m,n,C),Re(m,i,C),re(i,s),b&&b.m(s,null),re(i,o),k&&k.m(i,null),Re(m,c,C),p&&p.m(m,C),Re(m,a,C),w&&w.m(m,C),Re(m,r,C),g&&g.m(m,C),Re(m,u,C),v&&v.m(m,C),Re(m,f,C),_=!0},p(m,C){m[7]?d||(d=po(m),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),m[15]?h?h.p(m,C):(h=mo(m),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),m[16]&&m[10].config&&m[24]?b?(b.p(m,C),C[0]&16843776&&ze(b,1)):(b=ho(m),b.c(),ze(b,1),b.m(s,null)):b&&(Rn(),We(b,1,1,()=>{b=null}),An()),C[0]&256&&rl(s,"flex-grow",m[8]?"1":"auto"),m[6]?k?k.p(m,C):(k=go(m),k.c(),k.m(i,null)):k&&(k.d(1),k=null),C[0]&256&&rl(i,"min-height",m[8]?"100%":"auto"),m[19]?p?(p.p(m,C),C[0]&524288&&ze(p,1)):(p=vo(m),p.c(),ze(p,1),p.m(a.parentNode,a)):p&&(Rn(),We(p,1,1,()=>{p=null}),An()),m[17]&&m[16]?w?(w.p(m,C),C[0]&196608&&ze(w,1)):(w=ko(m),w.c(),ze(w,1),w.m(r.parentNode,r)):w&&(Rn(),We(w,1,1,()=>{w=null}),An()),m[18]&&m[16]&&m[10].config?g?(g.p(m,C),C[0]&328704&&ze(g,1)):(g=$o(m),g.c(),ze(g,1),g.m(u.parentNode,u)):g&&(Rn(),We(g,1,1,()=>{g=null}),An()),m[23]?v?(v.p(m,C),C[0]&8388608&&ze(v,1)):(v=wo(m),v.c(),ze(v,1),v.m(f.parentNode,f)):v&&(Rn(),We(v,1,1,()=>{v=null}),An())},i(m){_||(ze(b),ze(p),ze(w),ze(g),ze(v),_=!0)},o(m){We(b),We(p),We(w),We(g),We(v),_=!1},d(m){m&&(je(n),je(i),je(c),je(a),je(r),je(u),je(f)),d&&d.d(m),je(e),h&&h.d(m),je(t),b&&b.d(),k&&k.d(),p&&p.d(m),w&&w.d(m),g&&g.d(m),v&&v.d(m)}}}const Kf=/^'([^]+)'$/,Xf=15,xf=10;function yo(l){return"detail"in l}function e0(l,e,t){let n,i,s,o,c,a;mn(l,_i,S=>t(26,c=S));let{root:r}=e,{components:u}=e,{layout:f}=e,{dependencies:_}=e,{title:d="Gradio"}=e,{target:h}=e,{autoscroll:b}=e,{show_api:k=!0}=e,{show_footer:p=!0}=e,{control_page_title:w=!1}=e,{app_mode:g}=e,{theme_mode:v}=e,{app:m}=e,{space_id:C}=e,{version:y}=e,{js:L}=e,{fill_height:E=!1}=e,{ready:M}=e,{username:$}=e,{api_prefix:T=""}=e,{max_file_size:q=void 0}=e,{initial_layout:R=void 0}=e,{css:J=null}=e,{layout:Q,targets:G,update_value:O,get_data:j,modify_stream:P,get_stream_state:ee,set_time_limit:Pe,loading_status:me,scheduled_updates:be,create_layout:et,rerender_layout:Jn}=yr(R);mn(l,Q,S=>t(16,a=S)),mn(l,G,S=>t(66,s=S)),mn(l,me,S=>t(48,i=S)),mn(l,be,S=>t(67,o=S));let at=_;async function Qn(){await et({components:u,layout:f,dependencies:_,root:r+T,app:m,options:{fill_height:E}})}let{search_params:pt}=e,mt=pt.get("view")==="api"&&k,Lt=pt.get("view")==="settings",jt=pt.get("view")==="api-recorder"&&k,Te=!0,Pt=!0;function bt(S){t(19,jt=!1),t(17,mt=S);let x=new URLSearchParams(window.location.search);S?x.set("view","api"):x.delete("view"),history.replaceState(null,"","?"+x.toString())}function Ge(S){let x=new URLSearchParams(window.location.search);S?x.set("view","settings"):x.delete("view"),history.replaceState(null,"","?"+x.toString()),t(18,Lt=!Lt)}let Y=[],{render_complete:de=!1}=e;async function _n(S,x){const Z=_.find(ke=>ke.id===x),ve=u.find(ke=>ke.id===Z?.inputs[0])?.type;if(Te&&Z&&ve!=="dataset"&&(Z&&Z.inputs&&Z.inputs.length>0&&n&&ao(!0,Z.inputs,1),Z&&Z.outputs&&Z.outputs.length>0&&n&&ao(!1,Z.outputs,2)),!Z)return;const U=Z.outputs,_e=S?.map((ke,ct)=>({id:U[ct],prop:"value_is_output",value:!0}));O(_e),await cl();const $e=[];S?.forEach((ke,ct)=>{if(typeof ke=="object"&&ke!==null&&ke.__type__==="update")for(const[X,Ve]of Object.entries(ke))X!=="__type__"&&$e.push({id:U[ct],prop:X,value:Ve});else $e.push({id:U[ct],prop:"value",value:ke})}),O($e),await cl()}let tt=new Map,ue=[];function nt(S,x,Z,ve,U=10,_e=!0){return{title:S,message:x,fn_index:Z,type:ve,id:++Vo,duration:U,visible:_e}}function Rl(S,x,Z){t(23,ue=[nt(S,x,-1,Z),...ue])}let Vo=-1,Ol=!1;const Ho=c("blocks.long_requests_queue"),Wo=c("blocks.connection_can_break"),Zo=c("blocks.lost_connection"),Jo=c("blocks.waiting_for_inputs");let Dl=!1,Ci=!1,Si=!1,Tn=[];function fn(S,x=null,Z=null){let ve=()=>{};function U(){ve()}o?ve=be.subscribe(_e=>{_e||cl().then(()=>{Ei(S,x,Z),U()})}):Ei(S,x,Z)}async function Qo(S,x,Z){return S===x&&Z&&Z.is_value_data===!0?Z.value:j(S)}async function Ei(S,x=null,Z=null){const ve=_.find(X=>X.id===S);if(ve===void 0)return;const U=ve;if(Tn.length>0){for(const X of Tn)if(U.inputs.includes(X)){Rl("Warning",Jo,"warning");return}}const _e=me.get_status_for_fn(S);t(23,ue=ue.filter(({fn_index:X})=>X!==S)),(_e==="pending"||_e==="generating")&&(U.pending_request=!0);let $e={fn_index:S,data:await Promise.all(U.inputs.map(X=>Qo(X,x,Z))),event_data:U.collects_event_data?Z:null,trigger_id:x};U.frontend_fn&&typeof U.frontend_fn!="boolean"?U.frontend_fn($e.data.concat(await Promise.all(U.outputs.map(X=>j(X))))).then(X=>{U.backend_fn?($e.data=X,ke(U,$e)):_n(X,S)}):U.types.cancel&&U.cancels?await Promise.all(U.cancels.map(async X=>{const Ve=tt.get(X);return Ve?.cancel(),Ve})):U.backend_fn&&(U.js_implementation&&new Ti(`let result = await (${U.js_implementation})(...arguments);
return (!Array.isArray(result)) ? [result] : result;`)(...$e.data).then(Ve=>{_n(Ve,S),$e.js_implementation=!0}).catch(Ve=>{console.error(Ve),$e.js_implementation=!1}),ke(U,$e));function ke(X,Ve){X.trigger_mode==="once"?X.pending_request||ct(Ve,X.connection=="stream"):X.trigger_mode==="multiple"?ct(Ve,X.connection=="stream"):X.trigger_mode==="always_last"&&(X.pending_request?X.final_event=Ve:ct(Ve,X.connection=="stream"))}async function ct(X,Ve=!1){Pt&&Pf(),jt&&t(22,Y=[...Y,JSON.parse(JSON.stringify(X))]);let Bl;if(m.set_current_payload(X),Ve)if(!tt.has(S))U.inputs.forEach(pe=>P(pe,"waiting"));else{if(tt.has(S)&&U.inputs.some(pe=>ee(pe)==="waiting"))return;if(tt.has(S)&&U.inputs.some(pe=>ee(pe)==="open")){await m.send_ws_message(`${m.config.root+m.config.api_prefix}/stream/${tt.get(S).event_id()}`,{...X,session_hash:m.session_hash});return}}try{Bl=m.submit(X.fn_index,X.data,X.event_data,X.trigger_id)}catch(pe){if(m.closed)return;t(23,ue=[nt("Error",String(pe),0,"error"),...ue]),me.update({status:"error",fn_index:0,eta:0,queue:!1,queue_position:null}),Yn(i);return}tt.set(S,Bl);for await(const pe of Bl){if(X.js_implementation)return;pe.type==="data"?fr(pe):pe.type==="render"?dr(pe):pe.type==="status"?hr(pe):pe.type==="log"&&pr(pe)}function fr(pe){const{data:Le,fn_index:oe}=pe;U.pending_request&&U.final_event&&(U.pending_request=!1,ct(U.final_event,U.connection=="stream")),U.pending_request=!1,_n(Le,oe),Yn(i)}function dr(pe){const{data:Le}=pe;let oe=Le.components,we=Le.layout,St=Le.dependencies,At=Le.render_id,Rt=[];_.forEach((dn,gr)=>{dn.rendered_in===U.render_id&&Rt.push(gr)}),Rt.reverse().forEach(dn=>{_.splice(dn,1)}),St.forEach(dn=>{_.push(dn)}),Jn({components:oe,layout:we,root:r+T,dependencies:_,render_id:At})}function pr(pe){const{title:Le,log:oe,fn_index:we,level:St,duration:At,visible:Rt}=pe;t(23,ue=[nt(Le,oe,we,St,At,Rt),...ue])}function mr(pe,Le,oe){pe.original_msg==="process_starts"&&oe.connection==="stream"&&P(Le,"open")}function hr(pe){const{fn_index:Le,...oe}=pe;if(oe.stage==="streaming"&&oe.time_limit&&U.inputs.forEach(we=>{Pe(we,oe.time_limit)}),U.inputs.forEach(we=>{mr(pe,we,U)}),me.update({...oe,time_limit:oe.time_limit,status:oe.stage,progress:oe.progress_data,fn_index:Le}),Yn(i),!Ci&&C!==null&&oe.position!==void 0&&oe.position>=2&&oe.eta!==void 0&&oe.eta>Xf&&(Ci=!0,t(23,ue=[nt("Warning",Ho,Le,"warning"),...ue])),!Si&&Dl&&oe.eta!==void 0&&oe.eta>xf&&(Si=!0,t(23,ue=[nt("Warning",Wo,Le,"warning"),...ue])),oe.stage==="complete"||oe.stage==="generating"){const we=new Set;oe.changed_state_ids?.forEach(St=>{_.filter(At=>At.targets.some(([Rt,dn])=>Rt===St)).forEach(At=>{we.add(At)})}),we.forEach(St=>{fn(St.id,X.trigger_id)})}if(oe.stage==="complete"&&(_.forEach(async we=>{we.trigger_after===Le&&fn(we.id,X.trigger_id)}),U.inputs.forEach(we=>{P(we,"closed")}),tt.delete(S)),oe.broken&&Dl&&Ol)window.setTimeout(()=>{t(23,ue=[nt("Error",Zo,Le,"error"),...ue])},0),fn(U.id,X.trigger_id,Z),Ol=!1;else if(oe.stage==="error"){if(oe.message){const we=oe.message.replace(Kf,(At,Rt)=>Rt),St=oe.title??"Error";t(23,ue=[nt(St,we,Le,"error",oe.duration,oe.visible),...ue])}_.map(async we=>{we.trigger_after===Le&&!we.trigger_only_on_success&&fn(we.id,X.trigger_id)})}}Pt&&Af()}}function Yo(S,x){if(C===null)return;const Z=new URL(`https://huggingface.co/spaces/${C}/discussions/new`);S!==void 0&&S.length>0&&Z.searchParams.set("title",S),Z.searchParams.set("description",x),window.open(Z.toString(),"_blank")}function Ko(S){const x=S.detail;t(23,ue=ue.filter(Z=>Z.id!==x))}const Xo=S=>!!(S&&new URL(S,location.href).origin!==location.origin);async function xo(){L&&await new Ti(`let result = await (${L})();
return (!Array.isArray(result)) ? [result] : result;`)(),await cl();for(var S=h.getElementsByTagName("a"),x=0;x<S.length;x++){const Z=S[x].getAttribute("target"),ve=S[x].getAttribute("href");Xo(ve)&&Z!=="_blank"&&S[x].setAttribute("target","_blank")}qi(),!(!h||de)&&(h.addEventListener("prop_change",Z=>{if(!yo(Z))throw new Error("not a custom event");const{id:ve,prop:U,value:_e}=Z.detail;O([{id:ve,prop:U,value:_e}]),U==="input_ready"&&_e===!1&&Tn.push(ve),U==="input_ready"&&_e===!0&&(Tn=Tn.filter($e=>$e!==ve))}),h.addEventListener("gradio",Z=>{if(!yo(Z))throw new Error("not a custom event");const{id:ve,event:U,data:_e}=Z.detail;if(U==="share"){const{title:$e,description:ke}=_e;Yo($e,ke)}else U==="error"?t(23,ue=[nt("Error",_e,-1,U),...ue]):U==="warning"?t(23,ue=[nt("Warning",_e,-1,U),...ue]):U==="info"?t(23,ue=[nt("Info",_e,-1,U),...ue]):U=="clear_status"?er(ve,"complete",_e):U=="close_stream"?s[ve]?.[_e]?.forEach(ke=>{if(tt.has(ke)){const ct=`${m.config.root+m.config.api_prefix}/stream/${tt.get(ke).event_id()}`;m.post_data(`${ct}/close`,{}),m.close_ws(ct)}}):s[ve]?.[U]?.forEach(ke=>{requestAnimationFrame(()=>{fn(ke,ve,_e)})})}),t(37,de=!0))}const qi=()=>{_.forEach(S=>{S.targets.some(x=>x[1]==="load")&&fn(S.id)})};function er(S,x,Z){Z.status=x,O([{id:S,prop:"loading_status",value:Z}])}function Yn(S){let x=[];Object.entries(S).forEach(([U,_e])=>{if(m.closed&&_e.status==="error")return;let $e=_.find(ke=>ke.id==_e.fn_index);$e!==void 0&&(_e.scroll_to_output=$e.scroll_to_output,_e.show_progress=$e.show_progress,x.push({id:parseInt(U),prop:"loading_status",value:_e}))});const Z=me.get_inputs_to_update(),ve=Array.from(Z).map(([U,_e])=>({id:U,prop:"pending",value:_e==="pending"}));O([...x,...ve])}let Il=Cr(!1);mn(l,Il,S=>t(25,n=S)),Zf(()=>{document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&(Ol=!0)}),Dl=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Tf(r,(S,x,Z)=>{Rl(S,x,Z)},S=>{Wf(Il,n=S,n)})});function Fl(){n?jf():Lf()}let Mi=!1;fi(m.config?.i18n_translations??void 0).then(()=>{t(24,Mi=!0)});const tr=()=>{bt(!mt)},nr=()=>{Fl()},lr=()=>{Ge(!Lt)},ir=()=>{bt(!0),t(19,jt=!1)},sr=()=>{bt(!1)},or=S=>{bt(!1),t(22,Y=[]),t(19,jt=S.detail?.api_recorder_visible)},rr=()=>{Ge(!1)};function ar(S){Te=S,t(20,Te)}function cr(S){Pt=S,t(21,Pt)}const ur=S=>{Ge(!1)},_r=S=>{Fl()};return l.$$set=S=>{"root"in S&&t(0,r=S.root),"components"in S&&t(39,u=S.components),"layout"in S&&t(40,f=S.layout),"dependencies"in S&&t(1,_=S.dependencies),"title"in S&&t(2,d=S.title),"target"in S&&t(3,h=S.target),"autoscroll"in S&&t(4,b=S.autoscroll),"show_api"in S&&t(5,k=S.show_api),"show_footer"in S&&t(6,p=S.show_footer),"control_page_title"in S&&t(7,w=S.control_page_title),"app_mode"in S&&t(8,g=S.app_mode),"theme_mode"in S&&t(9,v=S.theme_mode),"app"in S&&t(10,m=S.app),"space_id"in S&&t(11,C=S.space_id),"version"in S&&t(12,y=S.version),"js"in S&&t(41,L=S.js),"fill_height"in S&&t(42,E=S.fill_height),"ready"in S&&t(38,M=S.ready),"username"in S&&t(13,$=S.username),"api_prefix"in S&&t(43,T=S.api_prefix),"max_file_size"in S&&t(14,q=S.max_file_size),"initial_layout"in S&&t(44,R=S.initial_layout),"css"in S&&t(15,J=S.css),"search_params"in S&&t(45,pt=S.search_params),"render_complete"in S&&t(37,de=S.render_complete)},l.$$.update=()=>{l.$$.dirty[0]&1035|l.$$.dirty[1]&2816&&Qn(),l.$$.dirty[0]&65536&&t(38,M=!!a),l.$$.dirty[0]&2|l.$$.dirty[1]&65600&&_!==at&&de&&(qi(),t(47,at=_)),l.$$.dirty[1]&131072&&Yn(i)},[r,_,d,h,b,k,p,w,g,v,m,C,y,$,q,J,a,mt,Lt,jt,Te,Pt,Y,ue,Mi,n,c,Q,G,me,be,bt,Ge,Ko,xo,Il,Fl,de,M,u,f,L,E,T,R,pt,Rl,at,i,tr,nr,lr,ir,sr,or,rr,ar,cr,ur,_r]}class E0 extends Bf{constructor(e){super(),Gf(this,e,e0,Yf,Hf,{root:0,components:39,layout:40,dependencies:1,title:2,target:3,autoscroll:4,show_api:5,show_footer:6,control_page_title:7,app_mode:8,theme_mode:9,app:10,space_id:11,version:12,js:41,fill_height:42,ready:38,username:13,api_prefix:43,max_file_size:14,initial_layout:44,css:15,search_params:45,render_complete:37,add_new_message:46},null,[-1,-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),he()}get components(){return this.$$.ctx[39]}set components(e){this.$$set({components:e}),he()}get layout(){return this.$$.ctx[40]}set layout(e){this.$$set({layout:e}),he()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),he()}get title(){return this.$$.ctx[2]}set title(e){this.$$set({title:e}),he()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),he()}get autoscroll(){return this.$$.ctx[4]}set autoscroll(e){this.$$set({autoscroll:e}),he()}get show_api(){return this.$$.ctx[5]}set show_api(e){this.$$set({show_api:e}),he()}get show_footer(){return this.$$.ctx[6]}set show_footer(e){this.$$set({show_footer:e}),he()}get control_page_title(){return this.$$.ctx[7]}set control_page_title(e){this.$$set({control_page_title:e}),he()}get app_mode(){return this.$$.ctx[8]}set app_mode(e){this.$$set({app_mode:e}),he()}get theme_mode(){return this.$$.ctx[9]}set theme_mode(e){this.$$set({theme_mode:e}),he()}get app(){return this.$$.ctx[10]}set app(e){this.$$set({app:e}),he()}get space_id(){return this.$$.ctx[11]}set space_id(e){this.$$set({space_id:e}),he()}get version(){return this.$$.ctx[12]}set version(e){this.$$set({version:e}),he()}get js(){return this.$$.ctx[41]}set js(e){this.$$set({js:e}),he()}get fill_height(){return this.$$.ctx[42]}set fill_height(e){this.$$set({fill_height:e}),he()}get ready(){return this.$$.ctx[38]}set ready(e){this.$$set({ready:e}),he()}get username(){return this.$$.ctx[13]}set username(e){this.$$set({username:e}),he()}get api_prefix(){return this.$$.ctx[43]}set api_prefix(e){this.$$set({api_prefix:e}),he()}get max_file_size(){return this.$$.ctx[14]}set max_file_size(e){this.$$set({max_file_size:e}),he()}get initial_layout(){return this.$$.ctx[44]}set initial_layout(e){this.$$set({initial_layout:e}),he()}get css(){return this.$$.ctx[15]}set css(e){this.$$set({css:e}),he()}get search_params(){return this.$$.ctx[45]}set search_params(e){this.$$set({search_params:e}),he()}get render_complete(){return this.$$.ctx[37]}set render_complete(e){this.$$set({render_complete:e}),he()}get add_new_message(){return this.$$.ctx[46]}}export{E0 as default};
//# sourceMappingURL=Blocks-CNpTFy6G.js.map