import './async-D55cHugf.js';
import { f as attr_class, a as attr, g as attr_style, d as bind_props } from './index-u8mz_F03.js';
import { c } from './BlockTitle-BnJIYf6a.js';
import { w } from './IconButton-BRnu7KaR.js';
import { e } from './Check-C7_ZsXgh.js';
import { h } from './Copy-B8YOhH7c.js';
import { M } from './Send-C1RPCeF6.js';
import { s } from './Square-CDuLMWYC.js';
import './2-BLdXJizP.js';
import { y } from './IconButtonWrapper-CjFRPb3y.js';
import { e as escape_html } from './escaping-CBnpiEl5.js';

/* empty css                                     */function et(y$1,v){y$1.component(a=>{let{value:s$1="",value_is_output:w$1=false,lines:_=1,placeholder:p="",label:z,info:C=void 0,disabled:c$1=false,show_label:d=true,container:I=true,max_lines:R=void 0,type:r="text",buttons:h$1=null,oncustombuttonclick:T=null,submit_btn:i=null,stop_btn:e$1=null,rtl:k=false,autofocus:n=false,text_align:b=void 0,autoscroll:W=true,max_length:m=void 0,html_attributes:o=null,validation_error:u=void 0,onchange:Y,onsubmit:j,onstop:H,onblur:J,onselect:K,oninput:M$1,onfocus:Q,oncopy:B}=v,f=false,x,S=1;const A=!i;async function D(){if("clipboard"in navigator){try{await navigator.clipboard.writeText(s$1),B?.({value:s$1});}catch(l){console.error("COPYING CLIPBOARD FAILED",l);}L();}}function L(){f=true,x&&clearTimeout(x),x=setTimeout(()=>{f=false;},1e3);}if(a.push(`<label${attr_class("svelte-1hguek3",void 0,{container:I,show_textbox_border:A})}>`),d&&h$1&&h$1.length>0?(a.push("<!--[-->"),y(a,{buttons:h$1,on_custom_button_click:T,children:l=>{h$1.some(g=>typeof g=="string"&&g==="copy")?(l.push("<!--[-->"),w(l,{Icon:f?e:h,onclick:D,label:f?"Copied":"Copy"})):l.push("<!--[!-->"),l.push("<!--]-->");}})):a.push("<!--[!-->"),a.push("<!--]--> "),c(a,{show_label:u?true:d,info:C,children:l=>{l.push(`<!---->${escape_html(z)} `),u?(l.push("<!--[-->"),l.push(`<div class="validation-error svelte-1hguek3">${escape_html(u)}</div>`)):l.push("<!--[!-->"),l.push("<!--]-->");},$$slots:{default:true}}),a.push('<!----> <div class="input-container svelte-1hguek3">'),_===1&&S===1)a.push("<!--[-->"),r==="text"?(a.push("<!--[-->"),a.push(`<input data-testid="textbox" type="text"${attr_class("scroll-hide svelte-1hguek3",void 0,{"validation-error":u})}${attr("dir",k?"rtl":"ltr")}${attr("value",s$1)}${attr("placeholder",p)}${attr("disabled",c$1,true)}${attr("autofocus",n,true)}${attr("maxlength",m)}${attr_style(b?"text-align: "+b:"")}${attr("autocapitalize",o?.autocapitalize)}${attr("autocorrect",o?.autocorrect)}${attr("spellcheck",o?.spellcheck)}${attr("autocomplete",o?.autocomplete)}${attr("tabindex",o?.tabindex)}${attr("enterkeyhint",o?.enterkeyhint)}${attr("lang",o?.lang)}/>`)):(a.push("<!--[!-->"),r==="password"?(a.push("<!--[-->"),a.push(`<input data-testid="password" type="password"${attr_class("scroll-hide svelte-1hguek3",void 0,{"validation-error":u})}${attr("value",s$1)}${attr("placeholder",p)}${attr("disabled",c$1,true)}${attr("autofocus",n,true)}${attr("maxlength",m)} autocomplete=""${attr("autocapitalize",o?.autocapitalize)}${attr("autocorrect",o?.autocorrect)}${attr("spellcheck",o?.spellcheck)}${attr("tabindex",o?.tabindex)}${attr("enterkeyhint",o?.enterkeyhint)}${attr("lang",o?.lang)}/>`)):(a.push("<!--[!-->"),r==="email"?(a.push("<!--[-->"),a.push(`<input data-testid="textbox" type="email"${attr_class("scroll-hide svelte-1hguek3",void 0,{"validation-error":u})}${attr("value",s$1)}${attr("placeholder",p)}${attr("disabled",c$1,true)}${attr("autofocus",n,true)}${attr("maxlength",m)} autocomplete="email"${attr("autocapitalize",o?.autocapitalize)}${attr("autocorrect",o?.autocorrect)}${attr("spellcheck",o?.spellcheck)}${attr("tabindex",o?.tabindex)}${attr("enterkeyhint",o?.enterkeyhint)}${attr("lang",o?.lang)}/>`)):a.push("<!--[!-->"),a.push("<!--]-->")),a.push("<!--]-->")),a.push("<!--]-->");else {a.push("<!--[!-->"),a.push(`<textarea data-testid="textbox"${attr("dir",k?"rtl":"ltr")}${attr("placeholder",p)}${attr("rows",_)}${attr("disabled",c$1,true)}${attr("autofocus",n,true)}${attr("maxlength",m)}${attr_style(b?"text-align: "+b:"")}${attr("autocapitalize",o?.autocapitalize)}${attr("autocorrect",o?.autocorrect)}${attr("spellcheck",o?.spellcheck)}${attr("autocomplete",o?.autocomplete)}${attr("tabindex",o?.tabindex)}${attr("enterkeyhint",o?.enterkeyhint)}${attr("lang",o?.lang)}${attr_class("svelte-1hguek3",void 0,{"no-label":!d&&(i||e$1),"validation-error":u})}>`);const l=escape_html(s$1);l&&a.push(`${l}`),a.push("</textarea>");}a.push("<!--]--> "),i?(a.push("<!--[-->"),a.push(`<button${attr_class("submit-button svelte-1hguek3",void 0,{"padded-button":i!==true})} data-testid="submit-button">`),i===true?(a.push("<!--[-->"),M(a)):(a.push("<!--[!-->"),a.push(`${escape_html(i)}`)),a.push("<!--]--></button>")):a.push("<!--[!-->"),a.push("<!--]--> "),e$1?(a.push("<!--[-->"),a.push(`<button${attr_class("stop-button svelte-1hguek3",void 0,{"padded-button":e$1!==true})} data-testid="stop-button">`),e$1===true?(a.push("<!--[-->"),s(a,{fill:"none",stroke_width:2.5})):(a.push("<!--[!-->"),a.push(`${escape_html(e$1)}`)),a.push("<!--]--></button>")):a.push("<!--[!-->"),a.push("<!--]--></div></label>"),bind_props(v,{value:s$1,value_is_output:w$1});});}

export { et as e };
//# sourceMappingURL=Textbox-DO7UelKj.js.map
