https://vintagevegasshirts.com/wp-content/plugins/advanced-gift-ca…/index.622f03c3.js?ver=1786981391
1import{f as h,s as u,v}from"../../common/validate-amount.25468957.js";function w(){import.meta.url,import("_").catch(()=>1);async function*e(){}}jQuery(document).ready(e=>{const d=e(".variations_form"),o=e(".agcfw-manual-amount-field"),n=o.find(".agcfw-manual-amount-input"),m=o.find(".agcfw-amount-presets"),s={currency_symbol:agcfwVariableProduct.currency_symbol,decimals:agcfwVariableProduct.decimals,decimal_separator:agcfwVariableProduct.decimal_separator,thousand_separator:agcfwVariableProduct.thousand_separator,price_format:agcfwVariableProduct.price_format},l=agcfwVariableProduct.manual_amount_i18n||{},f={min:l.min||"Min %s",max:l.max||"Max %s"},p={empty:l.empty,non_numeric:l.non_numeric,below_min:l.below_min,above_max:l.above_max,off_step:l.off_step},i={init:function(){d.length&&(d.wc_variation_form().find(".variations select").change(),d.on("found_variation.wc-variation-form",i.updateVariationFields),d.on("hide_variation",i.resetVariationFields),e(".reset_variations").on("click",i.resetAllFields),e("select").on("change",i.resetAllFields),e('input[name="send_to"]').on("change",i.handleSendToChange),o.on("click",".agcfw-amount-preset",i.handlePresetClick),n.on("input change",i.validateManualAmount))}
1,updateVariationFields:function(t,a){e(".variation_price").html(a.price_html),e(".variation_stock").html(a.availability_html),e("button.single_add_to_cart_button").removeAttr("disabled"),e("#variation_id").val(a.variation_id),i.handleGiftableFields(a),i.handleDeliveryDateField(a),i.handleManualAmountField(a)},handleManualAmountField:function(t){if(n.length)if(t.manual_amount_enabled==="yes"){const a=t.manual_amount_min===""?"":t.manual_amount_min,r=t.manual_amount_max===""?"":t.manual_amount_max;n.attr("data-min",a),n.attr("data-max",r),n.attr("data-step",t.manual_amount_step===""?"":t.manual_amount_step),a===""?n.removeAttr("min"):n.attr("min",a),r===""?n.removeAttr("max"):n.attr("max",r),n.attr("step",t.manual_amount_step===""?"any":t.manual_amount_step),n.attr("placeholder",h(a,r,s,f));const g=t.manual_amount_default!==""&&t.manual_amount_default!==void 0?u(t.manual_amount_default,s):"";n.val(g),m.empty(),(Array.isArray(t.manual_amount_presets)?t.manual_amount_presets:[]).slice(0,5).forEach(_=>{const c=e('<button type="button" class="agcfw-amount-preset"></button>');c.attr("data-amount",_),c.text(u(_,s)),m.append(c)}),o.show(),i.validateManualAmount()}else i.hideManualAmount()},getBounds:function(){const t=n.attr("data-min"),a=n.attr("data-max"),r=n.attr("data-step");return{min:t===""||t===void 0?"":parseFloat(t),max:a===""||a===void 0?"":parseFloat(a),step:r===""||r===void 0?"":parseFloat(r)}},handlePresetClick:function(t){t.preventDefault();const a=e(t.currentTarget).data("amount");n.val(u(a,s)),i.validateManualAmount()},validateManualAmount:function(){const t=String(n.val()),a=v(t,i.getBounds(),p,s);o.find(".agcfw-amount-error").text(a),n.toggleClass("agcfw-has-error",a!==""),i.highlightActivePreset(t)},highlightActivePreset:function(t){const a=parseFloat(t);o.find(".agcfw-amount-preset").each(function(){const r=parseFloat(String(e(this).data("amount")));e(this).toggleClass("is-active",!isNaN(a)&&r===a)})},hideManualAmount:function(){o.hide(),n.val("").removeAttr("placeholder").removeAttr("min").removeAttr("max").removeAttr("step").removeClass("agcfw-has-error"),o.find(".agcfw-amount-error").text(""),m.empty()},handleGiftableFields:function(t){t.is_giftable==="yes"?(e(".agcfw-variable-product-fields, .agcfw-send-option, .agcfw-send-to-friend-fields").show(),e("#recipient_name, #recipient_email").attr("required",!0)):(e(".agcfw-variable-product-fields, .agcfw-send-option, .agcfw-send-to-friend-fields").hide(),e('input[name="send_to"][value="me"]').prop("checked",!0),e("#recipient_name, #recipient_email").removeAttr("required"))},handleDeliveryDateField:function(t){t.allow_delivery_date==="yes"?(e(".delivery-date-field").show(),e("#delivery_date").flatpickr({enableTime:!0,dateFormat:agcfwVariableProduct.flatpickr_date_format||"Y-m-d h:i K",minDate:"today",time_24hr:!!agcfwVariableProduct.time_24hr||!1}),Intl&&Intl.DateTimeFormat&&Intl.DateTimeFormat().resolvedOptions&&e('input[name="timezone"]').val(Intl.DateTimeFormat().resolvedOptions().timeZone)):e(".delivery-date-field").hide()},resetVariationFields:function(){e(".variation_price, .variation_stock").html(""),e("button.single_add_to_cart_button").attr("disabled","disabled"),e(".agcfw-variable-product-fields, .delivery-date-field").hide(),e("#recipient_name, #recipient_email").removeAttr("required"),i.hideManualAmount()},resetAllFields:function(t){e(t.target).val()?e("button.single_add_to_cart_button").removeAttr("disabled"):e("button.single_add_to_cart_button").attr("disabled","disabled"),e(".variation_price, .variation_stock").html(""),e(".agcfw-variable-product-fields, .delivery-date-field").hide(),e("#recipient_name, #recipient_email").removeAttr("required").val(""),e("#short_message, #delivery_date").val(""),e('input[name="send_to"][value="friend"]').prop("checked",!0),e("#variation_id").val("0"),i.hideManualAmount()},handleSendToChange:function(t){e(t.target).val()==="friend"?(e(".agcfw-send-to-friend-fields").show(),e("#recipient_name, #recipient_email").attr("required",!0)):(e(".agcfw-send-to-friend-fields").hide(),e("#recipient_name, #recipient_email").removeAttr("required"))}};i.init()});export{w as __vite_legacy_guard};
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.