mailymaily/dist/mailgo.dark.min.js

2 lines
15 KiB
JavaScript

window.mailgo=function(e){var t={};function a(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(o,n,function(t){return e[t]}.bind(null,n));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=4)}([function(e){e.exports=JSON.parse('{"languages":["en","it"],"translations":{"en":{"open_in":"open in ","cc_":"cc ","bcc_":"bcc ","subject_":"subject ","body_":"body ","gmail":"Gmail","outlook":"Outlook","telegram":"Telegram","whatsapp":"WhatsApp","skype":"Skype","call":"call","open":"open","_default":" default","_as_default":" as default","copy":"copy"},"it":{"open_in":"apri con ","cc_":"cc ","bcc_":"ccn ","subject_":"oggetto ","body_":"testo ","gmail":"Gmail","outlook":"Outlook","telegram":"Telegram","whatsapp":"WhatsApp","skype":"Skype","call":"chiama","open":"apri","_default":" ","_as_default":" ","copy":"copia"}}}')},function(e,t,a){var o=a(2);e.exports="string"==typeof o?o:o.toString()},function(e,t,a){(t=a(3)(!1)).push([e.i,'.m-modal{position:fixed;top:0;right:0;bottom:0;left:0;justify-content:center;align-items:center;flex-direction:column;overflow:hidden;font-size:15px;z-index:10000}.m-modal p,.m-modal span,.m-modal strong,.m-modal a{margin:0;padding:0;font-size:100%;line-height:1;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-rendering:optimizeLegibility}.m-modal strong{font-weight:700}.m-modal .m-modal-back{position:absolute;z-index:10001;top:0;right:0;bottom:0;left:0;background-color:#20232a;opacity:0.8}.m-modal .m-modal-content{position:relative;z-index:10002;box-sizing:content-box;text-align:center;min-width:200px;max-width:240px;background-color:#fff;opacity:0.95;border-radius:20px;box-shadow:0 3px 20px rgba(32,35,42,0.5);color:#4a4a4a;display:flex;flex-direction:column;overflow:auto;padding:24px;transition:0.5s box-shadow}.m-modal .m-modal-content:hover{opacity:1}.m-modal .m-modal-content .m-title{margin-bottom:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.m-modal .m-modal-content .m-details{margin-bottom:10px}.m-modal .m-modal-content .m-details p{font-size:12px;margin-top:3px;margin-bottom:3px}.m-modal .m-modal-content a{padding:10px;color:#4a4a4a;border-radius:20px;text-decoration:none}.m-modal .m-modal-content a.m-gmail{color:#d44638}.m-modal .m-modal-content a.m-gmail:hover{background-color:rgba(212,70,56,0.08);color:#d44638}.m-modal .m-modal-content a.m-outlook{color:#0072c6}.m-modal .m-modal-content a.m-outlook:hover{background-color:rgba(0,114,198,0.08);color:#0072c6}.m-modal .m-modal-content a.m-tg{color:#08c}.m-modal .m-modal-content a.m-tg:hover{background-color:rgba(0,114,198,0.08);color:#08c}.m-modal .m-modal-content a.m-wa{color:#00bfa5}.m-modal .m-modal-content a.m-wa:hover{background-color:rgba(0,191,165,0.08);color:#00bfa5}.m-modal .m-modal-content a.m-skype{color:#00aff0}.m-modal .m-modal-content a.m-skype:hover{background-color:rgba(0,175,240,0.08);color:#00aff0}.m-modal .m-modal-content a.m-copy{padding:16px 10px;font-size:16px}.m-modal .m-modal-content a.m-default:hover,.m-modal .m-modal-content a.m-copy:hover{background-color:rgba(0,0,0,0.08);color:#4a4a4a}.m-modal .m-modal-content a.m-by{font-size:8px;margin-top:0.8rem;padding:5px;color:#4a4a4a;opacity:0.5}.m-modal .m-modal-content a.m-by:hover{opacity:1}.m-modal .m-modal-content .w-500{font-weight:500}.m-modal.m-dark .m-modal-back{background-color:#141414}.m-modal.m-dark .m-modal-content{color:white;box-shadow:0 3px 20px rgba(32,35,42,0.5);background-color:#1e1e1e}.m-modal.m-dark .m-modal-content a{color:white}\n',""]),e.exports=t},function(e,t,a){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var a=function(e,t){var a=e[1]||"",o=e[3];if(!o)return a;if(t&&"function"==typeof btoa){var n=(d=o,l=btoa(unescape(encodeURIComponent(JSON.stringify(d)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(c," */")),i=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[a].concat(i).concat([n]).join("\n")}var d,l,c;return[a].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(a,"}"):a})).join("")},t.i=function(e,a,o){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(o)for(var i=0;i<this.length;i++){var d=this[i][0];null!=d&&(n[d]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);o&&n[c[0]]||(a&&(c[2]?c[2]="".concat(a," and ").concat(c[2]):c[2]=a),t.push(c))}},t}},function(e,t,a){"use strict";a.r(t);var o,n,i,d,l,c,r,s,m,p,u,f,h,g,b,v,y,C,k,w=a(0),L=a(1).toString(),x="mailto:",_="tel:",j="callto:",A="javascript:void(0);",E="span",N="",S="",R="",U="",I="",M="",z="",O="",T="",W=function(e){var t="en",a=w.translations;if((null==e?void 0:e.lang)&&w.languages.includes(e.lang)&&(t=e.lang),!(null==e?void 0:e.forceLang)){var L=document.documentElement.lang;w.languages.includes(L)&&(t=document.documentElement.lang)}var x=a.en,_=a[t],j=te();j.style.display="none",j.id="mailgo",j.classList.add("m-modal"),(null==e?void 0:e.dark)&&j.classList.add("m-dark");var N=te();N.className="m-modal-back",j.appendChild(N);var S=te();S.className="m-modal-content",j.appendChild(S),(o=te("strong")).id="m-title",o.className="m-title",S.appendChild(o);var R=te();R.id="m-details",R.className="m-details",(i=te("p")).id="m-cc";var U=te(E);U.className="w-500",U.appendChild(ae(_.cc_||x.cc_)),(r=te(E)).id="m-cc-value",i.appendChild(U),i.appendChild(r),R.appendChild(i),(d=te("p")).id="m-bcc";var I=te(E);I.className="w-500",I.appendChild(ae(_.bcc_||x.bcc_)),(s=te(E)).id="m-bcc-value",d.appendChild(I),d.appendChild(s),R.appendChild(d),(l=te("p")).id="m-subject";var M=te(E);M.className="w-500",M.appendChild(ae(_.subject_||x.subject_)),(m=te(E)).id="m-subject-value",l.appendChild(M),l.appendChild(m),R.appendChild(l),(c=te("p")).id="m-body";var z=te(E);z.className="w-500",z.appendChild(ae(_.body_||x.body_)),(p=te(E)).id="m-body-value",c.appendChild(z),c.appendChild(p),R.appendChild(c),S.appendChild(R),(u=te("a")).id="m-gmail",u.href=A,u.classList.add("m-open"),u.classList.add("m-gmail"),u.appendChild(ae(_.open_in||x.open_in));var O=te(E);O.className="w-500",O.appendChild(ae(_.gmail||x.gmail)),u.appendChild(O),S.appendChild(u),(f=te("a")).id="m-outlook",f.href=A,f.classList.add("m-open"),f.classList.add("m-outlook"),f.appendChild(ae(_.open_in||x.open_in));var T=te(E);T.className="w-500",T.appendChild(ae(_.outlook||x.outlook)),f.appendChild(T),S.appendChild(f),(h=te("a")).id="m-open",h.href=A,h.classList.add("m-open"),h.classList.add("m-default");var W=te(E);W.className="w-500",W.appendChild(ae(_.open||x.open)),h.appendChild(W),h.appendChild(ae(_._default||x._default)),S.appendChild(h),(C=te("a")).id="m-copy",C.href=A,C.classList.add("m-copy"),C.classList.add("w-500"),C.appendChild(ae(_.copy||x.copy)),S.appendChild(C),S.appendChild(ee()),document.body.appendChild(j),N.addEventListener("click",X);var P=te();P.style.display="none",P.id="mailgo-tel",P.classList.add("m-modal"),(null==e?void 0:e.dark)&&P.classList.add("m-dark");var H=te();H.className="m-modal-back",P.appendChild(H);var D=te();D.className="m-modal-content",P.appendChild(D),(n=te("strong")).id="m-tel-title",n.className="m-title",D.appendChild(n),(g=te("a")).id="m-tg",g.href=A,g.classList.add("m-open"),g.classList.add("m-tg"),g.style.display="none",g.appendChild(ae(_.open_in||x.open_in));var B=te(E);B.className="w-500",B.appendChild(ae(_.telegram||x.telegram)),g.appendChild(B),D.appendChild(g),(b=te("a")).id="m-wa",b.href=A,b.classList.add("m-open"),b.classList.add("m-wa"),b.appendChild(ae(_.open_in||x.open_in));var G=te(E);G.className="w-500",G.appendChild(ae(_.whatsapp||x.whatsapp)),b.appendChild(G),D.appendChild(b),(v=te("a")).id="m-skype",v.href=A,v.classList.add("m-open"),v.classList.add("m-skype"),v.appendChild(ae(_.open_in||x.open_in));var J=te(E);J.className="w-500",J.appendChild(ae(_.skype||x.skype)),v.appendChild(J),D.appendChild(v),(y=te("a")).id="m-call",y.href=A,y.classList.add("m-open"),y.classList.add("m-default");var Z=te(E);Z.className="w-500",Z.appendChild(ae(_.call||x.call)),y.appendChild(Z),y.appendChild(ae(_._as_default||x._as_default)),D.appendChild(y),(k=te("a")).id="m-tel-copy",k.href=A,k.classList.add("m-copy"),k.classList.add("w-500"),k.appendChild(ae(_.copy||x.copy)),D.appendChild(k),D.appendChild(ee()),document.body.appendChild(P),H.addEventListener("click",X),document.addEventListener("click",K)},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail",t=arguments.length>1?arguments[1]:void 0;if("mail"===e){if(t.href&&t.href.toLowerCase().startsWith(x)){N=decodeURIComponent(t.href.split("?")[0].split(x)[1].trim());var a=new URL(t.href).searchParams;R=a.get("cc"),U=a.get("bcc"),I=a.get("subject"),M=a.get("body")}else N=t.getAttribute("data-address")+"@"+t.getAttribute("data-domain"),new URL(x+encodeURIComponent(N)),R=t.getAttribute("data-cc-address")+"@"+t.getAttribute("data-cc-domain"),U=t.getAttribute("data-bcc-address")+"@"+t.getAttribute("data-bcc-domain"),I=t.getAttribute("data-subject"),M=t.getAttribute("data-body");if(!se(N.split(",")))return;R&&!se(R.split(","))&&(R=""),U&&!se(U.split(","))&&(U=""),o.innerHTML=N.split(",").join("<br/>"),R?(i.style.display="block",r.innerHTML=R.split(",").join("<br/>")):i.style.display="none",U?(d.style.display="block",s.innerHTML=U.split(",").join("<br/>")):d.style.display="none",I?(l.style.display="block",m.textContent=I):l.style.display="none",M?(c.style.display="block",p.textContent=M):c.style.display="none",u.addEventListener("click",H),f.addEventListener("click",D),S=ne(N),h.addEventListener("click",B),C.addEventListener("click",(function(){return $(N)}))}"tel"===e&&(t.href&&t.href.toLowerCase().startsWith(_)?z=decodeURIComponent(t.href.split("?")[0].split(_)[1].trim()):t.href&&t.href.toLowerCase().startsWith(j)?z=decodeURIComponent(t.href.split("?")[0].split(j)[1].trim()):t.hasAttribute("data-tel")&&(z=t.getAttribute("data-tel"),t.getAttribute("data-msg")),t.hasAttribute("data-telegram")&&(O=t.getAttribute("data-telegram")),t.hasAttribute("data-skype")&&(T=t.getAttribute("data-skype")),n.innerHTML=z,b.addEventListener("click",Z),O&&(le("m-tg","block"),g.addEventListener("click",G)),v.addEventListener("click",J),y.addEventListener("click",F),k.addEventListener("click",(function(){return $(z)}))),V(e),document.addEventListener("keydown",Q)},H=function(){var e="https://mail.google.com/mail/u/0/?view=cm&source=mailto&to="+encodeURIComponent(N);R&&(e=e.concat("&cc="+encodeURIComponent(R))),U&&(e=e.concat("&bcc="+encodeURIComponent(U))),I&&(e=e.concat("&subject="+I)),M&&(e=e.concat("&body="+M)),window.open(e,"_blank"),X()},D=function(){var e="https://outlook.live.com/owa/?path=/mail/action/compose&to="+encodeURIComponent(N);I&&(e=e.concat("&subject="+I)),M&&(e=e.concat("&body="+M)),window.open(e,"_blank"),X()},B=function(){oe(S),X()},G=function(){var e="https://t.me/"+O;window.open(e,"_blank"),X()},J=function(){var e="skype:"+(""!==T?T:z);window.open(e,"_blank"),X()},Z=function(){var e="https://wa.me/"+z;window.open(e,"_blank"),X()},F=function(){var e="tel:"+z;window.open(e),X()},$=function(e){var t;me(e),(t=Y("mail")?C:k).textContent="copied",setTimeout((function(){t.textContent="copy",X()}),999)},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mail",a=e.href;return"mail"===t?a&&a.toLowerCase().startsWith(x)&&!e.classList.contains("no-mailgo")||e.hasAttribute("data-address")&&(a&&"#mailgo"===e.getAttribute("href").toLowerCase()||e.classList&&e.classList.contains("mailgo")):"tel"===t&&(a&&(a.toLowerCase().startsWith(_)||a.toLowerCase().startsWith(j))&&!e.classList.contains("no-mailgo")||e.hasAttribute("data-tel")&&a&&"#mailgo"===e.getAttribute("href").toLowerCase()||e.classList&&e.classList.contains("mailgo"))},K=function(e){if(document.contains(ie("mailgo"))&&document.contains(ie("mailgo-tel"))){if(Y("mail")||Y("tel"))return!1;var t=e.composedPath&&e.composedPath()||ce(e.target);return t&&t.forEach((function(t){return!(t instanceof HTMLDocument||t instanceof Window)&&(q(t,"mail")?(e.preventDefault(),P("mail",t),!0):q(t,"tel")?(e.preventDefault(),P("tel",t),!0):void 0)})),!1}},Q=function(e){if(Y("mail"))switch(e.keyCode){case 27:X();break;case 71:H();break;case 79:D();break;case 32:case 13:B();break;case 67:$(N);break;default:return}else if(Y("tel"))switch(e.keyCode){case 27:X();break;case 84:G();break;case 87:Z();break;case 32:case 13:F();break;case 67:$(z);break;default:return}},V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail";return"mail"===e?(le("mailgo","flex"),!0):"tel"===e&&(le("mailgo-tel","flex"),!0)},X=function(){le("mailgo","none"),le("mailgo-tel","none"),document.removeEventListener("keydown",Q)},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mail";return"mail"===e?"flex"===de("mailgo"):"tel"===e&&"flex"===de("mailgo-tel")},ee=function(){var e=te("a");return e.href="https://mailgo.js.org?ref=mailgo-modal",e.className="m-by",e.target="_blank",e.rel="noopener noreferrer",e.appendChild(ae("mailgo.js.org")),e},te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div";return document.createElement(e)},ae=function(e){return document.createTextNode(e)},oe=function(e){return window.location.href=x+atob(e)},ne=function(e){return btoa(e)},ie=function(e){return document.getElementById(e)},de=function(e){return ie(e).style.display},le=function(e,t){return ie(e).style.display=t},ce=function(e){for(var t=[];e;){if(t.push(e),"HTML"===e.tagName)return t.push(document),t.push(window),t;e=e.parentElement}},re=function(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},se=function(e){return e.every(re)},me=function(e){var t=te("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);var a=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);return t.select(),document.execCommand("copy"),document.body.removeChild(t),!!a&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(a),!0)},pe=function(e){var t;window&&"undefined"!=typeof window&&((t=te("style")).id="mailgo-style",t.type="text/css",t.appendChild(ae(L)),document.head.appendChild(t),(null==e?void 0:e.initEvent)?document.addEventListener(e.initEvent,(function(){W(e)})):W(e))};pe({initEvent:"DOMContentLoaded",dark:!0})}]);
//# sourceMappingURL=mailgo.dark.min.js.map