<?xml version="1.0" encoding="UTF-8"?>
<moya xmlns="http://moyaproject.com"
      xmlns:let="http://moyaproject.com/let">

    <widget name="recaptcha" template="widgets/recaptcha.html" synopsis="render a reCAPTCHA widget">
        <signature>
            <attribute name="sitekey" required="no" default="">
                Optional override of site key from settings
            </attribute>
            <attribute name="theme" required="no" default="light" choices="light,dark" />
        </signature>
        <include-js url="https://www.google.com/recaptcha/api.js" />
        <let sitekey=".app.settings.sitekey" if="not sitekey" />
        <throw exception="moya.google.recaptcha.sitekey-missing" if="not sitekey"
            msg="Sitekey should be specified on the widget or in settings"/>
    </widget>

</moya>