\blx@inputonce{biblatex-sbl.def}{biblatex-sbl definitions and macros}{}{}{}{}

\ProvidesFile{sbl.bbx}[\sbl@abx@bbxid]

\AtBeginBibliography{%
  \citereset
  \global\undef\bbx@lasthash
  \def\abx@str{abx@lstr}%
  \renewcommand*{\relateddelim}{\addperiod\space}%
  \renewcommand*{\begrelateddelim}{\addperiod\space}%
  \renewcommand*{\revsdnamedelim}{\addcomma}%
  \DeclareNameAlias{author}{sortname}%
  \DeclareNameAlias{editor}{sortname}%
  \DeclareNameAlias{translator}{sortname}%
  \renewcommand*{\newunitpunct}{\addperiod\space}%
  \renewbibmacro{dashcheck}[2]{\usebibmacro{bbx:dashcheck}{#1}{#2}}%
  \renewbibmacro*{savehash}{\savefield{fullhash}{\bbx@lasthash}}%
  \sloppy
}

\AtEveryBibitem{%
  \global\togglefalse{relatedseen}%
  \global\togglefalse{inentrytype}}%

\DeclareBibliographyDriver{set}{%
  \booltrue{bbx@inset}%
  \entryset{}{}%
  \finentry}

\DeclareBibliographyDriver{classictext}{%
  \usebibmacro{begentry}%
  \DeclareFieldFormat[classictext]{title}{\mkbibemph{##1}}%
  \clearfield{related}%
  \usedriver{}{incollection}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{ancienttext}{%
  \usebibmacro{begentry}%
  \iffieldequalstr{entrysubtype}{ANRW}
    {\usebibmacro{bibindex}%
     \usebibmacro{author/editor+others/translator+others}%
     \newunit
     \usebibmacro{title}%
     \newunit
     \entrydata{\thefield{related}}{%
       \printtext[title]{%
         \bibhyperlink{\strfield{shorthand}}{\thefield{shorthand}}}}%
     \setunit{\addspace}%
     \printfield{volume}%
     \setunit*{\addperiod}%
     \printfield{part}%
     \setunit{\volpostnotedelim}%
     \usebibmacro{pages}%
     \newunit
     \entrydata{\thefield{related}}{\printfield{titleaddon}}%
     \setunit{\addcomma\addspace}%
     \printfield{volume}%
     \setunit*{\addperiod}%
     \printfield{part}%
     \newunit
     \entrydata{\thefield{related}}
       {\usebibmacro{bymaineditor+others}%
        \newunit
        \usebibmacro{bymaintranslator+others}}%
     \usebibmacro{publisher+location+date}%
     \newunit}
    {\iffieldequalstr{entrysubtype}{primarysource}
       {}
       {\DeclareFieldFormat[ancienttext]{title}{\mkbibemph{##1}}}%
     \clearfield{related}%
     \usedriver{}{book}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \usebibmacro{bytranslator+others}%
  \newunit
  \usebibmacro{inissuetitle}%
  \newunit
  \printfield{version}%
  \newunit
  \printlist{organization}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{shortjournal+issue}%
  \usebibmacro{pages}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{issn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{book}{%
  \clearfield{booktitle}%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \iftoggle{blx@abbrevcite}
    {\usebibmacro{title}%
     \newunit
     \printnames[default]{author}}
    {\usebibmacro{author/editor+others/translator+others}%
     \newunit
     \usebibmacro{title}}%
  \newunit
  \usebibmacro{byauthor/byeditor+others/bytranslator+others}%
  \newunit
  \usebibmacro{chapter+pagesin}%
  \usebibmacro{volume+partof}%
  \usebibmacro{maintitle}%
  \newunit
  \usebibmacro{event+venue+date}%
  \newunit
  \usebibmacro{bymainauthor/bymaineditor+others/bymaintranslator+others}%
  \newunit
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit
  \ifentrytype{report}
    {\printfield{type}%
     \clearfield{type}%
     \setunit*{\addspace}%
     \printfield{number}}
    {\usebibmacro{shortseries+number}}%
  \newunit
  \printfield{type}%
  \newunit
  \printfield{version}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{isbn}%
  \newunit
  \usebibmacro{isrn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{suppbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \newunit
  \iffieldundef{type}
    {\toggletrue{inentrytype}%
     \usebibmacro{title}%
     \setunit{\addspace}%
     \usebibmacro{in}}
    {\printfield{type}%
     \usebibmacro{language}%
     \setunit{\addspace}%
     \usebibmacro{to}}%
  \usebibmacro{booktitle}%
  \usebibmacro{bybookauthor/bybookeditor+others/bybooktranslator+others}%
  \clearfield{booktitle}%
  \newunit
  \usebibmacro{chapter+pagesin}%
  \usebibmacro{volume+partof}%
  \usebibmacro{maintitle}%
  \newunit
  \usebibmacro{bymainauthor/bymaineditor+others/bymaintranslator+others}%
  \newunit
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit
  \usebibmacro{shortseries+number}%
  \newunit
  \printfield{note}%
  \newunit%
  \usebibmacro{publisher+location+date}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{isbn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{incommentary}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \iffieldundef{volume}
    {\usedriver{}{incollection}}
    {\iftoggle{fullbibrefs}
       {\usedriver{}{incollection}}
       {\usedriver{}{incommentary:short}}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{incommentary:short}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \usebibmacro{byauthor}%
  \newunit
  \usebibmacro{bytranslator+others}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{xrefshortmaintitle}%
  \newunit
  \usebibmacro{volume+pages}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{isbn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{incollection}{%
  \toggletrue{inentrytype}%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \ifentrytype{classictext}
    {\usebibmacro{byauthor}%
     \newunit
     \usebibmacro{bytranslator+others}}
    {\usebibmacro{byauthor/byeditor+others/bytranslator+others}}%
  \newunit
  \usebibmacro{chapter+pagesin}%
  \iffieldundef{booktitle}
    {}
    {\usebibmacro{booktitle}%
     \newunit
     \usebibmacro{event+venue+date}%
     \newunit
     \usebibmacro{bybookauthor/bybookeditor+others/bybooktranslator+others}%
     \newunit}%
  \usebibmacro{volume+partof}%
  \iffieldundef{maintitle}
    {}
    {\usebibmacro{maintitle}%
     \newunit
     \usebibmacro{event+venue+date}%
     \newunit
     \usebibmacro{bymainauthor/bymaineditor+others/bymaintranslator+others}}%
  \newunit
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit
  \usebibmacro{shortseries+number}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{isbn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{inlexicon}{%
  \usebibmacro{begentry}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{inreference}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \iffieldundef{volume}
    {\usedriver{}{incollection}}
    {\iftoggle{fullbibrefs}
       {\usedriver{}{incollection}}
       {\usedriver{}{inreference:short}}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{inreference:short}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \usebibmacro{byauthor}%
  \newunit
  \usebibmacro{bytranslator+others}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{xrefshortmaintitle+xrefshortbooktitle}%
  \newunit
  \usebibmacro{volume+pages}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{isbn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{review}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \newunit
  \iffieldundef{title}
    {\newunit}
    {\usebibmacro{title}%
     \newunit
     \usebibmacro{byauthor}%
     \newunit
     \usebibmacro{bytranslator+others}%
     \setunit{\addcomma\addspace}}%
  \usebibmacro{revdtitle}%
  \setunit{\addcomma\addspace}%
  \usebibmacro{revdauthor/revdeditor}%
  \newunit
  \usebibmacro{inissuetitle}%
  \newunit
  \printfield{version}%
  \newunit
  \printlist{organization}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{shortjournal+issue}%
  \usebibmacro{pages}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{issn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{thesis}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \usebibmacro{pagesin}%
  \newunit
  \printfield{note}%
  \newunit
  \printfield{type}%
  \setunit{\addcomma\addspace}%
  \usebibmacro{publisher+location+date}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \printfield{isbn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{misc}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \newunit
  \usebibmacro{title}%
  \usebibmacro{byauthor/byeditor+others/bytranslator+others}%
  \newunit
  \printfield{type}%
  \newunit
  \printfield{version}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit
  \usebibmacro{ebook}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{conferencepaper}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{eventtitle}%
  \newunit
  \printfield{organization}%
  \newunit
  \usebibmacro{venue+eventdate}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{periodical}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{editor+others}%
  \newunit
  \usebibmacro{issuetitle}%
  \usebibmacro{language}%
  \newunit
  \printfield{note}%
  \newunit
  \usebibmacro{shortjournal+issue}%
  \usebibmacro{pages}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{issn}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{patent}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author+holder}%
  \newunit
  \usebibmacro{title}%
  \newunit
  \printfield{note}%
  \newunit
  \printfield{type}%
  \setunit*{\addspace}%
  \printfield{number}%
  \iflistundef{location}
    {}
    {\setunit*{\addspace}%
     \printtext[parens]{\printlist{location}}}%
  \setunit{\addcomma\space}%
  \printfield{version}%
  \setunit{\addcomma\space}%
  \usebibmacro{patentdate}%
  \newunit
  \printfield{addendum}%
  \newunit
  \usebibmacro{doi+eprint+url}%
  \newunit
  \ifboolexpr{
    togl {relatedseen}
    or
    not togl {bbx:related}
  }
    {}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}%
  \usebibmacro{finentry}%
}
\endinput
