1import{a3 as h,r as m,j as l,z as y}from"./index-BPR3l8qa.js";function u(r,n){return u=Object.setPrototypeOf||function(o,a){return o.__proto__=a,o},u(r,n)}var v=function(r){var n=document.createElement("script");n.async=!0,n.defer=!0,n.src=r,document.head&&document.head.appendChild(n)},x=function(r){return Array.from(document.scripts).reduce(function(n,o){return n||r.test(o.src)},!1)},w=/(http|https):\/\/(www)?.+\/recaptcha/,b=["sitekey","theme","size","badge","tabindex","hl","isolated"],f=function(r){var n,o;function a(){for(var e,c=arguments.length,s=new Array(c),p=0;p<c;p++)s[p]=arguments[p];return(e=r.call.apply(r,[this].concat(s))||this).container=void 0,e.timer=void 0,e.state={instanceKey:Date.now(),ready:!1,rendered:!1,invisible:e.props.size==="invisible"},e._isAvailable=function(){var t;return!!((t=window.grecaptcha)!=null&&t.ready)},e._inject=function(){e.props.inject&&!x(w)&&v("https://recaptcha.net/recaptcha/api.js?render=explicit"+(e.props.hl?"&hl="+e.props.hl:""))},e._prepare=function(){var t=e.props,i=t.explicit,d=t.onLoad;window.grecaptcha.ready(function(){e.setState({ready:!0},function(){i||e.renderExplicitly(),d&&d()})})},e._renderRecaptcha=function(t,i){return window.grecaptcha.render(t,i)},e._resetRecaptcha=function(){return window.grecaptcha.reset(e.state.instanceId)},e._executeRecaptcha=function(){return window.grecaptcha.execute(e.state.instanceId)},e._getResponseRecaptcha=function(){return window.grecaptcha.getResponse(e.state.instanceId)},e._onVerify=function(t){return e.props.onVerify(t)},e._onExpire=function(){return e.props.onExpire&&e.props.onExpire()},e._onError=function(){return e.props.onError&&e.props.onError()},e._stopTimer=function(){e.timer&&clearInterval(e.timer)},e.componentDidMount=function(){e._inject(),e._isAvailable()?e._prepare():e.timer=window.setInterval(function(){e._isAvailable()&&(e._prepare(),e._stopTimer())},500)},e.componentWillUnmount=function(){e._stopTimer()},e.renderExplicitly=function(){return new Promise(function(t,i){if(e.state.rendered)return i(new Error("This recaptcha instance has been already rendered."));if(!e.state.ready||!e.container)return i(new Error("Recaptcha is not ready for rendering yet."));var d=e._renderRecaptcha(e.container,{sitekey:e.props.sitekey,theme:e.props.theme,size:e.props.size,badge:e.state.invisible?e.props.badge:void 0,tabindex:e.props.tabindex,callback:e._onVerify,"expired-callback":e._onExpire,"error-callback":e._onError,isolated:e.state.invisible?e.props.isolated:void 0,hl:e.state.invisible?void 0:e.props.hl});e.setState({instanceId:d,rendered:!0},function(){e.props.onRender&&e.props.onRender(),t()})})},e.reset=function(){return new Promise(function(t,i){if(e.state.rendered)return e._resetRecaptcha(),t();i(new Error("This recaptcha instance did not render yet."))})},e.execute=function(){return new Promise(function(t,i){return e.state.invisible?(e.state.rendered&&(e._executeRecaptcha(),t()),i(new Error("This recaptcha instance did not render yet."))):i(new Error("Manual execution is only available for invisible size."))})},e.getResponse=function(){return new Promise(function(t,i){if(e.state.rendered)return t(e._getResponseRecaptcha());i(new Error("This recaptcha instance did not render yet."))})},e.render=function(){var t=h.createElement("div",{key:e.state.instanceKey,id:e.props.id,className:e.props.className,ref:function(i){return e.container=i}});return e.props.children?e.props.children({renderExplicitly:e.renderExplicitly,reset:e.reset,execute:e.execute,getResponse:e.getResponse,recaptchaComponent:t}):t},e}return o=r,(n=a).prototype=Object.create(o.prototype),n.prototype.constructor=n,u(n,o),a.getDerivedStateFromProps=function(e,c){var s=e.size==="invisible";return s!==c.invisible?{invisible:s}:null},a.prototype.componentDidUpdate=function(e){var c=this;b.reduce(function(s,p){return c.props[p]!==e[p]?[].concat(s,[p]):s},[]).length>0&&this.setState({instanceKey:Date.now(),rendered:!1},function(){c.props.explicit||c.renderExplicitly()})},a}(m.Component);f.defaultProps={id:"",className:"g-recaptcha",theme:"light",size:"normal",badge:"bottomright",tabindex:0,explicit:!1,inject:!0,isolated:!1,hl:""};
1function g({onChange:r,recaptcha_site_key:n}){const o=a=>{r&&r({type:"recaptcha",value:a})};return l.jsx(y,{children:l.jsx(f,{sitekey:n,onVerify:o})})}export{g as default}; 2//# sourceMappingURL=GoogleRecaptchaRenderer-kCEFJTzU.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.