import{N as D,db as L,vb as U}from"./chunk-ROXKKVPK.js";import{C as b,D as u,Fa as d,Ha as h,Jb as S,Kb as k,Nb as M,Pa as W,Qb as A,Rc as V,S as i,Ta as y,Ua as g,X as I,ab as v,bc as B,bd as R,da as l,ea as p,fb as T,ja as C,ka as r,la as o,lc as O,ma as c,oc as E,ra as _,ta as f,va as x,xb as P}from"./chunk-ZVAMPSQU.js";import{j as w}from"./chunk-FB5LSH2R.js";var F=e=>({hasActionButton:e});function N(e,t){e&1&&(r(0,"span"),d(1),y(2,"translate"),o()),e&2&&(i(),h(" ",g(2,1,"components.copyWithWebshare.shareIcon")," "))}function H(e,t){if(e&1){let m=_();r(0,"ion-button",6),f("click",function(){b(m);let n=x();return u(n.webShare())}),c(1,"ion-icon",7),o()}}function j(e,t){if(e&1){let m=_();r(0,"ion-button",6),f("click",function(){b(m);let n=x();return u(n.clipboard())}),c(1,"ion-icon",8),o()}}var ee=(()=>{let t=class t{constructor(){this.disableWebshare=!1,this.hasCopyAPI=!!document.execCommand,this.hasWebShareAPI=!!navigator.share,U({copyOutline:D,shareOutline:L})}ngAfterViewInit(){this.hasWebShareAPI=this.hasWebShareAPI&&!this.disableWebshare}webShare(){return w(this,null,function*(){if(this.hasWebShareAPI)try{yield navigator.share({title:this.webshareTitle,text:this.webshareText,url:this.webshareURL})}catch(s){}})}clipboard(){document.getElementById("codeBlockCopy").select(),document.execCommand("copy")}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=I({type:t,selectors:[["copy-with-webshare"]],inputs:{webshareTitle:"webshareTitle",webshareText:"webshareText",webshareURL:"webshareURL",copyText:"copyText",disableWebshare:"disableWebshare"},decls:14,vars:11,consts:[["lines","none"],[1,"ion-text-wrap"],[1,"codeBlock"],[1,"code",3,"ngClass"],["fill","clear"],["id","codeBlockCopy","type","text",1,"invisible",3,"ngModel"],["fill","clear",3,"click"],["name","share-outline","slot","icon-only"],["name","copy-outline","slot","icon-only"]],template:function(n,a){n&1&&(r(0,"div"),c(1,"br"),r(2,"ion-item",0)(3,"ion-label",1)(4,"p"),d(5),y(6,"translate"),l(7,N,3,3,"span"),o()()(),r(8,"div",2)(9,"div",3),d(10),o(),l(11,H,2,0,"ion-button",4),l(12,j,2,0,"ion-button",4),o(),c(13,"textarea",5),o()),n&2&&(i(5),h(" ",g(6,7,"components.copyWithWebshare.instructions")," "),i(2),p(a.hasWebShareAPI?-1:7),i(2),C("ngClass",W(9,F,a.hasWebShareAPI)),i(),h(" ",a.copyText," "),i(),p(a.hasWebShareAPI?11:-1),i(),p(!a.hasWebShareAPI&&a.hasCopyAPI?12:-1),i(),C("ngModel",a.copyText))},dependencies:[T,v,A,S,k,M,P,O,E,B,V,R],styles:[".codeBlock[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--ion-background-tint-color);color:var(--ion-text-color);border-radius:10px;margin:10px;padding:15px}.codeBlock[_ngcontent-%COMP%]   .code[_ngcontent-%COMP%]{flex-grow:1;-webkit-user-select:all;user-select:all;word-wrap:break-word;min-width:0;max-width:100%}.codeBlock[_ngcontent-%COMP%]   .code.hasActionButton[_ngcontent-%COMP%]{padding-right:20px}.codeBlock[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{flex-shrink:0}"]});let e=t;return e})();export{ee as a};
