stat_ui / _app /immutable /nodes /2.CUyl0Enf.js
Hanzo03's picture
final commit
2f3061f
import"../chunks/DsnmJJEf.js";import{i as at}from"../chunks/Br_YijRw.js";import{o as rt,e as ct,s as lt}from"../chunks/KGbO_R4I.js";import{T as ut,V as dt,v as Be,W as pt,h as ht,k as te,X as ft,O as _t,Y as gt,Z as mt,J as wt,K as vt,y,I as ne,P as yt,S as W,Q as K,_ as E,$ as se,a0 as bt,R as Z,a1 as kt,a2 as fe,C as Et,F as $t}from"../chunks/0b4uXBGw.js";import{_ as Ae,i as Oe}from"../chunks/plSl5CzO.js";import{r as xt}from"../chunks/CRp_cMZk.js";function je(e,n,t=n){var s=new WeakSet;ut(e,"input",async i=>{var o=i?e.defaultValue:e.value;if(o=_e(e)?ge(o):o,t(o),te!==null&&s.add(te),await dt(),o!==(o=n())){var a=e.selectionStart,r=e.selectionEnd,l=e.value.length;if(e.value=o??"",r!==null){var u=e.value.length;a===r&&r===l&&u>l?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=a,e.selectionEnd=Math.min(r,u))}}}),(ht&&e.defaultValue!==e.value||Be(n)==null&&e.value)&&(t(_e(e)?ge(e.value):e.value),te!==null&&s.add(te)),pt(()=>{var i=n();if(e===document.activeElement){var o=ft??te;if(s.has(o))return}_e(e)&&i===ge(e.value)||e.type==="date"&&!i&&!e.value||i!==e.value&&(e.value=i??"")})}function _e(e){var n=e.type;return n==="number"||n==="range"}function ge(e){return e===""?null:+e}function St(e){return function(...n){var t=n[0];return t.preventDefault(),e?.apply(this,n)}}var Pt=Object.defineProperty,Fe=e=>{throw TypeError(e)},Tt=(e,n,t)=>n in e?Pt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,p=(e,n,t)=>Tt(e,typeof n!="symbol"?n+"":n,t),Ge=(e,n,t)=>n.has(e)||Fe("Cannot "+t),ie=(e,n,t)=>(Ge(e,n,"read from private field"),n.get(e)),Ct=(e,n,t)=>n.has(e)?Fe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),At=(e,n,t,s)=>(Ge(e,n,"write to private field"),n.set(e,t),t);const Ot="host",Je="queue/data",jt="queue/join",De="upload",Dt="login",ce="config",qt="info",zt="runtime",It="sleeptime",Nt="heartbeat",Lt="component_server",Rt="reset",Ut="cancel",Bt="app_id",Me="This application is currently busy. Please try again. ",ae="Connection errored out. ",M="Could not resolve app config. ",Ft="Could not get space status. ",Gt="Could not get API info. ",be="Space metadata could not be loaded. ",Jt="Invalid URL. A full URL path is required.",Mt="Not authorized to access this space. ",We="Invalid credentials. Could not login. ",Wt="Login credentials are required to access this space.",Ht="File system access is only available in Node.js environments",He="Root URL not found in client config",Vt="Error uploading file";async function qe(e,n,t){try{return(await(await fetch(`https://huggingface.co/api/spaces/${e}/jwt`,{headers:{Authorization:`Bearer ${n}`,...t?{Cookie:t}:{}}})).json()).token||!1}catch{return!1}}function Kt(e){let n={};return e.forEach(({api_name:t,id:s})=>{t&&(n[t]=s)}),n}async function Zt(e){const n=this.options.token?{Authorization:`Bearer ${this.options.token}`}:{};if(n["Content-Type"]="application/json",typeof window<"u"&&window.gradio_config&&location.origin!=="http://localhost:9876"){if(window.gradio_config.current_page&&(e=e.substring(0,e.lastIndexOf("/"))),window.gradio_config.dev_mode){let t=we(e,this.deep_link?ce+"?deep_link="+this.deep_link:ce);const s=await this.fetch(t,{headers:n,credentials:"include"}),i=await ze(s,e,!!this.options.auth);window.gradio_config={...i,current_page:window.gradio_config.current_page}}return window.gradio_config.root=e,{...window.gradio_config}}else if(e){let t=we(e,this.deep_link?ce+"?deep_link="+this.deep_link:ce);const s=await this.fetch(t,{headers:n,credentials:"include"});return ze(s,e,!!this.options.auth)}throw new Error(M)}async function ze(e,n,t){var s,i;if(e?.status===401&&!t){const o=await e.json(),a=(s=o?.detail)==null?void 0:s.auth_message;throw new Error(a||Wt)}else if(e?.status===401&&t)throw new Error(We);if(e?.status===200){let o=await e.json();return o.root=n,(i=o.dependencies)==null||i.forEach((a,r)=>{a.id===void 0&&(a.id=r)}),o}else if(e?.status===401)throw new Error(Mt);throw new Error(M)}async function Qt(){const{http_protocol:e,host:n}=await Ee(this.app_reference,this.options.token);try{if(this.options.auth){const t=await Ve(e,n,this.options.auth,this.fetch,this.options.token);t&&this.set_cookies(t)}}catch(t){throw Error(t.message)}}async function Ve(e,n,t,s,i){const o=new FormData;o.append("username",t?.[0]),o.append("password",t?.[1]);let a={};i&&(a.Authorization=`Bearer ${i}`);const r=await s(`${e}//${n}/${Dt}`,{headers:a,method:"POST",body:o,credentials:"include"});if(r.status===200)return r.headers.get("set-cookie");throw r.status===401?new Error(We):new Error(be)}function me(e){if(e.startsWith("http")){const{protocol:n,host:t,pathname:s}=new URL(e);return{ws_protocol:n==="https:"?"wss":"ws",http_protocol:n,host:t+(s!=="/"?s:"")}}return{ws_protocol:"wss",http_protocol:"https:",host:new URL(e).host}}const Ke=e=>{let n=[];return e.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach(t=>{const[s,i]=t.split(";")[0].split("=");s&&i&&n.push(`${s.trim()}=${i.trim()}`)}),n},ke=/^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/,Yt=/.*hf\.space\/{0,1}.*$/;async function Ee(e,n){const t={};n&&(t.Authorization=`Bearer ${n}`);const s=e.trim().replace(/\/$/,"");if(ke.test(s))try{const i=(await(await fetch(`https://huggingface.co/api/spaces/${s}/${Ot}`,{headers:t})).json()).host;return{space_id:e,...me(i)}}catch{throw new Error(be)}if(Yt.test(s)){const{ws_protocol:i,http_protocol:o,host:a}=me(s);return{space_id:a.split("/")[0].replace(".hf.space",""),ws_protocol:i,http_protocol:o,host:a}}return{space_id:!1,...me(s)}}const we=(...e)=>{try{return e.reduce((n,t)=>(n=n.replace(/\/+$/,""),t=t.replace(/^\/+/,""),new URL(t,n+"/").toString()))}catch{throw new Error(Jt)}};function Xt(e,n,t){const s={named_endpoints:{},unnamed_endpoints:{}};return Object.keys(e).forEach(i=>{(i==="named_endpoints"||i==="unnamed_endpoints")&&(s[i]={},Object.entries(e[i]).forEach(([o,{parameters:a,returns:r}])=>{var l,u,_,d;const h=((l=n.dependencies.find(c=>c.api_name===o||c.api_name===o.replace("/","")))==null?void 0:l.id)||t[o.replace("/","")]||-1,k=h!==-1?(u=n.dependencies.find(c=>c.id==h))==null?void 0:u.types:{generator:!1,cancel:!1};if(h!==-1&&((d=(_=n.dependencies.find(c=>c.id==h))==null?void 0:_.inputs)==null?void 0:d.length)!==a.length){const c=n.dependencies.find(f=>f.id==h).inputs.map(f=>{var x;return(x=n.components.find(T=>T.id===f))==null?void 0:x.type});try{c.forEach((f,x)=>{if(f==="state"){const T={component:"state",example:null,parameter_default:null,parameter_has_default:!0,parameter_name:null,hidden:!0};a.splice(x,0,T)}})}catch(f){console.error(f)}}const N=(c,f,x,T)=>({...c,description:tn(c?.type,x),type:en(c?.type,f,x,T)||""});s[i][o]={parameters:a.map(c=>N(c,c?.component,c?.serializer,"parameter")),returns:r.map(c=>N(c,c?.component,c?.serializer,"return")),type:k}}))}),s}function en(e,n,t,s){if(n==="Api")return e.type;switch(e?.type){case"string":return"string";case"boolean":return"boolean";case"number":return"number"}if(t==="JSONSerializable"||t==="StringSerializable")return"any";if(t==="ListStringSerializable")return"string[]";if(n==="Image")return s==="parameter"?"Blob | File | Buffer":"string";if(t==="FileSerializable")return e?.type==="array"?s==="parameter"?"(Blob | File | Buffer)[]":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]":s==="parameter"?"Blob | File | Buffer":"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";if(t==="GallerySerializable")return s==="parameter"?"[(Blob | File | Buffer), (string | null)][]":"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]"}function tn(e,n){return n==="GallerySerializable"?"array of [file, label] tuples":n==="ListStringSerializable"?"array of strings":n==="FileSerializable"?"array of files or single file":e?.description}function Ie(e,n){switch(e.msg){case"send_data":return{type:"data"};case"send_hash":return{type:"hash"};case"queue_full":return{type:"update",status:{queue:!0,message:Me,stage:"error",code:e.code,success:e.success}};case"heartbeat":return{type:"heartbeat"};case"unexpected_error":return{type:"unexpected_error",status:{queue:!0,message:e.message,session_not_found:e.session_not_found,stage:"error",success:!1}};case"broken_connection":return{type:"broken_connection",status:{queue:!0,message:e.message,stage:"error",success:!1}};case"estimation":return{type:"update",status:{queue:!0,stage:n||"pending",code:e.code,size:e.queue_size,position:e.rank,eta:e.rank_eta,success:e.success}};case"progress":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,progress_data:e.progress_data,success:e.success}};case"log":return{type:"log",data:e};case"process_generating":return{type:"generating",status:{queue:!0,message:e.success?null:e.output.error,stage:e.success?"generating":"error",code:e.code,progress_data:e.progress_data,eta:e.average_duration,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_streaming":return{type:"streaming",status:{queue:!0,message:e.output.error,stage:"streaming",time_limit:e.time_limit,code:e.code,progress_data:e.progress_data,eta:e.eta},data:e.output};case"process_completed":return"error"in e.output?{type:"update",status:{queue:!0,title:e.output.title,message:e.output.error,visible:e.output.visible,duration:e.output.duration,stage:"error",code:e.code,success:e.success}}:{type:"complete",status:{queue:!0,message:e.success?void 0:e.output.error,stage:e.success?"complete":"error",code:e.code,progress_data:e.progress_data,changed_state_ids:e.success?e.output.changed_state_ids:void 0},data:e.success?e.output:null};case"process_starts":return{type:"update",status:{queue:!0,stage:"pending",code:e.code,size:e.rank,position:0,success:e.success,eta:e.eta},original_msg:"process_starts"}}return{type:"none",status:{stage:"error",queue:!0}}}const nn=(e=[],n)=>{const t=n?n.parameters:[];if(Array.isArray(e))return n&&t.length>0&&e.length>t.length&&console.warn("Too many arguments provided for the endpoint."),e;const s=[],i=Object.keys(e);return t.forEach((o,a)=>{if(e.hasOwnProperty(o.parameter_name))s[a]=e[o.parameter_name];else if(o.parameter_has_default)s[a]=o.parameter_default;else throw new Error(`No value provided for required parameter: ${o.parameter_name}`)}),i.forEach(o=>{if(!t.some(a=>a.parameter_name===o))throw new Error(`Parameter \`${o}\` is not a valid keyword argument. Please refer to the API for usage.`)}),s.forEach((o,a)=>{if(o===void 0&&!t[a].parameter_has_default)throw new Error(`No value provided for required parameter: ${t[a].parameter_name}`)}),s};async function sn(){if(this.api_info)return this.api_info;const{token:e}=this.options,{config:n}=this,t={"Content-Type":"application/json"};if(e&&(t.Authorization=`Bearer ${e}`),!!n)try{let s,i;if(typeof window<"u"&&window.gradio_api_info)i=window.gradio_api_info;else{const o=we(n.root,this.api_prefix,qt);if(s=await this.fetch(o,{headers:t,credentials:"include"}),!s.ok)throw new Error(ae);i=await s.json()}return"api"in i&&(i=i.api),i.named_endpoints["/predict"]&&!i.unnamed_endpoints[0]&&(i.unnamed_endpoints[0]=i.named_endpoints["/predict"]),Xt(i,n,this.api_map)}catch(s){throw new Error("Could not get API info. "+s.message)}}async function on(e,n,t){var s;const i={};(s=this==null?void 0:this.options)!=null&&s.token&&(i.Authorization=`Bearer ${this.options.token}`);const o=1e3,a=[];let r;for(let l=0;l<n.length;l+=o){const u=n.slice(l,l+o),_=new FormData;u.forEach(h=>{_.append("files",h)});try{const h=t?`${e}${this.api_prefix}/${De}?upload_id=${t}`:`${e}${this.api_prefix}/${De}`;r=await this.fetch(h,{method:"POST",body:_,headers:i,credentials:"include"})}catch(h){throw new Error(ae+h.message)}if(!r.ok){const h=await r.text();return{error:`HTTP ${r.status}: ${h}`}}const d=await r.json();d&&a.push(...d)}return{files:a}}async function an(e,n,t,s){let i=(Array.isArray(e)?e:[e]).map(a=>a.blob);const o=i.filter(a=>a.size>(s??1/0));if(o.length)throw new Error(`File size exceeds the maximum allowed size of ${s} bytes: ${o.map(a=>a.name).join(", ")}`);return await Promise.all(await this.upload_files(n,i,t).then(async a=>{if(a.error)throw new Error(a.error);return a.files?a.files.map((r,l)=>new $e({...e[l],path:r,url:`${n}${this.api_prefix}/file=${r}`})):[]}))}class $e{constructor({path:n,url:t,orig_name:s,size:i,blob:o,is_stream:a,mime_type:r,alt_text:l,b64:u}){p(this,"path"),p(this,"url"),p(this,"orig_name"),p(this,"size"),p(this,"blob"),p(this,"is_stream"),p(this,"mime_type"),p(this,"alt_text"),p(this,"b64"),p(this,"meta",{_type:"gradio.FileData"}),this.path=n,this.url=t,this.orig_name=s,this.size=i,this.blob=t?void 0:o,this.is_stream=a,this.mime_type=r,this.alt_text=l,this.b64=u}}class rn{constructor(n,t){p(this,"type"),p(this,"command"),p(this,"meta"),p(this,"fileData"),this.type="command",this.command=n,this.meta=t}}typeof process<"u"&&process.versions&&process.versions.node;function Ne(e,n,t){for(;t.length>1;){const i=t.shift();if(typeof i=="string"||typeof i=="number")e=e[i];else throw new Error("Invalid key type")}const s=t.shift();if(typeof s=="string"||typeof s=="number")e[s]=n;else throw new Error("Invalid key type")}async function ve(e,n=void 0,t=[],s=!1,i=void 0){if(Array.isArray(e)){let o=[];return await Promise.all(e.map(async(a,r)=>{var l;let u=t.slice();u.push(String(r));const _=await ve(e[r],s?((l=i?.parameters[r])==null?void 0:l.component)||void 0:n,u,!1,i);o=o.concat(_)})),o}else{if(globalThis.Buffer&&e instanceof globalThis.Buffer||e instanceof Blob)return[{path:t,blob:new Blob([e]),type:n}];if(typeof e=="object"&&e!==null){let o=[];for(const a of Object.keys(e)){const r=[...t,a],l=e[a];o=o.concat(await ve(l,void 0,r,!1,i))}return o}}return[]}function cn(e,n){var t,s;let i=(s=(t=n?.dependencies)==null?void 0:t.find(o=>o.id==e))==null?void 0:s.queue;return i!=null?!i:!n.enable_queue}function ln(e,n){return new Promise((t,s)=>{const i=new MessageChannel;i.port1.onmessage=({data:o})=>{i.port1.close(),t(o)},window.parent.postMessage(e,n,[i.port2])})}function le(e,n,t,s,i=!1){if(s==="input"&&!i)throw new Error("Invalid code path. Cannot skip state inputs for input.");if(s==="output"&&i)return e;let o=[],a=0;const r=s==="input"?n.inputs:n.outputs;for(let l=0;l<r.length;l++){const u=r[l],_=t.find(d=>d.id===u);if(_?.type==="state"){if(i)if(e.length===r.length){const d=e[a];o.push(d),a++}else o.push(null);else{a++;continue}continue}else{const d=e[a];o.push(d),a++}}return o}async function un(e,n,t){const s=this;await dn(s,n);const i=await ve(n,void 0,[],!0,t);return(await Promise.all(i.map(async({path:o,blob:a,type:r})=>{if(!a)return{path:o,type:r};const l=await s.upload_files(e,[a]),u=l.files&&l.files[0];return{path:o,file_url:u,type:r,name:typeof File<"u"&&a instanceof File?a?.name:void 0}}))).forEach(({path:o,file_url:a,type:r,name:l})=>{if(r==="Gallery")Ne(n,a,o);else if(a){const u=new $e({path:a,orig_name:l});Ne(n,u,o)}}),n}async function dn(e,n){var t,s;if(!((t=e.config)!=null&&t.root||(s=e.config)!=null&&s.root_url))throw new Error(He);await Ze(e,n)}async function Ze(e,n,t=[]){for(const s in n)n[s]instanceof rn?await pn(e,n,s):typeof n[s]=="object"&&n[s]!==null&&await Ze(e,n[s],[...t,s])}async function pn(e,n,t){var s,i;let o=n[t];const a=((s=e.config)==null?void 0:s.root)||((i=e.config)==null?void 0:i.root_url);if(!a)throw new Error(He);try{let r,l;if(typeof process<"u"&&process.versions&&process.versions.node){const h=await Ae(()=>import("../chunks/BIHI7g3E.js"),[],import.meta.url);l=(await Ae(async()=>{const{resolve:k}=await import("../chunks/BIHI7g3E.js");return{resolve:k}},[],import.meta.url)).resolve(process.cwd(),o.meta.path),r=await h.readFile(l)}else throw new Error(Ht);const u=new Blob([r],{type:"application/octet-stream"}),_=await e.upload_files(a,[u]),d=_.files&&_.files[0];if(d){const h=new $e({path:d,orig_name:o.meta.name||""});n[t]=h}}catch(r){console.error(Vt,r)}}async function hn(e,n,t){const s={"Content-Type":"application/json"};this.options.token&&(s.Authorization=`Bearer ${this.options.token}`);try{var i=await this.fetch(e,{method:"POST",body:JSON.stringify(n),headers:{...s,...t},credentials:"include"})}catch{return[{error:ae},500]}let o,a;try{o=await i.json(),a=i.status}catch(r){o={error:`Could not parse server response: ${r}`},a=500}return[o,a]}async function fn(e,n={}){let t=!1,s=!1;if(!this.config)throw new Error("Could not resolve app config");if(typeof e=="number")this.config.dependencies.find(i=>i.id==e);else{const i=e.replace(/^\//,"");this.config.dependencies.find(o=>o.id==this.api_map[i])}return new Promise(async(i,o)=>{const a=this.submit(e,n,null,null,!0);let r;for await(const l of a)l.type==="data"&&(s&&i(r),t=!0,r=l),l.type==="status"&&(l.stage==="error"&&o(l),l.stage==="complete"&&(s=!0,t&&i(r)))})}async function oe(e,n,t){let s=n==="subdomain"?`https://huggingface.co/api/spaces/by-subdomain/${e}`:`https://huggingface.co/api/spaces/${e}`,i,o;try{if(i=await fetch(s),o=i.status,o!==200)throw new Error;i=await i.json()}catch{t({status:"error",load_status:"error",message:Ft,detail:"NOT_FOUND"});return}if(!i||o!==200)return;const{runtime:{stage:a},id:r}=i;switch(a){case"STOPPED":case"SLEEPING":t({status:"sleeping",load_status:"pending",message:"Space is asleep. Waking it up...",detail:a}),setTimeout(()=>{oe(e,n,t)},1e3);break;case"PAUSED":t({status:"paused",load_status:"error",message:"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",detail:a,discussions_enabled:await Le(r)});break;case"RUNNING":case"RUNNING_BUILDING":t({status:"running",load_status:"complete",message:"Space is running.",detail:a});break;case"BUILDING":t({status:"building",load_status:"pending",message:"Space is building...",detail:a}),setTimeout(()=>{oe(e,n,t)},1e3);break;case"APP_STARTING":t({status:"starting",load_status:"pending",message:"Space is starting...",detail:a}),setTimeout(()=>{oe(e,n,t)},1e3);break;default:t({status:"space_error",load_status:"error",message:"This space is experiencing an issue.",detail:a,discussions_enabled:await Le(r)});break}}const Qe=async(e,n)=>{let t=0;const s=12,i=5e3;return new Promise(o=>{oe(e,ke.test(e)?"space_name":"subdomain",a=>{n(a),a.status==="running"||a.status==="error"||a.status==="paused"||a.status==="space_error"?o():(a.status==="sleeping"||a.status==="building")&&(t<s?(t++,setTimeout(()=>{Qe(e,n).then(o)},i)):o())})})},_n=/^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;async function Le(e){try{const n=await fetch(`https://huggingface.co/api/spaces/${e}/discussions`,{method:"HEAD"}),t=n.headers.get("x-error-message");return!(!n.ok||t&&_n.test(t))}catch{return!1}}async function gn(e,n){const t={};n&&(t.Authorization=`Bearer ${n}`);try{const s=await fetch(`https://huggingface.co/api/spaces/${e}/${zt}`,{headers:t});if(s.status!==200)throw new Error("Space hardware could not be obtained.");const{hardware:i}=await s.json();return i.current}catch(s){throw new Error(s.message)}}async function mn(e,n,t){const s={};t&&(s.Authorization=`Bearer ${t}`);const i={seconds:n};try{const o=await fetch(`https://huggingface.co/api/spaces/${e}/${It}`,{method:"POST",headers:{"Content-Type":"application/json",...s},body:JSON.stringify(i)});if(o.status!==200)throw new Error("Could not set sleep timeout on duplicated Space. Please visit *ADD HF LINK TO SETTINGS* to set a timeout manually to reduce billing charges.");return await o.json()}catch(o){throw new Error(o.message)}}const Re=["cpu-basic","cpu-upgrade","cpu-xl","t4-small","t4-medium","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","zero-a10g","h100","h100x8"];async function wn(e,n){const{token:t,private:s,hardware:i,timeout:o,auth:a}=n;if(i&&!Re.includes(i))throw new Error(`Invalid hardware type provided. Valid types are: ${Re.map(f=>`"${f}"`).join(",")}.`);const{http_protocol:r,host:l}=await Ee(e,t);let u=null;if(a){const f=await Ve(r,l,a,fetch);f&&(u=Ke(f))}const _={Authorization:`Bearer ${t}`,"Content-Type":"application/json",...u?{Cookie:u.join("; ")}:{}},d=(await(await fetch("https://huggingface.co/api/whoami-v2",{headers:_})).json()).name,h=e.split("/")[1],k={repository:`${d}/${h}`};s&&(k.private=!0);let N;try{i||(N=await gn(e,t))}catch(f){throw Error(be+f.message)}const c=i||N||"cpu-basic";k.hardware=c;try{const f=await fetch(`https://huggingface.co/api/spaces/${e}/duplicate`,{method:"POST",headers:_,body:JSON.stringify(k)});if(f.status===409)try{return await ye.connect(`${d}/${h}`,n)}catch(T){throw console.error("Failed to connect Client instance:",T),T}else if(f.status!==200)throw new Error(f.statusText);const x=await f.json();return await mn(`${d}/${h}`,o||300,t),await ye.connect(vn(x.url),n)}catch(f){throw new Error(f)}}function vn(e){const n=/https:\/\/huggingface.co\/spaces\/([^/]+\/[^/]+)/,t=e.match(n);if(t)return t[1]}var J;class yn extends TransformStream{constructor(n={allowCR:!1}){super({transform:(t,s)=>{for(t=ie(this,J)+t;;){const i=t.indexOf(`
`),o=n.allowCR?t.indexOf("\r"):-1;if(o!==-1&&o!==t.length-1&&(i===-1||i-1>o)){s.enqueue(t.slice(0,o)),t=t.slice(o+1);continue}if(i===-1)break;const a=t[i-1]==="\r"?i-1:i;s.enqueue(t.slice(0,a)),t=t.slice(i+1)}At(this,J,t)},flush:t=>{if(ie(this,J)==="")return;const s=n.allowCR&&ie(this,J).endsWith("\r")?ie(this,J).slice(0,-1):ie(this,J);t.enqueue(s)}}),Ct(this,J,"")}}J=new WeakMap;function bn(e){let n=new TextDecoderStream,t=new yn({allowCR:!0});return e.pipeThrough(n).pipeThrough(t)}function kn(e){let n=/[:]\s*/.exec(e),t=n&&n.index;if(t)return[e.substring(0,t),e.substring(t+n[0].length)]}function Ue(e,n,t){e.get(n)||e.set(n,t)}async function*En(e,n){if(!e.body)return;let t=bn(e.body),s,i=t.getReader(),o;for(;;){if(n&&n.aborted)return i.cancel();if(s=await i.read(),s.done)return;if(!s.value){o&&(yield o),o=void 0;continue}let[a,r]=kn(s.value)||[];a&&(a==="data"?(o||(o={}),o[a]=o[a]?o[a]+`
`+r:r):a==="event"?(o||(o={}),o[a]=r):a==="id"?(o||(o={}),o[a]=+r||r):a==="retry"&&(o||(o={}),o[a]=+r||void 0))}}async function $n(e,n){let t=new Request(e,n);Ue(t.headers,"Accept","text/event-stream"),Ue(t.headers,"Content-Type","application/json");let s=await fetch(t);if(!s.ok)throw s;return En(s,t.signal)}async function xn(){let{event_callbacks:e,unclosed_events:n,pending_stream_messages:t,stream_status:s,config:i,jwt:o}=this;const a=this;if(!i)throw new Error("Could not resolve app config");s.open=!0;let r=null,l=new URLSearchParams({session_hash:this.session_hash}).toString(),u=new URL(`${i.root}${this.api_prefix}/${Je}?${l}`);if(o&&u.searchParams.set("__sign",o),r=this.stream(u),!r){console.warn("Cannot connect to SSE endpoint: "+u.toString());return}r.onmessage=async function(_){let d=JSON.parse(_.data);if(d.msg==="close_stream"){xe(s,a.abort_controller);return}const h=d.event_id;if(!h)await Promise.all(Object.keys(e).map(k=>e[k](d)));else if(e[h]&&i){d.msg==="process_completed"&&["sse","sse_v1","sse_v2","sse_v2.1","sse_v3"].includes(i.protocol)&&n.delete(h);let k=e[h];typeof window<"u"&&typeof document<"u"?setTimeout(k,0,d):k(d)}else t[h]||(t[h]=[]),t[h].push(d)},r.onerror=async function(_){console.error(_),await Promise.all(Object.keys(e).map(d=>e[d]({msg:"broken_connection",message:ae})))}}function xe(e,n){e&&(e.open=!1,n?.abort())}function Sn(e,n,t){e[n]?t.data.forEach((s,i)=>{let o=Pn(e[n][i],s);e[n][i]=o,t.data[i]=o}):(e[n]=[],t.data.forEach((s,i)=>{e[n][i]=s}))}function Pn(e,n){return n.forEach(([t,s,i])=>{e=Tn(e,s,t,i)}),e}function Tn(e,n,t,s){if(n.length===0){if(t==="replace")return s;if(t==="append")return e+s;throw new Error(`Unsupported action: ${t}`)}let i=e;for(let a=0;a<n.length-1;a++)i=i[n[a]];const o=n[n.length-1];switch(t){case"replace":i[o]=s;break;case"append":i[o]+=s;break;case"add":Array.isArray(i)?i.splice(Number(o),0,s):i[o]=s;break;case"delete":Array.isArray(i)?i.splice(Number(o),1):delete i[o];break;default:throw new Error(`Unknown action: ${t}`)}return e}function Cn(e,n={}){const t={close:()=>{console.warn("Method not implemented.")},onerror:null,onmessage:null,onopen:null,readyState:0,url:e.toString(),withCredentials:!1,CONNECTING:0,OPEN:1,CLOSED:2,addEventListener:()=>{throw new Error("Method not implemented.")},dispatchEvent:()=>{throw new Error("Method not implemented.")},removeEventListener:()=>{throw new Error("Method not implemented.")}};return $n(e,n).then(async s=>{t.readyState=t.OPEN;try{for await(const i of s)t.onmessage&&t.onmessage(i);t.readyState=t.CLOSED}catch(i){t.onerror&&t.onerror(i),t.readyState=t.CLOSED}}).catch(s=>{console.error(s),t.onerror&&t.onerror(s),t.readyState=t.CLOSED}),t}function An(e,n={},t,s,i){var o;try{let a=function(m){(i||et[m.type])&&_(m)},r=function(){for(st=!0;ee.length>0;)ee.shift()({value:void 0,done:!0})},l=function(m){ee.length>0?ee.shift()(m):pe.push(m)},u=function(m){l(On(m)),r()},_=function(m){l({value:m,done:!1})},d=function(){return pe.length>0?Promise.resolve(pe.shift()):new Promise(m=>ee.push(m))};const{token:h}=this.options,{fetch:k,app_reference:N,config:c,session_hash:f,api_info:x,api_map:T,stream_status:Q,pending_stream_messages:Y,pending_diff_streams:H,event_callbacks:V,unclosed_events:ue,post_data:w,options:C,api_prefix:B}=this,de=this;if(!x)throw new Error("No API found");if(!c)throw new Error("Could not resolve app config");let{fn_index:g,endpoint_info:L,dependency:R}=jn(x,e,T,c),Ye=nn(n,L),U,F=c.protocol??"ws";if(F==="ws")throw new Error("WebSocket protocol is not supported in this version");let Se="",Xe=()=>Se;const v=typeof e=="number"?"/predict":e;let re,S=null,G=!1,Pe={},X=typeof window<"u"&&typeof document<"u"?new URLSearchParams(window.location.search).toString():"";const et=((o=C?.events)==null?void 0:o.reduce((m,j)=>(m[j]=!0,m),{}))||{};async function tt(){let m={},j={};m={event_id:S},j={event_id:S,session_hash:f,fn_index:g};try{if(!c)throw new Error("Could not resolve app config");"event_id"in j&&await k(`${c.root}${B}/${Ut}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(j)}),await k(`${c.root}${B}/${Rt}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(m)})}catch{console.warn("The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.")}}const nt=async m=>{await this._resolve_heartbeat(m)};async function Te(m){if(!c)return;let j=m.render_id;c.components=[...c.components.filter(P=>P.props.rendered_in!==j),...m.components],c.dependencies=[...c.dependencies.filter(P=>P.rendered_in!==j),...m.dependencies];const he=c.components.some(P=>P.type==="state"),$=c.dependencies.some(P=>P.targets.some(D=>D[1]==="unload"));c.connect_heartbeat=he||$,await nt(c),a({type:"render",data:m,endpoint:v,fn_index:g})}this.handle_blob(c.root,Ye,L).then(async m=>{var j;if(re={data:le(m,R,c.components,"input",!0)||[],event_data:t,fn_index:g,trigger_id:s},cn(g,c))a({type:"status",endpoint:v,stage:"pending",queue:!1,fn_index:g,time:new Date}),w(`${c.root}${B}/run${v.startsWith("/")?v:`/${v}`}${X?"?"+X:""}`,{...re,session_hash:f}).then(([$,P])=>{const D=$.data;P==200?(a({type:"data",endpoint:v,fn_index:g,data:le(D,R,c.components,"output",C.with_null_state),time:new Date,event_data:t,trigger_id:s}),$.render_config&&Te($.render_config),a({type:"status",endpoint:v,fn_index:g,stage:"complete",eta:$.average_duration,queue:!1,time:new Date})):a({type:"status",stage:"error",endpoint:v,fn_index:g,message:$.error,queue:!1,time:new Date})}).catch($=>{a({type:"status",stage:"error",message:$.message,endpoint:v,fn_index:g,queue:!1,time:new Date})});else if(F=="sse"){a({type:"status",stage:"pending",queue:!0,endpoint:v,fn_index:g,time:new Date});var he=new URLSearchParams({fn_index:g.toString(),session_hash:f}).toString();let $=new URL(`${c.root}${B}/${Je}?${X?X+"&":""}${he}`);if(this.jwt&&$.searchParams.set("__sign",this.jwt),U=this.stream($),!U)return Promise.reject(new Error("Cannot connect to SSE endpoint: "+$.toString()));U.onmessage=async function(P){const D=JSON.parse(P.data),{type:I,status:A,data:q}=Ie(D,Pe[g]);if(I==="update"&&A&&!G)a({type:"status",endpoint:v,fn_index:g,time:new Date,...A}),A.stage==="error"&&(U?.close(),r());else if(I==="data"){let[O,b]=await w(`${c.root}${B}/queue/data`,{...re,session_hash:f,event_id:S});b!==200&&(a({type:"status",stage:"error",message:ae,queue:!0,endpoint:v,fn_index:g,time:new Date}),U?.close(),r())}else I==="complete"?G=A:I==="log"?a({type:"log",title:q.title,log:q.log,level:q.level,endpoint:v,duration:q.duration,visible:q.visible,fn_index:g}):(I==="generating"||I==="streaming")&&a({type:"status",time:new Date,...A,stage:A?.stage,queue:!0,endpoint:v,fn_index:g});q&&(a({type:"data",time:new Date,data:le(q.data,R,c.components,"output",C.with_null_state),endpoint:v,fn_index:g,event_data:t,trigger_id:s}),G&&(a({type:"status",time:new Date,...G,stage:A?.stage,queue:!0,endpoint:v,fn_index:g}),U?.close(),r()))}}else if(F=="sse_v1"||F=="sse_v2"||F=="sse_v2.1"||F=="sse_v3"){a({type:"status",stage:"pending",queue:!0,endpoint:v,fn_index:g,time:new Date});let $="";typeof window<"u"&&typeof document<"u"&&($=(j=window?.location)==null?void 0:j.hostname);const P=$.includes(".dev.")?`https://moon-${$.split(".")[1]}.dev.spaces.huggingface.tech`:"https://huggingface.co";(typeof window<"u"&&typeof document<"u"&&window.parent!=window&&window.supports_zerogpu_headers?ln("zerogpu-headers",P):Promise.resolve(null)).then(D=>w(`${c.root}${B}/${jt}?${X}`,{...re,session_hash:f},D)).then(async([D,I])=>{if(I===503)a({type:"status",stage:"error",message:Me,queue:!0,endpoint:v,fn_index:g,time:new Date});else if(I===422)a({type:"status",stage:"error",message:D.detail,queue:!0,endpoint:v,fn_index:g,code:"validation_error",time:new Date}),r();else if(I!==200)a({type:"status",stage:"error",broken:!1,message:D.detail,queue:!0,endpoint:v,fn_index:g,time:new Date});else{S=D.event_id,Se=S;let A=async function(q){try{const{type:O,status:b,data:z,original_msg:it}=Ie(q,Pe[g]);if(O=="heartbeat")return;if(O==="update"&&b&&!G)a({type:"status",endpoint:v,fn_index:g,time:new Date,original_msg:it,...b});else if(O==="complete")G=b;else if(O=="unexpected_error"||O=="broken_connection"){console.error("Unexpected error",b?.message);const ot=O==="broken_connection";a({type:"status",stage:"error",message:b?.message||"An Unexpected Error Occurred!",queue:!0,endpoint:v,broken:ot,session_not_found:b?.session_not_found,fn_index:g,time:new Date})}else if(O==="log"){a({type:"log",title:z.title,log:z.log,level:z.level,endpoint:v,duration:z.duration,visible:z.visible,fn_index:g});return}else(O==="generating"||O==="streaming")&&(a({type:"status",time:new Date,...b,stage:b?.stage,queue:!0,endpoint:v,fn_index:g}),z&&R.connection!=="stream"&&["sse_v2","sse_v2.1","sse_v3"].includes(F)&&Sn(H,S,z));z&&(a({type:"data",time:new Date,data:le(z.data,R,c.components,"output",C.with_null_state),endpoint:v,fn_index:g}),z.render_config&&await Te(z.render_config),G&&(a({type:"status",time:new Date,...G,stage:b?.stage,queue:!0,endpoint:v,fn_index:g}),r())),(b?.stage==="complete"||b?.stage==="error")&&(V[S]&&delete V[S],S in H&&delete H[S])}catch(O){console.error("Unexpected client exception",O),a({type:"status",stage:"error",message:"An Unexpected Error Occurred!",queue:!0,endpoint:v,fn_index:g,time:new Date}),["sse_v2","sse_v2.1","sse_v3"].includes(F)&&(xe(Q,de.abort_controller),Q.open=!1,r())}};S in Y&&(Y[S].forEach(q=>A(q)),delete Y[S]),V[S]=A,ue.add(S),Q.open||await this.open_stream()}})}});let st=!1;const pe=[],ee=[],Ce={[Symbol.asyncIterator]:()=>Ce,next:d,throw:async m=>(u(m),d()),return:async()=>(r(),d()),cancel:tt,event_id:Xe};return Ce}catch(a){throw console.error("Submit function encountered an error:",a),a}}function On(e){return{then:(n,t)=>t(e)}}function jn(e,n,t,s){let i,o,a;if(typeof n=="number")i=n,o=e.unnamed_endpoints[i],a=s.dependencies.find(r=>r.id==n);else{const r=n.replace(/^\//,"");i=t[r],o=e.named_endpoints[n.trim()],a=s.dependencies.find(l=>l.id==t[r])}if(typeof i!="number")throw new Error("There is no endpoint matching that name of fn_index matching that number.");return{fn_index:i,endpoint_info:o,dependency:a}}class ye{constructor(n,t={events:["data"]}){p(this,"app_reference"),p(this,"options"),p(this,"deep_link",null),p(this,"config"),p(this,"api_prefix",""),p(this,"api_info"),p(this,"api_map",{}),p(this,"session_hash",Math.random().toString(36).substring(2)),p(this,"jwt",!1),p(this,"last_status",{}),p(this,"cookies",null),p(this,"stream_status",{open:!1}),p(this,"closed",!1),p(this,"pending_stream_messages",{}),p(this,"pending_diff_streams",{}),p(this,"event_callbacks",{}),p(this,"unclosed_events",new Set),p(this,"heartbeat_event",null),p(this,"abort_controller",null),p(this,"stream_instance",null),p(this,"current_payload"),p(this,"view_api"),p(this,"upload_files"),p(this,"upload"),p(this,"handle_blob"),p(this,"post_data"),p(this,"submit"),p(this,"predict"),p(this,"open_stream"),p(this,"resolve_config"),p(this,"resolve_cookies");var s;this.app_reference=n,this.deep_link=((s=t.query_params)==null?void 0:s.deep_link)||null,t.events||(t.events=["data"]),this.options=t,this.current_payload={},this.view_api=sn.bind(this),this.upload_files=on.bind(this),this.handle_blob=un.bind(this),this.post_data=hn.bind(this),this.submit=An.bind(this),this.predict=fn.bind(this),this.open_stream=xn.bind(this),this.resolve_config=Zt.bind(this),this.resolve_cookies=Qt.bind(this),this.upload=an.bind(this),this.fetch=this.fetch.bind(this),this.handle_space_success=this.handle_space_success.bind(this),this.stream=this.stream.bind(this)}get_url_config(n=null){if(!this.config)throw new Error(M);n===null&&(n=window.location.href);const t=a=>a.replace(/^\/+|\/+$/g,"");let s=t(new URL(this.config.root).pathname),i=t(new URL(n).pathname),o;return i.startsWith(s)?o=t(i.substring(s.length)):o="",this.get_page_config(o)}get_page_config(n){if(!this.config)throw new Error(M);let t=this.config;return n in t.page||(n=""),{...t,current_page:n,layout:t.page[n].layout,components:t.components.filter(s=>t.page[n].components.includes(s.id)),dependencies:this.config.dependencies.filter(s=>t.page[n].dependencies.includes(s.id))}}fetch(n,t){const s=new Headers(t?.headers||{});if(this&&this.cookies&&s.append("Cookie",this.cookies),this&&this.options.headers)for(const i in this.options.headers)s.append(i,this.options.headers[i]);return fetch(n,{...t,headers:s})}stream(n){const t=new Headers;if(this&&this.cookies&&t.append("Cookie",this.cookies),this&&this.options.headers)for(const s in this.options.headers)t.append(s,this.options.headers[s]);return this&&this.options.token&&t.append("Authorization",`Bearer ${this.options.token}`),this.abort_controller=new AbortController,this.stream_instance=Cn(n.toString(),{credentials:"include",headers:t,signal:this.abort_controller.signal}),this.stream_instance}async init(){var n;this.options.auth&&await this.resolve_cookies(),await this._resolve_config().then(({config:t})=>this._resolve_heartbeat(t)),this.api_info=await this.view_api(),this.api_map=Kt(((n=this.config)==null?void 0:n.dependencies)||[])}async _resolve_heartbeat(n){if(n&&(this.config=n,this.api_prefix=n.api_prefix||"",this.config&&this.config.connect_heartbeat&&this.config.space_id&&this.options.token&&(this.jwt=await qe(this.config.space_id,this.options.token,this.cookies))),n.space_id&&this.options.token&&(this.jwt=await qe(n.space_id,this.options.token)),this.config&&this.config.connect_heartbeat){const t=new URL(`${this.config.root}${this.api_prefix}/${Nt}/${this.session_hash}`);this.jwt&&t.searchParams.set("__sign",this.jwt),this.heartbeat_event||(this.heartbeat_event=this.stream(t))}}static async connect(n,t={events:["data"]}){const s=new this(n,t);return t.session_hash&&(s.session_hash=t.session_hash),await s.init(),s}async reconnect(){const n=new URL(`${this.config.root}${this.api_prefix}/${Bt}`);let t;try{const s=await this.fetch(n);if(!s.ok)throw new Error;t=(await s.json()).app_id}catch{return"broken"}return t!==this.config.app_id?"changed":"connected"}close(){this.closed=!0,xe(this.stream_status,this.abort_controller)}set_current_payload(n){this.current_payload=n}static async duplicate(n,t={events:["data"]}){return wn(n,t)}async _resolve_config(){const{http_protocol:n,host:t,space_id:s}=await Ee(this.app_reference,this.options.token),{status_callback:i}=this.options;s&&i&&await Qe(s,i);let o;try{let a=`${n}//${t}`;if(o=await this.resolve_config(a),!o)throw new Error(M);return this.config_success(o)}catch(a){if(s&&i)oe(s,ke.test(s)?"space_name":"subdomain",this.handle_space_success);else throw i&&i({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),Error(a)}}async config_success(n){if(this.config=n,this.api_prefix=n.api_prefix||"",this.config.auth_required)return this.prepare_return_obj();try{this.api_info=await this.view_api()}catch(t){console.error(Gt+t.message)}return this.prepare_return_obj()}async handle_space_success(n){var t;if(!this)throw new Error(M);const{status_callback:s}=this.options;if(s&&s(n),n.status==="running")try{if(this.config=await this._resolve_config(),this.api_prefix=((t=this==null?void 0:this.config)==null?void 0:t.api_prefix)||"",!this.config)throw new Error(M);return await this.config_success(this.config)}catch(i){throw s&&s({status:"error",message:"Could not load this space.",load_status:"error",detail:"NOT_FOUND"}),i}}async component_server(n,t,s){var i;if(!this.config)throw new Error(M);const o={},{token:a}=this.options,{session_hash:r}=this;a&&(o.Authorization=`Bearer ${this.options.token}`);let l,u=this.config.components.find(d=>d.id===n);(i=u?.props)!=null&&i.root_url?l=u.props.root_url:l=this.config.root;let _;if("binary"in s){_=new FormData;for(const d in s.data)d!=="binary"&&_.append(d,s.data[d]);_.set("component_id",n.toString()),_.set("fn_name",t),_.set("session_hash",r)}else _=JSON.stringify({data:s,component_id:n,fn_name:t,session_hash:r}),o["Content-Type"]="application/json";a&&(o.Authorization=`Bearer ${a}`);try{const d=await this.fetch(`${l}${this.api_prefix}/${Lt}/`,{method:"POST",body:_,headers:o,credentials:"include"});if(!d.ok)throw new Error("Could not connect to component server: "+d.statusText);return await d.json()}catch(d){console.warn(d)}}set_cookies(n){this.cookies=Ke(n).join("; ")}prepare_return_obj(){return{config:this.config,predict:this.predict,submit:this.submit,view_api:this.view_api,component_server:this.component_server}}}var Dn=wt(`<main class="svelte-1uha8ag"><h1 class="svelte-1uha8ag">Svelte App ➡️ Gradio Client API</h1> <section class="token-input"><label for="hf-token" class="svelte-1uha8ag">Hugging Face Access Token (Stored in Local Storage):</label> <input type="password" id="hf-token" placeholder="hf_..." class="svelte-1uha8ag"/> <p class="note svelte-1uha8ag">The token is securely stored in your browser's **Local Storage** for future use. Clear the field to remove it.</p></section> <form><label for="input-text" class="svelte-1uha8ag">Input Prompt:</label> <textarea id="input-text" class="svelte-1uha8ag"></textarea> <button type="submit" class="svelte-1uha8ag"><!></button></form> <div class="result-box svelte-1uha8ag"><h2>API Result</h2> <p> </p></div></main>`);function Un(e,n){_t(n,!1);const t="hf_gradio_token",s="Hanzo03/gradioapp",i="/process_text";let o=se("your_huggingface_access_token_here"),a=se(""),r=se("Initializing..."),l=se(!1),u=se(null);rt(()=>{const w=localStorage.getItem(t);w&&E(o,w),y(o)?E(r,"Connecting..."):E(r,"Please enter your Hugging Face Access Token to connect.")});async function _(w){if(w)try{E(r,"Attempting to connect to Gradio Space..."),E(u,await ye.connect(s,{token:w})),console.log("Gradio Client connected successfully!"),E(r,"Submit a prompt to see the result...")}catch(C){console.error("Failed to connect to Gradio Client:",C),E(u,null),E(r,`Connection Error: Failed to connect to ${s}. Check your token and space ID.`)}}async function d(){if(!y(a).trim()){E(r,"Please enter some text.");return}if(!y(u)){E(r,"Error: Gradio Client not initialized. Check console for connection errors or provide a valid token.");return}E(l,!0),E(r,"Processing...");try{const w=await y(u).predict(i,[y(a)]);E(r,w.data[0])}catch(w){console.error("Gradio API Prediction Error:",w),E(r,`API Prediction Error: ${w.message}`)}finally{E(l,!1)}}gt(()=>y(o),()=>{y(o)?(typeof window<"u"&&localStorage.setItem(t,y(o)),_(y(o))):(typeof window<"u"&&localStorage.removeItem(t),E(u,null),E(r,"Please enter and save your Hugging Face Access Token to connect."))}),mt(),at();var h=Dn(),k=W(K(h),2),N=W(K(k),2);xt(N),bt(2),Z(k);var c=W(k,2),f=W(K(c),2);kt(f);var x=W(f,2),T=K(x);{var Q=w=>{var C=fe("Sending...");ne(w,C)},Y=w=>{var C=Et(),B=$t(C);{var de=L=>{var R=fe("Connecting...");ne(L,R)},g=L=>{var R=fe("Process Text");ne(L,R)};Oe(B,L=>{y(u)?L(g,!1):L(de)},!0)}ne(w,C)};Oe(T,w=>{y(l)?w(Q):w(Y,!1)})}Z(x),Z(c);var H=W(c,2),V=W(K(H),2),ue=K(V,!0);Z(V),Z(H),Z(h),vt(w=>{f.disabled=y(l)||!y(u),x.disabled=w,lt(ue,y(r))},[()=>(y(l),y(u),y(a),Be(()=>y(l)||!y(u)||!y(a).trim()))]),je(N,()=>y(o),w=>E(o,w)),je(f,()=>y(a),w=>E(a,w)),ct("submit",c,St(d)),ne(e,h),yt()}export{Un as component};