maildo 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var Ye=Object.defineProperty;var ze=(e,t,n)=>t in e?Ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ce=(e,t,n)=>ze(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(l){if(l.ep)return;l.ep=!0;const r=n(l);fetch(l.href,r)}})();function j(){}function je(e){return e()}function be(){return Object.create(null)}function V(e){e.forEach(je)}function Ne(e){return typeof e=="function"}function ie(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Be(e){return Object.keys(e).length===0}function We(e,...t){if(e==null){for(const o of t)o(void 0);return j}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function le(e,t,n){e.$$.on_destroy.push(We(t,n))}function se(e,t,n){return e.set(n),t}function u(e,t){e.appendChild(t)}function $(e,t,n){e.insertBefore(t,n||null)}function y(e){e.parentNode&&e.parentNode.removeChild(e)}function a(e){return document.createElement(e)}function A(e){return document.createTextNode(e)}function b(){return A(" ")}function Fe(){return A("")}function v(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function G(e){return function(t){return t.preventDefault(),e.call(this,t)}}function Ie(e){return function(t){t.target===this&&e.call(this,t)}}function U(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ge(e){return Array.from(e.childNodes)}function Y(e,t){t=""+t,e.data!==t&&(e.data=t)}let oe;function ne(e){oe=e}function de(){if(!oe)throw new Error("Function called outside component initialization");return oe}function pe(e){de().$$.on_mount.push(e)}function ye(e,t){return de().$$.context.set(e,t),t}function He(e){return de().$$.context.get(e)}const x=[],$e=[];let te=[];const we=[],Ke=Promise.resolve();let ue=!1;function Ve(){ue||(ue=!0,Ke.then(qe))}function ae(e){te.push(e)}const fe=new Set;let X=0;function qe(){if(X!==0)return;const e=oe;do{try{for(;X<x.length;){const t=x[X];X++,ne(t),Je(t.$$)}}catch(t){throw x.length=0,X=0,t}for(ne(null),x.length=0,X=0;$e.length;)$e.pop()();for(let t=0;t<te.length;t+=1){const n=te[t];fe.has(n)||(fe.add(n),n())}te.length=0}while(x.length);for(;we.length;)we.pop()();ue=!1,fe.clear(),ne(e)}function Je(e){if(e.fragment!==null){e.update(),V(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ae)}}function Qe(e){const t=[],n=[];te.forEach(o=>e.indexOf(o)===-1?t.push(o):n.push(o)),n.forEach(o=>o()),te=t}const re=new Set;let K;function ke(){K={r:0,c:[],p:K}}function Le(){K.r||V(K.c),K=K.p}function q(e,t){e&&e.i&&(re.delete(e),e.i(t))}function ee(e,t,n,o){if(e&&e.o){if(re.has(e))return;re.add(e),K.c.push(()=>{re.delete(e),o&&(n&&e.d(1),o())}),e.o(t)}else o&&o()}function ve(e){e&&e.c()}function me(e,t,n){const{fragment:o,after_update:l}=e.$$;o&&o.m(t,n),ae(()=>{const r=e.$$.on_mount.map(je).filter(Ne);e.$$.on_destroy?e.$$.on_destroy.push(...r):V(r),e.$$.on_mount=[]}),l.forEach(ae)}function he(e,t){const n=e.$$;n.fragment!==null&&(Qe(n.after_update),V(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Xe(e,t){e.$$.dirty[0]===-1&&(x.push(e),Ve(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function _e(e,t,n,o,l,r,s=null,c=[-1]){const p=oe;ne(e);const i=e.$$={fragment:null,ctx:[],props:r,update:j,not_equal:l,bound:be(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(p?p.$$.context:[])),callbacks:be(),dirty:c,skip_bound:!1,root:t.target||p.$$.root};s&&s(i.root);let m=!1;if(i.ctx=n?n(e,t.props||{},(h,d,..._)=>{const k=_.length?_[0]:d;return i.ctx&&l(i.ctx[h],i.ctx[h]=k)&&(!i.skip_bound&&i.bound[h]&&i.bound[h](k),m&&Xe(e,h)),d}):[],i.update(),m=!0,V(i.before_update),i.fragment=o?o(i.ctx):!1,t.target){if(t.hydrate){const h=Ge(t.target);i.fragment&&i.fragment.l(h),h.forEach(y)}else i.fragment&&i.fragment.c();t.intro&&q(e.$$.fragment),me(e,t.target,t.anchor),qe()}ne(p)}class ge{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){he(this,1),this.$destroy=j}$on(t,n){if(!Ne(n))return j;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const l=o.indexOf(n);l!==-1&&o.splice(l,1)}}$set(t){this.$$set&&!Be(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ze="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ze);function Ce(e){let t,n,o,l;return{c(){t=a("strong"),t.textContent="cc",n=b(),o=A(e[1]),l=a("br")},m(r,s){$(r,t,s),$(r,n,s),$(r,o,s),$(r,l,s)},p(r,s){s&2&&Y(o,r[1])},d(r){r&&(y(t),y(n),y(o),y(l))}}}function Ee(e){let t,n,o,l;return{c(){t=a("strong"),t.textContent="bcc",n=b(),o=A(e[2]),l=a("br")},m(r,s){$(r,t,s),$(r,n,s),$(r,o,s),$(r,l,s)},p(r,s){s&4&&Y(o,r[2])},d(r){r&&(y(t),y(n),y(o),y(l))}}}function Se(e){let t,n,o,l;return{c(){t=a("strong"),t.textContent="subject",n=b(),o=A(e[3]),l=a("br")},m(r,s){$(r,t,s),$(r,n,s),$(r,o,s),$(r,l,s)},p(r,s){s&8&&Y(o,r[3])},d(r){r&&(y(t),y(n),y(o),y(l))}}}function Te(e){let t,n,o,l;return{c(){t=a("strong"),t.textContent="body",n=b(),o=A(e[4]),l=a("br")},m(r,s){$(r,t,s),$(r,n,s),$(r,o,s),$(r,l,s)},p(r,s){s&16&&Y(o,r[4])},d(r){r&&(y(t),y(n),y(o),y(l))}}}function xe(e){let t,n,o,l,r,s,c,p,i,m,h,d,_,k,P,R,D,z,T,M,f,g,N,B,W=e[6]?"copied":"copy",F,J,Q,O,I,L=e[1]&&Ce(e),C=e[2]&&Ee(e),E=e[3]&&Se(e),S=e[4]&&Te(e);return{c(){t=a("dialog"),n=a("article"),o=a("h4"),l=A(e[0]),r=b(),s=a("p"),c=a("small"),L&&L.c(),p=b(),C&&C.c(),i=b(),E&&E.c(),m=b(),S&&S.c(),h=b(),d=a("section"),_=a("a"),_.innerHTML="open in <strong>Gmail</strong>",k=b(),P=a("a"),P.innerHTML="open in <strong>Outlook</strong>",R=b(),D=a("a"),D.innerHTML="open in <strong>Yahoo Mail</strong>",z=b(),T=a("a"),M=a("strong"),M.textContent="open",f=A(" default"),g=b(),N=a("a"),B=a("strong"),F=A(W),J=b(),Q=a("footer"),Q.innerHTML='<small><a href="https://github.com/Sammy-T/maildo" target="_blank">maildo</a></small>',U(_,"href","#gmail"),U(P,"href","#outlook"),U(D,"href","#yahoo"),U(T,"href",e[5]),U(N,"href","#copy"),t.open=!0},m(w,H){$(w,t,H),u(t,n),u(n,o),u(o,l),u(n,r),u(n,s),u(s,c),L&&L.m(c,null),u(c,p),C&&C.m(c,null),u(c,i),E&&E.m(c,null),u(c,m),S&&S.m(c,null),u(n,h),u(n,d),u(d,_),u(d,k),u(d,P),u(d,R),u(d,D),u(d,z),u(d,T),u(T,M),u(T,f),u(d,g),u(d,N),u(N,B),u(B,F),u(n,J),u(n,Q),O||(I=[v(_,"click",G(e[8])),v(P,"click",G(e[9])),v(D,"click",G(e[10])),v(N,"click",G(e[11])),v(t,"click",Ie(e[12]))],O=!0)},p(w,[H]){H&1&&Y(l,w[0]),w[1]?L?L.p(w,H):(L=Ce(w),L.c(),L.m(c,p)):L&&(L.d(1),L=null),w[2]?C?C.p(w,H):(C=Ee(w),C.c(),C.m(c,i)):C&&(C.d(1),C=null),w[3]?E?E.p(w,H):(E=Se(w),E.c(),E.m(c,m)):E&&(E.d(1),E=null),w[4]?S?S.p(w,H):(S=Te(w),S.c(),S.m(c,null)):S&&(S.d(1),S=null),H&32&&U(T,"href",w[5]),H&64&&W!==(W=w[6]?"copied":"copy")&&Y(F,W)},i:j,o:j,d(w){w&&y(t),L&&L.d(),C&&C.d(),E&&E.d(),S&&S.d(),O=!1,V(I)}}}const Ue="type-url",Ae="type-data";function et(e,t,n){let o;const l=He("selectedMailto");le(e,l,f=>n(14,o=f));let r="",s="",c="",p="",i="",m="",h="",d=!1;function _(){const f=new URL(o.href),{searchParams:g}=f;n(0,s=f.pathname),n(1,c=g.get("cc")),n(2,p=g.get("bcc")),n(3,i=g.get("subject")),n(4,m=g.get("body"))}function k(){const{dataset:f}=o;n(0,s=f.address&&f.domain?`${f.address}@${f.domain}`:""),n(1,c=f.ccAddress&&f.ccDomain?`${f.ccAddress}@${f.ccDomain}`:""),n(2,p=f.bccAddress&&f.bccDomain?`${f.bccAddress}@${f.bccDomain}`:""),n(3,i=f.subject),n(4,m=f.body)}function P(){switch(r){case Ue:return o.href;case Ae:const f=new URLSearchParams;c&&f.set("cc",c),p&&f.set("bcc",p),i&&f.set("subject",i),m&&f.set("body",m);const g=new URL(`mailto:${s}`);return g.search=f.toString(),g.toString();default:return console.error(`Invalid mailto type: ${r}`),""}}function R(){const f=P(),g="https://mail.google.com/mail/?extsrc=mailto&url="+encodeURIComponent(f);window.open(g,"_blank","noopener, noreferrer"),M()}function D(){const f=new URLSearchParams;f.set("path","/mail/action/compose"),s&&f.set("to",s),i&&f.set("subject",i),m&&f.set("body",m);const g=new URL("https://outlook.live.com/owa/");g.search=f.toString(),window.open(g.toString(),"_blank","noopener, noreferrer"),M()}function z(){const f=new URLSearchParams;s&&f.set("to",s),i&&f.set("subject",i),m&&f.set("body",m);const g=new URL("https://compose.mail.yahoo.com");g.search=f.toString(),window.open(g.toString(),"_blank","noopener, noreferrer"),M()}async function T(){try{await navigator.clipboard.writeText(s),n(6,d=!0),setTimeout(M,1500)}catch(f){console.error("Unable to copy to clipboard.",f)}}function M(){se(l,o=null,o)}return pe(()=>{o.href.startsWith("mailto:")?(r=Ue,_()):(r=Ae,k()),n(5,h=P())}),[s,c,p,i,m,h,d,l,R,D,z,T,M]}class tt extends ge{constructor(t){super(),_e(this,t,et,xe,ie,{})}}function nt(e){let t,n,o,l,r,s,c,p,i,m,h,d,_,k,P,R,D,z,T,M,f,g,N=e[1]?"copied":"copy",B,W,F,J,Q;return{c(){t=a("dialog"),n=a("article"),o=a("h4"),l=A(e[0]),r=b(),s=a("section"),c=a("a"),c.innerHTML="open in <strong>WhatsApp</strong>",p=b(),i=a("a"),i.innerHTML="open in <strong>Skype</strong>",m=b(),h=a("a"),d=a("strong"),d.textContent="call",_=A(" as default"),P=b(),R=a("a"),D=a("strong"),D.textContent="text",z=A(" as default"),M=b(),f=a("a"),g=a("strong"),B=A(N),W=b(),F=a("footer"),F.innerHTML='<small><a href="https://github.com/Sammy-T/maildo" target="_blank">maildo</a></small>',U(c,"href","#whatsapp"),U(i,"href","#skype"),U(h,"href",k=`tel:${e[0]}`),U(R,"href",T=`sms:${e[0]}`),U(f,"href","#copy"),t.open=!0},m(O,I){$(O,t,I),u(t,n),u(n,o),u(o,l),u(n,r),u(n,s),u(s,c),u(s,p),u(s,i),u(s,m),u(s,h),u(h,d),u(h,_),u(s,P),u(s,R),u(R,D),u(R,z),u(s,M),u(s,f),u(f,g),u(g,B),u(n,W),u(n,F),J||(Q=[v(c,"click",G(e[3])),v(i,"click",G(e[4])),v(f,"click",G(e[5])),v(t,"click",Ie(e[6]))],J=!0)},p(O,[I]){I&1&&Y(l,O[0]),I&1&&k!==(k=`tel:${O[0]}`)&&U(h,"href",k),I&1&&T!==(T=`sms:${O[0]}`)&&U(R,"href",T),I&2&&N!==(N=O[1]?"copied":"copy")&&Y(B,N)},i:j,o:j,d(O){O&&y(t),J=!1,V(Q)}}}const Me=/^(tel:)|^(callto:)/;function ot(e,t,n){let o;const l=He("selectedCallto");le(e,l,_=>n(8,o=_));let r="",s=!1;function c(){n(0,r=o.href.replace(Me,""))}function p(){const{dataset:_}=o;n(0,r=_.tel)}function i(){const k=`https://wa.me/${r.replaceAll(/\D/g,"").replace(/^0+/,"")}`;window.open(k,"_blank","noopener, noreferrer"),d()}function m(){const _=`skype:${encodeURIComponent(r)}`;window.open(_,"_blank","noopener, noreferrer"),d()}async function h(){try{await navigator.clipboard.writeText(r),n(1,s=!0),setTimeout(d,1500)}catch(_){console.error("Unable to copy to clipboard.",_)}}function d(){se(l,o=null,o)}return pe(()=>{Me.test(o.href)?c():p()}),[r,s,l,i,m,h,d]}class rt extends ge{constructor(t){super(),_e(this,t,ot,nt,ie,{})}}const Z=[];function Oe(e,t=j){let n;const o=new Set;function l(c){if(ie(e,c)&&(e=c,n)){const p=!Z.length;for(const i of o)i[1](),Z.push(i,e);if(p){for(let i=0;i<Z.length;i+=2)Z[i][0](Z[i+1]);Z.length=0}}}function r(c){l(c(e))}function s(c,p=j){const i=[c,p];return o.add(i),o.size===1&&(n=t(l,r)||j),c(e),()=>{o.delete(i),o.size===0&&n&&(n(),n=null)}}return{set:l,update:r,subscribe:s}}function Pe(e){let t,n;return t=new tt({}),{c(){ve(t.$$.fragment)},m(o,l){me(t,o,l),n=!0},i(o){n||(q(t.$$.fragment,o),n=!0)},o(o){ee(t.$$.fragment,o),n=!1},d(o){he(t,o)}}}function Re(e){let t,n;return t=new rt({}),{c(){ve(t.$$.fragment)},m(o,l){me(t,o,l),n=!0},i(o){n||(q(t.$$.fragment,o),n=!0)},o(o){ee(t.$$.fragment,o),n=!1},d(o){he(t,o)}}}function lt(e){let t,n,o,l=e[1]&&Pe(),r=e[0]&&Re();return{c(){l&&l.c(),t=b(),r&&r.c(),n=Fe()},m(s,c){l&&l.m(s,c),$(s,t,c),r&&r.m(s,c),$(s,n,c),o=!0},p(s,[c]){s[1]?l?c&2&&q(l,1):(l=Pe(),l.c(),q(l,1),l.m(t.parentNode,t)):l&&(ke(),ee(l,1,1,()=>{l=null}),Le()),s[0]?r?c&1&&q(r,1):(r=Re(),r.c(),q(r,1),r.m(n.parentNode,n)):r&&(ke(),ee(r,1,1,()=>{r=null}),Le())},i(s){o||(q(l),q(r),o=!0)},o(s){ee(l),ee(r),o=!1},d(s){s&&(y(t),y(n)),l&&l.d(s),r&&r.d(s)}}}const st='a[href^="mailto:"]:not(.no-maildo), a[href="#maildo"][data-address], a.maildo[data-address]',it='a[href^="tel:"]:not(.no-maildo), a[href^="callto:"]:not(.no-maildo), a[href="#maildo"][data-tel], a.maildo[data-tel]';function ct(e,t,n){let o,l;const r=Oe(null);le(e,r,c=>n(1,l=c)),ye("selectedMailto",r);const s=Oe(null);return le(e,s,c=>n(0,o=c)),ye("selectedCallto",s),pe(()=>{const c=document.querySelectorAll(st),p=document.querySelectorAll(it);c.forEach(i=>{i.addEventListener("click",m=>{m.preventDefault(),se(r,l=i,l)})}),p.forEach(i=>{i.addEventListener("click",m=>{m.preventDefault(),se(s,o=i,o)})})}),[o,l,r,s]}class ft extends ge{constructor(t){super(),_e(this,t,ct,lt,ie,{})}}const De="maildo-app";function ut(){let e=document.getElementById(De);if(!e)e=document.createElement("slot"),e.id=De,document.body.appendChild(e);else if(e.childElementCount>0){console.warn("App target already exists");return}new ft({target:e})}ut();
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const s of l.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();const tn=!1;var me=Array.isArray,en=Array.from,nn=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,ye=Object.getOwnPropertyDescriptors,rn=Object.prototype,on=Array.prototype,bt=Object.getPrototypeOf;const tt=()=>{};function ln(t){return t()}function oe(t){for(var e=0;e<t.length;e++)t[e]()}const M=2,be=4,vt=8,Ft=16,U=32,St=64,Nt=128,H=256,wt=512,D=1024,W=2048,pt=4096,nt=8192,lt=16384,sn=32768,jt=65536,an=1<<19,we=1<<20,ct=Symbol("$state");function Ee(t){return t===this.v}function xe(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function un(t){return!xe(t,this.v)}function fn(t){throw new Error("effect_in_teardown")}function cn(){throw new Error("effect_in_unowned_derived")}function _n(t){throw new Error("effect_orphan")}function dn(){throw new Error("effect_update_depth_exceeded")}function vn(){throw new Error("state_descriptors_fixed")}function pn(){throw new Error("state_prototype_fixed")}function hn(){throw new Error("state_unsafe_local_read")}function gn(){throw new Error("state_unsafe_mutation")}let ht=!1;function mn(){ht=!0}function L(t){return{f:0,v:t,reactions:null,equals:Ee,version:0}}function j(t){return bn(L(t))}function yn(t,e=!1){var r;const n=L(t);return e||(n.equals=un),ht&&y!==null&&y.l!==null&&((r=y.l).s??(r.s=[])).push(n),n}function bn(t){return b!==null&&b.f&M&&(P===null?Mn([t]):P.push(t)),t}function w(t,e){return b!==null&&Vt()&&b.f&(M|Ft)&&(P===null||!P.includes(t))&&gn(),wn(t,e)}function wn(t,e){return t.equals(e)||(t.v=e,t.version=qe(),Te(t,W),Vt()&&m!==null&&m.f&D&&!(m.f&U)&&(k!==null&&k.includes(t)?(I(m,W),At(m)):V===null?Pn([t]):V.push(t))),e}function Te(t,e){var n=t.reactions;if(n!==null)for(var r=Vt(),o=n.length,l=0;l<o;l++){var s=n[l],c=s.f;c&W||!r&&s===m||(I(s,e),c&(D|H)&&(c&M?Te(s,pt):At(s)))}}const En=1,xn=2,C=Symbol();function T(t,e=null,n){if(typeof t!="object"||t===null||ct in t)return t;const r=bt(t);if(r!==rn&&r!==on)return t;var o=new Map,l=me(t),s=L(0);l&&o.set("length",L(t.length));var c;return new Proxy(t,{defineProperty(a,i,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&vn();var f=o.get(i);return f===void 0?(f=L(u.value),o.set(i,f)):w(f,T(u.value,c)),!0},deleteProperty(a,i){var u=o.get(i);if(u===void 0)i in a&&o.set(i,L(C));else{if(l&&typeof i=="string"){var f=o.get("length"),_=Number(i);Number.isInteger(_)&&_<f.v&&w(f,_)}w(u,C),le(s)}return!0},get(a,i,u){var g;if(i===ct)return t;var f=o.get(i),_=i in a;if(f===void 0&&(!_||(g=ft(a,i))!=null&&g.writable)&&(f=L(T(_?a[i]:C,c)),o.set(i,f)),f!==void 0){var v=d(f);return v===C?void 0:v}return Reflect.get(a,i,u)},getOwnPropertyDescriptor(a,i){var u=Reflect.getOwnPropertyDescriptor(a,i);if(u&&"value"in u){var f=o.get(i);f&&(u.value=d(f))}else if(u===void 0){var _=o.get(i),v=_==null?void 0:_.v;if(_!==void 0&&v!==C)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return u},has(a,i){var v;if(i===ct)return!0;var u=o.get(i),f=u!==void 0&&u.v!==C||Reflect.has(a,i);if(u!==void 0||m!==null&&(!f||(v=ft(a,i))!=null&&v.writable)){u===void 0&&(u=L(f?T(a[i],c):C),o.set(i,u));var _=d(u);if(_===C)return!1}return f},set(a,i,u,f){var $;var _=o.get(i),v=i in a;if(l&&i==="length")for(var g=u;g<_.v;g+=1){var E=o.get(g+"");E!==void 0?w(E,C):g in a&&(E=L(C),o.set(g+"",E))}_===void 0?(!v||($=ft(a,i))!=null&&$.writable)&&(_=L(void 0),w(_,T(u,c)),o.set(i,_)):(v=_.v!==C,w(_,T(u,c)));var N=Reflect.getOwnPropertyDescriptor(a,i);if(N!=null&&N.set&&N.set.call(f,u),!v){if(l&&typeof i=="string"){var F=o.get("length"),R=Number(i);Number.isInteger(R)&&R>=F.v&&w(F,R+1)}le(s)}return!0},ownKeys(a){d(s);var i=Reflect.ownKeys(a).filter(_=>{var v=o.get(_);return v===void 0||v.v!==C});for(var[u,f]of o)f.v!==C&&!(u in a)&&i.push(u);return i},setPrototypeOf(){pn()}})}function le(t,e=1){w(t,t.v+e)}var ie,ke,Se;function Tn(){if(ie===void 0){ie=window;var t=Element.prototype,e=Node.prototype;ke=ft(e,"firstChild").get,Se=ft(e,"nextSibling").get,t.__click=void 0,t.__className="",t.__attributes=null,t.__styles=null,t.__e=void 0,Text.prototype.__t=void 0}}function kn(t=""){return document.createTextNode(t)}function Et(t){return ke.call(t)}function qt(t){return Se.call(t)}function S(t,e){return Et(t)}function ut(t,e){{var n=Et(t);return n instanceof Comment&&n.data===""?qt(n):n}}function x(t,e=1,n=!1){let r=t;for(;e--;)r=qt(r);return r}function Sn(t){var e=M|W;m===null?e|=H:m.f|=we;var n=b!==null&&b.f&M?b:null;const r={children:null,ctx:y,deps:null,equals:Ee,f:e,fn:t,reactions:null,v:null,version:0,parent:n??m};return n!==null&&(n.children??(n.children=[])).push(r),r}function De(t){var e=t.children;if(e!==null){t.children=null;for(var n=0;n<e.length;n+=1){var r=e[n];r.f&M?Yt(r):st(r)}}}function Dn(t){for(var e=t.parent;e!==null;){if(!(e.f&M))return e;e=e.parent}return null}function Ae(t){var e,n=m;ot(Dn(t));try{De(t),e=Ye(t)}finally{ot(n)}return e}function Ce(t){var e=Ae(t),n=(Q||t.f&H)&&t.deps!==null?pt:D;I(t,n),t.equals(e)||(t.v=e,t.version=qe())}function Yt(t){De(t),dt(t,0),I(t,lt),t.v=t.children=t.deps=t.ctx=t.reactions=null}function Oe(t){m===null&&b===null&&_n(),b!==null&&b.f&H&&cn(),Bt&&fn()}function An(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function it(t,e,n,r=!0){var o=(t&St)!==0,l=m,s={ctx:y,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:t|W,first:null,fn:e,last:null,next:null,parent:o?null:l,prev:null,teardown:null,transitions:null,version:0};if(n){var c=et;try{ue(!0),Dt(s),s.f|=sn}catch(u){throw st(s),u}finally{ue(c)}}else e!==null&&At(s);var a=n&&s.deps===null&&s.first===null&&s.nodes_start===null&&s.teardown===null&&(s.f&we)===0;if(!a&&!o&&r&&(l!==null&&An(s,l),b!==null&&b.f&M)){var i=b;(i.children??(i.children=[])).push(s)}return s}function Cn(t){const e=it(vt,null,!1);return I(e,D),e.teardown=t,e}function Rt(t){Oe();var e=m!==null&&(m.f&U)!==0&&y!==null&&!y.m;if(e){var n=y;(n.e??(n.e=[])).push({fn:t,effect:m,reaction:b})}else{var r=$e(t);return r}}function On(t){return Oe(),Nn(t)}function $n(t){const e=it(St,t,!0);return()=>{st(e)}}function $e(t){return it(be,t,!1)}function Nn(t){return it(vt,t,!0)}function J(t){return Ne(t)}function Ne(t,e=0){return it(vt|Ft|e,t,!0)}function Lt(t,e=!0){return it(vt|U,t,!0,e)}function Re(t){var e=t.teardown;if(e!==null){const n=Bt,r=b;fe(!0),rt(null);try{e.call(null)}finally{fe(n),rt(r)}}}function Le(t){var e=t.deriveds;if(e!==null){t.deriveds=null;for(var n=0;n<e.length;n+=1)Yt(e[n])}}function Me(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){var r=n.next;st(n,e),n=r}}function Rn(t){for(var e=t.first;e!==null;){var n=e.next;e.f&U||st(e),e=n}}function st(t,e=!0){var n=!1;if((e||t.f&an)&&t.nodes_start!==null){for(var r=t.nodes_start,o=t.nodes_end;r!==null;){var l=r===o?null:qt(r);r.remove(),r=l}n=!0}Me(t,e&&!n),Le(t),dt(t,0),I(t,lt);var s=t.transitions;if(s!==null)for(const a of s)a.stop();Re(t);var c=t.parent;c!==null&&c.first!==null&&Pe(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=null}function Pe(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function se(t,e){var n=[];Ue(t,n,!0),Ln(n,()=>{st(t),e&&e()})}function Ln(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function Ue(t,e,n){if(!(t.f&nt)){if(t.f^=nt,t.transitions!==null)for(const s of t.transitions)(s.is_global||n)&&e.push(s);for(var r=t.first;r!==null;){var o=r.next,l=(r.f&jt)!==0||(r.f&U)!==0;Ue(r,e,l?n:!1),r=o}}}function ae(t){Ie(t,!0)}function Ie(t,e){if(t.f&nt){gt(t)&&Dt(t),t.f^=nt;for(var n=t.first;n!==null;){var r=n.next,o=(n.f&jt)!==0||(n.f&U)!==0;Ie(n,o?e:!1),n=r}if(t.transitions!==null)for(const l of t.transitions)(l.is_global||e)&&l.in()}}function Fe(t){throw new Error("lifecycle_outside_component")}let yt=!1,xt=!1,et=!1,Bt=!1;function ue(t){et=t}function fe(t){Bt=t}let Mt=[],_t=0;let b=null;function rt(t){b=t}let m=null;function ot(t){m=t}let P=null;function Mn(t){P=t}let k=null,O=0,V=null;function Pn(t){V=t}let je=0,Q=!1,y=null;function qe(){return++je}function Vt(){return!ht||y!==null&&y.l===null}function gt(t){var s,c;var e=t.f;if(e&W)return!0;if(e&pt){var n=t.deps,r=(e&H)!==0;if(n!==null){var o;if(e&wt){for(o=0;o<n.length;o++)((s=n[o]).reactions??(s.reactions=[])).push(t);t.f^=wt}for(o=0;o<n.length;o++){var l=n[o];if(gt(l)&&Ce(l),r&&m!==null&&!Q&&!((c=l==null?void 0:l.reactions)!=null&&c.includes(t))&&(l.reactions??(l.reactions=[])).push(t),l.version>t.version)return!0}}r||I(t,D)}return!1}function Un(t,e){for(var n=e;n!==null;){if(n.f&Nt)try{n.fn(t);return}catch{n.f^=Nt}n=n.parent}throw yt=!1,t}function In(t){return(t.f&lt)===0&&(t.parent===null||(t.parent.f&Nt)===0)}function Wt(t,e,n,r){if(yt){if(n===null&&(yt=!1),In(e))throw t;return}n!==null&&(yt=!0);{Un(t,e);return}}function Ye(t){var _;var e=k,n=O,r=V,o=b,l=Q,s=P,c=y,a=t.f;k=null,O=0,V=null,b=a&(U|St)?null:t,Q=!et&&(a&H)!==0,P=null,y=t.ctx;try{var i=(0,t.fn)(),u=t.deps;if(k!==null){var f;if(dt(t,O),u!==null&&O>0)for(u.length=O+k.length,f=0;f<k.length;f++)u[O+f]=k[f];else t.deps=u=k;if(!Q)for(f=O;f<u.length;f++)((_=u[f]).reactions??(_.reactions=[])).push(t)}else u!==null&&O<u.length&&(dt(t,O),u.length=O);return i}finally{k=e,O=n,V=r,b=o,Q=l,P=s,y=c}}function Fn(t,e){let n=e.reactions;if(n!==null){var r=n.indexOf(t);if(r!==-1){var o=n.length-1;o===0?n=e.reactions=null:(n[r]=n[o],n.pop())}}n===null&&e.f&M&&(k===null||!k.includes(e))&&(I(e,pt),e.f&(H|wt)||(e.f^=wt),dt(e,0))}function dt(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)Fn(t,n[r])}function Dt(t){var e=t.f;if(!(e&lt)){I(t,D);var n=m,r=y;m=t;try{e&Ft?Rn(t):Me(t),Le(t),Re(t);var o=Ye(t);t.teardown=typeof o=="function"?o:null,t.version=je}catch(l){Wt(l,t,n,r||t.ctx)}finally{m=n}}}function jn(){_t>1e3&&(_t=0,dn()),_t++}function qn(t){var e=t.length;if(e!==0){jn();var n=et;et=!0;try{for(var r=0;r<e;r++){var o=t[r];o.f&D||(o.f^=D);var l=[];Be(o,l),Yn(l)}}finally{et=n}}}function Yn(t){var e=t.length;if(e!==0)for(var n=0;n<e;n++){var r=t[n];if(!(r.f&(lt|nt)))try{gt(r)&&(Dt(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null?Pe(r):r.fn=null))}catch(o){Wt(o,r,null,r.ctx)}}}function Bn(){if(xt=!1,_t>1001)return;const t=Mt;Mt=[],qn(t),xt||(_t=0)}function At(t){xt||(xt=!0,queueMicrotask(Bn));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&(St|U)){if(!(n&D))return;e.f^=D}}Mt.push(e)}function Be(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,l=(o&U)!==0,s=l&&(o&D)!==0,c=n.next;if(!s&&!(o&nt))if(o&vt){if(l)n.f^=D;else try{gt(n)&&Dt(n)}catch(f){Wt(f,n,null,n.ctx)}var a=n.first;if(a!==null){n=a;continue}}else o&be&&r.push(n);if(c===null){let f=n.parent;for(;f!==null;){if(t===f)break t;var i=f.next;if(i!==null){n=i;continue t}f=f.parent}}n=c}for(var u=0;u<r.length;u++)a=r[u],e.push(a),Be(a,e)}function d(t){var u;var e=t.f,n=(e&M)!==0;if(n&&e&lt){var r=Ae(t);return Yt(t),r}if(b!==null){P!==null&&P.includes(t)&&hn();var o=b.deps;k===null&&o!==null&&o[O]===t?O++:k===null?k=[t]:k.push(t),V!==null&&m!==null&&m.f&D&&!(m.f&U)&&V.includes(t)&&(I(m,W),At(m))}else if(n&&t.deps===null)for(var l=t,s=l.parent,c=l;s!==null;)if(s.f&M){var a=s;c=a,s=a.parent}else{var i=s;(u=i.deriveds)!=null&&u.includes(c)||(i.deriveds??(i.deriveds=[])).push(c);break}return n&&(l=t,gt(l)&&Ce(l)),t.v}function Kt(t){const e=b;try{return b=null,t()}finally{b=e}}const Vn=~(W|pt|D);function I(t,e){t.f=t.f&Vn|e}function Ve(t){return We().get(t)}function ce(t,e){return We().set(t,e),e}function We(t){return y===null&&Fe(),y.c??(y.c=new Map(Wn(y)||void 0))}function Wn(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}function Ct(t,e=!1,n){y={p:y,c:null,e:null,m:!1,s:t,x:null,l:null},ht&&!e&&(y.l={s:null,u:null,r1:[],r2:L(!1)})}function Ot(t){const e=y;if(e!==null){const s=e.e;if(s!==null){var n=m,r=b;e.e=null;try{for(var o=0;o<s.length;o++){var l=s[o];ot(l.effect),rt(l.reaction),$e(l.fn)}}finally{ot(n),rt(r)}}y=e.p,e.m=!0}return{}}function Kn(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(ct in t)Pt(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&ct in n&&Pt(n)}}}function Pt(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Pt(t[r],e)}catch{}const n=bt(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=ye(n);for(let o in r){const l=r[o].get;if(l)try{l.call(t)}catch{}}}}}const Ke=new Set,Ut=new Set;function He(t){for(var e=0;e<t.length;e++)Ke.add(t[e]);for(var n of Ut)n(t)}function mt(t){var R;var e=this,n=e.ownerDocument,r=t.type,o=((R=t.composedPath)==null?void 0:R.call(t))||[],l=o[0]||t.target,s=0,c=t.__root;if(c){var a=o.indexOf(c);if(a!==-1&&(e===document||e===window)){t.__root=e;return}var i=o.indexOf(e);if(i===-1)return;a<=i&&(s=a)}if(l=o[s]||t.target,l!==e){nn(t,"currentTarget",{configurable:!0,get(){return l||n}});var u=b,f=m;rt(null),ot(null);try{for(var _,v=[];l!==null;){var g=l.assignedSlot||l.parentNode||l.host||null;try{var E=l["__"+r];if(E!==void 0&&!l.disabled)if(me(E)){var[N,...F]=E;N.apply(l,[t,...F])}else E.call(l,t)}catch($){_?v.push($):_=$}if(t.cancelBubble||g===e||g===null)break;l=g}if(_){for(let $ of v)queueMicrotask(()=>{throw $});throw _}}finally{t.__root=e,delete t.currentTarget,rt(u),ot(f)}}}function Hn(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function _e(t,e){var n=m;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function G(t,e){var n=(e&En)!==0,r=(e&xn)!==0,o,l=!t.startsWith("<!>");return()=>{o===void 0&&(o=Hn(l?t:"<!>"+t),n||(o=Et(o)));var s=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var c=Et(s),a=s.lastChild;_e(c,a)}else _e(s,s);return s}}function K(t,e){t!==null&&t.before(e)}const Gn=["touchstart","touchmove"];function zn(t){return Gn.includes(t)}function B(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n==null?"":n+"")}function Zn(t,e){return Jn(t,e)}const z=new Map;function Jn(t,{target:e,anchor:n,props:r={},events:o,context:l,intro:s=!0}){Tn();var c=new Set,a=f=>{for(var _=0;_<f.length;_++){var v=f[_];if(!c.has(v)){c.add(v);var g=zn(v);e.addEventListener(v,mt,{passive:g});var E=z.get(v);E===void 0?(document.addEventListener(v,mt,{passive:g}),z.set(v,1)):z.set(v,E+1)}}};a(en(Ke)),Ut.add(a);var i=void 0,u=$n(()=>{var f=n??e.appendChild(kn());return Lt(()=>{if(l){Ct({});var _=y;_.c=l}o&&(r.$$events=o),i=t(f,r)||{},l&&Ot()}),()=>{var g;for(var _ of c){e.removeEventListener(_,mt);var v=z.get(_);--v===0?(document.removeEventListener(_,mt),z.delete(_)):z.set(_,v)}Ut.delete(a),de.delete(i),f!==n&&((g=f.parentNode)==null||g.removeChild(f))}});return de.set(i,u),i}let de=new WeakMap;function X(t,e,n,r=null,o=!1){var l=t,s=null,c=null,a=null,i=o?jt:0;Ne(()=>{a!==(a=!!e())&&(a?(s?ae(s):s=Lt(()=>n(l)),c&&se(c,()=>{c=null})):(c?ae(c):r&&(c=Lt(()=>r(l))),s&&se(s,()=>{s=null})))},i)}function It(t,e,n,r){var o=t.__attributes??(t.__attributes={});o[e]!==(o[e]=n)&&(n==null?t.removeAttribute(e):typeof n!="string"&&Qn(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var ve=new Map;function Qn(t){var e=ve.get(t.nodeName);if(e)return e;ve.set(t.nodeName,e=[]);for(var n,r=bt(t),o=Element.prototype;o!==r;){n=ye(r);for(var l in n)n[l].set&&e.push(l);r=bt(r)}return e}function Xn(t=!1){const e=y,n=e.l.u;if(!n)return;let r=()=>Kn(e.s);if(t){let o=0,l={};const s=Sn(()=>{let c=!1;const a=e.s;for(const i in a)a[i]!==l[i]&&(l[i]=a[i],c=!0);return c&&o++,o});r=()=>d(s)}n.b.length&&On(()=>{pe(e,r),oe(n.b)}),Rt(()=>{const o=Kt(()=>n.m.map(ln));return()=>{for(const l of o)typeof l=="function"&&l()}}),n.a.length&&Rt(()=>{pe(e,r),oe(n.a)})}function pe(t,e){if(t.l.s)for(const n of t.l.s)d(n);e()}function tr(t,e,n){if(t==null)return e(void 0),tt;const r=Kt(()=>t.subscribe(e,n));return r.unsubscribe?()=>r.unsubscribe():r}function Tt(t,e,n){const r=n[e]??(n[e]={store:null,source:yn(void 0),unsubscribe:tt});if(r.store!==t)if(r.unsubscribe(),r.store=t??null,t==null)r.source.v=void 0,r.unsubscribe=tt;else{var o=!0;r.unsubscribe=tr(t,l=>{o?r.source.v=l:w(r.source,l)}),o=!1}return d(r.source)}function kt(t,e){return t.set(e),e}function Ht(){const t={};return Cn(()=>{for(var e in t)t[e].unsubscribe()}),t}function Gt(t){y===null&&Fe(),ht&&y.l!==null?er(y).m.push(t):Rt(()=>{const e=Kt(t);if(typeof e=="function")return e})}function er(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const nr="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(nr);mn();function rr(t,e,n){t.preventDefault();const r="https://mail.google.com/mail/?extsrc=mailto&url="+encodeURIComponent(d(e));window.open(r,"_blank","noopener, noreferrer"),n()}async function or(t,e,n,r){t.preventDefault();try{await navigator.clipboard.writeText(d(e)),w(n,!0),setTimeout(r,1500)}catch(o){console.error("Unable to copy to clipboard.",o)}}var lr=G("<strong>cc</strong> <br>",1),ir=G("<strong>bcc</strong> <br>",1),sr=G("<strong>subject</strong> <br>",1),ar=G("<strong>body</strong> <br>",1),ur=G('<dialog open><article><h4> </h4> <p><small><!> <!> <!> <!></small></p> <section><a href="#gmail">open in <strong>Gmail</strong></a> <a href="#outlook">open in <strong>Outlook</strong></a> <a href="#yahoo">open in <strong>Yahoo Mail</strong></a> <a><strong>open</strong> default</a> <a href="#copy"><strong> </strong></a></section> <footer><small><a href="https://github.com/Sammy-T/maildo" target="_blank">maildo</a></small></footer></article></dialog>');function fr(t,e){Ct(e,!0);const n=Ht(),r=()=>Tt(s,"$selectedMailto",n),o="type-url",l="type-data",s=Ve("selectedMailto");let c="",a=j(""),i=j(""),u=j(""),f=j(""),_=j(""),v=j(""),g=j(!1);function E(){const p=new URL(r().href),{searchParams:h}=p;w(a,T(p.pathname)),w(i,T(h.get("cc"))),w(u,T(h.get("bcc"))),w(f,T(h.get("subject"))),w(_,T(h.get("body")))}function N(){const{dataset:p}=r();w(a,T(p.address&&p.domain?`${p.address}@${p.domain}`:"")),w(i,T(p.ccAddress&&p.ccDomain?`${p.ccAddress}@${p.ccDomain}`:"")),w(u,T(p.bccAddress&&p.bccDomain?`${p.bccAddress}@${p.bccDomain}`:"")),w(f,T(p.subject)),w(_,T(p.body))}function F(){switch(c){case o:return r().href;case l:const p=new URLSearchParams;d(i)&&p.set("cc",d(i)),d(u)&&p.set("bcc",d(u)),d(f)&&p.set("subject",d(f)),d(_)&&p.set("body",d(_));const h=new URL(`mailto:${d(a)}`);return h.search=p.toString(),h.toString();default:return console.error(`Invalid mailto type: ${c}`),""}}function R(p){p.preventDefault();const h=new URLSearchParams;h.set("path","/mail/action/compose"),d(a)&&h.set("to",d(a)),d(f)&&h.set("subject",d(f)),d(_)&&h.set("body",d(_));const A=new URL("https://outlook.live.com/owa/");A.search=h.toString(),window.open(A.toString(),"_blank","noopener, noreferrer"),q()}function $(p){p.preventDefault();const h=new URLSearchParams;d(a)&&h.set("to",d(a)),d(f)&&h.set("subject",d(f)),d(_)&&h.set("body",d(_));const A=new URL("https://compose.mail.yahoo.com");A.search=h.toString(),window.open(A.toString(),"_blank","noopener, noreferrer"),q()}function q(p=null){p&&p.currentTarget!==p.target||kt(s,null)}Gt(()=>{r().href.startsWith("mailto:")?(c=o,E()):(c=l,N()),w(v,T(F()))});var at=ur();at.__click=q;var $t=S(at),Y=S($t),Ge=S(Y),zt=x(Y,2),ze=S(zt),Zt=S(ze);X(Zt,()=>d(i),p=>{var h=lr(),A=x(ut(h));J(()=>B(A,` ${d(i)??""}`)),K(p,h)});var Jt=x(Zt,2);X(Jt,()=>d(u),p=>{var h=ir(),A=x(ut(h));J(()=>B(A,` ${d(u)??""}`)),K(p,h)});var Qt=x(Jt,2);X(Qt,()=>d(f),p=>{var h=sr(),A=x(ut(h));J(()=>B(A,` ${d(f)??""}`)),K(p,h)});var Ze=x(Qt,2);X(Ze,()=>d(_),p=>{var h=ar(),A=x(ut(h));J(()=>B(A,` ${d(_)??""}`)),K(p,h)});var Je=x(zt,2),Xt=S(Je);Xt.__click=[rr,v,q];var te=x(Xt,2);te.__click=R;var ee=x(te,2);ee.__click=$;var ne=x(ee,2),re=x(ne,2);re.__click=[or,a,g,q];var Qe=S(re),Xe=S(Qe);J(()=>{B(Ge,d(a)),It(ne,"href",d(v)),B(Xe,d(g)?"copied":"copy")}),K(t,at),Ot()}He(["click"]);function cr(t,e,n){t.preventDefault();const o=`https://wa.me/${d(e).replaceAll(/\D/g,"").replace(/^0+/,"")}`;window.open(o,"_blank","noopener, noreferrer"),n()}function _r(t,e,n){t.preventDefault();const r=`skype:${encodeURIComponent(d(e))}`;window.open(r,"_blank","noopener, noreferrer"),n()}async function dr(t,e,n,r){t.preventDefault();try{await navigator.clipboard.writeText(d(e)),w(n,!0),setTimeout(r,1500)}catch(o){console.error("Unable to copy to clipboard.",o)}}var vr=G('<dialog open><article><h4> </h4> <section><a href="#whatsapp">open in <strong>WhatsApp</strong></a> <a href="#skype">open in <strong>Skype</strong></a> <a><strong>call</strong> as default</a> <a><strong>text</strong> as default</a> <a href="#copy"><strong> </strong></a></section> <footer><small><a href="https://github.com/Sammy-T/maildo" target="_blank">maildo</a></small></footer></article></dialog>');function pr(t,e){Ct(e,!0);const n=Ht(),r=()=>Tt(l,"$selectedCallto",n),o=/^(tel:)|^(callto:)/,l=Ve("selectedCallto");let s=j(""),c=j(!1);function a(){w(s,T(r().href.replace(o,"")))}function i(){const{dataset:Y}=r();w(s,T(Y.tel))}function u(Y=null){Y&&Y.currentTarget!==Y.target||kt(l,null)}Gt(()=>{o.test(r().href)?a():i()});var f=vr();f.__click=u;var _=S(f),v=S(_),g=S(v),E=x(v,2),N=S(E);N.__click=[cr,s,u];var F=x(N,2);F.__click=[_r,s,u];var R=x(F,2),$=x(R,2),q=x($,2);q.__click=[dr,s,c,u];var at=S(q),$t=S(at);J(()=>{B(g,d(s)),It(R,"href",`tel:${d(s)}`),It($,"href",`sms:${d(s)}`),B($t,d(c)?"copied":"copy")}),K(t,f),Ot()}He(["click"]);const Z=[];function he(t,e=tt){let n=null;const r=new Set;function o(c){if(xe(t,c)&&(t=c,n)){const a=!Z.length;for(const i of r)i[1](),Z.push(i,t);if(a){for(let i=0;i<Z.length;i+=2)Z[i][0](Z[i+1]);Z.length=0}}}function l(c){o(c(t))}function s(c,a=tt){const i=[c,a];return r.add(i),r.size===1&&(n=e(o,l)||tt),c(t),()=>{r.delete(i),r.size===0&&n&&(n(),n=null)}}return{set:o,update:l,subscribe:s}}var hr=G("<!> <!>",1);function gr(t,e){Ct(e,!1);const n=Ht(),r=()=>Tt(c,"$selectedMailto",n),o=()=>Tt(a,"$selectedCallto",n),l='a[href^="mailto:"]:not(.no-maildo), a[href="#maildo"][data-address], a.maildo[data-address]',s='a[href^="tel:"]:not(.no-maildo), a[href^="callto:"]:not(.no-maildo), a[href="#maildo"][data-tel], a.maildo[data-tel]',c=he(null);ce("selectedMailto",c);const a=he(null);ce("selectedCallto",a),Gt(()=>{const _=document.querySelectorAll(l),v=document.querySelectorAll(s);_.forEach(g=>{g.addEventListener("click",E=>{E.preventDefault(),kt(c,g)})}),v.forEach(g=>{g.addEventListener("click",E=>{E.preventDefault(),kt(a,g)})})}),Xn();var i=hr(),u=ut(i);X(u,r,_=>{fr(_,{})});var f=x(u,2);X(f,o,_=>{pr(_,{})}),K(t,i),Ot()}const ge="maildo-app";function mr(){let t=document.getElementById(ge);if(!t)t=document.createElement("slot"),t.id=ge,document.body.appendChild(t);else if(t.childElementCount>0){console.warn("App target already exists");return}Zn(gr,{target:t})}mr();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maildo",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "Mailto links extended.",
5
5
  "keywords": [],
6
6
  "author": "Sammy-T",
@@ -16,9 +16,9 @@
16
16
  "dist/**.css"
17
17
  ],
18
18
  "devDependencies": {
19
- "@sveltejs/vite-plugin-svelte": "^3.1.2",
20
- "svelte": "^4.2.19",
21
- "vite": "^5.4.9"
19
+ "@sveltejs/vite-plugin-svelte": "^5.0.1",
20
+ "svelte": "^5.1.3",
21
+ "vite": "^6.0.1"
22
22
  },
23
23
  "scripts": {
24
24
  "dev": "vite",