PageSourceSearch

https://www.meaning.ca/web/wp-content/plugins/woocommerce-name-you…/frontend/name-your-price.min.js?ver=3.8.2

js meaning.ca collected 2026-09-24 09:37:32 UTC 13,332 bytes, 2 lines download raw bytes

1/*! WooCommerce Name Your Price 3.8.2 2026-09-01 17:56 */
2function wc_nyp_format_price(t,e){var i={decimal_sep:woocommerce_nyp_params.currency_format_decimal_sep,currency_position:woocommerce_nyp_params.currency_format_position,currency_symbol:woocommerce_nyp_params.currency_format_symbol,trim_zeros:woocommerce_nyp_params.currency_format_trim_zeros,num_decimals:woocommerce_nyp_params.currency_format_num_decimals,html:!1},r=wc_nyp_format_number(t,e=Object.assign(i,e)),n=e.html?'<span class="woocommerce-Price-currencySymbol">'+e.currency_symbol+"</span>":e.currency_symbol;switch(e.currency_position){case"left":r=n+r;break;case"right":r+=n;break;case"left_space":r=n+" "+r;break;case"right_space":r=r+" "+n}return r=e.html?'<span class="woocommerce-Price-amount amount">'+r+"</span>":r}function wc_nyp_format_number(t,e){var i,r,n,a,o={decimal_sep:woocommerce_nyp_params.currency_format_decimal_sep,thousands_sep:woocommerce_nyp_params.currency_format_thousand_sep,num_decimals:woocommerce_nyp_params.currency_format_num_decimals,trim_zeros:woocommerce_nyp_params.currency_format_trim_zeros,format_null:!0};return e=Object.assign(o,e),"string"==typeof t&&""===t.trim()&&!1===e.format_null?"":(o=wc_nyp_unformat_number(t),t=isNaN(e.num_decimals=Math.abs(e.num_decimals))?2:e.num_decimals,i=e.decimal_sep===undefined?",":e.decimal_sep,n=e.thousands_sep===undefined?".":e.thousands_sep,a=(o<0?"-":"")+((a=3<(a=(r=parseInt(o=Math.abs(+o||0).toFixed(t),10)+"").length)?a%3:0)?r.substring(0,a)+n:"")+r.substring(a).replace(/(\d{3})(?=\d)/g,"$1"+n)+(t?i+Math.abs(o-r).toFixed(t).slice(2):""),e.trim_zeros&&(n=new RegExp("\\"+e.decimal_sep+"0+$","i"),a=a.replace(n,"")),a)}function wc_nyp_unformat_number(t){var e,i;return"number"==typeof(t=t||0)?t:(e=woocommerce_nyp_params.currency_format_decimal_sep,i=new RegExp("[^0-9-"+e+"]",["g"]),t=parseFloat((""+t).replace(/\((?=\d+)(.*)\)/,"-$1").replace(i,"").replace(e,".")),isNaN(t)?0:Math.abs(t))}function woocommerce_nyp_format_price(t,e,i){e={currency_symbol:e=void 0===e?"":e};return((i=void 0===i?!1:i)?wc_nyp_format_price:wc_nyp_format_number)(t,e)}function woocommerce_nyp_unformat_price(t){return wc_nyp_unformat_number(t)}jQuery.fn.wc_nyp_get_script_object=function(){var t=jQuery(this);return void 0!==t.data("wc_nyp_script_obj")&&t.data("wc_nyp_script_obj")},function(a){var i=function(t){var e=t.wc_nyp_get_script_object();if("object"==typeof e)return e;this.$el=t,this.$add_to_cart=t.find(".single_add_to_cart_button"),this.$add_to_cart.length||(this.$add_to_cart=t.find(":submit")),this.$addons_totals=this.$el.find("#product-addons-total"),this.show_addons_totals=!1,this.nypProducts=[],this.update_nyp_timer=!1,this.$el.trigger("wc-nyp-initializing",[this]),this.updateForm=this.updateForm.bind(this),this.$add_to_cart.on("click",{nypForm:this},this.onSubmit),this.$el.on("wc-nyp-initialized",{nypForm:this},this.updateForm),this.$el.on("wc-nyp-updated",{nypForm:this},this.updateForm),this.initIntegrations(),this.$el.data("wc_nyp_script_obj",this),this.$el.trigger("wc-nyp-initialized",[this])},n=(i.prototype.getProducts=function(){var r=this;return this.$el.find(".nyp").each(function(t){var e=a(this),i=e.wc_nyp_get_script_object();"object"!=typeof i&&(i=new n(e)),r.nypProducts[t]=i}),r.nypProducts},i.prototype.initIntegrations=function(){new t,this.$el.hasClass("grouped_form")&&new e,a("#woo_pp_ec_button_product").length&&new r},i.prototype.updateForm=function(t,e){var i=this.getProducts();void 0!==(e=void 0===e&&void 0!==i&&i.length?i.shift():e)&&"undefined"!=typeof e.$price_input&&(i=e.$price_input.attr("name"),e=e.user_price,this.$add_to_cart.data(i,e),this.$addons_totals.data("price",e),this.$el.trigger("woocommerce-product-addons-update")),this.isValid()?(this.$add_to_cart.removeClass("nyp-disabled"),this.$el.trigger("wc-nyp-valid",[this])):(this.$add_to_cart.addClass("nyp-disabled"),this.$el.trigger("wc-nyp-invalid",[this]))},i.prototype.updateFormTask=function(t){this.updateForm(!1,t)},i.prototype.onSubmit=function(t){if(!t.data.nypForm.isValid("submit"))return t.preventDefault(),t.stopImmediatePropagation(),!1},i.prototype.isValid=function(e){var i=!0;
2return this.getProducts().forEach(function(t){if("submit"===e&&t.$el.trigger("wc-nyp-update"),!t.isValid())return!(i=!1)}),i},i.prototype.shutdown=function(){this.$el.find("*").off()},function(t){var e=t.wc_nyp_get_script_object();if(e)return e;e=this;e.$el=t,e.$cart=t.closest(".cart"),e.$form=t.closest(".cart").not(".product, [data-bundled_item_id]"),e.$error=t.find(".woocommerce-nyp-message"),e.$error_content=e.$error.find("ul.woocommerce-error"),e.$label=t.find("label"),e.$screen_reader=t.find(".screen-reader-text"),e.$price_input=t.find(".nyp-input"),e.$period_input=t.find(".nyp-period"),e.$minimum=t.find(".minimum-price"),e.$subscription_terms=t.find(".subscription-details"),e.form=e.$form.wc_nyp_get_script_object(),e.min_price=parseFloat(t.data("min-price")),e.max_price=parseFloat(t.data("max-price")),e.annual_minimum=parseFloat(t.data("annual-minimum")),e.raw_price=e.$price_input.val(),e.user_price=wc_nyp_unformat_number(e.raw_price),e.user_period=e.$period_input.val(),e.error_messages=[],e.optional=!1,e.initialized=!1,this.update_timer=!1,e.onUpdate=e.onUpdate.bind(e),e.validate=e.validate.bind(e),this.$el.on("change",".nyp-input, .nyp-period",{nypProduct:this},this.onChange),this.$el.on("keypress",".nyp-input, .nyp-period",{nypProduct:this},this.onKeypress),this.$el.on("keyup",".nyp-input",{nypProduct:this},this.onKeyUp),this.$el.on("keydown",".nyp-input",{nypProduct:this},this.onKeyDown),this.$el.on("woocommerce-nyp-update",{nypProduct:this},this.onUpdate),this.$el.on("wc-nyp-update",{nypProduct:this},this.onUpdate),e.$el.data("wc_nyp_script_obj",e),e.$el.trigger("wc-nyp-update")});function t(){var n=this;this.integrate=function(){a(".cart").on("found_variation",n.onFoundVariation),a(".cart").on("reset_image reset_data",n.resetVariations),a(".bundled_product").on("found_variation",n.onFoundVariation),a(".bundled_product").on("reset_image reset_data",n.resetVariations)},this.onFoundVariation=function(t,e){var i=a(t.target).wc_nyp_get_script_object(),r=(i&&i.$add_to_cart&&""===i.default_add_to_cart_text&&(i.default_add_to_cart_text=i.$add_to_cart.html()),a(t.target).find(".nyp").wc_nyp_get_script_object());"object"==typeof r&&(r.$error.slideUp(),"undefined"!=typeof e.is_nyp&&!0===e.is_nyp?(i&&i.$add_to_cart&&i.$add_to_cart.html(e.add_to_cart_text),i="undefined"!=typeof e.display_price&&e.display_price?e.display_price:"",r.min_price="undefined"!=typeof e.minimum_price&&e.minimum_price?parseFloat(e.minimum_price):"",r.max_price="undefined"!=typeof e.maximum_price&&e.maximum_price?parseFloat(e.maximum_price):"",r.$price_input.val(wc_nyp_format_number(i,{format_null:!1})),r.$label.length&&((i="undefined"!==e.price_label?e.price_label:"")?r.$label.html(i).show():r.$label.empty().hide()),r.$minimum.length&&((i="undefined"!==e.minimum_price_html?e.minimum_price_html:"")?r.$minimum.html(i).show():r.$minimum.empty().hide()),r.$el.slideDown(),r.$el.data("hide-minimum",e.hide_minimum),r.initialized=!1,r.$el.trigger("wc-nyp-update")):n.resetVariations(t))},this.resetVariations=function(t){var e=a(t.target).find(".nyp").wc_nyp_get_script_object();"object"==typeof e&&(a(t.target).is("form")&&(t=a(t.target).wc_nyp_get_script_object())&&t.$add_to_cart&&""!==t.default_add_to_cart_text&&t.$add_to_cart.html(t.default_add_to_cart_text).removeClass("nyp-disabled"),e.$el.slideUp().removeClass("nyp-error"),e.initialized=!1,e.$error.empty(),e.$price_input.val(""))},this.integrate()}function e(){var t=this;this.integrate=function(){a(".cart").on("change",".qty, .wc-grouped-product-add-to-cart-checkbox",t.onStatusChange),a(".cart").find(".qty, .wc-grouped-product-add-to-cart-checkbox").trigger("change")},this.onStatusChange=function(){var t=a(this).closest("tr").find(".nyp");t.length&&((a(this).is(":checkbox")?a(this).is(":checked"):0<a(this).val())?t.data("optional_status",!0):t.data("optional_status",!1),t.trigger("wc-nyp-update",[{force:""===t.raw_price}]))},this.integrate()}function r(){var t=this;this.integrate=function(){a(".cart").on("wc-nyp-valid",t.enable),a(".cart").on("wc-nyp-invalid",t.disable),a(document).on("wc_ppec_validate_product_form",t.validate)},this.enable=function(){a("#woo_pp_ec_button_product").trigger("enable")},this.disable=function(){a("#woo_pp_ec_button_product").trigger("disable")}
2,this.validate=function(t,e,i){i=i.wc_nyp_get_script_object();return e="object"==typeof i?i.isValid():e},this.integrate()}n.prototype.onChange=function(t){t.data.nypProduct.$el.trigger("wc-nyp-update")},n.prototype.onKeypress=function(t){"Enter"===t.key&&(t.preventDefault(),t.data.nypProduct.$el.trigger("wc-nyp-update"),t.data.nypProduct.isValid()?t.data.nypProduct.$el.nextAll(":input:visible:first").focus():t.stopPropagation())},n.prototype.onKeyUp=function(t){clearTimeout(t.data.nypProduct.update_timer),t.data.nypProduct.update_timer=setTimeout(()=>{t.data.nypProduct.$el.trigger("wc-nyp-update",[{hide_error:!0}])},1e3)},n.prototype.onKeyDown=function(t){clearTimeout(t.data.nypProduct.update_timer)},n.prototype.onUpdate=function(t,e){var i,r=this,n=void 0!==e&&e.hasOwnProperty("force")&&!0===e.force,e=void 0!==e&&e.hasOwnProperty("hide_error")&&!0===e.hide_error;n&&(this.initialized=!1),this.raw_price=this.$price_input.val().trim()?this.$price_input.val().trim():"",this.user_price=wc_nyp_unformat_number(this.raw_price),this.user_period=this.$period_input.val(),e||this.$price_input.val(wc_nyp_format_number(this.raw_price,{format_null:!1})),this.validate(),this.$el.data("price",this.user_price),this.$el.data("period",this.user_period),this.isValid()?(this.$el.removeClass("nyp-error"),this.$error.slideUp().empty(),this.$el.trigger("wc-nyp-valid-item",[this])):(i=a('<ul class="woocommerce-error wc-nyp-error" />'),0<(n=this.getErrorMessages()).length&&a.each(n,function(t,e){i.append(a("<li/>").html(e))}),this.$error.html(i),this.$el.trigger("wc-nyp-invalid-item",[this])),!this.isInitialized()||this.isValid()||e||(this.$el.addClass("nyp-error"),this.$error.slideDown(function(){r.$price_input.trigger("focus")})),this.$cart.trigger("woocommerce-nyp-updated-item"),a("body").trigger("woocommerce-nyp-updated"),this.$el.trigger("wc-nyp-updated",[this]),this.initialized=!0},n.prototype.validate=function(){var t,e,i,r,n;return!this.priceChanged()||(this.resetMessages(),this.$el.data("nyp-valid",!0),!!this.isOptional())||(t=this.$el.data("hide-minimum")?this.$el.data("hide-minimum-error"):this.$el.data("minimum-error"),e="%%MINIMUM%%",n="",0<this.annual_minimum?this.user_price*woocommerce_nyp_params.annual_price_factors[this.user_period]<this.annual_minimum&&(i=this.annual_minimum/woocommerce_nyp_params.annual_price_factors[this.user_period],r=this.$period_input.find('option[value="'+this.user_period+'"]').text(),n=woocommerce_nyp_params.i18n_subscription_string.replace("%price",wc_nyp_format_price(i)).replace("%period",r),this.addErrorMessage(t.replace(e,n))):this.min_price&&this.user_price<this.min_price?(n=wc_nyp_format_price(this.min_price),this.addErrorMessage(t.replace(e,n))):this.max_price&&this.user_price>this.max_price?(t=this.$el.data("maximum-error"),e="%%MAXIMUM%%",n=wc_nyp_format_price(this.max_price),this.addErrorMessage(t.replace(e,n))):""===this.raw_price&&(t=this.$el.data("empty-error"),this.addErrorMessage(t.replace(e,n))),void(this.isValid()||this.$el.data("nyp-valid",!1)))},n.prototype.priceChanged=function(){var t=!0;return t=!this.$el.is(":visible")||this.isInitialized()&&this.raw_price===this.user_price&&this.user_price===this.$el.data("price")&&this.user_period===this.$el.data("period")?!1:t},n.prototype.isValid=function(){return!this.$el.is(":visible")||this.isOptional()||!this.error_messages.length},n.prototype.isOptional=function(){return"yes"===this.$el.data("optional")&&!0!==this.$el.data("optional_status")},n.prototype.isInitialized=function(){return this.initialized},n.prototype.addErrorMessage=function(t){this.error_messages.push(t.toString())},n.prototype.getErrorMessages=function(){return this.error_messages},n.prototype.resetMessages=function(){this.error_messages=[]},n.prototype.getPrice=function(){return this.user_price},n.prototype.getPeriod=function(){return this.user_period},jQuery(function(a){a.fn.wc_nyp_form=function(){var t=a(this),e=t.wc_nyp_get_script_object();if(t.hasClass("cart"))return e&&t.data("wc_nyp_script_obj").shutdown(),new i(t),this},a("form.cart").each(function(){a(this).wc_nyp_form()}),new i(a("form.cart")),a("body").on("quick-view-displayed",function(){a("form.cart").each(function(){a(this).wc_nyp_form()})}),a(".wcopc .cart").each(function(){a(this).wc_nyp_form()}
2),a("body").on("opc_add_remove_product",function(t,e,i){var r,n;return void 0!==i&&(r=(i=a(i.currentTarget)).closest(".cart").find(".nyp").wc_nyp_get_script_object())&&(r.$el.trigger("wc-nyp-update"),0<(n=parseFloat(e.quantity))&&!r.isValid()?("number"===i.prop("type")&&i.val(i.data("cart_quantity")),e.invalid=!0):0===n&&(r.$el.removeClass("nyp-error"),r.$error.slideUp(),i=r.$el.data("initial-price"),r.$price_input.val(wc_nyp_format_number(i,{format_null:!1})))),e}),a("body .component").on("wc-composite-component-loaded",function(){var t=a(this).find(".nyp");t.length?new n(t):a(this).trigger("wc-nyp-updated")})})}(jQuery);

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.