import{Aa as l,Ca as f,Da as m,Xb as h,jb as y,kb as _,na as a,oa as u,pa as p,ra as s}from"./chunk-GJDGQISV.js";var r=class{_document;_textarea;constructor(n,e){this._document=e;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=n,t.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(t)}copy(){let n=this._textarea,e=!1;try{if(n){let t=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),e=this._document.execCommand("copy"),t&&t.focus()}}catch(t){}return e}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},C=(()=>{class o{_document=s(l);constructor(){}copy(e){let t=this.beginCopy(e),i=t.copy();return t.destroy(),i}beginCopy(e){return new r(e,this._document)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=a({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),g=new p("CDK_COPY_TO_CLIPBOARD_CONFIG"),I=(()=>{class o{_clipboard=s(C);_ngZone=s(m);text="";attempts=1;copied=new f;_pending=new Set;_destroyed=!1;_currentTimeout;constructor(){let e=s(g,{optional:!0});e&&e.attempts!=null&&(this.attempts=e.attempts)}copy(e=this.attempts){if(e>1){let t=e,i=this._clipboard.beginCopy(this.text);this._pending.add(i);let c=()=>{let d=i.copy();!d&&--t&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(d))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(e=>e.destroy()),this._pending.clear(),this._destroyed=!0}static \u0275fac=function(t){return new(t||o)};static \u0275dir=_({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,i){t&1&&h("click",function(){return i.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}})}return o})(),M=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=y({type:o});static \u0275inj=u({})}return o})();export{C as a,I as b,M as c};
