(()=>{"use strict";const e=window.wc.blocksCheckout,t=window.React,i=window.wp.element,a=({attributes:e,setAttributes:a,setPhoneNumber:n})=>{const{phoneVerification:c}=e;return(0,i.useEffect)((()=>{const e=(navigator.language||"en").split(",")[0].substr(0,2),t=rc_options.gdpr_implementation||!1,i=rc_options.js_implementation||!1,c=rc_options.app_key||"";rc_options.gdpr_consent_message,t?(document.getElementById("widget-point").innerHTML='<div id="xyz" data-widget data-locale="'+e+'" data-type="dual" data-mode="signup"></div>',document.getElementById("gdpr_consent").value="false",i&&(document.getElementById("ringcaptcha_verified").value="false"),new RingCaptcha.Widget("#xyz",{app:c,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true",a("verified")}}}).setup()):i?(document.getElementById("widget-point").innerHTML='<div id="xyz" data-widget data-locale="'+e+'" data-type="dual" data-mode="signup"></div>',document.getElementById("ringcaptcha_verified").value="false",new RingCaptcha.Widget("#xyz",{app:c,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true",a("verified")}}}).setup()):(document.getElementById("widget-point").innerHTML='<div data-widget data-app="'+c+'" data-locale="'+e+'" data-type="dual"></div>',new RingCaptcha.Widget("[data-widget]",{app:c,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true";const e=document.getElementsByName("ringcaptcha_phone_number");a("verified"),n(e[0].value)}}}).setup()),document.querySelectorAll(".panel.woocommerce_options_panel").forEach((function(e){console.log("Panel ID:",e.id,"Display:",e.style.display)}))}),[]),(0,t.createElement)("div",null,(0,t.createElement)("div",{id:"widget-point"}),(0,t.createElement)("input",{id:"gdpr_consent",type:"hidden",name:"gdpr_consent",value:"false"}),(0,t.createElement)("input",{id:"ringcaptcha_verified",type:"hidden",name:"ringcaptcha_verified",value:"false"}))};console.log("RingCaptcha Block: block.js loaded");const n=JSON.parse('{"apiVersion":2,"name":"ringcaptcha/ringcaptcha-block","version":"1.0.0","title":"Phone Verification Block","category":"woocommerce","description":"A block for phone verification on the checkout page.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"ringcaptcha-phone-verification-on-checkout-sms-order-notifications","editorScript":"file:../../../build/ringcaptcha-block.js","editorStyle":"file:../../../build/style-ringcaptcha-block.css"}');(0,e.registerCheckoutBlock)({metadata:n,component:({checkoutExtensionData:e})=>{const{setExtensionData:n}=e,[c,o]=(0,i.useState)(""),[d,r]=(0,i.useState)("");return(0,i.useEffect)((()=>{n("ringcaptcha","phoneVerification",c)}),[c,n]),(0,i.useEffect)((()=>{n("ringcaptcha","phoneNumber",d)}),[d,n]),(0,t.createElement)("div",{className:"wp-block-ringcaptcha-phone-verification"},(0,t.createElement)(a,{attributes:{phoneVerification:c},setPhoneNumber:r,setAttributes:o}))}})})();