import{C as b,Ga as m,Ma as E,ca as f,da as v,f as d,fa as a,g as p,ha as o,m as g,na as y,pe as w}from"./chunk-6V7GSX3W.js";var A=new a("recaptcha-language"),I=new a("recaptcha-base-url"),R=new a("recaptcha-nonce-tag"),ne=new a("recaptcha-settings"),x=new a("recaptcha-v3-site-key"),S=new a("recaptcha-loader-options");function O(n,e,u,{url:i,lang:t,nonce:s}={}){window.ng2recaptchaloaded=()=>{u(grecaptcha)};let r=document.createElement("script");r.innerHTML="";let{url:c,nonce:l}=e(new URL(i||"https://www.google.com/recaptcha/api.js"));c.searchParams.set("render",n==="explicit"?n:n.key),c.searchParams.set("onload","ng2recaptchaloaded"),c.searchParams.set("trustedtypes","true"),t&&c.searchParams.set("hl",t),r.src=c.href;let h=l||s;h&&r.setAttribute("nonce",h),r.async=!0,r.defer=!0,document.head.appendChild(r)}function D({v3SiteKey:n,onBeforeLoad:e,onLoaded:u}){let i=n?{key:n}:"explicit";j.loadScript(i,e,u)}var j={loadScript:O,newLoadScript:D};function B(n){return n.asObservable().pipe(b(e=>e!==null))}var C=(()=>{let e=class e{constructor(i,t,s,r,c,l){this.platformId=i,this.language=t,this.baseUrl=s,this.nonce=r,this.v3SiteKey=c,this.options=l;let h=this.init();this.ready=h?B(h):g()}init(){if(e.ready)return e.ready;if(!w(this.platformId))return;let i=new p(null);return e.ready=i,j.newLoadScript({v3SiteKey:this.v3SiteKey,onBeforeLoad:t=>{if(this.options?.onBeforeLoad)return this.options.onBeforeLoad(t);let s=new URL(this.baseUrl??t);return this.language&&s.searchParams.set("hl",this.language),{url:s,nonce:this.nonce}},onLoaded:t=>{let s=t;this.options?.onLoaded&&(s=this.options.onLoaded(t)),i.next(s)}}),i}};e.ready=null,e.\u0275fac=function(t){return new(t||e)(o(E),o(A,8),o(I,8),o(R,8),o(x,8),o(S,8))},e.\u0275prov=f({token:e,factory:e.\u0275fac});let n=e;return n})();var M=(()=>{let e=class e{constructor(i,t,s){this.recaptchaLoader=t,this.zone=i,this.siteKey=s,this.init()}get onExecute(){return this.onExecuteSubject||(this.onExecuteSubject=new d,this.onExecuteObservable=this.onExecuteSubject.asObservable()),this.onExecuteObservable}get onExecuteError(){return this.onExecuteErrorSubject||(this.onExecuteErrorSubject=new d,this.onExecuteErrorObservable=this.onExecuteErrorSubject.asObservable()),this.onExecuteErrorObservable}execute(i){let t=new d;return this.grecaptcha?this.executeActionWithSubject(i,t):(this.actionBacklog||(this.actionBacklog=[]),this.actionBacklog.push([i,t])),t.asObservable()}executeActionWithSubject(i,t){let s=r=>{this.zone.run(()=>{t.error(r),this.onExecuteErrorSubject&&this.onExecuteErrorSubject.next({action:i,error:r})})};this.zone.runOutsideAngular(()=>{try{this.grecaptcha.execute(this.siteKey,{action:i}).then(r=>{this.zone.run(()=>{t.next(r),t.complete(),this.onExecuteSubject&&this.onExecuteSubject.next({action:i,token:r})})},s)}catch(r){s(r)}})}init(){this.recaptchaLoader.ready.subscribe(i=>{this.grecaptcha=i,this.actionBacklog&&this.actionBacklog.length>0&&(this.actionBacklog.forEach(([t,s])=>this.executeActionWithSubject(t,s)),this.actionBacklog=void 0)})}};e.\u0275fac=function(t){return new(t||e)(o(m),o(C),o(x))},e.\u0275prov=f({token:e,factory:e.\u0275fac});let n=e;return n})(),se=(()=>{let e=class e{};e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=y({type:e}),e.\u0275inj=v({providers:[M,C]});let n=e;return n})();export{x as a,M as b,se as c};