MMaDA
/
venv
/lib
/python3.11
/site-packages
/gradio
/templates
/frontend
/assets
/Blocks-DKDrXp28.js
import{$ as di,s as pi,l as vr,y as kr,d as $r,t as Ti,z as wr,A as yr,c as Cr,p as Li,B as ji,w as Sr}from"./index-Co_Q4qaw.js";import{B as El}from"./Button-DgOo0qHV.js";import{L as Eo}from"./index-CdIv-E5z.js";/* empty css */import"./MarkdownCode.svelte_svelte_type_style_lang-DwuBo7pZ.js";import"./StreamingBar.svelte_svelte_type_style_lang-DlRzv56K.js";import{B as Ht}from"./Block-CJdXVpa7.js";import{c as Er}from"./Dropdown-BWRZ8eYJ.js";/* empty css */import{C as Pi}from"./Checkbox-CjOIpf6b.js";import{T as qr}from"./Toast-DPeWz-Kz.js";import{G as Mr}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-PMlrFIzj.js";import"./index-DTl--HH3.js";import"./BlockTitle-EkHcTHPF.js";import"./Info-B0PjAnhx.js";import"./MarkdownCode-D_G1OEp4.js";import"./DropdownArrow-DYWFcSFn.js";const{SvelteComponent:zr,append:Vl,attr:qt,detach:Nr,init:Tr,insert:Lr,noop:Hl,safe_not_equal:jr,set_style:jn,svg_element:Xn}=window.__gradio__svelte__internal;function Pr(l){let e,t,n,i;return{c(){e=Xn("svg"),t=Xn("g"),n=Xn("path"),i=Xn("path"),qt(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"),qt(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"),qt(e,"width","100%"),qt(e,"height","100%"),qt(e,"viewBox","0 0 5 5"),qt(e,"version","1.1"),qt(e,"xmlns","http://www.w3.org/2000/svg"),qt(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),qt(e,"xml:space","preserve"),jn(e,"fill","currentColor"),jn(e,"fill-rule","evenodd"),jn(e,"clip-rule","evenodd"),jn(e,"stroke-linejoin","round"),jn(e,"stroke-miterlimit","2")},m(s,o){Lr(s,e,o),Vl(e,t),Vl(t,n),Vl(t,i)},p:Hl,i:Hl,o:Hl,d(s){s&&Nr(e)}}}class mi extends zr{constructor(e){super(),Tr(this,e,null,Pr,jr,{})}}const{SvelteComponent:Ar,append:It,attr:xn,create_component:Rr,destroy_component:Or,detach:Wl,element:mn,flush:Dr,init:Ir,insert:Zl,listen:Fr,mount_component:Br,safe_not_equal:Ur,set_data:Gr,space:Jl,text:Ai,transition_in:Vr,transition_out:Hr}=window.__gradio__svelte__internal,{createEventDispatcher:Wr}=window.__gradio__svelte__internal;function Zr(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b;return _=new mi({}),{c(){e=mn("div"),t=mn("h1"),t.textContent="API Docs",n=Jl(),i=mn("p"),s=Ai(`No API Routes found for | |
`),o=mn("code"),c=Ai(l[0]),a=Jl(),r=mn("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=Jl(),f=mn("button"),Rr(_.$$.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){Zl(k,e,p),It(e,t),It(e,n),It(e,i),It(i,s),It(i,o),It(o,c),It(e,a),It(e,r),Zl(k,u,p),Zl(k,f,p),Br(_,f,null),d=!0,h||(b=Fr(f,"click",l[2]),h=!0)},p(k,[p]){(!d||p&1)&&Gr(c,k[0])},i(k){d||(Vr(_.$$.fragment,k),d=!0)},o(k){Hr(_.$$.fragment,k),d=!1},d(k){k&&(Wl(e),Wl(u),Wl(f)),Or(_),h=!1,b()}}}function Jr(l,e,t){const n=Wr();let{root:i}=e;const s=()=>n("close");return l.$$set=o=>{"root"in o&&t(0,i=o.root)},[i,n,s]}class Qr extends Ar{constructor(e){super(),Ir(this,e,Jr,Zr,Ur,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Dr()}}const qo="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:Yr,append:He,attr:mt,check_outros:Kr,create_component:Mo,destroy_component:zo,detach:Nt,element:ht,empty:Xr,flush:Ql,group_outros:xr,init:ea,insert:Tt,listen:ta,mount_component:No,noop:na,safe_not_equal:la,set_data:Ri,space:gn,src_url_equal:ia,text:$n,transition_in:Dn,transition_out:_l}=window.__gradio__svelte__internal,{createEventDispatcher:sa}=window.__gradio__svelte__internal;function Oi(l){let e,t;return e=new El({props:{size:"sm",variant:"secondary",elem_id:"start-api-recorder",$$slots:{default:[oa]},$$scope:{ctx:l}}}),e.$on("click",l[4]),{c(){Mo(e.$$.fragment)},m(n,i){No(e,n,i),t=!0},p(n,i){const s={};i&64&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Dn(e.$$.fragment,n),t=!0)},o(n){_l(e.$$.fragment,n),t=!1},d(n){zo(e,n)}}}function oa(l){let e,t,n;return{c(){e=ht("div"),t=gn(),n=ht("p"),n.textContent="API Recorder",mt(e,"class","loading-dot self-baseline svelte-1i1gjw2"),mt(n,"class","self-baseline btn-text svelte-1i1gjw2")},m(i,s){Tt(i,e,s),Tt(i,t,s),Tt(i,n,s)},p:na,d(i){i&&(Nt(e),Nt(t),Nt(n))}}}function ra(l){let e;return{c(){e=$n("MCP Tool")},m(t,n){Tt(t,e,n)},d(t){t&&Nt(e)}}}function aa(l){let e;return{c(){e=$n("API endpoint")},m(t,n){Tt(t,e,n)},d(t){t&&Nt(e)}}}function Di(l){let e;return{c(){e=$n("s")},m(t,n){Tt(t,e,n)},d(t){t&&Nt(e)}}}function ca(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"&&Oi(l);function E(q,R){return q[2]!=="mcp"?aa:ra}let M=E(l),$=M(l),T=l[1]>1&&Di();return v=new mi({}),{c(){e=ht("h2"),t=ht("img"),i=gn(),s=ht("div"),o=$n(`API documentation | |
`),c=ht("div"),a=$n(l[0]),r=gn(),u=ht("span"),L&&L.c(),f=gn(),_=ht("p"),d=ht("span"),h=$n(l[1]),b=gn(),$.c(),k=Xr(),T&&T.c(),p=ht("br"),w=gn(),g=ht("button"),Mo(v.$$.fragment),ia(t.src,n=qo)||mt(t,"src",n),mt(t,"alt",""),mt(t,"class","svelte-1i1gjw2"),mt(c,"class","url svelte-1i1gjw2"),mt(s,"class","title svelte-1i1gjw2"),mt(d,"class","url svelte-1i1gjw2"),mt(u,"class","counts svelte-1i1gjw2"),mt(e,"class","svelte-1i1gjw2"),mt(g,"class","svelte-1i1gjw2")},m(q,R){Tt(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),Tt(q,w,R),Tt(q,g,R),No(v,g,null),m=!0,C||(y=ta(g,"click",l[5]),C=!0)},p(q,[R]){(!m||R&1)&&Ri(a,q[0]),q[2]!=="mcp"?L?(L.p(q,R),R&4&&Dn(L,1)):(L=Oi(q),L.c(),Dn(L,1),L.m(u,f)):L&&(xr(),_l(L,1,1,()=>{L=null}),Kr()),(!m||R&2)&&Ri(h,q[1]),M!==(M=E(q))&&($.d(1),$=M(q),$&&($.c(),$.m(_,k))),q[1]>1?T||(T=Di(),T.c(),T.m(_,p)):T&&(T.d(1),T=null)},i(q){m||(Dn(L),Dn(v.$$.fragment,q),m=!0)},o(q){_l(L),_l(v.$$.fragment,q),m=!1},d(q){q&&(Nt(e),Nt(w),Nt(g)),L&&L.d(),$.d(),T&&T.d(),zo(v),C=!1,y()}}}function ua(l,e,t){let{root:n}=e,{api_count:i}=e,{current_language:s="python"}=e;const o=sa(),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 _a extends Yr{constructor(e){super(),ea(this,e,ua,ca,la,{root:0,api_count:1,current_language:2})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Ql()}get api_count(){return this.$$.ctx[1]}set api_count(e){this.$$set({api_count:e}),Ql()}get current_language(){return this.$$.ctx[2]}set current_language(e){this.$$set({current_language:e}),Ql()}}function ct(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=ii(l)),t==="py"&&(l=si(l)),fa(l))}function To(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"&&To(l[e]))return!0}return!1}function ii(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]=ii(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=ii(l[e])}),l)}function si(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]=si(e))}):typeof l=="object"&&l!==null&&Object.keys(l).forEach(e=>{l[e]=si(l[e])}),l)}function fa(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:da,append:ye,attr:Bt,check_outros:pa,create_component:ma,destroy_component:ha,destroy_each:ga,detach:De,element:nt,empty:Lo,ensure_array_like:Ii,flush:el,group_outros:ba,init:va,insert:Ie,mount_component:ka,noop:$a,safe_not_equal:wa,set_data:Ut,set_style:sn,space:on,text:Ue,toggle_class:Fi,transition_in:fl,transition_out:oi}=window.__gradio__svelte__internal;function Bi(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 Ui(l){let e;return{c(){e=Ue("s")},m(t,n){Ie(t,e,n)},d(t){t&&De(e)}}}function ya(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")+"")&&Ut(t,e)},d(n){n&&De(t)}}}function Ca(l){let e=l[5].type+"",t,n,i=l[8]&&l[9]===null&&Gi();return{c(){t=Ue(e),i&&i.c(),n=Lo()},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+"")&&Ut(t,e),s[8]&&s[9]===null?i||(i=Gi(),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 Gi(l){let e;return{c(){e=Ue(`Β | | |
None`)},m(t,n){Ie(t,e,n)},d(t){t&&De(e)}}}function Sa(l){let e,t,n=ct(l[9],l[5].type,"py")+"",i;return{c(){e=nt("span"),e.textContent="Default: ",t=nt("span"),i=Ue(n),Bt(t,"class","code svelte-1yt946s"),sn(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=ct(s[9],s[5].type,"py")+"")&&Ut(i,n)},d(s){s&&(De(e),De(t))}}}function Ea(l){let e;return{c(){e=nt("span"),e.textContent="Required",sn(e,"font-weight","bold")},m(t,n){Ie(t,e,n)},p:$a,d(t){t&&De(e)}}}function Vi(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"?Ca:ya}let L=y(l),E=L(l);function M(q,R){return!q[8]||q[3]=="bash"?Ea:Sa}let $=M(l),T=$(l);return{c(){e=nt("hr"),t=on(),n=nt("div"),i=nt("p"),s=nt("span"),c=Ue(o),a=on(),r=nt("span"),E.c(),u=on(),T.c(),f=on(),_=nt("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=on(),Bt(e,"class","hr svelte-1yt946s"),Bt(s,"class","code svelte-1yt946s"),sn(s,"margin-right","10px"),Bt(r,"class","code highlight svelte-1yt946s"),sn(r,"margin-right","10px"),sn(i,"white-space","nowrap"),sn(i,"overflow-x","auto"),Bt(_,"class","desc svelte-1yt946s"),sn(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]+"]")+"")&&Ut(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]+"")&&Ut(b,h),R&2&&p!==(p=q[6]+"")&&Ut(w,p),R&2&&v!==(v=q[5].description+"")&&Ut(m,v)},d(q){q&&(De(e),De(t),De(n)),E.d(),T.d()}}}function Hi(l){let e,t,n;return t=new Eo({props:{margin:!1}}),{c(){e=nt("div"),ma(t.$$.fragment),Bt(e,"class","load-wrap")},m(i,s){Ie(i,e,s),ka(t,e,null),n=!0},i(i){n||(fl(t.$$.fragment,i),n=!0)},o(i){oi(t.$$.fragment,i),n=!1},d(i){i&&De(e),ha(t)}}}function qa(l){let e,t,n,i=l[1].length+"",s,o,c,a,r,u,f,_,d=l[1].length!=1&&Ui(),h=Ii(l[1]),b=[];for(let p=0;p<h.length;p+=1)b[p]=Vi(Bi(l,h,p));let k=l[0]&&Hi();return{c(){e=nt("h4"),t=nt("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=on(),r=nt("div");for(let p=0;p<b.length;p+=1)b[p].c();u=on(),k&&k.c(),f=Lo(),Bt(t,"class","toggle-icon svelte-1yt946s"),Bt(e,"class","svelte-1yt946s"),Fi(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+"")&&Ut(s,i),p[1].length!=1?d||(d=Ui(),d.c(),d.m(e,c)):d&&(d.d(1),d=null),w&14){h=Ii(p[1]);let g;for(g=0;g<h.length;g+=1){const v=Bi(p,h,g);b[g]?b[g].p(v,w):(b[g]=Vi(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)&&Fi(r,"hide",p[0]),p[0]?k?w&1&&fl(k,1):(k=Hi(),k.c(),fl(k,1),k.m(f.parentNode,f)):k&&(ba(),oi(k,1,1,()=>{k=null}),pa())},i(p){_||(fl(k),_=!0)},o(p){oi(k),_=!1},d(p){p&&(De(e),De(a),De(r),De(u),De(f)),d&&d.d(),ga(b,p),k&&k.d(p)}}}function Ma(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 za extends da{constructor(e){super(),va(this,e,Ma,qa,wa,{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{SvelteComponent:Na,create_component:Ta,destroy_component:La,detach:ja,flush:Pa,init:Aa,insert:Ra,mount_component:Oa,safe_not_equal:Da,set_data:Ia,text:Fa,transition_in:Ba,transition_out:Ua}=window.__gradio__svelte__internal;function Ga(l){let e;return{c(){e=Fa(l[0])},m(t,n){Ra(t,e,n)},p(t,n){n&1&&Ia(e,t[0])},d(t){t&&ja(e)}}}function Va(l){let e,t;return e=new El({props:{size:"sm",$$slots:{default:[Ga]},$$scope:{ctx:l}}}),e.$on("click",l[1]),{c(){Ta(e.$$.fragment)},m(n,i){Oa(e,n,i),t=!0},p(n,[i]){const s={};i&9&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Ba(e.$$.fragment,n),t=!0)},o(n){Ua(e.$$.fragment,n),t=!1},d(n){La(e,n)}}}function Ha(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 ft extends Na{constructor(e){super(),Aa(this,e,Ha,Va,Da,{code:2})}get code(){return this.$$.ctx[2]}set code(e){this.$$set({code:e}),Pa()}}const{SvelteComponent:Wa,append:hi,attr:fn,check_outros:Za,create_component:ql,destroy_component:Ml,detach:yt,element:Ct,flush:Ja,group_outros:Qa,init:Ya,insert:St,mount_component:zl,noop:gi,safe_not_equal:Ka,space:bi,transition_in:Cn,transition_out:Sn}=window.__gradio__svelte__internal;function Xa(l){let e,t,n,i,s,o;return t=new ft({props:{code:Ji}}),{c(){e=Ct("div"),ql(t.$$.fragment),n=bi(),i=Ct("div"),s=Ct("pre"),s.textContent=`$ ${Ji}`,fn(e,"class","copy svelte-hq8ezf"),fn(s,"class","svelte-hq8ezf")},m(c,a){St(c,e,a),zl(t,e,null),St(c,n,a),St(c,i,a),hi(i,s),o=!0},p:gi,i(c){o||(Cn(t.$$.fragment,c),o=!0)},o(c){Sn(t.$$.fragment,c),o=!1},d(c){c&&(yt(e),yt(n),yt(i)),Ml(t)}}}function xa(l){let e,t,n,i,s,o;return t=new ft({props:{code:Zi}}),{c(){e=Ct("div"),ql(t.$$.fragment),n=bi(),i=Ct("div"),s=Ct("pre"),s.textContent=`$ ${Zi}`,fn(e,"class","copy svelte-hq8ezf"),fn(s,"class","svelte-hq8ezf")},m(c,a){St(c,e,a),zl(t,e,null),St(c,n,a),St(c,i,a),hi(i,s),o=!0},p:gi,i(c){o||(Cn(t.$$.fragment,c),o=!0)},o(c){Sn(t.$$.fragment,c),o=!1},d(c){c&&(yt(e),yt(n),yt(i)),Ml(t)}}}function ec(l){let e,t,n,i,s,o;return t=new ft({props:{code:Wi}}),{c(){e=Ct("div"),ql(t.$$.fragment),n=bi(),i=Ct("div"),s=Ct("pre"),s.textContent=`$ ${Wi}`,fn(e,"class","copy svelte-hq8ezf"),fn(s,"class","svelte-hq8ezf")},m(c,a){St(c,e,a),zl(t,e,null),St(c,n,a),St(c,i,a),hi(i,s),o=!0},p:gi,i(c){o||(Cn(t.$$.fragment,c),o=!0)},o(c){Sn(t.$$.fragment,c),o=!1},d(c){c&&(yt(e),yt(n),yt(i)),Ml(t)}}}function tc(l){let e,t,n,i;const s=[ec,xa,Xa],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=Ct("code"),n&&n.c(),fn(e,"class","svelte-hq8ezf")},m(a,r){St(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&&(Qa(),Sn(o[u],1,1,()=>{o[u]=null}),Za()),~t?(n=o[t],n?n.p(a,r):(n=o[t]=s[t](a),n.c()),Cn(n,1),n.m(e,null)):n=null)},i(a){i||(Cn(n),i=!0)},o(a){Sn(n),i=!1},d(a){a&&yt(e),~t&&o[t].d()}}}function nc(l){let e,t;return e=new Ht({props:{$$slots:{default:[tc]},$$scope:{ctx:l}}}),{c(){ql(e.$$.fragment)},m(n,i){zl(e,n,i),t=!0},p(n,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Cn(e.$$.fragment,n),t=!0)},o(n){Sn(e.$$.fragment,n),t=!1},d(n){Ml(e,n)}}}let Wi="pip install gradio_client",Zi="npm i -D @gradio/client",Ji="curl --version";function lc(l,e,t){let{current_language:n}=e;return l.$$set=i=>{"current_language"in i&&t(0,n=i.current_language)},[n]}class ic extends Wa{constructor(e){super(),Ya(this,e,lc,nc,Ka,{current_language:0})}get current_language(){return this.$$.ctx[0]}set current_language(e){this.$$set({current_language:e}),Ja()}}const{SvelteComponent:sc,append:wn,attr:bl,detach:vi,element:vl,empty:oc,flush:Yl,init:rc,insert:ki,noop:Qi,safe_not_equal:ac,set_data:jo,text:kl}=window.__gradio__svelte__internal;function cc(l){let e,t,n,i;return{c(){e=vl("h3"),t=kl(`fn_index: | |
`),n=vl("span"),i=kl(l[1]),bl(n,"class","post svelte-41kcm6"),bl(e,"class","svelte-41kcm6")},m(s,o){ki(s,e,o),wn(e,t),wn(e,n),wn(n,i)},p(s,o){o&2&&jo(i,s[1])},d(s){s&&vi(e)}}}function uc(l){let e,t,n,i="/"+l[0],s;return{c(){e=vl("h3"),t=kl(`api_name: | |
`),n=vl("span"),s=kl(i),bl(n,"class","post svelte-41kcm6"),bl(e,"class","svelte-41kcm6")},m(o,c){ki(o,e,c),wn(e,t),wn(e,n),wn(n,s)},p(o,c){c&1&&i!==(i="/"+o[0])&&jo(s,i)},d(o){o&&vi(e)}}}function _c(l){let e;function t(s,o){return s[2]?uc:cc}let n=t(l),i=n(l);return{c(){i.c(),e=oc()},m(s,o){i.m(s,o),ki(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:Qi,o:Qi,d(s){s&&vi(e),i.d(s)}}}function fc(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 Po extends sc{constructor(e){super(),rc(this,e,fc,_c,ac,{api_name:0,fn_index:1,named:2})}get api_name(){return this.$$.ctx[0]}set api_name(e){this.$$set({api_name:e}),Yl()}get fn_index(){return this.$$.ctx[1]}set fn_index(e){this.$$set({fn_index:e}),Yl()}get named(){return this.$$.ctx[2]}set named(e){this.$$set({named:e}),Yl()}}const{SvelteComponent:dc,append:F,attr:Ce,binding_callbacks:Kl,check_outros:Yi,create_component:Qt,destroy_component:Yt,destroy_each:$l,detach:te,element:ge,empty:Ao,ensure_array_like:Gt,flush:Mt,group_outros:Ki,init:pc,insert:ne,mount_component:Kt,noop:mc,safe_not_equal:hc,set_data:Ne,space:Nl,text:A,transition_in:ut,transition_out:_t}=window.__gradio__svelte__internal;function Xi(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[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 es(l,e,t){const n=l.slice();return n[30]=e[t].component,n[22]=e[t].example_input,n[27]=t,n}function ts(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 gc(l){let e,t;return e=new Po({props:{named:l[5],fn_index:l[1]}}),{c(){Qt(e.$$.fragment)},m(n,i){Kt(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||(ut(e.$$.fragment,n),t=!0)},o(n){_t(e.$$.fragment,n),t=!1},d(n){Yt(e,n)}}}function bc(l){let e,t;return e=new Po({props:{named:l[5],api_name:l[0].api_name}}),{c(){Qt(e.$$.fragment)},m(n,i){Kt(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||(ut(e.$$.fragment,n),t=!0)},o(n){_t(e.$$.fragment,n),t=!1},d(n){Yt(e,n)}}}function vc(l){let e,t;return e=new Ht({props:{$$slots:{default:[wc]},$$scope:{ctx:l}}}),{c(){Qt(e.$$.fragment)},m(n,i){Kt(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||(ut(e.$$.fragment,n),t=!0)},o(n){_t(e.$$.fragment,n),t=!1},d(n){Yt(e,n)}}}function kc(l){let e,t;return e=new Ht({props:{$$slots:{default:[qc]},$$scope:{ctx:l}}}),{c(){Qt(e.$$.fragment)},m(n,i){Kt(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||(ut(e.$$.fragment,n),t=!0)},o(n){_t(e.$$.fragment,n),t=!1},d(n){Yt(e,n)}}}function $c(l){let e,t;return e=new Ht({props:{$$slots:{default:[zc]},$$scope:{ctx:l}}}),{c(){Qt(e.$$.fragment)},m(n,i){Kt(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||(ut(e.$$.fragment,n),t=!0)},o(n){_t(e.$$.fragment,n),t=!1},d(n){Yt(e,n)}}}function ns(l){let e;return{c(){e=A(",")},m(t,n){ne(t,e,n)},d(t){t&&te(e)}}}function ls(l){let e,t=ct(l[22],l[21].type,"bash")+"",n,i,s=l[27]<l[4].length-1&&ns();return{c(){e=A(` | |
`),n=A(t),s&&s.c(),i=Ao()},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=ct(o[22],o[21].type,"bash")+"")&&Ne(n,t),o[27]<o[4].length-1?s||(s=ns(),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 wc(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 ft({props:{code:l[10]?.innerText}});let O=Gt(l[4]),j=[];for(let P=0;P<O.length;P+=1)j[P]=ls(Xi(l,O,P));return{c(){e=ge("code"),t=ge("div"),Qt(n.$$.fragment),i=Nl(),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),Kt(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=Gt(P[4]);let pe;for(pe=0;pe<O.length;pe+=1){const be=Xi(P,O,pe);j[pe]?j[pe].p(be,ee):(j[pe]=ls(be),j[pe].c(),j[pe].m(o,p))}for(;pe<j.length;pe+=1)j[pe].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||(ut(n.$$.fragment,P),G=!0)},o(P){_t(n.$$.fragment,P),G=!1},d(P){P&&te(e),Yt(n),$l(j,P),l[19](null)}}}function is(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:mc,d(_){_&&(te(e),te(t),te(n),te(s),te(o),te(a),te(r),te(u),te(f))}}}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 yc(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 Cc(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 Sc(l){let e,t,n=l[23]+"",i,s,o=ct(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=ct(r[22],r[21].type,"js")+"")&&Ne(c,o)},d(r){r&&(te(e),te(t),te(a))}}}function Ec(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 os(l){let e,t;function n(o,c){return c[0]&16&&(e=null),e==null&&(e=!!o[14].includes(o[30])),e?Ec:Sc}let i=n(l,[-1,-1]),s=i(l);return{c(){s.c(),t=Ao()},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 qc(l){let e,t,n,i,s,o,c,a,r,u,f=(l[3]||l[2])+"",_,d,h,b,k,p;n=new ft({props:{code:l[9]?.innerText}});let w=Gt(l[15]),g=[];for(let M=0;M<w.length;M+=1)g[M]=is(es(l,w,M));let v=l[6]!==null&&ss(l);function m(M,$){return M[5]?Cc:yc}let C=m(l),y=C(l),L=Gt(l[4]),E=[];for(let M=0;M<L.length;M+=1)E[M]=os(xi(l,L,M));return{c(){e=ge("code"),t=ge("div"),Qt(n.$$.fragment),i=Nl(),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),Kt(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=Gt(M[15]);let q;for(q=0;q<w.length;q+=1){const R=es(M,w,q);g[q]?g[q].p(R,$):(g[q]=is(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=ss(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=Gt(M[4]);let q;for(q=0;q<L.length;q+=1){const R=xi(M,L,q);E[q]?E[q].p(R,$):(E[q]=os(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||(ut(n.$$.fragment,M),p=!0)},o(M){_t(n.$$.fragment,M),p=!1},d(M){M&&te(e),Yt(n),$l(g,M),v&&v.d(),y.d(),$l(E,M),l[18](null)}}}function Mc(l){let e;return{c(){e=A(", handle_file")},m(t,n){ne(t,e,n)},d(t){t&&te(e)}}}function rs(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 as(l){let e,t=l[23]?l[23]+"=":"",n,i,s=ct(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=ct(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 zc(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 ft({props:{code:l[8]?.innerText}});let R=l[13]&&Mc(),J=l[6]!==null&&rs(l),Q=Gt(l[4]),G=[];for(let O=0;O<Q.length;O+=1)G[O]=as(ts(l,Q,O));return{c(){e=ge("code"),t=ge("div"),Qt(n.$$.fragment),i=Nl(),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),Kt(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=rs(O),J.c(),J.m(o,p)):J&&(J.d(1),J=null),j[0]&16){Q=Gt(O[4]);let ee;for(ee=0;ee<Q.length;ee+=1){const Pe=ts(O,Q,ee);G[ee]?G[ee].p(Pe,j):(G[ee]=as(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||(ut(n.$$.fragment,O),q=!0)},o(O){_t(n.$$.fragment,O),q=!1},d(O){O&&te(e),Yt(n),R&&R.d(),J&&J.d(),$l(G,O),l[17](null)}}}function Nc(l){let e,t,n,i,s,o,c;const a=[bc,gc],r=[];function u(h,b){return h[5]?0:1}t=u(l),n=r[t]=a[t](l);const f=[$c,kc,vc],_=[];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=Nl(),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):(Ki(),_t(r[k],1,1,()=>{r[k]=null}),Yi(),n=r[t],n?n.p(h,b):(n=r[t]=a[t](h),n.c()),ut(n,1),n.m(e,i));let p=s;s=d(h),s===p?~s&&_[s].p(h,b):(o&&(Ki(),_t(_[p],1,1,()=>{_[p]=null}),Yi()),~s?(o=_[s],o?o.p(h,b):(o=_[s]=f[s](h),o.c()),ut(o,1),o.m(e,null)):o=null)},i(h){c||(ut(n),ut(o),c=!0)},o(h){_t(n),_t(o),c=!1},d(h){h&&te(e),r[t].d(),~s&&_[s].d()}}}function Tc(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=>To(y.example_input)),w=["Audio","File","Image","Video"],g=u.filter(y=>w.includes(y.component));function v(y){Kl[y?"unshift":"push"](()=>{h=y,t(8,h)})}function m(y){Kl[y?"unshift":"push"](()=>{b=y,t(9,b)})}function C(y){Kl[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 Lc extends dc{constructor(e){super(),pc(this,e,Tc,Nc,hc,{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}),Mt()}get dependency_index(){return this.$$.ctx[1]}set dependency_index(e){this.$$set({dependency_index:e}),Mt()}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),Mt()}get api_prefix(){return this.$$.ctx[16]}set api_prefix(e){this.$$set({api_prefix:e}),Mt()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),Mt()}get endpoint_parameters(){return this.$$.ctx[4]}set endpoint_parameters(e){this.$$set({endpoint_parameters:e}),Mt()}get named(){return this.$$.ctx[5]}set named(e){this.$$set({named:e}),Mt()}get username(){return this.$$.ctx[6]}set username(e){this.$$set({username:e}),Mt()}get current_language(){return this.$$.ctx[7]}set current_language(e){this.$$set({current_language:e}),Mt()}}const{SvelteComponent:jc,append:V,attr:Oe,binding_callbacks:Xl,check_outros:Pc,create_component:Tl,destroy_component:Ll,destroy_each:$i,detach:qe,element:Ee,empty:Ac,ensure_array_like:En,flush:xt,group_outros:Rc,init:Oc,insert:Me,mount_component:jl,safe_not_equal:Dc,set_data:lt,space:Pl,text:W,transition_in:qn,transition_out:Mn}=window.__gradio__svelte__internal,{onMount:Ic,tick:Fc}=window.__gradio__svelte__internal;function cs(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function us(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function _s(l,e,t){const n=l.slice();return n[20]=e[t].call,n[21]=e[t].api_name,n}function Bc(l){let e,t,n,i,s,o;n=new ft({props:{code:l[6]?.innerText}});let c=En(l[9]),a=[];for(let r=0;r<c.length;r+=1)a[r]=fs(cs(l,c,r));return{c(){e=Ee("code"),t=Ee("div"),Tl(n.$$.fragment),i=Pl(),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),jl(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=En(r[9]);let _;for(_=0;_<c.length;_+=1){const d=cs(r,c,_);a[_]?a[_].p(d,u):(a[_]=fs(d),a[_].c(),a[_].m(s,null))}for(;_<a.length;_+=1)a[_].d(1);a.length=c.length}},i(r){o||(qn(n.$$.fragment,r),o=!0)},o(r){Mn(n.$$.fragment,r),o=!1},d(r){r&&qe(e),Ll(n),$i(a,r),l[16](null)}}}function Uc(l){let e,t,n,i,s,o,c,a,r,u,f,_,d;n=new ft({props:{code:l[5]?.innerText}});let h=l[2]!==null&&ds(l),b=En(l[8]),k=[];for(let p=0;p<b.length;p+=1)k[p]=ms(us(l,b,p));return{c(){e=Ee("code"),t=Ee("div"),Tl(n.$$.fragment),i=Pl(),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),jl(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)&<(u,p[0]),p[2]!==null?h?h.p(p,w):(h=ds(p),h.c(),h.m(o,_)):h&&(h.d(1),h=null),w&256){b=En(p[8]);let v;for(v=0;v<b.length;v+=1){const m=us(p,b,v);k[v]?k[v].p(m,w):(k[v]=ms(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||(qn(n.$$.fragment,p),d=!0)},o(p){Mn(n.$$.fragment,p),d=!1},d(p){p&&qe(e),Ll(n),h&&h.d(),$i(k,p),l[15](null)}}}function Gc(l){let e,t,n,i,s,o,c,a,r,u,f,_,d,h,b,k;n=new ft({props:{code:l[4]}});let p=l[2]!==null&&hs(l),w=En(l[7]),g=[];for(let v=0;v<w.length;v+=1)g[v]=gs(_s(l,w,v));return{c(){e=Ee("code"),t=Ee("div"),Tl(n.$$.fragment),i=Pl(),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),jl(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)&<(d,v[0]),v[2]!==null?p?p.p(v,m):(p=hs(v),p.c(),p.m(o,b)):p&&(p.d(1),p=null),m&128){w=En(v[7]);let y;for(y=0;y<w.length;y+=1){const L=_s(v,w,y);g[y]?g[y].p(L,m):(g[y]=gs(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||(qn(n.$$.fragment,v),k=!0)},o(v){Mn(n.$$.fragment,v),k=!1},d(v){v&&qe(e),Ll(n),p&&p.d(),$i(g,v),l[14](null)}}}function fs(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=Pl(),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&<(n,R[0]),J&512&&s!==(s=R[21]+"")&<(o,s),J&512&&f!==(f=R[20]+"")&<(_,f),J&1&<(y,R[0]),J&512&&E!==(E=R[21]+"")&<(M,E)},d(R){R&&(qe(e),qe(T),qe(q))}}}function ds(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&<(t,i[2])},d(i){i&&(qe(e),qe(t),qe(n))}}}function ps(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]+"")&<(n,t)},d(i){i&&(qe(e),qe(n))}}}function ms(l){let e,t,n,i=l[21]+"",s,o,c,a=l[20]&&ps(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]+"")&<(s,i),r[20]?a?a.p(r,u):(a=ps(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 hs(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&<(t,i[2])},d(i){i&&(qe(e),qe(t),qe(n))}}}function gs(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]+"")&<(s,i),h&128&&r!==(r=d[21]+"")&<(u,r)},d(d){d&&(qe(e),qe(t))}}}function Vc(l){let e,t,n,i;const s=[Gc,Uc,Bc],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=Ac()},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&&(Rc(),Mn(o[u],1,1,()=>{o[u]=null}),Pc()),~e?(t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),qn(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(qn(t),i=!0)},o(a){Mn(t),i=!1},d(a){a&&qe(n),~e&&o[e].d(a)}}}function Hc(l){let e,t,n;return t=new Ht({props:{border_mode:"focus",$$slots:{default:[Vc]},$$scope:{ctx:l}}}),{c(){e=Ee("div"),Tl(t.$$.fragment),Oe(e,"class","container svelte-j71ub0")},m(i,s){Me(i,e,s),jl(t,e,null),n=!0},p(i,[s]){const o={};s&268436479&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(qn(t.$$.fragment,i),n=!0)},o(i){Mn(t.$$.fragment,i),n=!1},d(i){i&&qe(e),Ll(t)}}}function Wc(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}=${ct(T,Q,"py")}`;if(L==="js")return` ${J}: ${ct(T,Q,"js")}`;if(L==="bash")return` ${ct(T,Q,"bash")}`}return` ${ct(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"?"":` | |
`}Ic(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 Fc(),t(4,u=r.innerText)});function v(y){Xl[y?"unshift":"push"](()=>{r=y,t(3,r)})}function m(y){Xl[y?"unshift":"push"](()=>{f=y,t(5,f)})}function C(y){Xl[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 Zc extends jc{constructor(e){super(),Oc(this,e,Wc,Hc,Dc,{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}),xt()}get short_root(){return this.$$.ctx[0]}set short_root(e){this.$$set({short_root:e}),xt()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),xt()}get api_prefix(){return this.$$.ctx[12]}set api_prefix(e){this.$$set({api_prefix:e}),xt()}get current_language(){return this.$$.ctx[1]}set current_language(e){this.$$set({current_language:e}),xt()}get username(){return this.$$.ctx[2]}set username(e){this.$$set({username:e}),xt()}get api_calls(){return this.$$.ctx[13]}set api_calls(e){this.$$set({api_calls:e}),xt()}}const 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%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",Qc="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",Yc="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:Kc,append:tt,attr:_n,check_outros:Xc,create_component:xc,destroy_component:eu,destroy_each:tu,detach:Fe,element:$t,empty:nu,ensure_array_like:bs,flush:tl,group_outros:lu,init:iu,insert:Be,mount_component:su,noop:ou,safe_not_equal:ru,set_data:zn,set_style:au,space:bn,text:it,toggle_class:vs,transition_in:dl,transition_out:ri}=window.__gradio__svelte__internal;function ks(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 cu(l){let e;return{c(){e=it("1 element")},m(t,n){Be(t,e,n)},p:ou,d(t){t&&Fe(e)}}}function uu(l){let e=l[3]=="python"?"tuple":"list",t,n,i=l[1].length+"",s,o;return{c(){t=it(e),n=it(" of "),s=it(i),o=it(` | |
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")&&zn(t,e),a&2&&i!==(i=c[1].length+"")&&zn(s,i)},d(c){c&&(Fe(t),Fe(n),Fe(s),Fe(o))}}}function $s(l){let e;return{c(){e=$t("span"),e.textContent=`[${l[10]}]`,_n(e,"class","code svelte-16h224k")},m(t,n){Be(t,e,n)},d(t){t&&Fe(e)}}}function _u(l){let e=l[2][l[10]].type+"",t;return{c(){t=it(e)},m(n,i){Be(n,t,i)},p(n,i){i&4&&e!==(e=n[2][n[10]].type+"")&&zn(t,e)},d(n){n&&Fe(t)}}}function fu(l){let e=l[6].type+"",t;return{c(){t=it(e)},m(n,i){Be(n,t,i)},p(n,i){i&2&&e!==(e=n[6].type+"")&&zn(t,e)},d(n){n&&Fe(t)}}}function ws(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&&$s(l);function w(m,C){return m[3]==="python"?fu:_u}let g=w(l),v=g(l);return{c(){e=$t("hr"),t=bn(),n=$t("div"),i=$t("p"),p&&p.c(),s=bn(),o=$t("span"),v.c(),c=bn(),a=$t("p"),r=it('The output value that appears in the "'),f=it(u),_=it('" '),h=it(d),b=it(` | |
component.`),k=bn(),_n(e,"class","hr svelte-16h224k"),_n(o,"class","code highlight svelte-16h224k"),_n(a,"class","desc svelte-16h224k"),au(n,"margin","10px")},m(m,C){Be(m,e,C),Be(m,t,C),Be(m,n,C),tt(n,i),p&&p.m(i,null),tt(i,s),tt(i,o),v.m(o,null),tt(n,c),tt(n,a),tt(a,r),tt(a,f),tt(a,_),tt(a,h),tt(a,b),tt(n,k)},p(m,C){m[1].length>1?p||(p=$s(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]+"")&&zn(f,u),C&2&&d!==(d=m[7]+"")&&zn(h,d)},d(m){m&&(Fe(e),Fe(t),Fe(n)),p&&p.d(),v.d()}}}function ys(l){let e,t,n;return t=new Eo({props:{margin:!1}}),{c(){e=$t("div"),xc(t.$$.fragment),_n(e,"class","load-wrap")},m(i,s){Be(i,e,s),su(t,e,null),n=!0},i(i){n||(dl(t.$$.fragment,i),n=!0)},o(i){ri(t.$$.fragment,i),n=!1},d(i){i&&Fe(e),eu(t)}}}function du(l){let e,t,n,i,s,o,c,a;function r(b,k){return b[1].length>1?uu:cu}let u=r(l),f=u(l),_=bs(l[1]),d=[];for(let b=0;b<_.length;b+=1)d[b]=ws(ks(l,_,b));let h=l[0]&&ys();return{c(){e=$t("h4"),t=$t("div"),t.innerHTML='<div class="toggle-dot toggle-right svelte-16h224k"></div>',n=it(` | |
Returns `),f.c(),i=bn(),s=$t("div");for(let b=0;b<d.length;b+=1)d[b].c();o=bn(),h&&h.c(),c=nu(),_n(t,"class","toggle-icon svelte-16h224k"),_n(e,"class","svelte-16h224k"),vs(s,"hide",l[0])},m(b,k){Be(b,e,k),tt(e,t),tt(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){_=bs(b[1]);let p;for(p=0;p<_.length;p+=1){const w=ks(b,_,p);d[p]?d[p].p(w,k):(d[p]=ws(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)&&vs(s,"hide",b[0]),b[0]?h?k&1&&dl(h,1):(h=ys(),h.c(),dl(h,1),h.m(c.parentNode,c)):h&&(lu(),ri(h,1,1,()=>{h=null}),Xc())},i(b){a||(dl(h),a=!0)},o(b){ri(h),a=!1},d(b){b&&(Fe(e),Fe(i),Fe(s),Fe(o),Fe(c)),f.d(),tu(d,b),h&&h.d(b)}}}function pu(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 mu extends Kc{constructor(e){super(),iu(this,e,pu,du,ru,{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}),tl()}get endpoint_returns(){return this.$$.ctx[1]}set endpoint_returns(e){this.$$set({endpoint_returns:e}),tl()}get js_returns(){return this.$$.ctx[2]}set js_returns(e){this.$$set({js_returns:e}),tl()}get current_language(){return this.$$.ctx[3]}set current_language(e){this.$$set({current_language:e}),tl()}}const hu=""+new URL("mcp-DNm9doVd.svg",import.meta.url).href,{SvelteComponent:gu,append:D,attr:B,bubble:Cs,check_outros:Wt,create_component:Ke,destroy_component:Xe,destroy_each:Al,detach:z,element:I,empty:Tn,ensure_array_like:Zt,flush:en,group_outros:Jt,init:bu,insert:N,listen:Ro,mount_component:xe,noop:st,safe_not_equal:vu,set_data:wt,set_style:ln,space:ie,src_url_equal:ku,text:H,transition_in:se,transition_out:ae}=window.__gradio__svelte__internal,{onMount:$u,createEventDispatcher:wu}=window.__gradio__svelte__internal;function Ss(l,e,t){const n=l.slice();return n[24]=e[t],n[26]=t,n}function Es(l,e,t){const n=l.slice();return n[27]=e[t],n[28]=e,n[29]=t,n}function qs(l,e,t){const n=l.slice();return n[30]=e[t][0],n[31]=e[t][1],n}function Ms(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 zs(l){let e,t,n,i;const s=[Cu,yu],o=[];function c(a,r){return a[11]?0:1}return e=c(l),t=o[e]=s[e](l),{c(){t.c(),n=Tn()},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 yu(l){let e,t;return e=new Qr({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 Cu(l){let e,t,n,i,s,o,c,a,r,u,f,_,d;t=new _a({props:{root:l[3]||l[0],api_count:l[11],current_language:l[6]}}),t.$on("close",l[16]);let h=Zt(l[12]),b=[];for(let v=0;v<h.length;v+=1)b[v]=Ns(Ms(l,h,v));const k=[Eu,Su],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"&&Ds(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=Zt(v[12]);let L;for(L=0;L<h.length;L+=1){const E=Ms(v,h,L);b[L]?b[L].p(E,m):(b[L]=Ns(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):(Jt(),ae(p[y],1,1,()=>{p[y]=null}),Wt(),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=Ds(v),g.c(),se(g,1),g.m(c,null)):g&&(Jt(),ae(g,1,1,()=>{g=null}),Wt())},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),Al(b,v),p[u].d(),g&&g.d()}}}function Ns(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(),ku(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=Ro(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 Su(l){let e,t,n,i,s,o;const c=[zu,Mu,qu],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"&&Ps(l);return{c(){e=I("p"),n.c(),i=ie(),u&&u.c(),s=Tn(),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,_):(Jt(),ae(a[d],1,1,()=>{a[d]=null}),Wt(),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=Ps(f),u.c(),se(u,1),u.m(s.parentNode,s)):u&&(Jt(),ae(u,1,1,()=>{u=null}),Wt())},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 Eu(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 Zc({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"),ln(t,"font-size","var(--text-lg)"),ln(t,"font-weight","bold"),ln(t,"margin","10px 0px"),ln(g,"font-size","var(--text-lg)"),ln(g,"font-weight","bold"),ln(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+"")&&wt(c,o),(!v||C[0]&64)&&wt(_,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 qu(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:st,i:st,o:st,d(t){t&&z(e)}}}function Mu(l){let e,t,n,i;const s=[Tu,Nu],o=[];function c(a,r){return a[7]?0:1}return e=c(l),t=o[e]=s[e](l),{c(){t.c(),n=Tn()},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):(Jt(),ae(o[u],1,1,()=>{o[u]=null}),Wt(),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 zu(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."),ln(t,"text-transform","capitalize"),B(s,"href",c=l[6]=="python"?yl:wl),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&&wt(n,r[6]),u[0]&64&&c!==(c=r[6]=="python"?yl:wl)&&B(s,"href",c)},i:st,o:st,d(r){r&&(z(e),z(t),z(i),z(s),z(a))}}}function Nu(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:st,i:st,o:st,d(a){a&&(z(e),z(t),z(n),z(i),z(s),z(o),z(c))}}}function Tu(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 Ht({props:{$$slots:{default:[Lu]},$$scope:{ctx:l}}});let G=Zt(l[10]),O=[];for(let j=0;j<G.length;j+=1)O[j]=js(Es(l,G,j));return b=new Ht({props:{$$slots:{default:[Au]},$$scope:{ctx:l}}}),E=new Ht({props:{$$slots:{default:[Ru]},$$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",Iu),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=Zt(j[10]);let be;for(be=0;be<G.length;be+=1){const et=Es(j,G,be);O[be]?O[be].p(et,P):(O[be]=js(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 pe={};P[1]&256&&(pe.$$scope={dirty:P,ctx:j}),E.$set(pe)},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),Al(O,j),Xe(b,j),Xe(E,j)}}}function Lu(l){let e,t,n,i,s,o,c,a;return c=new ft({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:st,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 Ts(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?Pu:ju}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 ju(l){let e;return{c(){e=I("p"),e.textContent="Takes no input parameters"},m(t,n){N(t,e,n)},p:st,d(t){t&&z(e)}}}function Pu(l){let e,t=Zt(Object.entries(l[27].parameters)),n=[];for(let i=0;i<t.length;i+=1)n[i]=Ls(qs(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=Zt(Object.entries(i[27].parameters));let o;for(o=0;o<t.length;o+=1){const c=qs(i,t,o);n[o]?n[o].p(c,s):(n[o]=Ls(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),Al(n,i)}}}function Ls(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]+"")&&wt(i,n),g[0]&1024&&a!==(a=w[31].type+"")&&wt(r,a),g[0]&1024&&u!==(u=w[31].default!==void 0?`, default: ${JSON.stringify(w[31].default)}`:"")&&wt(f,u),g[0]&1024&&b!==(b=(w[31].description?w[31].description:"β οΈ No description for this parameter in function docstring")+"")&&wt(k,b)},d(w){w&&z(e)}}}function js(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&&Ts(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=Ro(t,"click",g),p=!0)},p(m,C){l=m,C[0]&1024&&s!==(s=l[27].name+"")&&wt(o,s),C[0]&1024&&r!==(r=(l[27].description?l[27].description:"β οΈ No description provided in function docstring")+"")&&wt(u,r),C[0]&1024&&d!==(d=l[27].expanded?"βΌ":"βΆ")&&wt(h,d),l[27].expanded?v?v.p(l,C):(v=Ts(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 Au(l){let e,t,n,i,s,o,c;return n=new ft({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:st,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 Ru(l){let e,t,n,i,s,o,c;return n=new ft({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:st,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 Ps(l){let e,t,n,i,s,o,c,a;e=new ic({props:{current_language:l[6]}});let r=l[3]&&As(l);o=new El({props:{size:"sm",variant:"secondary",$$slots:{default:[Ou]},$$scope:{ctx:l}}}),o.$on("click",l[19]);let u=l[6]=="bash"&&Rs(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=As(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=Rs(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 As(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"?yl+nl:l[6]=="javascript"?wl+nl:ai),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"?yl+nl:o[6]=="javascript"?wl+nl:ai)&&B(t,"href",i)},d(o){o&&(z(e),z(t),z(s))}}}function Ou(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:st,d(i){i&&(z(e),z(t),z(n))}}}function Rs(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&&Os();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",ai),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=Os(),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 Os(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 Ds(l){let e,t,n=Zt(l[1]),i=[];for(let o=0;o<n.length;o+=1)i[o]=Fs(Ss(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=Tn()},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=Zt(o[1]);let a;for(a=0;a<n.length;a+=1){const r=Ss(o,n,a);i[a]?(i[a].p(r,c),se(i[a],1)):(i[a]=Fs(r),i[a].c(),se(i[a],1),i[a].m(e.parentNode,e))}for(Jt(),a=n.length;a<i.length;a+=1)s(a);Wt()}},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),Al(i,o)}}}function Is(l){let e,t,n,i,s,o,c,a;return t=new Lc({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 za({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:Bs,current_language:l[6]}}),o=new mu({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:Bs,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 Fs(l){let e,t,n=l[24].show_api&&l[8].named_endpoints["/"+l[24].api_name]&&Is(l);return{c(){n&&n.c(),e=Tn()},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=Is(i),n.c(),se(n,1),n.m(e.parentNode,e)):n&&(Jt(),ae(n,1,1,()=>{n=null}),Wt())},i(i){t||(se(n),t=!0)},o(i){ae(n),t=!1},d(i){i&&z(e),n&&n.d(i)}}}function Du(l){let e,t,n=l[8]&&zs(l);return{c(){n&&n.c(),e=Tn()},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=zs(i),n.c(),se(n,1),n.m(e.parentNode,e)):n&&(Jt(),ae(n,1,1,()=>{n=null}),Wt())},i(i){t||(se(n),t=!0)},o(i){ae(n),t=!1},d(i){i&&z(e),n&&n.d(i)}}}const wl="https://www.gradio.app/guides/getting-started-with-the-js-client",yl="https://www.gradio.app/guides/getting-started-with-the-python-client",ai="https://www.gradio.app/guides/querying-gradio-apps-with-curl",nl="#connecting-to-a-hugging-face-space",Iu="https://www.gradio.app/guides/building-mcp-server-with-gradio";let Bs=!1;function Fu(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",Jc],["javascript","JavaScript",Qc],["bash","cURL",Yc],["mcp","MCP",hu]];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=wu(),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=[])}}$u(()=>(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($){Cs.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($){Cs.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 Bu extends gu{constructor(e){super(),bu(this,e,Fu,Du,vu,{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}),en()}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),en()}get app(){return this.$$.ctx[2]}set app(e){this.$$set({app:e}),en()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),en()}get root_node(){return this.$$.ctx[15]}set root_node(e){this.$$set({root_node:e}),en()}get username(){return this.$$.ctx[4]}set username(e){this.$$set({username:e}),en()}get api_calls(){return this.$$.ctx[5]}set api_calls(e){this.$$set({api_calls:e}),en()}}const{SvelteComponent:Uu,append:rn,attr:vn,create_component:Gu,destroy_component:Vu,detach:an,element:kn,flush:Us,init:Hu,insert:cn,mount_component:Wu,safe_not_equal:Zu,set_data:Oo,space:xl,text:Fn,transition_in:Ju,transition_out:Qu}=window.__gradio__svelte__internal;function Gs(l){let e,t,n=l[1][l[0][l[0].length-1].fn_index].api_name+"",i;return{c(){e=kn("span"),t=Fn("/"),i=Fn(n),vn(e,"class","api-name svelte-sy28j6")},m(s,o){cn(s,e,o),rn(e,t),rn(e,i)},p(s,o){o&3&&n!==(n=s[1][s[0][s[0].length-1].fn_index].api_name+"")&&Oo(i,n)},d(s){s&&an(e)}}}function Yu(l){let e,t,n,i,s,o,c,a=l[0].length+"",r,u,f,_=l[0].length>0&&Gs(l);return{c(){e=kn("div"),t=xl(),n=kn("p"),n.textContent="Recording API Calls:",i=xl(),s=kn("p"),o=kn("span"),c=Fn("["),r=Fn(a),u=Fn("]"),f=xl(),_&&_.c(),vn(e,"class","loading-dot self-baseline svelte-sy28j6"),vn(n,"class","self-baseline svelte-sy28j6"),vn(o,"class","api-count svelte-sy28j6"),vn(s,"class","self-baseline api-section svelte-sy28j6")},m(d,h){cn(d,e,h),cn(d,t,h),cn(d,n,h),cn(d,i,h),cn(d,s,h),rn(s,o),rn(o,c),rn(o,r),rn(o,u),rn(s,f),_&&_.m(s,null)},p(d,h){h&1&&a!==(a=d[0].length+"")&&Oo(r,a),d[0].length>0?_?_.p(d,h):(_=Gs(d),_.c(),_.m(s,null)):_&&(_.d(1),_=null)},d(d){d&&(an(e),an(t),an(n),an(i),an(s)),_&&_.d()}}}function Ku(l){let e,t,n;return t=new El({props:{size:"sm",variant:"secondary",$$slots:{default:[Yu]},$$scope:{ctx:l}}}),{c(){e=kn("div"),Gu(t.$$.fragment),vn(e,"id","api-recorder")},m(i,s){cn(i,e,s),Wu(t,e,null),n=!0},p(i,[s]){const o={};s&7&&(o.$$scope={dirty:s,ctx:i}),t.$set(o)},i(i){n||(Ju(t.$$.fragment,i),n=!0)},o(i){Qu(t.$$.fragment,i),n=!1},d(i){i&&an(e),Vu(t)}}}function Xu(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 Uu{constructor(e){super(),Hu(this,e,Xu,Ku,Zu,{api_calls:0,dependencies:1})}get api_calls(){return this.$$.ctx[0]}set api_calls(e){this.$$set({api_calls:e}),Us()}get dependencies(){return this.$$.ctx[1]}set dependencies(e){this.$$set({dependencies:e}),Us()}}const Do="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:e_,append:tn,attr:nn,component_subscribe:t_,create_component:n_,destroy_component:l_,detach:ei,element:Pn,flush:i_,init:s_,insert:ti,listen:o_,mount_component:r_,safe_not_equal:a_,set_data:Vs,space:ni,src_url_equal:c_,text:Hs,transition_in:u_,transition_out:__}=window.__gradio__svelte__internal,{createEventDispatcher:f_}=window.__gradio__svelte__internal;function d_(l){let e,t,n,i,s,o=l[1]("common.settings")+"",c,a,r,u,f,_,d,h,b,k;return d=new mi({}),{c(){e=Pn("h2"),t=Pn("img"),i=ni(),s=Pn("div"),c=Hs(o),a=ni(),r=Pn("div"),u=Hs(l[0]),f=ni(),_=Pn("button"),n_(d.$$.fragment),c_(t.src,n=Do)||nn(t,"src",n),nn(t,"alt",""),nn(t,"class","svelte-1b2d8fn"),nn(r,"class","url svelte-1b2d8fn"),nn(s,"class","title svelte-1b2d8fn"),nn(e,"class","svelte-1b2d8fn"),nn(_,"class","svelte-1b2d8fn")},m(p,w){ti(p,e,w),tn(e,t),tn(e,i),tn(e,s),tn(s,c),tn(s,a),tn(s,r),tn(r,u),ti(p,f,w),ti(p,_,w),r_(d,_,null),h=!0,b||(k=o_(_,"click",l[3]),b=!0)},p(p,[w]){(!h||w&2)&&o!==(o=p[1]("common.settings")+"")&&Vs(c,o),(!h||w&1)&&Vs(u,p[0])},i(p){h||(u_(d.$$.fragment,p),h=!0)},o(p){__(d.$$.fragment,p),h=!1},d(p){p&&(ei(e),ei(f),ei(_)),l_(d),b=!1,k()}}}function p_(l,e,t){let n;t_(l,di,c=>t(1,n=c));let{root:i}=e;const s=f_();pi();const o=()=>s("close");return l.$$set=c=>{"root"in c&&t(0,i=c.root)},[i,n,s,o]}class m_ extends e_{constructor(e){super(),s_(this,e,p_,d_,a_,{root:0})}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),i_()}}const h_="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:g_,append:K,attr:fe,bubble:b_,component_subscribe:v_,create_component:ll,destroy_component:il,detach:Ze,element:ce,flush:An,init:k_,insert:Je,listen:pl,mount_component:sl,noop:$_,run_all:w_,safe_not_equal:y_,set_data:Bn,space:Qe,text:Ye,transition_in:ol,transition_out:rl}=window.__gradio__svelte__internal,{onMount:C_}=window.__gradio__svelte__internal,{createEventDispatcher:S_}=window.__gradio__svelte__internal;function Ws(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=[pl(c,"click",l[14]),pl(f,"click",l[15]),pl(b,"click",l[16])],w=!0)},p(v,m){m&128&&n!==(n=v[7]("common.display_theme")+"")&&Bn(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,w_(g)}}}function E_(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:$_,d(i){i&&(Ze(e),Ze(t),Ze(n))}}}function q_(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&&Bn(n,s[0]),o&1&&fe(t,"href",s[0])},d(s){s&&(Ze(e),Ze(t),Ze(i))}}}function M_(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,pe,be,et,Qn,ot,Yn,dt,pt,jt,Pt;t=new m_({props:{root:l[0]}}),t.$on("close",l[13]);let Te=l[3]===null&&Ws(l);f=new Er({props:{label:"Language",choices:vr,show_label:!1,value:l[5]}}),f.$on("change",l[10]);function At(Y,me){return Y[4]?q_:E_}let gt=At(l),Ge=gt(l);return et=new Pi({props:{label:"Include automatic zoom in/out",interactive:!0,value:l[1]}}),et.$on("change",l[11]),ot=new Pi({props:{label:"Include automatic video trimming",interactive:!0,value:l[2]}}),ot.$on("change",l[12]),{c(){e=ce("div"),ll(t.$$.fragment),n=Qe(),Te&&Te.c(),i=Qe(),s=ce("div"),o=ce("h2"),a=Ye(c),r=Qe(),u=ce("p"),ll(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"),pe=ce("br"),be=Qe(),ll(et.$$.fragment),Qn=Qe(),ll(ot.$$.fragment),Yn=Qe(),dt=ce("button"),dt.innerHTML=`<img src="${h_}" 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(dt,"class","record-button svelte-1asl00n"),fe(v,"class","banner-wrap svelte-1asl00n")},m(Y,me){Je(Y,e,me),sl(t,e,null),Je(Y,n,me),Te&&Te.m(Y,me),Je(Y,i,me),Je(Y,s,me),K(s,o),K(o,a),K(s,r),K(s,u),sl(f,u,null),Je(Y,_,me),Je(Y,d,me),K(d,h),K(h,k),K(d,p),K(d,w),Ge.m(w,null),Je(Y,g,me),Je(Y,v,me),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($,pe),K($,be),sl(et,$,null),K($,Qn),sl(ot,$,null),K(v,Yn),K(v,dt),pt=!0,jt||(Pt=pl(dt,"click",l[17]),jt=!0)},p(Y,[me]){const Rt={};me&1&&(Rt.root=Y[0]),t.$set(Rt),Y[3]===null?Te?Te.p(Y,me):(Te=Ws(Y),Te.c(),Te.m(i.parentNode,i)):Te&&(Te.d(1),Te=null),(!pt||me&128)&&c!==(c=Y[7]("common.language")+"")&&Bn(a,c);const pn={};me&32&&(pn.value=Y[5]),f.$set(pn),(!pt||me&128)&&b!==(b=Y[7]("common.pwa")+"")&&Bn(k,b),gt===(gt=At(Y))&&Ge?Ge.p(Y,me):(Ge.d(1),Ge=gt(Y),Ge&&(Ge.c(),Ge.m(w,null))),(!pt||me&128)&&C!==(C=Y[7]("common.screen_studio")+"")&&Bn(y,C);const rt={};me&2&&(rt.value=Y[1]),et.$set(rt);const ue={};me&4&&(ue.value=Y[2]),ot.$set(ue)},i(Y){pt||(ol(t.$$.fragment,Y),ol(f.$$.fragment,Y),ol(et.$$.fragment,Y),ol(ot.$$.fragment,Y),pt=!0)},o(Y){rl(t.$$.fragment,Y),rl(f.$$.fragment,Y),rl(et.$$.fragment,Y),rl(ot.$$.fragment,Y),pt=!1},d(Y){Y&&(Ze(e),Ze(n),Ze(i),Ze(s),Ze(_),Ze(d),Ze(g),Ze(v)),il(t),Te&&Te.d(Y),il(f),Ge.d(),il(et),il(ot),jt=!1,Pt()}}}function z_(l,e,t){let n;v_(l,di,m=>t(7,n=m));let{root:i}=e,{space_id:s}=e,{pwa_enabled:o}=e;const c=S_();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()}C_(()=>{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;kr.subscribe(m=>{m&&t(5,r=m)});function d(m){const C=m.detail;$r(C)}function h(m){t(1,f=m.detail)}function b(m){t(2,_=m.detail)}pi();function k(m){b_.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 N_ extends g_{constructor(e){super(),k_(this,e,z_,M_,y_,{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}),An()}get space_id(){return this.$$.ctx[3]}set space_id(e){this.$$set({space_id:e}),An()}get pwa_enabled(){return this.$$.ctx[4]}set pwa_enabled(e){this.$$set({pwa_enabled:e}),An()}get allow_zoom(){return this.$$.ctx[1]}set allow_zoom(e){this.$$set({allow_zoom:e}),An()}get allow_video_trim(){return this.$$.ctx[2]}set allow_video_trim(e){this.$$set({allow_video_trim:e}),An()}}const{SvelteComponent:T_,add_flush_callback:L_,assign:Cl,bind:Zs,binding_callbacks:ci,bubble:j_,check_outros:P_,compute_rest_props:Js,construct_svelte_component:Qs,create_component:Ys,create_slot:A_,destroy_component:Ks,detach:R_,empty:O_,exclude_internal_props:D_,flush:kt,get_all_dirty_from_scope:I_,get_slot_changes:F_,get_spread_object:Xs,get_spread_update:xs,group_outros:B_,init:U_,insert:G_,mount_component:eo,not_equal:V_,transition_in:ui,transition_out:_i,update_slot_base:H_}=window.__gradio__svelte__internal,{bind:W_,binding_callbacks:Z_}=window.__gradio__svelte__internal;function J_(l){let e;const t=l[12].default,n=A_(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)&&H_(n,t,i,i[16],e?F_(t,i[16],s,null):I_(i[16]),null)},i(i){e||(ui(n,i),e=!0)},o(i){_i(n,i),e=!1},d(i){n&&n.d(i)}}}function Q_(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:[J_]},$$scope:{ctx:r}};for(let _=0;_<s.length;_+=1)f=Cl(f,s[_]);return u!==void 0&&u&764&&(f=Cl(f,xs(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&&Xs(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=Qs(c,a(l)),l[13](e),ci.push(()=>Zs(e,"value",o)),e.$on("prop_change",l[15])),{c(){e&&Ys(e.$$.fragment),n=O_()},m(r,u){e&&eo(e,r,u),G_(r,n,u),i=!0},p(r,[u]){if(c!==(c=r[8])){if(e){B_();const f=e;_i(f.$$.fragment,1,0,()=>{Ks(f,1)}),P_()}c?(e=Qs(c,a(r,u)),r[13](e),ci.push(()=>Zs(e,"value",o)),e.$on("prop_change",r[15]),Ys(e.$$.fragment),ui(e.$$.fragment,1),eo(e,n.parentNode,n)):e=null}else if(c){const f=u&764?xs(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&&Xs(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],L_(()=>t=!1)),e.$set(f)}},i(r){i||(e&&ui(e.$$.fragment,r),i=!0)},o(r){e&&_i(e.$$.fragment,r),i=!1},d(r){r&&R_(n),l[13](null),e&&Ks(e,r)}}}function Y_(l,e,t){const n=["root","component","target","theme_mode","instance","value","elem_id","elem_classes","_id","visible"];let i=Js(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=>{Z_.push(()=>W_(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]=Ti(E[M]))}function C(E){ci[E?"unshift":"push"](()=>{f=E,t(1,f)})}function y(E){_=E,t(0,_)}function L(E){j_.call(this,l,E)}return l.$$set=E=>{e=Cl(Cl({},e),D_(E)),t(9,i=Js(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,_=Ti(_))},[_,f,c,r,u,d,h,k,g,i,a,b,s,C,y,L,o]}class K_ extends T_{constructor(e){super(),U_(this,e,Y_,Q_,V_,{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}),kt()}get component(){return this.$$.ctx[10]}set component(e){this.$$set({component:e}),kt()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),kt()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),kt()}get instance(){return this.$$.ctx[1]}set instance(e){this.$$set({instance:e}),kt()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),kt()}get elem_id(){return this.$$.ctx[5]}set elem_id(e){this.$$set({elem_id:e}),kt()}get elem_classes(){return this.$$.ctx[6]}set elem_classes(e){this.$$set({elem_classes:e}),kt()}get _id(){return this.$$.ctx[11]}set _id(e){this.$$set({_id:e}),kt()}get visible(){return this.$$.ctx[7]}set visible(e){this.$$set({visible:e}),kt()}}const{SvelteComponent:X_,add_flush_callback:to,assign:x_,bind:no,binding_callbacks:lo,bubble:io,check_outros:Io,component_subscribe:ef,create_component:Fo,destroy_component:Bo,detach:wi,empty:yi,ensure_array_like:so,flush:zt,get_spread_object:tf,get_spread_update:nf,group_outros:Uo,init:lf,insert:Ci,mount_component:Go,outro_and_destroy_block:sf,safe_not_equal:of,transition_in:yn,transition_out:Hn,update_keyed_each:rf}=window.__gradio__svelte__internal,{onMount:af,createEventDispatcher:cf,setContext:uf}=window.__gradio__svelte__internal;function oo(l,e,t){const n=l.slice();return n[16]=e[t],n}function ro(l){let e=[],t=new Map,n,i,s=so(l[0].children);const o=c=>c[16].id;for(let c=0;c<s.length;c+=1){let a=oo(l,s,c),r=o(a);t.set(r,e[c]=ao(r,a))}return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=yi()},m(c,a){for(let r=0;r<e.length;r+=1)e[r]&&e[r].m(c,a);Ci(c,n,a),i=!0},p(c,a){a&63&&(s=so(c[0].children),Uo(),e=rf(e,a,o,1,c,s,t,n.parentNode,sf,ao,n,oo),Io())},i(c){if(!i){for(let a=0;a<s.length;a+=1)yn(e[a]);i=!0}},o(c){for(let a=0;a<e.length;a+=1)Hn(e[a]);i=!1},d(c){c&&wi(n);for(let a=0;a<e.length;a+=1)e[a].d(c)}}}function ao(l,e){let t,n,i;return n=new Vo({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=yi(),Fo(n.$$.fragment),this.first=t},m(s,o){Ci(s,t,o),Go(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||(yn(n.$$.fragment,s),i=!0)},o(s){Hn(n.$$.fragment,s),i=!1},d(s){s&&wi(t),Bo(n,s)}}}function _f(l){let e,t,n=l[0].children&&l[0].children.length&&ro(l);return{c(){n&&n.c(),e=yi()},m(i,s){n&&n.m(i,s),Ci(i,e,s),t=!0},p(i,s){i[0].children&&i[0].children.length?n?(n.p(i,s),s&1&&yn(n,1)):(n=ro(i),n.c(),yn(n,1),n.m(e.parentNode,e)):n&&(Uo(),Hn(n,1,1,()=>{n=null}),Io())},i(i){t||(yn(n),t=!0)},o(i){Hn(n),t=!1},d(i){i&&wi(e),n&&n.d(i)}}}function ff(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:[_f]},$$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 K_({props:a}),lo.push(()=>no(e,"instance",o)),lo.push(()=>no(e,"value",c)),{c(){Fo(e.$$.fragment)},m(r,u){Go(e,r,u),i=!0},p(r,[u]){const f=u&15?nf(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&&tf(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,to(()=>t=!1)),!n&&u&1&&(n=!0,f.value=r[0].props.value,to(()=>n=!1)),e.$set(f)},i(r){i||(yn(e.$$.fragment,r),i=!0)},o(r){Hn(e.$$.fragment,r),i=!1},d(r){Bo(e,r)}}}function df(l,e,t){let n;ef(l,wr,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=cf();let h=[];af(()=>{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)}}),uf("BLOCK_KEY",o);function b(g){io.call(this,l,g)}function k(g){io.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 Mr(s.id,c,a,r,i,u,f,n,_,yr),s)},[s,i,c,a,f,_,o,r,u,n,b,k,p,w]}class Vo extends X_{constructor(e){super(),lf(this,e,df,ff,of,{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}),zt()}get node(){return this.$$.ctx[0]}set node(e){this.$$set({node:e}),zt()}get parent(){return this.$$.ctx[6]}set parent(e){this.$$set({parent:e}),zt()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),zt()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),zt()}get version(){return this.$$.ctx[7]}set version(e){this.$$set({version:e}),zt()}get autoscroll(){return this.$$.ctx[8]}set autoscroll(e){this.$$set({autoscroll:e}),zt()}get max_file_size(){return this.$$.ctx[4]}set max_file_size(e){this.$$set({max_file_size:e}),zt()}get client(){return this.$$.ctx[5]}set client(e){this.$$set({client:e}),zt()}}const{SvelteComponent:pf,check_outros:mf,create_component:hf,destroy_component:gf,detach:bf,empty:vf,flush:Ft,group_outros:kf,init:$f,insert:wf,mount_component:yf,safe_not_equal:Cf,transition_in:ml,transition_out:fi}=window.__gradio__svelte__internal,{onMount:Sf,createEventDispatcher:Ef}=window.__gradio__svelte__internal;function co(l){let e,t;return e=new Vo({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(){hf(e.$$.fragment)},m(n,i){yf(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||(ml(e.$$.fragment,n),t=!0)},o(n){fi(e.$$.fragment,n),t=!1},d(n){gf(e,n)}}}function qf(l){let e,t,n=l[0]&&co(l);return{c(){n&&n.c(),e=vf()},m(i,s){n&&n.m(i,s),wf(i,e,s),t=!0},p(i,[s]){i[0]?n?(n.p(i,s),s&1&&ml(n,1)):(n=co(i),n.c(),ml(n,1),n.m(e.parentNode,e)):n&&(kf(),fi(n,1,1,()=>{n=null}),mf())},i(i){t||(ml(n),t=!0)},o(i){fi(n),t=!1},d(i){i&&bf(e),n&&n.d(i)}}}function Mf(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=Ef();return Sf(()=>{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 zf extends pf{constructor(e){super(),$f(this,e,Mf,qf,Cf,{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}),Ft()}get root(){return this.$$.ctx[1]}set root(e){this.$$set({root:e}),Ft()}get target(){return this.$$.ctx[2]}set target(e){this.$$set({target:e}),Ft()}get theme_mode(){return this.$$.ctx[3]}set theme_mode(e){this.$$set({theme_mode:e}),Ft()}get version(){return this.$$.ctx[4]}set version(e){this.$$set({version:e}),Ft()}get autoscroll(){return this.$$.ctx[5]}set autoscroll(e){this.$$set({autoscroll:e}),Ft()}get max_file_size(){return this.$$.ctx[6]}set max_file_size(e){this.$$set({max_file_size:e}),Ft()}get client(){return this.$$.ctx[7]}set client(e){this.$$set({client:e}),Ft()}}const Nf="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",Tf="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 Lt=!1,un=null,Si=[],Rl=0,Vt={},Ho,Sl,dn=null,Un=[];function Lf(l,e,t){Ho=l,Sl=e,t&&(dn=t)}async function jf(){if(!Lt)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};un=new MediaRecorder(e,t),Si=[],Vt={},un.ondataavailable=Df,un.onstop=If,un.start(1e3),Lt=!0,dn&&dn(!0),Rl=Date.now()}catch(l){Sl("Recording Error","Failed to start recording: "+l.message,"error")}}function Pf(){!Lt||!un||(un.stop(),Lt=!1,dn&&dn(!1))}function Af(){if(!Lt)return;const l=(Date.now()-Rl)/1e3;Vt.start=l}function Rf(){if(!Lt||Vt.start===void 0)return;const l=(Date.now()-Rl)/1e3;Vt.end=l}function Of(l,e){if(!Lt)return;const t=30,n=(Date.now()-Rl)/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);Un.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})||Un.push({boundingBox:e.boundingBox,start_frame:i,duration:s})}}function uo(l,e,t=2){if(Lt)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]),Of(l,{boundingBox:{topLeft:b,bottomRight:k},duration:t})},300)}catch{}}function Df(l){l.data.size>0&&Si.push(l.data)}function If(){Lt=!1,dn&&dn(!1);const l=new Blob(Si,{type:"video/mp4"});Ff(l),(un?.stream?.getTracks()||[]).forEach(t=>t.stop())}async function Ff(l){try{Sl("Processing video","This may take a few seconds...","info");const e=new FormData;e.append("video",l,"recording.mp4"),Vt.start!==void 0&&Vt.end!==void 0&&(e.append("remove_segment_start",Vt.start.toString()),e.append("remove_segment_end",Vt.end.toString())),Un.length>0&&e.append("zoom_effects",JSON.stringify(Un));const t=await fetch(Ho+"/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`;_o(n,i),Un=[]}catch{Sl("Processing Error","Failed to process recording. Saving original version.","warning");const t=`gradio-screen-recording-${new Date().toISOString().replace(/:/g,"-").replace(/\..+/,"")}.mp4`;_o(l,t)}}function _o(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:Bf,SvelteComponent:Uf,add_flush_callback:fo,append:re,attr:le,bind:po,binding_callbacks:mo,check_outros:Rn,component_subscribe:hn,create_component:Wn,destroy_component:Zn,detach:je,element:Se,empty:hl,flush:he,globals:Gf,group_outros:On,init:Vf,insert:Re,listen:Nn,mount_component:Jn,noop:li,run_all:Hf,safe_not_equal:Wf,set_data:Gn,set_store_value:Zf,set_style:al,space:Ae,src_url_equal:gl,text:Vn,toggle_class:cl,transition_in:ze,transition_out:We}=window.__gradio__svelte__internal,{document:In}=Gf,{tick:ul,onMount:Jf}=window.__gradio__svelte__internal;function ho(l){return In.title=l[2],{c:li,m:li,d:li}}function go(l){let e,t=`<style>${Li(l[15],l[12])}</style>`,n;return{c(){e=new Bf(!1),n=hl(),e.a=n},m(i,s){e.m(t,i,s),Re(i,n,s)},p(i,s){s[0]&36864&&t!==(t=`<style>${Li(i[15],i[12])}</style>`)&&e.p(t)},d(i){i&&(je(n),e.d())}}}function bo(l){let e,t;return e=new zf({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(){Wn(e.$$.fragment)},m(n,i){Jn(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){Zn(e,n)}}}function vo(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]&&ko(l);return{c(){e=Se("footer"),Q&&Q.c(),t=Ae(),n=Se("a"),s=Vn(i),o=Ae(),c=Se("img"),u=Ae(),f=Se("div"),f.textContent="Β·",_=Ae(),d=Se("button"),b=Vn(h),k=Ae(),p=Se("img"),v=Ae(),m=Se("div"),m.textContent="Β·",C=Ae(),y=Se("button"),E=Vn(L),M=Ae(),$=Se("img"),gl(c.src,a=Nf)||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"),cl(f,"hidden",!l[25]),gl(p.src,w=Tf)||le(p,"src",w),le(p,"alt",g=l[26]("common.stop_recording")),le(p,"class","svelte-czcr5b"),le(d,"class","record svelte-czcr5b"),cl(d,"hidden",!l[25]),le(m,"class","divider svelte-czcr5b"),gl($.src,T=Do)||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=[Nn(d,"click",l[51]),Nn(y,"click",l[52])],R=!0)},p(G,O){G[5]?Q?Q.p(G,O):(Q=ko(G),Q.c(),Q.m(e,t)):Q&&(Q.d(1),Q=null),O[0]&67108864&&i!==(i=G[26]("common.built_with_gradio")+"")&&Gn(s,i),O[0]&67108864&&r!==(r=G[26]("common.logo"))&&le(c,"alt",r),O[0]&33554432&&cl(f,"hidden",!G[25]),O[0]&67108864&&h!==(h=G[26]("common.stop_recording")+"")&&Gn(b,h),O[0]&67108864&&g!==(g=G[26]("common.stop_recording"))&&le(p,"alt",g),O[0]&33554432&&cl(d,"hidden",!G[25]),O[0]&67108864&&L!==(L=G[26]("common.settings")+"")&&Gn(E,L),O[0]&67108864&&q!==(q=G[26]("common.settings"))&&le($,"alt",q)},d(G){G&&je(e),Q&&Q.d(),R=!1,Hf(J)}}}function ko(l){let e,t,n,i,s,o,c,a,r;function u(d,h){return d[10].config?.mcp_server?Yf:Qf}let f=u(l),_=f(l);return{c(){e=Se("button"),_.c(),t=Ae(),n=Se("img"),o=Ae(),c=Se("div"),c.textContent="Β·",gl(n.src,i=qo)||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=Nn(e,"click",l[50]),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 Qf(l){let e=l[26]("errors.use_via_api")+"",t;return{c(){t=Vn(e)},m(n,i){Re(n,t,i)},p(n,i){i[0]&67108864&&e!==(e=n[26]("errors.use_via_api")+"")&&Gn(t,e)},d(n){n&&je(t)}}}function Yf(l){let e=l[26]("errors.use_via_api_or_mcp")+"",t;return{c(){t=Vn(e)},m(n,i){Re(n,t,i)},p(n,i){i[0]&67108864&&e!==(e=n[26]("errors.use_via_api_or_mcp")+"")&&Gn(t,e)},d(n){n&&je(t)}}}function $o(l){let e,t,n,i,s;return t=new xu({props:{api_calls:l[22],dependencies:l[1]}}),{c(){e=Se("div"),Wn(t.$$.fragment),le(e,"id","api-recorder-container"),le(e,"class","svelte-czcr5b")},m(o,c){Re(o,e,c),Jn(t,e,null),n=!0,i||(s=Nn(e,"click",l[53]),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),Zn(t),i=!1,s()}}}function wo(l){let e,t,n,i,s,o,c,a;return s=new Bu({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[55]),{c(){e=Se("div"),t=Se("div"),n=Ae(),i=Se("div"),Wn(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),Jn(s,i,null),o=!0,c||(a=Nn(t,"click",l[54]),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),Zn(s),c=!1,a()}}}function yo(l){let e,t,n,i,s,o,c,a,r,u;function f(h){l[57](h)}function _(h){l[58](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 N_({props:d}),mo.push(()=>po(s,"allow_zoom",f)),mo.push(()=>po(s,"allow_video_trim",_)),s.$on("close",l[59]),s.$on("start_recording",l[60]),{c(){e=Se("div"),t=Se("div"),n=Ae(),i=Se("div"),Wn(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),Jn(s,i,null),a=!0,r||(u=Nn(t,"click",l[56]),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],fo(()=>o=!1)),!c&&b[0]&2097152&&(c=!0,k.allow_video_trim=h[21],fo(()=>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),Zn(s),r=!1,u()}}}function Co(l){let e,t;return e=new qr({props:{messages:l[23]}}),e.$on("close",l[33]),{c(){Wn(e.$$.fragment)},m(n,i){Jn(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){Zn(e,n)}}}function Kf(l){let e,t,n,i,s,o,c,a,r,u,f,_,d=l[7]&&ho(l),h=l[15]&&go(l),b=l[16]&&l[10].config&&l[24]&&bo(l),k=l[6]&&vo(l),p=l[19]&&$o(l),w=l[17]&&l[16]&&wo(l),g=l[18]&&l[16]&&l[10].config&&yo(l),v=l[23]&&Co(l);return{c(){d&&d.c(),e=hl(),h&&h.c(),t=hl(),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=hl(),le(s,"class","contain svelte-czcr5b"),al(s,"flex-grow",l[8]?"1":"auto"),le(i,"class","wrap svelte-czcr5b"),al(i,"min-height",l[8]?"100%":"auto")},m(m,C){d&&d.m(In.head,null),re(In.head,e),h&&h.m(In.head,null),re(In.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=ho(m),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),m[15]?h?h.p(m,C):(h=go(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=bo(m),b.c(),ze(b,1),b.m(s,null)):b&&(On(),We(b,1,1,()=>{b=null}),Rn()),C[0]&256&&al(s,"flex-grow",m[8]?"1":"auto"),m[6]?k?k.p(m,C):(k=vo(m),k.c(),k.m(i,null)):k&&(k.d(1),k=null),C[0]&256&&al(i,"min-height",m[8]?"100%":"auto"),m[19]?p?(p.p(m,C),C[0]&524288&&ze(p,1)):(p=$o(m),p.c(),ze(p,1),p.m(a.parentNode,a)):p&&(On(),We(p,1,1,()=>{p=null}),Rn()),m[17]&&m[16]?w?(w.p(m,C),C[0]&196608&&ze(w,1)):(w=wo(m),w.c(),ze(w,1),w.m(r.parentNode,r)):w&&(On(),We(w,1,1,()=>{w=null}),Rn()),m[18]&&m[16]&&m[10].config?g?(g.p(m,C),C[0]&328704&&ze(g,1)):(g=yo(m),g.c(),ze(g,1),g.m(u.parentNode,u)):g&&(On(),We(g,1,1,()=>{g=null}),Rn()),m[23]?v?(v.p(m,C),C[0]&8388608&&ze(v,1)):(v=Co(m),v.c(),ze(v,1),v.m(f.parentNode,f)):v&&(On(),We(v,1,1,()=>{v=null}),Rn())},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 Xf=/^'([^]+)'$/,xf=15,e0=10;function So(l){return"detail"in l}function t0(l,e,t){let n,i,s,o,c,a;hn(l,di,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:pe,scheduled_updates:be,create_layout:et,rerender_layout:Qn}=Cr(R);hn(l,Q,S=>t(16,a=S)),hn(l,G,S=>t(67,s=S)),hn(l,pe,S=>t(49,i=S)),hn(l,be,S=>t(68,o=S));let ot=_;async function Yn(){t(48,me=!0),await et({components:u,layout:f,dependencies:_,root:r+T,app:m,options:{fill_height:E}}),t(48,me=!1)}let{search_params:dt}=e,pt=dt.get("view")==="api"&&k,jt=dt.get("view")==="settings",Pt=dt.get("view")==="api-recorder"&&k,Te=!0,At=!0;function gt(S){t(19,Pt=!1),t(17,pt=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,jt=!jt)}let Y=[],me=!1,{render_complete:Rt=!1}=e;async function pn(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&&uo(!0,Z.inputs,1),Z&&Z.outputs&&Z.outputs.length>0&&n&&uo(!1,Z.outputs,2)),!Z)return;const U=Z.outputs,_e=S?.map((ke,at)=>({id:U[at],prop:"value_is_output",value:!0}));O(_e),await ul();const $e=[];S?.forEach((ke,at)=>{if(typeof ke=="object"&&ke!==null&&ke.__type__==="update")for(const[X,Ve]of Object.entries(ke))X!=="__type__"&&$e.push({id:U[at],prop:X,value:Ve});else $e.push({id:U[at],prop:"value",value:ke})}),O($e),await ul()}let rt=new Map,ue=[];function bt(S,x,Z,ve,U=10,_e=!0){return{title:S,message:x,fn_index:Z,type:ve,id:++Wo,duration:U,visible:_e}}function Ol(S,x,Z){t(23,ue=[bt(S,x,-1,Z),...ue])}let Wo=-1,Dl=!1;const Zo=c("blocks.long_requests_queue"),Jo=c("blocks.connection_can_break"),Qo=c("blocks.lost_connection"),Yo=c("blocks.waiting_for_inputs");let Il=!1,Ei=!1,qi=!1,Ln=[];function Xt(S,x=null,Z=null){let ve=()=>{};function U(){ve()}o?ve=be.subscribe(_e=>{_e||ul().then(()=>{Mi(S,x,Z),U()})}):Mi(S,x,Z)}async function Ko(S,x,Z){return S===x&&Z&&Z.is_value_data===!0?Z.value:j(S)}async function Mi(S,x=null,Z=null){const ve=_.find(X=>X.id===S);if(ve===void 0)return;const U=ve;if(Ln.length>0){for(const X of Ln)if(U.inputs.includes(X)){Ol("Warning",Yo,"warning");return}}const _e=pe.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=>Ko(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)):pn(X,S)}):U.types.cancel&&U.cancels?await Promise.all(U.cancels.map(async X=>{const Ve=rt.get(X);return Ve?.cancel(),Ve})):U.backend_fn&&(U.js_implementation&&new ji(`let result = await (${U.js_implementation})(...arguments); | |
return (!Array.isArray(result)) ? [result] : result;`)(...$e.data).then(Ve=>{pn(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||at(Ve,X.connection=="stream"):X.trigger_mode==="multiple"?at(Ve,X.connection=="stream"):X.trigger_mode==="always_last"&&(X.pending_request?X.final_event=Ve:at(Ve,X.connection=="stream"))}async function at(X,Ve=!1){At&&Af(),Pt&&t(22,Y=[...Y,JSON.parse(JSON.stringify(X))]);let Ul;if(m.set_current_payload(X),Ve)if(!rt.has(S))U.inputs.forEach(de=>P(de,"waiting"));else{if(rt.has(S)&&U.inputs.some(de=>ee(de)==="waiting"))return;if(rt.has(S)&&U.inputs.some(de=>ee(de)==="open")){await m.send_ws_message(`${m.config.root+m.config.api_prefix}/stream/${rt.get(S).event_id()}`,{...X,session_hash:m.session_hash});return}}try{Ul=m.submit(X.fn_index,X.data,X.event_data,X.trigger_id)}catch(de){if(m.closed)return;t(23,ue=[bt("Error",String(de),0,"error"),...ue]),pe.update({status:"error",fn_index:0,eta:0,queue:!1,queue_position:null}),Kn(i);return}rt.set(S,Ul);for await(const de of Ul){if(X.js_implementation)return;de.type==="data"?pr(de):de.type==="render"?mr(de):de.type==="status"?br(de):de.type==="log"&&hr(de)}function pr(de){const{data:Le,fn_index:oe}=de;U.pending_request&&U.final_event&&(U.pending_request=!1,at(U.final_event,U.connection=="stream")),U.pending_request=!1,pn(Le,oe),Kn(i)}function mr(de){const{data:Le}=de;let oe=Le.components,we=Le.layout,vt=Le.dependencies,Ot=Le.render_id,Dt=[];_.forEach((Et,Gl)=>{Et.rendered_in===U.render_id&&Dt.push(Gl)}),Dt.reverse().forEach(Et=>{_.splice(Et,1)}),vt.forEach(Et=>{_.push(Et)}),Qn({components:oe,layout:we,root:r+T,dependencies:_,render_id:Ot}),vt.forEach(Et=>{Et.targets.some(Gl=>Gl[1]==="load")&&Xt(Et.id)})}function hr(de){const{title:Le,log:oe,fn_index:we,level:vt,duration:Ot,visible:Dt}=de;t(23,ue=[bt(Le,oe,we,vt,Ot,Dt),...ue])}function gr(de,Le,oe){de.original_msg==="process_starts"&&oe.connection==="stream"&&P(Le,"open")}function br(de){const{fn_index:Le,...oe}=de;if(oe.stage==="streaming"&&oe.time_limit&&U.inputs.forEach(we=>{Pe(we,oe.time_limit)}),U.inputs.forEach(we=>{gr(de,we,U)}),pe.update({...oe,time_limit:oe.time_limit,status:oe.stage,progress:oe.progress_data,fn_index:Le}),Kn(i),!Ei&&C!==null&&oe.position!==void 0&&oe.position>=2&&oe.eta!==void 0&&oe.eta>xf&&(Ei=!0,t(23,ue=[bt("Warning",Zo,Le,"warning"),...ue])),!qi&&Il&&oe.eta!==void 0&&oe.eta>e0&&(qi=!0,t(23,ue=[bt("Warning",Jo,Le,"warning"),...ue])),oe.stage==="complete"||oe.stage==="generating"){const we=new Set;oe.changed_state_ids?.forEach(vt=>{_.filter(Ot=>Ot.targets.some(([Dt,Et])=>Dt===vt)).forEach(Ot=>{we.add(Ot)})}),we.forEach(vt=>{Xt(vt.id,X.trigger_id)})}if(oe.stage==="complete"&&(_.forEach(async we=>{we.trigger_after===Le&&Xt(we.id,X.trigger_id)}),U.inputs.forEach(we=>{P(we,"closed")}),rt.delete(S)),oe.broken&&Il&&Dl)window.setTimeout(()=>{t(23,ue=[bt("Error",Qo,Le,"error"),...ue])},0),Xt(U.id,X.trigger_id,Z),Dl=!1;else if(oe.stage==="error"){if(oe.message){const we=oe.message.replace(Xf,(Ot,Dt)=>Dt),vt=oe.title??"Error";t(23,ue=[bt(vt,we,Le,"error",oe.duration,oe.visible),...ue])}_.map(async we=>{we.trigger_after===Le&&!we.trigger_only_on_success&&Xt(we.id,X.trigger_id)})}}At&&Rf()}}function Xo(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 xo(S){const x=S.detail;t(23,ue=ue.filter(Z=>Z.id!==x))}const er=S=>!!(S&&new URL(S,location.href).origin!==location.origin);async function tr(){L&&await new ji(`let result = await (${L})(); | |
return (!Array.isArray(result)) ? [result] : result;`)(),await ul();for(var S=h.getElementsByTagName("a"),x=0;x<S.length;x++){const Z=S[x].getAttribute("target"),ve=S[x].getAttribute("href");er(ve)&&Z!=="_blank"&&S[x].setAttribute("target","_blank")}zi(),!(!h||Rt)&&(h.addEventListener("prop_change",Z=>{if(!So(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&&Ln.push(ve),U==="input_ready"&&_e===!0&&(Ln=Ln.filter($e=>$e!==ve))}),h.addEventListener("gradio",Z=>{if(!So(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;Xo($e,ke)}else U==="error"?t(23,ue=[bt("Error",_e,-1,U),...ue]):U==="warning"?t(23,ue=[bt("Warning",_e,-1,U),...ue]):U==="info"?t(23,ue=[bt("Info",_e,-1,U),...ue]):U=="clear_status"?nr(ve,"complete",_e):U=="close_stream"?s[ve]?.[_e]?.forEach(ke=>{if(rt.has(ke)){const at=`${m.config.root+m.config.api_prefix}/stream/${rt.get(ke).event_id()}`;m.post_data(`${at}/close`,{}),m.close_ws(at)}}):s[ve]?.[U]?.forEach(ke=>{requestAnimationFrame(()=>{Xt(ke,ve,_e)})})}),t(37,Rt=!0))}const zi=()=>{_.forEach(S=>{S.targets.some(x=>x[1]==="load")&&Xt(S.id)})};function nr(S,x,Z){Z.status=x,O([{id:S,prop:"loading_status",value:Z}])}function Kn(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=pe.get_inputs_to_update(),ve=Array.from(Z).map(([U,_e])=>({id:U,prop:"pending",value:_e==="pending"}));O([...x,...ve])}let Fl=Sr(!1);hn(l,Fl,S=>t(25,n=S)),Jf(()=>{document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&(Dl=!0)}),Il=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Lf(r,(S,x,Z)=>{Ol(S,x,Z)},S=>{Zf(Fl,n=S,n)})});function Bl(){n?Pf():jf()}let Ni=!1;pi(m.config?.i18n_translations??void 0).then(()=>{t(24,Ni=!0)});const lr=()=>{gt(!pt)},ir=()=>{Bl()},sr=()=>{Ge(!jt)},or=()=>{gt(!0),t(19,Pt=!1)},rr=()=>{gt(!1)},ar=S=>{gt(!1),t(22,Y=[]),t(19,Pt=S.detail?.api_recorder_visible)},cr=()=>{Ge(!1)};function ur(S){Te=S,t(20,Te)}function _r(S){At=S,t(21,At)}const fr=S=>{Ge(!1)},dr=S=>{Bl()};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,dt=S.search_params),"render_complete"in S&&t(37,Rt=S.render_complete)},l.$$.update=()=>{l.$$.dirty[0]&1035|l.$$.dirty[1]&2816&&Yn(),l.$$.dirty[0]&65536&&t(38,M=!!a),l.$$.dirty[0]&2|l.$$.dirty[1]&196672&&_!==ot&&Rt&&!me&&(zi(),t(47,ot=_)),l.$$.dirty[1]&262144&&Kn(i)},[r,_,d,h,b,k,p,w,g,v,m,C,y,$,q,J,a,pt,jt,Pt,Te,At,Y,ue,Ni,n,c,Q,G,pe,be,gt,Ge,xo,tr,Fl,Bl,Rt,M,u,f,L,E,T,R,dt,Ol,ot,me,i,lr,ir,sr,or,rr,ar,cr,ur,_r,fr,dr]}class q0 extends Uf{constructor(e){super(),Vf(this,e,t0,Kf,Wf,{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{q0 as default}; | |
//# sourceMappingURL=Blocks-DKDrXp28.js.map | |