jQuery(e=>{const i=e(".arraysubs-variable-subscription-info");if(!i.length)return;const r=window.arraySubsVariableProduct?.i18n||{},n=(e,...i)=>{let r=e||"";return i.forEach((e,i)=>{r=r.replace(new RegExp(`%${i+1}\\$[sd]`,"g"),String(e))}),r};e("form.variations_form").on("found_variation",(e,t)=>{if(!t.arraysubs_is_subscription||!t.arraysubs_data)return void i.hide().empty();const s=t.arraysubs_data;let a='<div class="arraysubs-product-info"><div class="subscription-terms">';if(a+=`<p class="subscription-pricing">${(e=>e.enable_different_renewal_price&&e.different_renewal_price?e.different_renewal_price_after>1?n(r.pricingAfterN,e.price_html,e.billing_schedule,e.different_renewal_price_after,e.different_renewal_price_html):n(r.pricingFirstThen,e.price_html,e.different_renewal_price_html,e.billing_schedule):e.is_on_sale?n(r.pricingOnSale,e.price_html,e.billing_schedule,e.regular_price_html):n(r.pricingDefault,e.price_html,e.billing_schedule))(s)}</p>`,s.signup_fee>0&&(a+=`<p class="subscription-signup-fee">${n(r.signupFee,s.signup_fee_html)}</p>`),s.trial_length>0&&(a+=`<p class="subscription-trial">${n(r.trialInfo,s.trial_length,s.trial_period)}</p>`),s.length>0){const e=s.length*s.interval,i=`${s.period}${e>1?"s":""}`;a+=`<p class="subscription-length">${n(r.subscriptionLength,e,i)}</p>`}a+="</div></div>",i.html(a).show()}),e("form.variations_form").on("reset_data",()=>{i.hide().empty()})});