1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Blocks-DDFr0Niq.js","./index-DZobeNVa.js","./index-BkS15Xs3.css","./core-CAXGlMNg.js","./src-Dl2nhAat.js","./runtime-CCi_C8Gz.js","./dist-Kll2twSG.js","./core-CzpTPg5X.css","./api-logo-CCEtYehn.js","./settings-logo-AL7zGNml.js","./logo-D4NPp-_W.js","./statustracker-DPU4ThhG.js","./src-Dk2Ve7HQ.js","./legacy-CccpxOkO.js","./src-BfutoOhM.css","./browser-j4vcKnNL.js","./statustracker-CouyIdTk.css","./Blocks-0aNuD791.css","./Login-DswHWqbB.js","./Index-BF-wbmOv.js","./Image-C6EwRAez.js","./Image-Da_XA0w6.css","./shared-DhgbHT7U.js","./ImagePreview-DkOjf1wS.js","./ImagePreview-B2sIO-1d.css","./Index-CcsdfK63.css","./Index-Cgx-aBqH.js","./Index-DrCM5gzc.css","./Index-dp8qAiZ6.js","./Index-C1GyojFs.css","./Index-GgT5NFWC.js","./Example-zffv55Vc.js","./Example-B1swpn2y.css","./Index-Ba0kRe4M.css","./Login-CfvgKHi0.css"])))=>i.map(i=>d[i]); 2import{$ as e,$t as t,At as n,B as r,G as i,It as a,J as o,K as s,L as c,Lt as l,St as u,Tt as d,U as f,Ut as p,V as m,Vt as h,Wt as g,X as _,Xt as v,Y as y,Yt as b,a as ee,an as te,at as x,bt as S,cn as ne,et as C,ht as w,in as re,k as ie,mt as T,n as E,nn as ae,nt as D,q as O,r as k,rn as A,sn as oe,t as j,tn as se,tt as M,u as N,vt as ce,wt as P,x as F,xt as I,yt as L}from"./index-DZobeNVa.js";import{d as le}from"./src-Dl2nhAat.js";import{c as ue}from"./statustracker-DPU4ThhG.js";import{t as de}from"./runtime-CCi_C8Gz.js";import{Embed as R,O as z,mount_css as fe,prefix_css as B,setupi18n as pe}from"./core-CAXGlMNg.js";import{t as V}from"./logo-D4NPp-_W.js";var H=()=>{let e=document.createElement(`link`);e.href=`https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900&display=swap`,e.rel=`stylesheet`;let t=document.createElement(`link`);t.href=`https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap`,t.rel=`stylesheet`,document.head.appendChild(e),document.head.appendChild(t)},me=()=>{let e=document.createElement(`div`);return e.style.backgroundImage=`linear-gradient(to top, #f9fafb, white)`,e.style.border=`1px solid #e5e7eb`,e.style.borderRadius=`0.75rem`,e.style.boxShadow=`0 0 10px rgba(0, 0, 0, 0.1)`,e.style.color=`#374151`,e.style.display=`flex`,e.style.flexDirection=`row`,e.style.alignItems=`center`,e.style.height=`40px`,e.style.justifyContent=`space-between`,e.style.overflow=`hidden`,e.style.position=`fixed`,e.style.right=`.75rem`,e.style.top=`.75rem`,e.style.width=`auto`,e.style.zIndex=`20`,e.style.paddingLeft=`1rem`,e.setAttribute(`id`,`huggingface-space-header`),window.matchMedia(`(max-width: 768px)`).addEventListener(`change`,t=>{t.matches?e.style.display=`none`:e.style.display=`flex`}),e},he=()=>{let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),e.setAttribute(`xmlns:link`,`http://www.w3.org/1999/xlink`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`focu
2sable`,`false`),e.setAttribute(`role`,`img`),e.setAttribute(`width`,`1em`),e.setAttribute(`height`,`1em`),e.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),e.setAttribute(`viewBox`,`0 0 12 12`),e.setAttribute(`fill`,`currentColor`);let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return t.setAttribute(`d`,`M0.375001 10.3828L0.375 1.61719C0.375 1.104 0.816001 0.687501 1.35938 0.687501L10.6406 0.6875C10.9017 0.6875 11.1521 0.785449 11.3367 0.959797C11.5213 1.13415 11.625 1.37062 11.625 1.61719V10.3828C11.625 10.6294 11.5213 10.8659 11.3367 11.0402C11.1521 11.2145 10.9017 11.3125 10.6406 11.3125H1.35938C0.816001 11.3125 0.375001 10.896 0.375001 10.3828ZM1.35938 10.5156H10.6406C10.7183 10.5156 10.7813 10.4561 10.7813 10.3828V4.40625H1.21875V10.3828C1.21875 10.418 1.23356 10.4518 1.25994 10.4767C1.28631 10.5017 1.32208 10.5156 1.35938 10.5156ZM4.61052 6.38251L5.9999 7.69472L7.38927 6.38251C7.44083 6.33007 7.50645 6.29173 7.57913 6.27153C7.6518 6.25134 7.72898 6.25003 7.8024 6.26776C7.87583 6.28549 7.9428 6.3216 7.99628 6.37227C8.04983 6.42295 8.08785 6.48631 8.10645 6.5557C8.12528 6.62497 8.12393 6.69773 8.10263 6.76635C8.0814 6.83497 8.0409 6.8969 7.98555 6.94564L6.29802 8.53936C6.21892 8.61399 6.11169 8.65592 5.9999 8.65592C5.8881 8.65592 5.78087 8.61399 5.70177 8.53936L4.01427 6.94564C3.95874 6.89694 3.91814 6.835 3.89676 6.76633C3.87538 6.69766 3.874 6.62483 3.89277 6.55549C3.91154 6.48615 3.94977 6.42287 4.00343 6.37233C4.05708 6.32179 4.12418 6.28585 4.19765 6.2683C4.27098 6.25054 4.34803 6.25178 4.42068 6.27188C4.49334 6.29198 4.55891 6.3302 4.61052 6.38251Z`),e.appendChild(t),e},U=(e,t)=>{let n=document.createElement(`div`);return n.setAttribute(`id`,`space-header__collapse`),n.style.display=`flex`,n.style.flexDirection=`row`,n.style.alignItems=`center`,n.style.justifyContent=`center`,n.style.fontSize=`16px`,n.style.paddingLeft=`10px`,n.style.paddingRight=`10px`,n.style.height=`40px`,n.style.cursor=`pointer`,n.style.color=`#40546e`,n.style.transitionDuration=`0.1s`,n.style.transitionProperty=`all`,n.style.transitionTimingFunction=`ease-in-out`,n.appendChild(he()),n.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),t()}),n.addEventListener(`mouseenter`,()=>{n.style.color=`#213551`}),n.addEventListener(`mouseleave`,()=>{n.style.color=`#40546e`}),n},W=e=>{let t=document.createElement(`p`);return t.style.margin=`0`,t.style.padding=`0`,t.style.color=`#9ca3af`,t.style.fontSize=`14px`,t.style.fontFamily=`Source Sans Pro, sans-serif`,t.style.padding=`0px 6px`,t.style.borderLeft=`1px solid #e5e7eb`,t.style.marginLeft=`4px`,t.textContent=(e??0).toString(),t},G=()=>{let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),e.setAttribute(`xmlns:link`,`http://www.w3.org/1999/xlink`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`focu
2sable`,`false`),e.setAttribute(`role`,`img`),e.setAttribute(`width`,`1em`),e.setAttribute(`height`,`1em`),e.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),e.setAttribute(`viewBox`,`0 0 32 32`),e.setAttribute(`fill`,`#6b7280`);let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return t.setAttribute(`d`,`M22.45,6a5.47,5.47,0,0,1,3.91,1.64,5.7,5.7,0,0,1,0,8L16,26.13,5.64,15.64a5.7,5.7,0,0,1,0-8,5.48,5.48,0,0,1,7.82,0L16,10.24l2.53-2.58A5.44,5.44,0,0,1,22.45,6m0-2a7.47,7.47,0,0,0-5.34,2.24L16,7.36,14.89,6.24a7.49,7.49,0,0,0-10.68,0,7.72,7.72,0,0,0,0,10.82L16,29,27.79,17.06a7.72,7.72,0,0,0,0-10.82A7.49,7.49,0,0,0,22.45,4Z`),e.appendChild(t),e},K=e=>{let t=document.createElement(`a`);return t.setAttribute(`href`,`https://huggingface.co/spaces/${e.id}`),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),t.style.border=`1px solid #e5e7eb`,t.style.borderRadius=`6px`,t.style.display=`flex`,t.style.flexDirection=`row`,t.style.alignItems=`center`,t.style.margin=`0 0 0 12px`,t.style.fontSize=`14px`,t.style.paddingLeft=`4px`,t.style.textDecoration=`none`,t.appendChild(G()),t.appendChild(W(e.likes)),t},q=(e,t=`user`)=>{let n=t===`user`?`users`:`organizations`,r=document.createElement(`img`);return r.src=`https://huggingface.co/api/${n}/${e}/avatar`,r.style.width=`0.875rem`,r.style.height=`0.875rem`,r.style.borderRadius=`50%`,r.style.flex=`none`,r.style.marginRight=`0.375rem`,r},J=e=>{let[t,n]=e.split(`/`),r=document.createElement(`a`);return r.setAttribute(`href`,`https://huggingface.co/spaces/${e}`),r.setAttribute(`rel`,`noopener noreferrer`),r.setAttribute(`target`,`_blank`),r.style.color=`#1f2937`,r.style.textDecoration=`none`,r.style.fontWeight=`600`,r.style.fontSize=`15px`,r.style.lineHeight=`24px`,r.style.flex=`none`,r.style.fontFamily=`IBM Plex Mono, sans-serif`,r.addEventListener(`mouseover`,()=>{r.style.color=`#2563eb`}),r.addEventListener(`mouseout`,()=>{r.style.color=`#1f2937`}),r.textContent=n,r},ge=()=>{let e=document.createElement(`div`);return e.style.marginLeft=`.125rem`,e.style.marginRight=`.125rem`,e.style.color=`#d1d5db`,e.textContent=`/`,e},Y=e=>{let t=document.createElement(`a`);return t.setAttribute(`href`,`https://huggingface.co/${e}`),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),t.style.color=`rgb(107, 114, 128)`,t.style.textDecoration=`none`,t.style.fontWeight=`400`,t.style.fontSize=`16px`,t.style.lineHeight=`24px`,t.style.flex=`none`,t.style.fontFamily=`Source Sans Pro, sans-serif`,t.addEventListener(`mouseover`,()=>{t.style.color=`#2563eb`}),t.addEventListener(`mouseout`,()=>{t.style.color=`rgb(107, 114, 128)`}),t.textContent=e,t},X=e=>{let t=document.createElement(`div`);return t.style.display=`flex`,t.style.flexDirection=`row`,t.style.alignItems=`center`,t.style.justifyContent=`center`,t.style.borderRight=`1px solid #e5e7eb`,t.style.paddingRight=`12px`,t.style.height=`40px`,e.type!==`unknown`&&t.appendChild(q(e.author,e.type)),t.appendChild(Y(e.author)),t.appendChild(ge()),t.appendChild(J(e.id)),t.appendChild(K(e)),t},Z=e=>{let t=me();return t.appendChild(X(e)),t.appendChild(U(e,()=>t.style.display=`none`)),t},_e=async(e,t=`user`)=>{let n=t===`user`?`users`:`organizations`;try{return(await fetch(`https://huggingface.co/api/${n}/${e}/avatar`)).ok}catch{return!1}},ve=async e=>{try{return await(await fetch(`https://huggingface.co/api/spaces/${e}`)).json()}catch{return null}},ye=(e,t)=>{if(t?.target){if(t.target.appendChild){t.target.appendChild(e);return}return console.error(`the target element does not have an appendChild method`)}if(document.body===null)return console.error(`document.body is null`);document.body.appendChild(e)};async function be(e,t){if(window===void 0)return console.error(`Please run this script in a browser environment`);if(Object.values(window.location?.ancestorOrigins??{0:window.document.referrer}).some(e=>new URL(e)?.origin===`https://huggingface.co`))return;H();let n;if(typeof e==`string`){if(n=await ve(e),n===null)return console.error(`Space not found`)}else n=e;let[r,i]=await Promise.all([_e(n.author,`user`),_e(n.author,`org`)]);n.type=r?`user`:i?`org`:`unknown`;let a=Z(n);return ye(a,t),{element:a}}var xe=(e,t)=>be(e,t),Se=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%205c0-1.1.9-2%202-2h14c1.1%200%202%20.9%202%202v14c0%201.1-.9%202-2%202H5c-1.1%200-2-.9-2-2V5zm2%200v3h14V5H5zm0%205v9h14v-9H5z'%20fill='%23808080'/%3e%3ccircle%20cx='6.75'%20cy='6.5'%20r='.9'%20fill='%23808080'/%3e%3ccircle%20cx='9.35'%20cy='6.5'%20r='.9'%20fill='%23808080'/%3e%3c/svg%3e`,Ce=_(`<div class="divider svelte-7ovi85">·</div>
2 <a href="https://gradio.app" class="built-with svelte-7ovi85" target="_blank" rel="noreferrer"> <img class="svelte-7ovi85"/></a>`,1),we=_(`<footer aria-label="Gradio footer navigation" class="svelte-7ovi85"><a class="app-link svelte-7ovi85"> <img class="svelte-7ovi85"/></a> <!></footer>`);function Te(e,t){g(t,!0);let r=k(t,`footer_links`,19,()=>[]),i=k(t,`i18n`,3,e=>e);var a=y(),c=S(a),l=e=>{var a=we(),c=L(a),l=L(c),u=I(l);v(c);var d=I(c,2),p=e=>{var t=Ce(),n=I(S(t),2),r=L(n),a=I(r);v(n),T((e,t)=>{s(r,`${e??``} `),F(a,`src`,V),F(a,`alt`,t)},[()=>i()(`common.built_with_gradio`),()=>i()(`common.logo`)]),o(e,t)},m=n(()=>r().includes(`gradio`));f(d,e=>{x(m)&&e(p)}),v(a),T((e,n,r)=>{F(c,`href`,t.app_url),F(c,`title`,e),s(l,`${n??``} `),F(u,`src`,Se),F(u,`alt`,r)},[()=>i()(`common.back_to_app_description`),()=>i()(`common.back_to_app`),()=>i()(`common.back_to_app`)]),o(e,a)};f(c,e=>{r().length>0&&e(l)}),o(e,a),p()}var Q=new Set([`image`,`simpleimage`,`video`,`gallery`,`imageeditor`]);function Ee(e){return Array.isArray(e)?e.some(Ee):!e||typeof e!=`object`?!1:e.meta?._type===`gradio.FileData`}function De(e){if(Array.isArray(e))return e.map(De).join(`, `);if(e&&typeof e==`object`){let t=e,n=t.orig_name||t.path||t.url;if(typeof n==`string`)return n.split(`/`).pop()||n}return typeof e==`string`?e:``}function Oe(e,t){if(t==null)return t;if(e===`dataframe`){let e=t;return Array.isArray(e.data)?Array.isArray(e.headers)?[e.headers,...e.data]:e.data:t}return!Q.has(e)&&Ee(t)&&De(t)||t}function $(e){if(e==null)return`No value`;if(typeof e==`string`)return e||`Empty value`;if(typeof e!=`object`)return String(e);let t=e.label;if(typeof t==`string`)return t;if(Array.isArray(e)&&e.length>0&&e.every(e=>e&&typeof e==`object`&&`token`in e))return e.map(e=>e.token).join(``);if(Ee(e)){let t=De(e);if(t)return t}try{return JSON.stringify(e)}catch{return String(e)}}var ke=_(`<span class="fallback svelte-1auy4sh"> </span>`),Ae=_(`<div class="run-value svelte-1auy4sh"></div>`);function je(e,t){g(t,!0);let r=d(null),a=d(!1),c=n(()=>{try{return z({api_url:t.root,name:t.component.type,id:t.component.component_class_id,variant:`example`})}catch{return null}});w(()=>{P(a,!x(c)?.component)}),w(()=>{let e=x(r);if(!e||!x(c)?.component)return;let n=!1,o;
2return Promise.all([x(c).component,x(c).runtime]).then(([r,s])=>{if(n)return;let c=Array.isArray(t.component.props.choices)?t.component.props.choices:(t.component.type===`dropdown`||t.component.type===`radio`)&&t.value!=null?(Array.isArray(t.value)?t.value:[t.value]).map(e=>[String(e),e]):void 0,l={...t.component.props,...c?{choices:c}:{},value:Oe(t.component.type,t.value),type:`table`,selected:!1,root:t.root,samples_dir:`${t.root}/file=`};o=s?s.mount(r.default,{target:e,props:l}):i(r.default,{target:e,props:l}),requestAnimationFrame(()=>{n||e.children.length===0&&!e.textContent?.trim()&&P(a,!0)})}).catch(()=>{n||P(a,!0)}),()=>{n=!0,o&&(x(c)?.runtime?x(c).runtime.unmount(o):O(o))}});var l=y(),u=S(l),m=e=>{var n=ke(),r=L(n,!0);v(n),T((e,t)=>{F(n,`title`,e),s(r,t)},[()=>$(t.value),()=>$(t.value)]),o(e,n)},h=e=>{var t=Ae();N(t,e=>P(r,e),()=>x(r)),o(e,t)};f(u,e=>{x(a)?e(m):e(h,-1)}),o(e,l),p()}var Me=_(`<button class="clear svelte-e6s3iw">Clear history</button>`),Ne=_(`<section class="empty svelte-e6s3iw"><h2 class="svelte-e6s3iw">No runs yet</h2> <p class="svelte-e6s3iw">Use the app, then return here to load previous runs.</p></section>`),Pe=_(`<span class="fallback svelte-e6s3iw"> </span>
2`),Fe=_(`<div class="example-cell svelte-e6s3iw"><span class="value-label svelte-e6s3iw"> </span> <!></div>`),Ie=_(`<div class="empty-output svelte-e6s3iw">No saved output</div>`),Le=_(`<span><button type="button" class="error-trigger svelte-e6s3iw"> </button> <span class="error-bubble svelte-e6s3iw" aria-hidden="true"> </span> <span class="visually-hidden svelte-e6s3iw"> </span></span>`),Re=_(`<span class="duration svelte-e6s3iw"> </span>`),ze=_(`<article class="run svelte-e6s3iw"><section class="run-values svelte-e6s3iw"><h3 class="svelte-e6s3iw">Inputs</h3> <!></section> <section class="run-values svelte-e6s3iw"><h3 class="svelte-e6s3iw">Outputs</h3> <!></section> <footer class="metadata svelte-e6s3iw"><span><span class="dot svelte-e6s3iw" aria-hidden="true"></span> <!> <!></span> <span class="separator svelte-e6s3iw" aria-hidden="true">·</span> <time> </time> <div class="actions svelte-e6s3iw"><button class="load svelte-e6s3iw"><span class="play svelte-e6s3iw" aria-hidden="true">â¶</span> Load run</button> <button class="delete svelte-e6s3iw">Delete</button></div></footer></article>`),Be=_(`<section class="group svelte-e6s3iw"><header class="group-header svelte-e6s3iw"><code class="svelte-e6s3iw"> </code> <span class="count svelte-e6s3iw"> </span></header> <div class="table-header svelte-e6s3iw" aria-hidden="true"><span>
2Inputs</span><span>Outputs</span></div> <!></section>`),Ve=_(`<main class="history-page svelte-e6s3iw" data-testid="run-history"><header class="page-header svelte-e6s3iw"><div class="title-line svelte-e6s3iw"><h1 class="svelte-e6s3iw"> </h1> <div class="storage-copy svelte-e6s3iw"><span>saved in</span> <span><code class="storage-code svelte-e6s3iw">Local Storage</code>, privately in this 3 browser.</span></div></div> <!></header> <!> <!></main>`);function He(i,c){g(c,!0);let h=()=>l(de,`$_`,_),[_,ee]=a(),ne=k(c,`footer_links`,19,()=>[]),C=n(()=>new URL(c.root,window.location.href).href),w=d(u([])),O=n(()=>{let e=new Map;for(let t of x(w)){let n=e.get(t.api_name)||[];n.push(t),e.set(t.api_name,n)}return Array.from(e.entries())});function j(){P(w,te(c.scope),!0)}E(()=>(`parentIFrame`in window&&window.parentIFrame?.scrollTo(0,0),j(),re(j)));function se(e){return Array.isArray(e)?e:e&&typeof e==`object`?Object.values(e):e==null?[]:[e]}function N(e,t){let n=e?.props?.label;return typeof n==`string`&&n?n:e?.type||`Value ${t+1}`}function le(e,t){return e.map((e,n)=>({value:e,meta:t?.[n]??null,index:n})).filter(e=>e.meta?.type!==`state`)}function ue(e){return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e))}function R(e){if(e<1)return`<1ms`;if(e<1e3)return`${Math.round(e)}ms`;if(e<1e4)return`${(e/1e3).toFixed(2)}s`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.round(e/1e3);return`${Math.floor(t/60)}m ${t%60}s`}function z(e){let t=[`Ran in ${R(e.duration_ms??0)}`];if(e.queued_ms&&t.push(`queued for ${R(e.queued_ms)}`),e.completed_at){let n=Date.parse(e.completed_at)-Date.parse(e.started_at);n>0&&t.push(`${R(n)} in total`)}return t.join(` · `)}function fe(e){return e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Running`}let B=d(null);function pe(e){P(B,x(B)===e?null:e,!0)}function V(e){if(e.key!==`Escape`)return;P(B,null);let t=document.activeElement;t instanceof HTMLElement&&t.matches(`.error-trigger`)&&t.blur()}function H(e){oe(c.scope,e);let t=new URL(c.root,window.location.href),n=new URL(e.page||t.pathname,t);n.origin!==t.origin&&(n=t),window.location.assign(n)}function me(){window.confirm(`Clear all saved runs for this app?`)&&(ae(c.scope),j())}function he(e){window.confirm(`Delete this saved run?`)&&(A(c.scope,e.id),j())}var U=Ve();D(`keydown`,ce,V);var W=L(U),G=L(W),K=L(G),q=L(K);v(K),b(2),v(G);var J=I(G,2),ge=e=>{var t=Me();M(`click`,t,me),o(e,t)};f(J,e=>{x(w).length&&e(ge)}),v(W);var Y=I(W,2),X=e=>{o(e,Ne())},Z=i=>{var a=y();r(S(a),17,()=>x(O),m,(i,a)=>{var l=n(()=>t(x(a),2));let u=()=>x(l)[0],d=()=>x(l)[1];var p=Be(),m=L(p),h=L(m),g=L(h,!0);v(h);var _=I(h,2),b=L(_);
3v(_),v(m),r(I(m,4),17,d,e=>e.id,(t,i)=>{let a=n(()=>le(se(x(i).inputs),x(i).input_components)),l=n(()=>le(se(x(i).outputs),x(i).output_components));var u=ze(),d=L(u);r(I(L(d),2),17,()=>x(a),e=>e.index,(e,t)=>{var n=Fe(),r=L(n),i=L(r,!0);v(r);var a=I(r,2),l=e=>{je(e,{get component(){return x(t).meta},get value(){return x(t).value},get root(){return c.root}})},u=e=>{var n=Pe(),r=L(n,!0);v(n),T((e,t)=>{F(n,`title`,e),s(r,t)},[()=>$(x(t).value),()=>$(x(t).value)]),o(e,n)};f(a,e=>{x(t).meta?e(l):e(u,-1)}),v(n),T(e=>s(i,e),[()=>N(x(t).meta,x(t).index)]),o(e,n)}),v(d);var p=I(d,2),m=I(L(p),2),h=e=>{var t=y();r(S(t),17,()=>x(l),e=>e.index,(e,t)=>{var n=Fe(),r=L(n),i=L(r,!0);v(r);var a=I(r,2),l=e=>{je(e,{get component(){return x(t).meta},get value(){return x(t).value},get root(){return c.root}})},u=e=>{var n=Pe(),r=L(n,!0);v(n),T((e,t)=>{F(n,`title`,e),s(r,t)},[()=>$(x(t).value),()=>$(x(t).value)]),o(e,n)};f(a,e=>{x(t).meta?e(l):e(u,-1)}),v(n),T(e=>s(i,e),[()=>N(x(t).meta,x(t).index)]),o(e,n)}),o(e,t)},g=e=>{o(e,Ie())};f(m,e=>{x(l).length?e(h):e(g,-1)}),v(p);var _=I(p,2),b=L(_);let ee;var te=I(L(b),2),ne=e=>{var t=Le();let n;var r=L(t),a=L(r,!0);v(r);var c=I(r,2),l=L(c,!0);v(c);var u=I(c,2),d=L(u);v(u),v(t),T(e=>{n=ie(t,1,`error-anchor svelte-e6s3iw`,null,n,{open:x(B)===x(i).id}),s(a,e),s(l,x(i).error),s(d,`: ${x(i).error??``}`)},[()=>fe(x(i))]),M(`click`,r,()=>pe(x(i).id)),o(e,t)},C=t=>{var n=e();T(e=>s(n,e),[()=>fe(x(i))]),o(t,n)};f(te,e=>{x(i).error?e(ne):e(C,-1)});var w=I(te,2),re=e=>{var t=Re(),n=L(t);v(t),T((e,r)=>{F(t,`title`,e),s(n,`in ${r??``}`)},[()=>z(x(i)),()=>R(x(i).duration_ms)]),o(e,t)};f(w,e=>{x(i).duration_ms!==void 0&&e(re)}),v(b);var E=I(b,4),ae=L(E,!0);v(E);var D=I(E,2),O=L(D),k=I(O,2);v(D),v(_),v(u),T(e=>{ee=ie(b,1,`status svelte-e6s3iw`,null,ee,{completed:x(i).status===`completed`,failed:x(i).status===`failed`,running:x(i).status===`running`}),F(E,`datetime`,x(i).started_at),s(ae,e)},[()=>ue(x(i).started_at)]),M(`click`,O,()=>H(x(i))),M(`click`,k,()=>he(x(i))),o(t,u)}),v(p),T(()=>{s(g,u()),s(b,`${d().length??``} 4 ${d().length===1?`run`:`runs`}`)}),o(i,p)}),o(i,a)};f(Y,e=>{x(O).length===0?e(X):e(Z,-1)}),Te(I(Y,2),{get app_url(){return x(C)},get footer_links(){return ne()},get i18n(){return h()}}),v(U),T(()=>s(q,`Run history (${x(w).length??``})`)),o(i,U),p(),ee()}C([`click`]);var Ue=-1;function We(){let e=h({}),t=new Map,n=new IntersectionObserver(n=>{n.forEach(n=>{if(n.isIntersecting){let r=t.get(n.target);r!==void 0&&e.update(e=>({...e,[r]:!0}))}})});function r(e,r){t.set(r,e),n.observe(r)}return{register:r,subscribe:e.subscribe}}var Ge=We(),Ke=_(`<p>If your custom component never loads, consult the 5 troubleshooting <a style="color: blue;" href="https://www.gradio.app/guides/frequently-asked-questions#the-development-server-didnt-work-for-me" class="svelte-15izthb">guide</a>.</p>`),qe=_(`<div class="load-text"><!></div>`),Je=_(`<p class="svelte-15izthb">Please <a class="svelte-15izthb">contact the author of the space</a> to let them know.</p>`),Ye=_(`<p class="svelte-15izthb"> </p>`),Xe=_(`<div class="error svelte-15izthb"><p class="svelte-15izthb"><strong> </strong></p> <!></div>`),Ze=_(`<!> <!>`,1);function Qe(e,t){g(t,!0);let r=()=>l(Ge,`$intersecting`,m),i=()=>l(de,`$_`,m),[m,h]=a(),_=d(!1);pe().then(()=>{P(_,!0)});let te=k(t,`theme_mode`,3,`system`),C,re=d(u([])),ie=d(``),ae=d(``),D=Ue++,O=d(void 0),A=d(!1),oe=d(!1),M=d(void 0),N=d(`Loading...`),ce=d(`system`),z=d(``),V=d(!1);w(()=>{x(M)?.app_id&&x(M).app_id});let H=null;async function me(e){e&&(H||(H=document.createElement(`style`),document.head.appendChild(H)),H.textContent=B(e,t.version,H)),await fe(le(x(M).root,`/theme.css?v=${x(M).theme_hash}`).toString(),document.head),x(M).stylesheets&&await Promise.all(x(M).stylesheets.map(e=>e.startsWith(`http:`)||e.startsWith(`https:`)?fe(e,document.head):fetch(le(x(M).root,e).toString()).then(e=>e.text()).then(e=>{B(e,t.version)})))}async function he(e){if(e){let t=new DOMParser,n=Array.from(t.parseFromString(e,`text/html`).head.children);if(n)for(let e of n){let t=document.createElement(e.tagName);if(t.tagName===`SCRIPT`&&(t.async=!1),Array.from(e.attributes).forEac
5h(e=>{t.setAttribute(e.name,e.value)}),t.textContent=e.textContent,t.tagName==`META`){let e=t.getAttribute(`property`),n=t.getAttribute(`name`);if(e||n){let r=Array.from(document.head.getElementsByTagName(`meta`)??[]).find(r=>e&&r.getAttribute(`property`)===e||n&&r.getAttribute(`name`)===n?!r.isEqualNode(t):!1);if(r){document.head.replaceChild(t,r);continue}}}document.head.appendChild(t)}}}function U(e){let t=window.__gradio_mode__===`website`,n;if(t)n=`light`;else{let e=new URL(window.location.toString()).searchParams.get(`__theme`);n=te()||e||`system`}return n===`dark`||n===`light`?G(e,n):n=W(e),n}function W(e){let t=n();window?.matchMedia(`(prefers-color-scheme: dark)`)?.addEventListener(`change`,n);function n(){let t=window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;return G(e,t),t}return t}function G(e,n){let r=t.is_embed?e.parentElement:document.body,i=t.is_embed?e:e.parentElement;i.style.background=`var(--body-background-fill)`,n===`dark`?r.classList.add(`dark`):r.classList.remove(`dark`)}let K=d(u({message:``,load_status:`pending`,status:`sleeping`,detail:`SLEEPING`})),q=d(void 0),J=d(!1);function ge(e){P(K,e,!0)}let Y=window.__GRADIO_DEV__,X=d(!1),Z=d(void 0);w(()=>{x(Z)&&x(X)&&(x(Z)(`Error`,`Deep link was not valid`,-1,`error`,10,!0),P(X,!1))});let _e=d(0);E(async()=>{if(!x(O))return;P(ce,U(x(O)),!0),P(V,window.location.pathname.replace(/\/$/,``).endsWith(`/gradio_api/runs`),!0);let e=window.__GRADIO__SERVER_PORT__,n=x(V)?window.location.pathname.replace(/gradio_api\/runs\/?$/,``):window.location.pathname;P(z,Y===`dev`?`http://localhost:${typeof e==`number`?e:7860}`:t.space||t.src||new URL(n,location.origin).href.replace(/\/$/,``),!0);let r=new URLSearchParams(window.location.search).get(`deep_link`),i={};if(r&&(i.deep_link=r),P(q,await t.Client.connect(x(z),{status_callback:ge,with_null_state:!0,events:[`data`,`log`,`status`,`render`],query_params:i}),!0),window.addEventListener(`beforeunload`,()=>{x(q).close()}),!x(q).config&&!x(M)?.auth_required)throw Error(`Could not resolve app config`);if(P(M,x(q).get_url_config(),!0),se(x(M)),window.__gradio_space__=x(M).space_id,x(q).config?.i18n_translations&&(await pe(x(q).config.i18n_translations),P(_,!0)),window.__gradio_session_hash__=x(q).session_hash,P(K,{message:``,load_status:`complete`,status:`running`,detail:`RUNNING`},!0),await me(x(M).css),await he(x(M).head),P(J,!0),window.__is_colab__=x(M).is_colab,t.onloaded?.(),P(re,x(M).pages,!0),P(ie,x(M).current_page,!0),P(ae,x(M).root,!0),x(M).deep_link_state===`invalid`&&P(X,!0),x(M).js)try{let e=document.createElement(`script`);e.textContent=x(M).js,document.head.appendChild(e)}catch(e){console.error(`Error executing custom JS:`,e)}x(M).dev_mode&&setTimeout(()=>{let{host:e}=new URL(x(z)),n=new URL(`${window.location.protocol}//${e}${x(q).api_prefix}/dev/reload`);C=new EventSource(n),C.addEventListener(`error`,async e=>{let t=e.data;t&&(x(Z)(`Error`,`Error reloading app`,-1,`error`,10,!0),console.error(JSON.parse(t)))}),C.addEventListener(`reload`,async e=>{try{let e=await x(q).refresh();await me(e.css),await he(e.head),P(M,e,!0),window.__gradio_space__=x(M).space_id,P(J,!0),window.__is_colab__=x(M).is_colab,P(_e,x(_e)+1),t.onloaded?.()}catch(e){x(Z)(`Error`,`Error reloading app`,-1,`error`,10,!0),console.error(`Error reloading app:`,e)}})},200)});let ve=n(()=>x(V)?x(K).load_status:!x(A)&&x(K).load_status!==`error`?`pending`:!x(A)&&x(K).load_status===`error`?`error`:x(K).load_status);w(()=>{x(M)&&(t.eager||r()[D])&&we()});let ye=d(void 0),be=d(void 0);async function Se(){P(ye,(await ne(async()=>{let{default:e}=await import(`./Blocks-DDFr0Niq.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url)).default,!0)}async function Ce(){P(be,(await ne(async()=>{let{default:e}=await import(`./Login-DswHWqbB.js`);return{default:e}},__vite__mapDeps([18,1,2,3,4,5,6,7,12,13,14,19,20,21,22,23,24,25,26,11,15,16,27,28,29,30,31,32,33,34]),import.meta.url)).default,!0)}function we(){x(M).auth_required?Ce():Se()}let Te=d(void 0);w(()=>{x(_)&&(P(N,i()(`common.loading`)+`...`),P(Te,{readable_error:{NO_APP_FILE:i()(`errors.no_app_file`),CONFIG_ERROR:i()(`errors.config_error`),BUILD_ERROR:i()(`errors.build_error`),RUNTIME_ERROR:i()(`errors.runtime_error`),PAUSED:i()(`errors.space_paused`)},title(e){return encodeURIComponent(i()(`errors.space_not_working`))},description(e,t){return encodeURIComponent(`Hello,\n\nFirstly, thanks for creating this space!\n\nI noticed that the space isn't working correctly because there is ${this.readable_error[e]||`an error`}.\n\nIt would be great if you could take a look at this because this space is being embedded on ${t}.\n\nThanks!`)}},!0))}),E(async()=>{x(O)&&Ge.register(D,x(O))}),w(()=>{x(oe)&&x(O)&&x(O).dispatchEvent(new CustomEvent(`render`,{bubbles:!0,cancelable:!1,
5composed:!0}))}),w(()=>{x(q)?.config&&Ee(x(q)?.config?.space_id,t.is_embed)});let Q;async function Ee(e,t){if(e&&!t&&window.self===window.top){Q&&=(Q.remove(),void 0);let t=await xe(e);t&&(Q=t.element)}}j(()=>{Q?.remove()});{let r=n(()=>t.container&&t.is_embed),a=n(()=>!!t.space&&t.info),l=n(()=>x(ve)===`complete`),u=n(()=>x(M)?.fill_width||!1),d=n(()=>x(M)?.components||[]);R(e,{get display(){return x(r)},get is_embed(){return t.is_embed},get info(){return x(a)},get version(){return t.version},get initial_height(){return t.initial_height},get space(){return t.space},get loaded(){return x(l)},get fill_width(){return x(u)},get pages(){return x(re)},get current_page(){return x(ie)},get root(){return x(ae)},get components(){return x(d)},get wrapper(){return x(O)},set wrapper(e){P(O,e,!0)},children:(e,r)=>{var a=y(),l=S(a),u=e=>{var r=Ze(),a=S(r),l=e=>{{let r=e=>{var t=qe(),n=L(t),r=e=>{o(e,Ke())};f(n,e=>{Y===`dev`&&e(r)}),v(t),o(e,t)},a=e=>{var n=Xe(),r=L(n),a=L(r),c=L(a,!0);v(a),v(r);var l=I(r,2),u=e=>{var n=Je(),r=I(L(n));b(),v(n),T((e,n)=>F(r,`href`,`https://huggingface.co/spaces/${t.space??``}/discussions/new?title=${e??``}&description=${n??``}`),[()=>x(Te).title(x(K)?.detail),()=>x(Te).description(x(K)?.detail,location.origin)]),o(e,n)},d=e=>{var t=Ye(),n=L(t,!0);v(t),T(e=>s(n,e),[()=>i()(`errors.contact_page_author`)]),o(e,t)};f(l,e=>{(x(K).status===`space_error`||x(K).status===`paused`)&&x(K).discussions_enabled&&x(Te)?e(u):x(_)&&e(d,1)}),v(n),T(()=>s(c,x(K)?.message||``)),o(e,n)},c=n(()=>!t.is_embed);ue(e,{get absolute(){return x(c)},get status(){return x(ve)},timer:!1,queue_position:null,queue_size:null,translucent:!0,get loading_text(){return x(N)},get i18n(){return i()},get autoscroll(){return t.autoscroll},additional_loading_text:r,error_details:a,$$slots:{additional_loading_text:!0,error_details:!0}})}};f(a,e=>{!x(V)&&(x(ve)===`pending`||x(ve)===`error`)&&!(x(M)&&x(M)?.auth_required)&&e(l)}
5);var u=I(a,2),d=e=>{var r=y(),a=S(r);{let e=n(()=>x(_)?i():e=>e);c(a,()=>x(be),(n,r)=>{r(n,{get auth_message(){return x(M).auth_message},get root(){return x(M).root},get space_id(){return t.space},get i18n(){return x(e)},get app_mode(){return t.app_mode}})})}o(e,r)},p=e=>{He(e,{get root(){return x(z)},get scope(){return x(M)},get footer_links(){return x(M).footer_links}})},m=e=>{var r=y(),i=S(r);{let e=n(()=>!t.is_embed&&!!x(M).fill_height),r=n(()=>t.is_embed?[]:x(M).footer_links),a=n(()=>x(M).api_prefix||``);c(i,()=>x(ye),(n,i)=>{i(n,ee({get app(){return x(q)}},()=>x(M),{get fill_height(){return x(e)},get theme_mode(){return x(ce)},get control_page_title(){return t.control_page_title},get target(){return x(O)},get autoscroll(){return t.autoscroll},get footer_links(){return x(r)},get app_mode(){return t.app_mode},vibe_mode:!1,get version(){return t.version},get api_prefix(){return x(a)},get max_file_size(){return x(M).max_file_size},initial_layout:void 0,search_params:new URLSearchParams(window.location.search),get reload_count(){return x(_e)},get ready(){return x(A)},set ready(e){P(A,e,!0)},get render_complete(){return x(oe)},set render_complete(e){P(oe,e,!0)},get add_new_message(){return x(Z)},set add_new_message(e){P(Z,e,!0)}}))})}o(e,r)};f(u,e=>{x(M)?.auth_required&&x(be)?e(d):x(M)&&x(J)&&x(V)?e(p,1):x(M)&&x(ye)&&x(J)&&e(m,2)}),o(e,r)};f(l,e=>{x(_)&&e(u)}),o(e,a)},$$slots:{default:!0}})}p(),h()}export{Qe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.