import{C as ee,a as W,c as Z,g as q,n as J}from"./chunk-JDOQXT4C.js";import{a as N}from"./chunk-2WREWCTT.js";import{Bb as _,Cc as I,Da as s,Db as v,Eb as G,Fb as L,Fc as P,La as T,Lb as B,Mb as H,Nb as D,Oc as E,Sb as $,Tb as j,X as R,Y as k,Yb as U,Zb as z,_a as w,_b as X,aa as C,ab as h,bb as y,ec as x,fa as p,ga as c,gb as d,gc as Y,hb as m,hc as Q,ib as u,jb as b,ka as V,tb as O,th as te,xb as F,xc as r,yc as K}from"./chunk-DWEAL4OJ.js";import{i as l}from"./chunk-YM6OINSR.js";var S=class{_document;_textarea;constructor(e,a){this._document=a;let t=this._textarea=this._document.createElement("textarea"),i=t.style;i.position="fixed",i.top=i.opacity="0",i.left="-999em",t.setAttribute("aria-hidden","true"),t.value=e,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t);}copy(){let e=this._textarea,a=!1;try{if(e){let t=this._document.activeElement;e.select(),e.setSelectionRange(0,e.value.length),a=this._document.execCommand("copy"),t&&t.focus();}}catch(t){}return a;}destroy(){let e=this._textarea;e&&(e.remove(),this._textarea=void 0);}},A=(()=>{let e=class e{_document=C(V);constructor(){}copy(t){let i=this.beginCopy(t),n=i.copy();return i.destroy(),n;}beginCopy(t){return new S(t,this._document);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275prov",k({token:e,factory:e.ɵfac,providedIn:"root"}));let o=e;return o;})();var ie=["*"],re=(o,e)=>({"is-input-group":o,"with-border":e}),oe=(()=>{let e=class e{notifier=C(te);clipboard=C(A);value=r(void 0);elementContent=r(void 0);title=r(void 0);notification=r(void 0);withBorder=r(!1,{transform:P});isInputGroup=r(!1,{transform:P});copy(){this.clipboard.copy(this.value()||this.elementContent()?.innerText);let t=this.notification();t&&this.notifier.success(t);}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275cmp",T({type:e,selectors:[["my-copy-button"]],inputs:{value:[1,"value"],elementContent:[1,"elementContent"],title:[1,"title"],notification:[1,"notification"],withBorder:[1,"withBorder"],isInputGroup:[1,"isInputGroup"]},features:[x([A])],ngContentSelectors:ie,decls:3,vars:5,consts:[["type","button",1,"btn","copy-button",3,"click","ngClass"],["iconName","copy"]],template:function(i,n){i&1&&(G(),m(0,"button",0),_("click",function(){return n.copy();}),b(1,"my-global-icon",1),L(2),u()),i&2&&(d("ngClass",Q(2,re,n.isInputGroup(),n.withBorder())),w("title",n.title()));},dependencies:[E,N],styles:[`button[_ngcontent-%COMP%]:not(.with-border,.is-input-group){border:0}.is-input-group[_ngcontent-%COMP%]{--bs-btn-border-color: var(--input-border-color);--bs-btn-hover-border-color: var(--input-border-color);border-top-left-radius:0;border-bottom-left-radius:0}my-global-icon[_ngcontent-%COMP%]{display:inline-block;width:15px;height:15px;line-height:15px;margin-inline-end:.3125rem}
/*# sourceMappingURL=copy-button.component-FYOMQUHM.css.map */`]}));let o=e;return o;})();var ae=["input"],le=o=>({"input-error":o});function ue(o,e){o&1&&b(0,"my-global-icon",8);}function pe(o,e){o&1&&b(0,"my-global-icon",9);}function ce(o,e){if(o&1){let a=O();m(0,"button",7),_("click",function(){p(a);let i=v();return c(i.toggle());}),h(1,ue,1,0,"my-global-icon",8)(2,pe,1,0,"my-global-icon",9),u();}if(o&2){let a=v();d("title",a.toggleTitle),s(),y(a.show()?1:2);}}function se(o,e){if(o&1&&(m(0,"my-copy-button",5),F(1,1),u()),o&2){v();let a=D(2);d("value",a.value)("isInputGroup",!0);}}function de(o,e){if(o&1&&(m(0,"div",6),$(1),u()),o&2){let a=v();s(),j(a.formError());}}var $e=(()=>{let e=class e{inputElement=K("input");inputId=r.required();value=I("");autocomplete=r("off");placeholder=r("");tabindex=r(0);withToggle=r(!0);withCopy=r(!1);readonly=r(!1);show=I(!1);formError=r(void 0);autofocus=r(!1);ariaLabel=r(void 0);get inputType(){return this.show()?"text":"password";}get toggleTitle(){return this.show()?"Cuir am falach":"Seall";}ngAfterViewInit(){this.autofocus()===!0&&this.inputElement().nativeElement.focus({preventScroll:!0});}toggle(){this.show.set(!this.show());}propagateChange=t=>{};writeValue(t){this.value.set(t);}registerOnChange(t){this.propagateChange=t;}registerOnTouched(){}update(){this.propagateChange(this.value());}focus(){this.inputElement().nativeElement.focus({preventScroll:!0});}};l(e,"\u0275fac",function(i){return new(i||e)();}),l(e,"\u0275cmp",T({type:e,selectors:[["my-input-text"]],viewQuery:function(i,n){i&1&&B(n.inputElement,ae,5),i&2&&H();},inputs:{inputId:[1,"inputId"],value:[1,"value"],autocomplete:[1,"autocomplete"],placeholder:[1,"placeholder"],tabindex:[1,"tabindex"],withToggle:[1,"withToggle"],withCopy:[1,"withCopy"],readonly:[1,"readonly"],show:[1,"show"],formError:[1,"formError"],autofocus:[1,"autofocus"],ariaLabel:[1,"ariaLabel"]},outputs:{value:"valueChange",show:"showChange"},features:[x([{provide:W,useExisting:R(()=>e),multi:!0}])],decls:6,vars:16,consts:()=>{let t;t="Chaidh lethbhreac dheth a dh\xE8anamh";let i;return i="COPY",[["input",""],i,[1,"input-group"],[1,"form-control",3,"ngModelChange","click","input","change","id","name","autocomplete","value","placeholder","tabindex","ngModel","readonly","type","ngClass"],["type","button",1,"btn",3,"title"],["notification",t,3,"value","isInputGroup"],["role","alert",1,"form-error"],["type","button",1,"btn",3,"click","title"],["iconName","eye-open"],["iconName","eye-close"]];},template:function(i,n){if(i&1){let g=O();m(0,"div",2)(1,"input",3,0),X("ngModelChange",function(f){return p(g),z(n.value,f)||(n.value=f),c(f);}),_("ngModelChange",function(){return p(g),c(n.update());})("click",function(){p(g);let f=D(2);return c(f.select());})("input",function(){return p(g),c(n.update());})("change",function(){return p(g),c(n.update());}),u(),h(3,ce,3,2,"button",4),h(4,se,2,2,"my-copy-button",5),u(),h(5,de,2,1,"div",6);}i&2&&(s(),d("id",n.inputId())("name",n.inputId())("autocomplete",n.autocomplete())("value",n.value())("placeholder",n.placeholder())("tabindex",n.tabindex()),U("ngModel",n.value),d("readonly",n.readonly())("type",n.inputType)("ngClass",Y(14,le,n.formError())),w("aria-label",n.ariaLabel()),s(2),y(n.withToggle()?3:-1),s(),y(n.withCopy()?4:-1),s(),y(n.formError()?5:-1));},dependencies:[ee,Z,q,J,E,N,oe],styles:[`input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:auto;max-width:auto;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[_ngcontent-%COMP%]:focus, input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(auto + 40px)){input[_ngcontent-%COMP%]{width:100%}}.btn[_ngcontent-%COMP%], my-copy-button[_ngcontent-%COMP%]     .btn{background-color:var(--input-bg);border-left:1px solid var(--bg)}.btn[_ngcontent-%COMP%]:hover, my-copy-button[_ngcontent-%COMP%]     .btn:hover{opacity:.8}.btn[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:0;right:0;display:inline-block;width:18px;height:18px;line-height:18px}.btn[_ngcontent-%COMP%]:not(.icon-only)   my-global-icon[_ngcontent-%COMP%]{margin-inline-end:.1875rem}.copy-text[_ngcontent-%COMP%]{font-size:14px;margin-left:5px;vertical-align:top}
/*# sourceMappingURL=input-text.component-N76VSKPL.css.map */`]}));let o=e;return o;})();export{oe as a,$e as b};/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*///# sourceMappingURL=chunk-TBGBDJOR.js.map