\def\thelastpage{\pageref{LastPage}}

\newcommand{\Emaillink}[2]{\mbox{\href{mailto:#1}{#2}}}
\newcommand{\Httplink }[2]{\mbox{\href{http://#1}{#2}}}
\newcommand{\Httpslink}[2]{\mbox{\href{https://#1}{#2}}}

\newcommand{\emaillink}[2][]{\mbox{\Emaillink{#2}{#1\nolinkurl{#2}}}}
\newcommand{\httplink }[2][]{\mbox{\Httplink {#2}{#1\nolinkurl{#2}}}}
\newcommand{\httpslink}[2][]{\mbox{\Httpslink{#2}{#1\nolinkurl{#2}}}}

\newcommand{\nolink}[1]{\directlua{hazLink=false}#1\directlua{hazLink=true}}
\newcommand{\iflink}[2]{\directlua{
  if hazLink
  then
    tex.print([[#1]])
  else
    tex.print([[#2]])
  end
}}

\newcommand{\linkdest}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
