window.tribe.tickets=window.tribe.tickets||{},window.tribe.tickets.commerce=window.tribe.tickets.commerce||{},window.tribe.tickets.commerce.gateway=window.tribe.tickets.commerce.gateway||{},window.tribe.tickets.commerce.gateway.paypal=window.tribe.tickets.commerce.gateway.paypal||{},window.tribe.tickets.commerce.gateway.paypal.signup={},function(e,t){"use strict";t.onboardNonce=tecTicketsCommerceGatewayPayPalSignup.onboardNonce,t.refreshConnectNonce=tecTicketsCommerceGatewayPayPalSignup.refreshConnectNonce,t.onboardingEndpointUrl=tecTicketsCommerceGatewayPayPalSignup.onboardingEndpointUrl,t.selectors={button:".tec-tickets__admin-settings-tickets-commerce-paypal-connect-button-link",countryField:'[name="tec-tickets-commerce-gateway-paypal-merchant-country"]'},t.onboardedCallback=(e,c)=>{fetch(t.onboardingEndpointUrl,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({auth_code:e,shared_id:c,nonce:t.onboardNonce})})},t.onCountryChange=function(c){const o=e(this),n=e(t.selectors.button);n.addClass("disabled"),fetch(ajaxurl+"?action=tec_tickets_commerce_gateway_paypal_refresh_connect_url&nonce="+t.refreshConnectNonce+"&country_code="+o.val(),{method:"GET",headers:{"content-type":"application/json"}}).then((function(e){return e.json()})).then((function(e){!0===e.success&&n.prop("href",e.data.new_url),n.removeClass("disabled")}))},t.setup=()=>{e(t.selectors.countryField).on("change",t.onCountryChange)},t.ready=()=>{t.setup()},e(t.ready)}(jQuery,window.tribe.tickets.commerce.gateway.paypal.signup),window.tecTicketsCommerceGatewayPayPalSignupCallback=window.tribe.tickets.commerce.gateway.paypal.signup.onboardedCallback,window.tec=window.tec||{},window.tec.tickets=window.tec.tickets||{},window.tec.tickets.commerce=window.tec.tickets.commerce||{},window.tec.tickets.commerce.gateway=window.tec.tickets.commerce.gateway||{},window.tec.tickets.commerce.gateway.paypal=window.tec.tickets.commerce.gateway.paypal||{},window.tec.tickets.commerce.gateway.paypal.signup={};