var wc_cp_composite_scripts={},$wc_cp_body=!1,$wc_cp_html=jQuery("html"),$wc_cp_window=jQuery(window),$wc_cp_document=jQuery(document),wc_cp_block_params={message:null,fadeIn:200,fadeOut:200,overlayCSS:{background:"rgba(255, 255, 255, 0)",opacity:.6}};function wc_cp_toggle_element(t,e,i,o){return o=void 0===o?300:o,!0!==t.data("animating")&&(t.hasClass("closed")?(setTimeout(function(){e.slideDown({duration:o,queue:!1,always:function(){t.removeClass("opening"),t.data("animating",!1),"function"==typeof i&&i()}})},40),t.removeClass("closed").addClass("open opening"),t.find(".aria_button").attr("aria-expanded","true")):(setTimeout(function(){e.slideUp({duration:o,queue:!1,always:function(){t.removeClass("closing"),t.data("animating",!1),"function"==typeof i&&i()}})},40),t.removeClass("open").addClass("closed closing"),t.find(".aria_button").attr("aria-expanded","false")),t.data("animating",!0),!0)}function wc_cp_price_format(t,e){return e=void 0!==e&&e,wc_cp_woocommerce_number_format(wc_cp_number_format(t),e)}function wc_cp_woocommerce_number_format(t,e){var i=wc_composite_params.currency_format_decimal_sep,o=wc_composite_params.currency_position,n=wc_composite_params.currency_symbol,s=wc_composite_params.currency_format_trim_zeros,_=wc_composite_params.currency_format_num_decimals;if(e=void 0!==e&&e,"yes"==s&&0<_){for(var a=0;a<_;a++)i+="0";t=t.replace(i,"")}s=String(t),t=e?n:'<span class="woocommerce-Price-currencySymbol">'+n+"</span>";return"left"===o?s=t+s:"right"===o?s+=t:"left_space"===o?s=t+" "+s:"right_space"===o&&(s=s+" "+t),s=e?s:'<span class="woocommerce-Price-amount amount">'+s+"</span>"}function wc_cp_number_format(t){var e=wc_composite_params.currency_format_num_decimals,i=wc_composite_params.currency_format_decimal_sep,o=wc_composite_params.currency_format_thousand_sep,e=isNaN(e=Math.abs(e))?2:e,i=void 0===i?",":i,o=void 0===o?".":o,n=t<0?"-":"",s=parseInt(t=Math.abs(+t||0).toFixed(e),10)+"",_=3<(_=s.length)?_%3:0;return n+(_?s.substr(0,_)+o:"")+s.substr(_).replace(/(\d{3})(?=\d)/g,"$1"+o)+(e?i+Math.abs(t-s).toFixed(e).slice(2):"")}function wc_cp_number_round(t,e){e=void 0===e?wc_composite_params.currency_format_num_decimals:e,e=Math.pow(10,parseInt(e,10));return Math.round(t*e)/e}function wc_cp_join(t){var e="",i=t.length;if(0<i)for(var o=0,n=0;n<i;n++)o++,e=1==i||1==o?t[n]:wc_composite_params.i18n_comma_sep.replace("%s",e).replace("%v",t[n]);return e}function wc_cp_get_variation_data(t,e,s){e=e||!1,s=s||!1;var t=t.find(".attribute_options"),_=t.length,a=s?{}:[],c="";return 0===_?"":(t.each(function(t){var e=jQuery(this),i=e.find("select"),o=i.data("attribute_name")||i.attr("name"),n=e.data("attribute_label"),i=i.val();if(!s&&""===i)return c="",!(a=[]);o=s?o:n,n=s?i:e.find("select option:selected").text();s?a[o]=n:a.push({meta_key:o,meta_value:n}),c=c+'<span class="meta_element"><span class="meta_key">'+o+':</span> <span class="meta_value">'+n+"</span>",t!==_-1&&(c+='<span class="meta_element_sep">, </span>'),c+="</span>"}),e?c:a)}jQuery.fn.wc_cp_is_in_viewport=function(t,e,i){var o,n,s,_,a,c,r,d,l=$wc_cp_window;if(!(this.length<1))return s=(r=1<this.length?this.eq(0):this).get(0),a=l.width(),d=l.height(),e=!0!==e||s.offsetWidth*s.offsetHeight,i=i||"vertical","function"==typeof s.getBoundingClientRect?(c=0<=(s=s.getBoundingClientRect()).top&&s.top<d,o=0<s.bottom&&s.bottom<=d,_=s.top<0&&s.bottom>d,n=0<=s.left&&s.left<a,s=0<s.right&&s.right<=a,_=t?c||o||_:c&&o,c=t?n||s:n&&s,"both"===i?e&&_&&c:"vertical"===i?e&&_:"horizontal"===i?e&&c:void 0):(n=(o=l.scrollTop())+d,_=(s=l.scrollLeft())+a,l=(d=(c=r.offset()).top)+r.height(),c=(a=c.left)+r.width(),r=!0===t?l:d,d=!0===t?d:l,l=!0===t?c:a,t=!0===t?a:c,"both"===i?!!e&&d<=n&&o<=r&&t<=_&&s<=l:"vertical"===i?!!e&&d<=n&&o<=r:"horizontal"===i?!!e&&t<=_&&s<=l:void 0)},jQuery.fn.wc_get_composite_script=function(){var t=jQuery(this);return!!t.hasClass("composite_form")&&(t=t.data("script_id"),void 0!==wc_cp_composite_scripts[t])&&wc_cp_composite_scripts[t]},jQuery.fn.wc_cp_animate_height=function(t,e,i){var o,n=jQuery(this),s=!(!i||"function"!=typeof i.before)&&i.before,_=!(!i||"function"!=typeof i.start)&&i.start,a=!(!i||"function"!=typeof i.complete)&&i.complete;s&&s(),"css"===wc_composite_params.animate_height_method?(void 0===(s=n.get(0).getBoundingClientRect().height)&&(s=n.outerHeight()),n.addClass("animating").css({height:s+"px",overflow:"hidden",transition:"height "+(e-10)/1e3+"s","-webkit-transition":"height "+(e-10)/1e3+"s"}),setTimeout(function(){i&&"function"==typeof i.start&&i.start(),n.css({height:t+"px"})},1),setTimeout(function(){n.removeClass("animating").css({height:"",overflow:"",transition:"","-webkit-transition":""}),i&&"function"==typeof i.complete&&i.complete()},e)):(o={duration:e,queue:!1,always:function(){a&&a(),n.removeClass("animating")}},setTimeout(function(){_&&_(),n.addClass("animating").animate({height:t},o)},1))},function(M,o){var p={};function s(t){var m=this;this.composite_id=t.$composite_data.data("container_id"),this.$composite_data=t.$composite_data,this.$composite_form=t.$composite_form,this.$composite_add_to_cart_button=t.$composite_form.find(".composite_add_to_cart_button"),this.$composite_navigation=t.$composite_form.find(".composite_navigation"),this.$composite_navigation_top=t.$composite_form.find(".composite_navigation.top"),this.$composite_navigation_bottom=t.$composite_form.find(".composite_navigation.bottom"),this.$composite_navigation_movable=t.$composite_form.find(".composite_navigation.movable"),this.$composite_pagination=t.$composite_form.find(".composite_pagination"),this.$composite_summary=t.$composite_form.find(".composite_summary"),this.$composite_summary_widget=M(".widget_composite_summary").filter(function(){return 0<M(this).find(".widget_composite_summary_content_"+m.composite_id).length}),this.$components=t.$composite_form.find(".composite_component"),this.$steps={},this.$composite_availability=t.$composite_data.find(".composite_availability"),this.$composite_price=t.$composite_data.find(".composite_price"),this.$composite_message=t.$composite_data.find(".composite_message"),this.$composite_button=t.$composite_data.find(".composite_button"),this.$composite_quantity=this.$composite_button.find("input.qty"),this.$composite_status=t.$composite_form.find(".composite_status"),this.$composite_transition_helper=t.$composite_form.find(".scroll_show_component"),this.$composite_form_blocker=t.$composite_form.find(".form_input_blocker"),this.timers={on_resize_timer:!1},this.ajax_url="yes"===wc_composite_params.use_wc_ajax?woocommerce_params.wc_ajax_url:woocommerce_params.ajax_url,this.debug_tab_count=0,this.settings=t.$composite_data.data("composite_settings"),this.is_initialized=!1,this.is_finalized=!1,this.has_transition_lock=!1,this.blocked_elements=[],this.steps=[],this.step_factory=new p.WC_CP_Step_Factory,this.scenarios=new p.WC_CP_Scenarios_Manager(this),this.actions=new p.WC_CP_Actions_Dispatcher(this),this.filters=new p.WC_CP_Filters_Manager,this.router=!1,this.data_model=!1,this.view_classes=new p.WC_CP_Views(this),this.model_classes=new p.WC_CP_Models(this),this.composite_viewport_scroller=!1,this.composite_summary_view=!1,this.composite_pagination_view=!1,this.composite_navigation_view=!1,this.composite_validation_view=!1,this.composite_availability_view=!1,this.composite_price_view=!1,this.composite_add_to_cart_button_view=!1,this.composite_summary_widget_views=[],this.api={navigate_to_step:function(t){t=m.get_step_by("id",t);if(!1===t)return!1;m.navigate_to_step(t)},show_previous_step:function(){m.show_previous_step()},show_next_step:function(){m.show_next_step()},get_steps:function(){return m.get_steps()},get_components:function(){return m.get_components()},get_step:function(t){return m.get_step(t)},get_step_by:function(t,e){return m.get_step_by(t,e)},get_step_title:function(t){t=m.get_step_by("id",t);return!1!==t&&t.get_title()},get_step_slug:function(t){t=m.get_step_by("id",t);return!1!==t&&t.get_slug()},get_current_step:function(){return m.get_current_step()},get_previous_step:function(){return m.get_previous_step()},get_next_step:function(){return m.get_next_step()},get_composite_totals:function(){return m.data_model.get("totals")},get_composite_stock_status:function(){return m.data_model.get("is_in_stock")?"in-stock":"out-of-stock"},get_composite_availability:function(){var t=m.composite_availability_view.get_insufficient_stock_components_string();return t=""===t&&!1!==m.composite_availability_view.$composite_stock_status?m.composite_availability_view.$composite_stock_status.clone().wrap("<div></div>").parent().html():t},get_composite_validation_status:function(){return m.data_model.get("passes_validation")?"pass":"fail"},get_composite_validation_messages:function(){return m.data_model.get("validation_messages")},get_composite_configuration:function(){var t={},e=m.get_components();if(0===e.length)return!1;for(var i=0,o=e.length;i<o;i++){var n=e[i],s=m.api.get_component_configuration(n.component_id);t[n.component_id]=s}return t},get_component_totals:function(t){return!1!==m.get_step_by("id",t)&&m.data_model.get("component_"+t+"_totals")},get_component_stock_status:function(t){t=m.get_step_by("id",t);return!1!==t&&(t.step_validation_model.get("is_in_stock")?"in-stock":"out-of-stock")},get_component_availability:function(t){var t=m.get_step_by("id",t);return!1!==t&&(0<(t=t.$component_summary_content.find(".component_wrap .stock")).length?t.clone().wrap("<div></div>").parent().html():"")},get_component_validation_status:function(t){t=m.get_step_by("id",t);return!1!==t&&(t.step_validation_model.get("passes_validation")?"pass":"fail")},get_component_validation_messages:function(t,e){t=m.get_step_by("id",t);return!1!==t&&("composite"===e?t.step_validation_model.get("composite_messages"):t.step_validation_model.get("component_messages"))},get_component_configuration:function(t){var e,t=m.get_step_by("id",t);return!1!==t&&(e={title:t.get_title(),selection_title:t.get_selected_product_title(!1),selection_meta:t.get_selected_product_meta(!1),product_id:t.get_selected_product(!1),variation_id:t.get_selected_variation(!1),product_valid:t.is_selected_product_valid(),variation_valid:t.is_selected_variation_valid(),quantity:t.get_selected_quantity(),product_type:t.get_selected_product_type()},m.filters.apply_filters("component_configuration",[e,t]))},is_component_priced_individually:function(t){return"yes"===m.data_model.price_data.is_priced_individually[t]}},this.init=function(){m.$composite_data.trigger("wc-composite-initializing",[m]),this.actions.add_action("initialize_composite",function(){m.init_steps()},10,this).add_action("initialize_composite",function(){m.init_models()},20,this).add_action("initialize_composite",function(){m.actions.init()},30,this).add_action("initialize_composite",function(){m.on_resize_handler()},40,this).add_action("initialize_composite",function(){m.init_views()},50,this).add_action("initialize_composite",function(){m.scenarios.init()},60,this).add_action("initialize_composite",function(){m.console_log("debug:events","\nInitializing Options:"),m.debug_indent_incr();for(var t=0,e=m.get_components(),i=e.length;t<i;t++)e[t].component_options_model.refresh_options_state();m.debug_indent_decr(),m.console_log("debug:events","\nDone.")},61,this).add_action("initialize_composite",function(){m.console_log("debug:events","\nValidating Steps:"),m.debug_indent_incr();for(var t=0,e=m.get_steps(),i=e.length;t<i;t++)e[t].validate();m.debug_indent_decr(),m.console_log("debug:events","\nValidation complete.")},70,this).add_action("initialize_composite",function(){m.get_current_step().show_step()},80,this).add_action("initialize_composite",function(){m.init_router()},90,this),this.actions.do_action("initialize_composite"),m.is_initialized=!0,this.actions.add_action("composite_initialized",function(){m.data_model.init()},10,this).add_action("composite_initialized",function(){m.render_views()},20,this),this.actions.do_action("composite_initialized"),m.is_finalized=!0},this.init_router=function(){var t=o.Router.extend({has_initial_route:!1,is_initial_route:!1,is_history_started:!1,routes:{":step_slug":"show_step"},show_step:function(t){t=encodeURIComponent(t),t=m.get_step_by("slug",t);t&&(this.is_history_started||(this.has_initial_route=!0,this.is_initial_route=!0),t.is_locked()?(m.console_log("warning",wc_composite_params.i18n_step_not_accessible.replace(/%s/g,t.get_title())),m.router.navigate(m.get_current_step().get_slug())):(this.is_history_started&&m.composite_viewport_scroller.scroll_viewport(m.$composite_form,{timeout:0,partial:!1,duration:0,queue:!1}),t.show_step()))},navigate_to_step:function(t){this.is_initial_route=!1,t.show_step(),this.is_routing()&&this.navigate(t.get_slug())},update_history:function(){return"yes"===m.settings.update_browser_history},is_routing:function(){return this.update_history()&&m.is_initialized&&!1===this.is_initial_route},start:function(){this.update_history()&&$wc_cp_body.hasClass("single-product")&&$wc_cp_body.hasClass("postid-"+m.composite_id)&&!m.$composite_form.parent().hasClass("quick-view-content")&&(o.history.started&&(this.is_history_started=!0),this.is_history_started||(o.history.start(),this.is_history_started=!0,"single"===m.settings.layout)||!1!==this.has_initial_route||window.location.hash||this.navigate(m.get_current_step().get_slug(),{trigger:!1}))}});m.router=new t,m.router.start()},this.init_steps=function(){m.console_log("debug:events","\nInitializing Steps..."),"paged"===m.settings.layout?"componentized"===m.settings.layout_variation?(m.$composite_form.find(".multistep.active").removeClass("active"),m.$composite_data.addClass("multistep active")):m.$composite_data.prev().hasClass("multistep")?(m.$composite_data.addClass("multistep"),m.$composite_data.hide(),"no"===m.settings.update_browser_history&&m.$composite_data.hasClass("composite_added_to_cart")&&(m.$composite_form.find(".multistep.active").removeClass("active"),m.$composite_data.addClass("active"))):(m.$composite_data.show(),m.$composite_data.find(".component_title .step_index").hide()):"progressive"!==m.settings.layout&&"single"!==m.settings.layout||(m.$components.show(),m.$composite_data.show()),m.$steps=m.$composite_form.find(".multistep"),m.$composite_form.find(".composite_component, .multistep").each(function(t){var e=m.step_factory.create_step(m,M(this),t);m.steps[t]=e}),m.$composite_navigation.removeAttr("style")},this.get_ajax_url=function(t){return"yes"===wc_composite_params.use_wc_ajax?this.ajax_url.toString().replace("%%endpoint%%",t):this.ajax_url},this.navigate_to_step=function(t){"object"==typeof t&&"function"==typeof t.show_step&&this.router.navigate_to_step(t)},this.show_previous_step=function(){for(var t=0,e=m.get_steps(),i=e.length;t<i;t++)if(e[t].is_previous()){m.navigate_to_step(e[t]);break}},this.show_next_step=function(){for(var t=0,e=m.get_steps(),i=e.length;t<i;t++)if(e[t].is_next()){m.navigate_to_step(e[t]);break}},this.get_steps=function(){return this.steps},this.get_components=function(){for(var t=[],e=0,i=m.get_steps(),o=i.length;e<o;e++)i[e].is_component()&&t.push(i[e]);return t},this.get_step=function(t){for(var e=!1,i=0,o=m.get_steps(),n=o.length;i<n;i++)if(o[i].step_id==t){e=o[i];break}return e},this.get_step_by=function(t,e){var i=!1;if("id"!==t&&"index"!==t&&"slug"!==t)return!1;for(var o=0,n=m.get_steps(),s=n.length;o<s;o++)if("id"===t&&String(n[o].step_id)===String(e)||"index"===t&&String(o)===String(e)||"slug"===t&&String(n[o].get_slug()).toUpperCase()===String(e).toUpperCase()){i=n[o];break}return i},this.get_current_step=function(){for(var t=!1,e=0,i=m.get_steps(),o=i.length;e<o;e++)if(i[e].is_current()){t=i[e];break}return t},this.set_current_step=function(t){var e=this.settings.layout,i=this.settings.layout_variation,o=this.get_current_step(),n=this.get_next_step(),s=this.get_previous_step(),_=this.get_last_step(),a=!1,c=!1,r=!1;if("paged"===e&&"componentized"===i)a=c=r=this.get_step_by("id","review");else for(var d=0,l=m.get_steps(),p=l.length;d<p;d++)!1===a&&l[d].step_index>t.step_index&&l[d].is_visible()&&(a=l[d]),l[d].step_index<t.step_index&&l[d].is_visible()&&(c=l[d]),l[d].is_visible()&&(r=l[d]);o._is_current=!1,t._is_current=!0,o.$el.removeClass("active"),t.$el.addClass("active"),!1!==n&&(n._is_next=!1,n.$el.removeClass("next")),!1!==a&&(a._is_next=!0,a.$el.addClass("next")),!1!==s&&(s._is_previous=!1,s.$el.removeClass("prev")),!1!==c&&(c._is_previous=!0,c.$el.addClass("prev")),!1!==_&&(_._is_last=!1,_.$el.removeClass("last")),!1!==r&&(r._is_last=!0,r.$el.addClass("last"))},this.get_previous_step=function(){for(var t=!1,e=0,i=m.get_steps(),o=i.length;e<o;e++)if(i[e].is_previous()){t=i[e];break}return t},this.get_next_step=function(){for(var t=!1,e=0,i=m.get_steps(),o=i.length;e<o;e++)if(i[e].is_next()){t=i[e];break}return t},this.get_last_step=function(){for(var t=!1,e=0,i=m.get_steps(),o=i.length;e<o;e++)if(i[e].is_last()){t=i[e];break}return t},this.on_resize_handler=function(){var t=m.$composite_form.width();if(t<=wc_composite_params.small_width_threshold?m.$composite_form.addClass("small_width"):m.$composite_form.removeClass("small_width"),t>wc_composite_params.full_width_threshold?m.$composite_form.addClass("full_width"):m.$composite_form.removeClass("full_width"),wc_composite_params.legacy_width_threshold&&(t<=wc_composite_params.legacy_width_threshold?m.$composite_form.addClass("legacy_width"):m.$composite_form.removeClass("legacy_width")),m.is_initialized)for(var e,i,o=0,n=m.get_components(),s=n.length;o<s;o++)n[o].component_selection_view.is_relocated()&&(e=n[o].component_selection_view.get_new_relocation_data()).relocate&&(i=n[o].component_selection_view.$relocation_target,e.reference.after(i))},this.init_models=function(){for(var t=0,e=m.get_steps(),i=e.length;t<i;t++){var o=e[t];o.step_visibility_model=new m.model_classes.Step_Visibility_Model(o),o.step_validation_model=new m.model_classes.Step_Validation_Model(o),o.step_access_model=new m.model_classes.Step_Access_Model(o)}for(var n=0,s=m.get_components(),_=s.length;n<_;n++){var a=s[n];a.component_options_model=new m.model_classes.Component_Options_Model(a),a.component_selection_model=new m.model_classes.Component_Selection_Model(a)}m.data_model=new m.model_classes.Composite_Data_Model},this.init_views=function(){m.console_log("debug:events","\nInitializing Views..."),this.composite_validation_view=new m.view_classes.Composite_Validation_View({is_in_widget:!1,el:m.$composite_message,model:m.data_model}),this.composite_price_view=new m.view_classes.Composite_Price_View({is_in_widget:!1,el:m.$composite_price,model:m.data_model}),this.composite_availability_view=new m.view_classes.Composite_Availability_View({is_in_widget:!1,el:m.$composite_availability,model:m.data_model}),this.composite_add_to_cart_button_view=new m.view_classes.Composite_Add_To_Cart_Button_View({is_in_widget:!1,el:m.$composite_button,$el_button:m.$composite_add_to_cart_button,model:m.data_model}),this.composite_status_view=new m.view_classes.Composite_Status_View({el:m.$composite_status,$el_content:m.$composite_status.find(".wrapper"),model:m.data_model}),0<m.$composite_pagination.length&&(m.composite_pagination_view=new m.view_classes.Composite_Pagination_View({el:m.$composite_pagination})),0<m.$composite_summary.length&&(m.composite_summary_view=new m.view_classes.Composite_Summary_View({is_in_widget:!1,el:m.$composite_summary})),0<m.$composite_navigation.length&&(m.composite_navigation_view=new m.view_classes.Composite_Navigation_View({el:m.$composite_navigation})),0<m.$composite_summary_widget.length&&m.$composite_summary_widget.each(function(t,e){m.composite_summary_widget_views.push(new m.view_classes.Composite_Widget_View({widget_count:t+1,el:e}))}),m.composite_viewport_scroller=new m.view_classes.Composite_Viewport_Scroller;for(var t=0,e=m.get_steps(),i=e.length;t<i;t++){var o=e[t];o.validation_view=new m.view_classes.Step_Validation_View(o,{el:o.$component_message,model:o.step_validation_model}),o.step_title_view=new m.view_classes.Step_Title_View(o,{el:o.$step_title})}for(var n=0,s=m.get_components(),_=s.length;n<_;n++){var a=s[n];a.component_selection_view=new m.view_classes.Component_Selection_View(a,{el:a.$component_content,model:a.component_selection_model}),a.component_options_view=new m.view_classes.Component_Options_View(a,{el:a.$component_options,model:a.component_options_model}),a.component_pagination_view=new m.view_classes.Component_Pagination_View(a,{el:a.$component_pagination,model:a.component_options_model})}},this.render_views=function(){m.console_log("debug:views","\nRendering Views..."),m.debug_indent_incr();for(var t=0,e=m.get_components(),i=e.length;t<i;t++){var o=e[t];o.component_selection_view.render_default(),o.component_options_view.render(),o.component_pagination_view.render()}for(var n=0,s=m.get_steps(),_=s.length;n<_;n++){var a=s[n];a.step_title_view.render_navigation_state(),a.step_title_view.render_index()}!1!==m.composite_pagination_view&&m.composite_pagination_view.render(),!1!==m.composite_summary_view&&m.composite_summary_view.render(),!1!==m.composite_navigation_view&&m.composite_navigation_view.render("transition");for(var c=0,r=m.composite_summary_widget_views,d=r.length;c<d;c++)r[c].composite_summary_view.render();m.debug_indent_decr(),m.console_log("debug:views","\nRendering complete."),m.$composite_form.removeClass("cp-no-js"),m.$composite_form.find(".cp-no-js-msg").remove()},this.block=function(t){t=t.attr("id")||t.attr("class");this.blocked_elements.push(t),1===this.blocked_elements.length&&(this.$composite_form.block(wc_cp_block_params),m.has_transition_lock=!0)},this.unblock=function(t){t=t.attr("id")||t.attr("class");this.blocked_elements=_.without(this.blocked_elements,t),0===this.blocked_elements.length&&(this.$composite_form.unblock(),m.has_transition_lock=!1)},this.console_log=function(t,e){if(window.console&&void 0!==e){var i=!1,o=!1,n=!1;if("error"===t)o=i=!0;else if("warning"===t)n=i=!0;else if(0<wc_composite_params.script_debug_level.length)if(_.includes(wc_composite_params.script_debug_level,t))i=!0;else for(var s=0,a=wc_composite_params.script_debug_level.length;s<a;s++)if(-1<t.indexOf(wc_composite_params.script_debug_level[s])){i=!0;break}if(i){var c="";if("error"!==t)for(var r=m.debug_tab_count;0<r;r--)c+="\t";e="function"==typeof(e="function"==typeof e?e():e).substring&&"\n"===e.substring(0,1)?e.replace("\n","\n"+c):c+e,-1<t.indexOf("animation")&&(e=e+" ("+window.performance.now()+")"),o?window.console.error(e):n?window.console.warn(e):window.console.log(e)}}},this.debug_indent_incr=function(){this.debug_tab_count=this.debug_tab_count+2},this.debug_indent_decr=function(){this.debug_tab_count=this.debug_tab_count-2},this.allow_history_updates=function(){return m.console_log("warning","\nMethod 'WC_CP_Composite::allow_history_updates' is deprecated since v3.14.0. Use 'WC_CP_Composite::router::is_routing' instead."),m.router.is_routing()}}p.WC_CP_Models=function(k){this.Composite_Data_Model=function(t){return new(o.Model.extend({price_data:k.$composite_data.data("price_data"),$nyp:!1,initialize:function(){for(var t={passes_validation:!0,validation_messages:[],status_messages:[],is_in_stock:!0,stock_statuses:[],totals:{price:"",regular_price:"",price_incl_tax:"",price_excl_tax:""}},e=0,i=k.get_components(),o=i.length;e<o;e++)t["component_"+i[e].component_id+"_totals"]={price:"",regular_price:"",price_incl_tax:"",price_excl_tax:""};this.set(t),this.price_data.suffix_exists=""!==wc_composite_params.price_display_suffix,this.price_data.suffix_contains_price_incl=-1<wc_composite_params.price_display_suffix.indexOf("{price_including_tax}"),this.price_data.suffix_contains_price_excl=-1<wc_composite_params.price_display_suffix.indexOf("{price_excluding_tax}"),k.actions.add_action("component_nyp_changed",this.nyp_changed_handler,10,this),k.actions.add_action("component_quantity_changed",this.quantity_changed_handler,20,this),k.actions.add_action("component_selection_changed",this.selection_changed_handler,30,this),k.actions.add_action("component_selection_content_changed",this.selection_content_changed_handler,30,this),k.actions.add_action("component_availability_changed",this.availability_changed_handler,10,this),k.actions.add_action("component_validation_message_changed",this.validation_status_changed_handler,10,this),k.actions.add_action("component_validation_status_changed",this.validation_status_changed_handler,10,this),k.actions.add_action("component_totals_changed",this.component_totals_changed_handler,10,this);var n=k.$composite_data.find(".nyp");0<n.length&&(M.fn.wc_nyp_get_script_object&&k.filters.add_filter("composite_validation_status",function(t){var e=k.data_model.$nyp.wc_nyp_get_script_object();return t=e&&!1===e.isValid()?!1:t},10,this),this.$nyp=n,this.price_data.base_price=n.data("price"),k.$composite_data.on("woocommerce-nyp-updated-item",function(){k.data_model.price_data.base_price=k.data_model.$nyp.data("price"),k.data_model.price_data.base_regular_price=k.data_model.$nyp.data("price"),k.data_model.update_validation(),k.data_model.calculate_subtotals(),k.data_model.calculate_totals()}))},init:function(){k.console_log("debug:models","\nInitializing composite data model..."),k.debug_indent_incr(),this.update_validation(),this.update_totals(),this.update_availability(),k.debug_indent_decr()},nyp_changed_handler:function(t){if(!k.is_initialized)return!1;this.update_totals(t)},selection_changed_handler:function(){if(!k.is_initialized)return!1;this.update_validation(),this.update_totals()},availability_changed_handler:function(){if(!k.is_initialized)return!1;this.update_availability()},selection_content_changed_handler:function(){if(!k.is_initialized)return!1;this.update_validation(),this.update_totals()},quantity_changed_handler:function(t){if(!k.is_initialized)return!1;this.update_validation(),this.update_totals(t)},validation_status_changed_handler:function(){this.update_validation()},component_totals_changed_handler:function(){this.calculate_totals()},update_validation:function(){var t=[],e=this.get_validation_status();this.is_purchasable()?t=this.get_validation_messages():t.push(wc_composite_params.i18n_unavailable_text),k.console_log("debug:models","\nUpdating 'Composite_Data_Model' validation state... Attribute count: \"validation_messages\": "+t.length+', Attribute: "passes_validation": '+(0===t.length).toString()),k.debug_indent_incr(),this.set({validation_messages:t,passes_validation:e}),k.debug_indent_decr()},get_validation_status:function(){var t=!0;if(!this.is_purchasable())return!1;for(var e=0,i=k.get_steps(),o=i.length;e<o;e++)if(!i[e].step_validation_model.get("passes_validation")){t=!1;break}return k.filters.apply_filters("composite_validation_status",[t])},get_validation_messages:function(){for(var t=[],e=0,i=k.get_steps(),o=i.length;e<o;e++)for(var n=i[e].get_title(),s=0,_=i[e].get_validation_messages("composite"),a=_.length;s<a;s++)if(i[e].is_review())t.push({sources:!1,content:_[s].toString()});else{var c=!1;if(0<t.length)for(var r=0,d=t.length;r<d;r++)if(t[r].content===_[s]){var l=t[r].sources;l.push(n),t[r]={sources:l,content:_[s]},c=!0;break}c||t.push({sources:[n],content:_[s].toString()})}var p=[];if(0<t.length)for(var m,u=0,h=t.length;u<h;u++)!1===t[u].sources?p.push(t[u].content):(m=wc_cp_join(t[u].sources),p.push(wc_composite_params.i18n_validation_issues_for.replace("%c",m).replace("%e",t[u].content)));return p=k.filters.apply_filters("composite_validation_messages",[p])},is_purchasable:function(){return"no"!==this.price_data.is_purchasable},get_quantity:function(){return 0<k.$composite_quantity.length?parseInt(k.$composite_quantity.val(),10):1},update_availability:function(){for(var t=[],e=!0,i=0,o=k.get_components(),n=o.length;i<n;i++)t.push(o[i].step_validation_model.get("is_in_stock"));e=!_.includes(t,!1),k.console_log("debug:models","\nUpdating 'Composite_Data_Model' availability... Attribute: \"stock_statuses\": "+t.toString()+', Attribute: "is_in_stock": '+e.toString()),k.debug_indent_incr(),this.set({stock_statuses:t,is_in_stock:e}),k.debug_indent_decr()},update_totals:function(t){if(k.console_log("debug:models","\nUpdating 'Composite_Data_Model' totals..."),k.debug_indent_incr(),void 0===t){for(var e=0,i=k.get_components(),o=i.length;e<o;e++)this.update_component_prices(i[e]);this.calculate_subtotals()}else this.update_component_prices(t),this.calculate_subtotals(t);k.debug_indent_decr()},get_taxed_totals:function(t,e,i,o){o=void 0===o?1:o;var n=!(!i||void 0===i.incl)&&Number(i.incl),i=!(!i||void 0===i.excl)&&Number(i.excl),e={price:o*t,regular_price:o*e,price_incl_tax:o*t,price_excl_tax:o*t};return n&&i&&(e.price_incl_tax=wc_cp_number_round(e.price*n),e.price_excl_tax=wc_cp_number_round(e.price*i),"incl"===wc_composite_params.tax_display_shop?(e.price=e.price_incl_tax,e.regular_price=wc_cp_number_round(e.regular_price*n)):(e.price=e.price_excl_tax,e.regular_price=wc_cp_number_round(e.regular_price*i))),e},calculate_totals:function(t){var e=void 0===t?this.price_data:t,i=(k.console_log("debug:models","\nAdding totals..."),{price:wc_cp_number_round(e.base_price_totals.price),regular_price:wc_cp_number_round(e.base_price_totals.regular_price),price_incl_tax:wc_cp_number_round(e.base_price_totals.price_incl_tax),price_excl_tax:wc_cp_number_round(e.base_price_totals.price_excl_tax)});e.base_display_price=i.price;for(var o=0,n=k.get_components(),s=n.length;o<s;o++){var _=void 0===t?this.get("component_"+n[o].component_id+"_totals"):t["component_"+n[o].component_id+"_totals"];i.price+=wc_cp_number_round(_.price),i.regular_price+=wc_cp_number_round(_.regular_price),i.price_incl_tax+=wc_cp_number_round(_.price_incl_tax),i.price_excl_tax+=wc_cp_number_round(_.price_excl_tax)}return i=k.filters.apply_filters("composite_totals",[i]),void 0===t&&(k.debug_indent_incr(),this.set({totals:i}),k.debug_indent_decr()),i},calculate_subtotals:function(t,e,i){var o,n,s,_=void 0===e?this.price_data:e;i=void 0===i?1:parseInt(i,10),!1===(t=void 0!==t&&t)&&(o=Number(_.base_price),n=Number(_.base_regular_price),s=_.base_price_tax_ratios,_.base_price_totals=this.get_taxed_totals(o,n,s,i));for(var a,c=0,r=k.get_components(),d=r.length;c<d;c++)!1!==t&&t.component_id!==r[c].component_id||(a=_.quantities[r[c].component_id]*i,a=this.calculate_component_subtotals(r[c],_,a),void 0===e?(k.console_log("debug:models","Updating 'Composite_Data_Model' component totals... Attribute: \"component_"+r[c].component_id+'_totals".'),k.debug_indent_incr(),this.set("component_"+r[c].component_id+"_totals",a),k.debug_indent_decr()):_["component_"+r[c].component_id+"_totals"]=a);if(void 0!==e)return _},calculate_component_subtotals:function(t,e,i){var e=void 0===e?this.price_data:e,o="variable"===t.get_selected_product_type()?t.get_selected_variation(!1):t.get_selected_product(!1),n=e.price_tax_ratios[t.component_id],s=e.regular_prices[t.component_id]+e.addons_regular_prices[t.component_id],e=e.prices[t.component_id]+e.addons_prices[t.component_id],_={price:0,regular_price:0,price_incl_tax:0,price_excl_tax:0};return k.console_log("debug:models",'Calculating "'+t.get_title()+'" totals...'),"yes"===wc_composite_params.calc_taxes?0<o&&0<i&&(0<e||0<s)&&(_=this.get_taxed_totals(e,s,n,i)):(_.price=i*e,_.regular_price=i*s,_.price_incl_tax=i*e,_.price_excl_tax=i*e),k.filters.apply_filters("component_totals",[_,t,i])},update_component_prices:function(t){k.console_log("debug:models",'Fetching "'+t.get_title()+'" price data...');var e=t.get_selected_quantity();this.price_data.prices[t.component_id]=t.component_selection_model.get_price(),this.price_data.regular_prices[t.component_id]=t.component_selection_model.get_regular_price(),this.price_data.price_tax_ratios[t.component_id]=t.component_selection_model.get_tax_ratios(),this.price_data.addons_prices[t.component_id]=Number(t.component_selection_model.get_addons_price()),this.price_data.addons_regular_prices[t.component_id]=Number(t.component_selection_model.get_addons_regular_price()),this.price_data.quantities[t.component_id]=0<e?parseInt(e,10):0},add_status_message:function(t,e){var i=M.extend(!0,[],this.get("status_messages"));i.push({message_source:t,message_content:e}),k.console_log("debug:models",'Adding "'+t+'" status message: "'+e+'"...'),this.set({status_messages:i})},remove_status_message:function(e){k.console_log("debug:models",'Removing "'+e+'" status message...');var t=_.filter(this.get("status_messages"),function(t){return t.message_source!==e});this.set({status_messages:t})}}))(t)},this.Step_Access_Model=function(t,e){var n=t;return new(o.Model.extend({is_lockable:!1,initialize:function(){if(this.set({is_locked:!1}),this.is_lockable="single"!==k.settings.layout&&("componentized"!==k.settings.layout_variation||"yes"===k.settings.sequential_componentized_progress&&!1===n.is_review()),this.is_lockable)for(var t=0,e=k.get_steps(),i=e.length;t<i;t++)e[t].is_review()||e[t].step_index<n.step_index&&(this.listenTo(e[t].step_validation_model,"change:passes_validation",this.update_lock_state),this.listenTo(e[t].step_access_model,"change:is_locked",this.update_lock_state));this.listenTo(n.step_visibility_model,"change:is_visible",this.update_lock_state)},update_lock_state:function(){var t=!1;if(!1===n.is_visible())t=!0;else if(this.is_lockable)for(var e=0,i=k.get_steps(),o=i.length;e<o&&i[e].step_index!==n.step_index;e++)if(!1!==i[e].is_visible()){if(i[e].step_access_model.get("is_locked")){t=!0;break}if(!1===i[e].step_validation_model.get("passes_validation")){t=!0;break}}k.console_log("debug:models","\nUpdating 'Step_Access_Model': \""+n.get_title()+'", Attribute: "is_locked": '+t.toString()),this.get("is_locked")!==t?k.console_log("debug:models","Lock state changed.\n"):k.console_log("debug:models","Lock state unchanged.\n"),k.debug_indent_incr(),this.set({is_locked:t}),k.debug_indent_decr()}}))(e)},this.Step_Validation_Model=function(t,e){var i=t;return new(o.Model.extend({initialize:function(){this.set({passes_validation:!0,is_in_stock:!0,component_messages:[],composite_messages:[]}),k.actions.add_action("component_quantity_changed",this.quantity_changed_handler,10,this),k.actions.add_action("component_selection_changed",this.selection_changed_handler,20,this),k.actions.add_action("component_selection_content_changed",this.selection_content_changed_handler,20,this)},addons_changed_handler:function(t){k.is_initialized&&t.step_id===i.step_id&&i.validate()},quantity_changed_handler:function(t){k.is_initialized&&t.step_id===i.step_id&&i.validate()},selection_changed_handler:function(){!k.is_initialized||i.is_component()&&i.component_selection_model.has_pending_updates()||i.validate()},selection_content_changed_handler:function(t){k.is_initialized&&t.step_id===i.step_id&&i.validate()},update:function(t,e){t={passes_validation:t,is_in_stock:e,component_messages:i.get_validation_messages("component"),composite_messages:i.get_validation_messages("composite")};k.console_log("debug:models","\nUpdating 'Step_Validation_Model': \""+i.get_title()+'", Attribute: "passes_validation": '+t.passes_validation.toString()+', Attribute: "is_in_stock": '+t.is_in_stock.toString()),this.get("passes_validation")!==t.passes_validation?k.console_log("debug:models","Validation state changed.\n"):k.console_log("debug:models","Validation state unchanged.\n"),_.isEqual(this.get("component_messages"),t.component_messages)?k.console_log("debug:models","Validation message unchanged.\n"):k.console_log("debug:models","Validation message changed.\n"),this.get("is_in_stock")!==t.is_in_stock?k.console_log("debug:models","Stock state changed.\n"):k.console_log("debug:models","Stock state unchanged.\n"),k.debug_indent_incr(),this.set(t),k.debug_indent_decr()}}))(e)},this.Step_Visibility_Model=function(t,e){var i=t;return new(o.Model.extend({recursing:!1,initialize:function(){this.set({is_visible:!0}),i.is_component()&&k.actions.add_action("hidden_components_changed",this.update_visibility_state,10,this)},update_visibility_state:function(){var t=!0;k.console_log("debug:models",'\nUpdating "'+i.get_title()+'" visibility...'),k.scenarios.is_component_hidden(i.step_id)&&(t=!1),k.debug_indent_incr(),k.console_log("debug:models","\nUpdating 'Step_Visibility_Model': \""+i.get_title()+'", Attribute: "is_visible": '+t.toString()),this.get("is_visible")!==t?k.console_log("debug:models","Visibility state changed.\n"):k.console_log("debug:models","Visibility state unchanged.\n"),k.debug_indent_incr(),this.recursing?k.console_log("error","\nStep visibility model recursion detected. Stepping out..."):(this.recursing=!0,this.set({is_visible:t})),this.recursing=!1,k.debug_indent_decr(),k.debug_indent_decr()}}))(e)},this.Component_Options_Model=function(t,e){var x=t;return new(o.Model.extend({available_options_data:[],xhr:!1,initialize:function(){this.available_options_data=x.find_options_data();var t=[],t=(0<this.available_options_data.length&&(t=_.pluck(this.available_options_data,"option_id")),{filters:x.find_active_filters(),orderby:x.find_order_by(),page:x.find_pagination_param("page"),pages:x.find_pagination_param("pages"),available_options:t,options_state:{active:_.pluck(_.where(this.available_options_data,{is_in_view:!0}),"option_id"),inactive:[],invalid:[]},options_in_scenarios:{compat_group:k.scenarios.get_scenarios_by_type("compat_group"),conditional_options:[]}});this.set(t),k.actions.add_action("component_selection_changed",this.component_selection_changed_handler,15,this),k.actions.add_action("available_options_changed_"+x.step_id,this.available_options_changed_handler,10,this),"single"!==k.settings.layout&&k.actions.add_action("active_step_changed_"+x.step_id,this.active_step_changed_handler,10,this)},active_step_changed_handler:function(){k.is_initialized&&this.refresh_options_state()},available_options_changed_handler:function(){this.refresh_options_state()},component_selection_changed_handler:function(t){if(k.settings.layout&&x.step_index<t.step_index)return!1;this.refresh_options_state()},reload_options_on_scenarios_change:function(){var t=!1;return t=x.hide_disabled_products()&&x.has_options_style("thumbnails")&&x.get_max_results()>x.get_results_per_page()&&(!1===x.append_results()||_.pluck(_.where(this.available_options_data,{is_in_view:!0}),"option_id").length<x.get_max_results())?!0:t},request_options:function(t,e){var i=this,t=(this.set(_.omit(t,"page")),{action:"woocommerce_show_component_options",component_id:x.component_id,composite_id:k.composite_id,load_page:t.page||1,selected_option:x.get_selected_product(!1),filters:this.get("filters"),orderby:this.get("orderby"),options_in_scenarios:this.reload_options_on_scenarios_change()?this.get("options_in_scenarios"):[]});this.xhr&&this.xhr.abort(),this.xhr=M.post(k.get_ajax_url(t.action),t,function(t){i.trigger("component_options_data_loaded",t,e),"success"===t.result?"reload"===e?(i.available_options_data=t.options_data,k.scenarios.set_scenario_data(t.scenario_data,x.component_id),k.scenarios.set_conditional_options_scenario_data(t.conditional_options_data,x.component_id),i.set(t.pagination_data),i.refresh_options(_.pluck(i.available_options_data,"option_id"))):"append"===e&&(i.available_options_data=_.union(_.where(i.available_options_data,{is_in_view:!0}),_.map(t.options_data,function(t){return _.extend(t,{is_appended:!0})})),k.scenarios.merge_scenario_data(t.scenario_data,x.component_id),k.scenarios.merge_conditional_options_scenario_data(t.conditional_options_data,x.component_id),i.set(t.pagination_data),i.refresh_options(_.pluck(i.available_options_data,"option_id")),i.available_options_data=_.map(i.available_options_data,function(t){return _.omit(t,"is_appended")})):window.alert(t.message),k.actions.do_action("component_options_loaded",[x])},"json")},get_option_data:function(t,e){var i=null,o=this;if(""!==t&&0<o.available_options_data.length)for(var n=0,s=o.available_options_data.length;n<s;n++)if(parseInt(o.available_options_data[n].option_id,10)===parseInt(t,10)){i=e?void 0!==o.available_options_data[n][e]?o.available_options_data[n][e]:null:o.available_options_data[n];break}return i},set_option_data:function(t,e,i){var o=this;if(""!==t&&0<o.available_options_data.length)for(var n=0,s=o.available_options_data.length;n<s;n++)if(parseInt(t,10)===parseInt(o.available_options_data[n].option_id,10)){i?o.available_options_data[n][i]=e:o.available_options_data[n]=e;break}},intersection_exists:function(t,e){for(var i=!1,o=0,n=t.length;o<n;o++)if(-1<M.inArray(t[o],e)){i=!0;break}return i},refresh_options:function(t){k.console_log("debug:models",'\nUpdating "'+x.get_title()+'" options: '+_.map(t,function(t){return""===t?"0":t})),k.debug_indent_incr(),_.isEqual(this.get("available_options"),t)?this.refresh_options_state():this.set({available_options:t}),k.debug_indent_decr()},refresh_options_state:function(){k.console_log("debug:models",'\nUpdating "'+x.get_title()+'" options state...'),k.debug_indent_incr();var t,e=[],i={active:[],inactive:[],invalid:[]},o=x.component_id,n=k.scenarios.get_scenario_data().scenario_data[o],s=k.scenarios.get_scenario_data().conditional_options_data[o],a=!1,c=!1,r=!1,e=k.scenarios.calculate_active_scenarios("compat_group",x,!0,!0);k.console_log("debug:models","\nReference scenarios: ["+e+"]"),k.console_log("debug:models","Removing scenarios where the current component is masked..."),0===(e=k.scenarios.clean_masked_component_scenarios(e,o)).length&&e.push("0"),t=k.scenarios.calculate_active_scenarios("conditional_options",x,!0,!0),k.console_log("debug:models","\nUpdating 'Component_Options_Model': \""+x.get_title()+'", Attribute: "options_in_scenarios"...'),_.isEqual(this.get("options_in_scenarios"),{compat_group:e,conditional_options:t})?k.console_log("debug:models","\nActive options scenarios unchanged.\n"):k.console_log("debug:models","\nActive options scenarios changed.\n"),k.debug_indent_incr(),this.set({options_in_scenarios:{compat_group:e,conditional_options:t}}),k.debug_indent_decr(),x.maybe_is_optional()&&(0 in n&&this.intersection_exists(n[0],e)&&(a=!0),0 in s)&&this.intersection_exists(s[0],t)&&(a=!1),((a=!1===x.is_visible()?!0:a)?(k.console_log("debug:models","Component set as optional."),i.active):i.inactive).push("");for(var d=0,l=this.available_options_data.length;d<l;d++){var p=this.available_options_data[d].option_id,m=p in n?n[p]:[],u=p in s?s[p]:[],h=!1;k.console_log("debug:models","Updating selection #"+p+":"),k.console_log("debug:models","\tSelection in states: ["+m+"]"),k.console_log("debug:models","\tSelection hidden by scenarios: ["+u+"]"),this.intersection_exists(m,e)&&(h=!0),(h=this.intersection_exists(u,t)?!1:h)?(k.console_log("debug:models","\tSelection enabled."),i.active.push(p)):(k.console_log("debug:models","\tSelection disabled."),i.inactive.push(p),x.get_selected_product(!1)===p&&(c=!0)&&k.console_log("debug:models","\t--- Selection invalid."))}if("variable"===x.get_selected_product_type()){var g,v,f,b,o=x.get_selected_variation(),w=x.component_selection_model.get_available_variations_data();k.console_log("debug:models","\tChecking variations..."),0<o&&k.console_log("debug:models","\t\t--- Stored variation is #"+o);for(var y=0,$=w.length;y<$;y++)b=!1,v=(g=w[y].variation_id.toString())in n?n[g]:[],f=g in s?s[g]:[],k.console_log("debug:models","\t\tChecking variation #"+g+":"),k.console_log("debug:models","\t\tSelection in states: ["+v+"]"),k.console_log("debug:models","\t\tSelection hidden by scenarios: ["+f+"]"),this.intersection_exists(v,e)&&(b=!0),(b=this.intersection_exists(f,t)?!1:b)?(k.console_log("debug:models","\t\tVariation enabled."),i.active.push(g)):(k.console_log("debug:models","\t\tVariation disabled."),i.inactive.push(g.toString()),x.get_selected_variation(!1).toString()===g&&(r=!0)&&(k.console_log("debug:models","\t\t--- Selection invalid."),i.invalid.push(g.toString())))}k.console_log("debug:models","Done.\n"),k.debug_indent_decr();a=!0;k.filters.apply_filters("reset_invalid_selections",[!1,x])&&(k.console_log("debug:models",'\nChecking current "'+x.get_title()+'" selections:'),c?x.is_static()?k.console_log("debug:models","\nProduct selection invalid - moving on (static component)...\n\n"):(k.console_log("debug:models","\nProduct selection invalid - resetting...\n\n"),a=!1,k.debug_indent_incr(),x.component_selection_view.resetting_product=!0,x.component_selection_view.set_option(""),x.component_selection_view.resetting_product=!1,k.debug_indent_decr()):r?(a=!1,k.console_log("debug:models","\nVariation selection invalid - resetting...\n\n"),k.debug_indent_incr(),x.component_selection_view.resetting_variation=!0,x.$component_summary_content.find(".reset_variations").trigger("click"),x.component_selection_view.resetting_variation=!1,k.debug_indent_decr()):k.console_log("debug:models","...looking good!")),a&&(_.isEqual(this.get("options_state"),i)?k.console_log("debug:models","\nOptions state unchanged.\n"):k.console_log("debug:models","\nOptions state changed.\n"),k.debug_indent_incr(),this.set({options_state:i}),k.debug_indent_decr())}}))(e)},this.Component_Selection_Model=function(t,e){var p=t;return new(o.Model.extend({selected_product_data:!1,initialize:function(){var t="",e=!1;if(0<p.component_options_model.available_options_data.length)for(var i=0,o=p.component_options_model.available_options_data.length;i<o;i++){var n=p.component_options_model.available_options_data[i];if(n.is_selected){t=n.option_id,e=M.extend(!0,{},n.option_product_data);break}}var s={selected_product:t,selected_variation:t&&"variable"===e.product_type?e.variation_id:"",selected_variation_data:!1,selected_quantity:0,selected_addons:!1,selected_nyp:!1};this.selected_product_data=e,this.set(s),k.actions.add_action("component_options_state_changed_"+p.step_id,this.update_active_variations_data,0,this)},get_product_data:function(){return this.selected_product_data},get_product_image_data:function(){return this.selected_product_data.image_data||!1},get_variation_data:function(){return this.get("selected_variation_data")},get_availability_text_for_summary:function(){if("variable"!==this.get_type())return this.selected_product_data.availability_for_summary||"";{const e=this.get("selected_variation");var t=this.get_available_variations_data().find(t=>String(t.variation_id)===e);if(t)return t.availability_for_summary||""}},set_availability_for_summary:function(t){this.selected_product_data.availability_for_summary=t},get_variation_image_data:function(){var t=this.get("selected_variation"),e=this.get_available_variations_data(),i=!1;if(0<t&&e)for(var o=0,n=e.length;o<n;o++){var s=e[o];if(parseInt(s.variation_id,10)===parseInt(t,10)){s.image?i={image_src:s.image.src,image_srcset:s.image.srcset,image_sizes:s.image.sizes,image_title:s.image.title}:s.image_src&&(i={image_src:s.image_src,image_srcset:s.image_srcset,image_sizes:s.image_sizes,image_title:s.image_title});break}}return i},get_meta_data:function(){var t=[];return t=0<this.get("selected_variation")?this.get_variation_data().meta_data||[]:t},get_available_variations_data:function(){return this.selected_product_data.variations_data||[]},get_active_variations_data:function(){return this.selected_product_data.active_variations_data||[]},get_type:function(){return this.selected_product_data.product_type||"none"},get_price:function(){return this.selected_product_data.price?Number(this.selected_product_data.price):0},set_price:function(t){this.selected_product_data.price=t},get_regular_price:function(){return this.selected_product_data.regular_price?Number(this.selected_product_data.regular_price):0},set_regular_price:function(t){this.selected_product_data.regular_price=t},get_addons_price:function(){return this.selected_product_data.addons_price?Number(this.selected_product_data.addons_price):0},get_addons_regular_price:function(){return this.selected_product_data.addons_regular_price?Number(this.selected_product_data.addons_regular_price):0},get_addons_form:function(){return this.selected_product_data.addons_form},set_addons_form:function(t){this.selected_product_data.addons_form=t,this.set({selected_addons:!1})},set_addons_price:function(t){this.selected_product_data.addons_price=t},set_addons_regular_price:function(t){this.selected_product_data.addons_regular_price=t},get_tax_ratios:function(){return this.selected_product_data.tax_ratios||!1},set_tax_ratios:function(t){this.selected_product_data.tax_ratios=t},get_details_html:function(){return this.selected_product_data.details_html||""},get_stock_status:function(){return this.selected_product_data.stock_status||""},set_stock_status:function(t){this.selected_product_data.stock_status=t},load_selection_data:function(e,i){i=i||!1;var o=this,t={action:"woocommerce_show_composited_product",product_id:e,component_id:p.component_id,composite_id:k.composite_id};M.ajax({type:"POST",url:k.get_ajax_url(t.action),data:t,timeout:15e3,dataType:"json",success:function(t){"success"===t.result?(k.console_log("debug:models","\nFetched 'Component_Selection_Model' data: \""+p.get_title()+'", Product ID: #'+(""===e?"0":e)),p.component_options_model.set_option_data(e,t.product_data,"option_product_data"),o.trigger("selected_product_data_loaded",e,t.product_data),i&&o.update_selected_product(e,t.product_data)):o.trigger("selected_product_data_load_error",e)},error:function(){o.trigger("selected_product_data_load_error",e)}})},update_selection:function(t){var e;""===t?this.update_selected_product("",wc_composite_params.empty_product_data):(e=p.component_options_model.get_option_data(t,"option_product_data"))?this.update_selected_product(t,e):(k.console_log("debug:models","\nFetching 'Component_Selection_Model' data: \""+p.get_title()+'", Product ID: #'+(""===t?"0":t)),this.load_selection_data(t,!0))},update_selected_product:function(t,e){this.selected_product_data=M.extend(!0,{},e),this.get("selected_product")!==t&&(e=0,t&&(e="yes"===k.settings.component_qty_restore?this.get("selected_quantity"):1),k.console_log("debug:models","\nUpdating 'Component_Selection_Model': \""+p.get_title()+'", Attribute: "selected_product": #'+(""===t?"0":t)),k.debug_indent_incr(),this.set({selected_product:t,selected_variation:"",selected_variation_data:!1,selected_quantity:e,selected_addons:!1,selected_nyp:!1}),k.debug_indent_decr(),this.trigger("selected_product_updated"))},update_selected_variation:function(t,e){this.get("selected_variation")===t&&_.isEqual(this.get("selected_variation_data"),e)||(k.console_log("debug:models","\nUpdating 'Component_Selection_Model': \""+p.get_title()+'", Attribute: "selected_variation": #'+(""===t?"0":t)),k.debug_indent_incr(),this.set({selected_variation:t,selected_variation_data:e}),k.debug_indent_decr(),this.trigger("selected_variation_updated"))},update_selected_quantity:function(t){this.get("selected_quantity")!==t&&(k.console_log("debug:models","\nUpdating 'Component_Selection_Model': \""+p.get_title()+'", Attribute: "selected_quantity": '+t),k.debug_indent_incr(),this.set({selected_quantity:t}),k.debug_indent_decr())},update_selected_addons:function(t,e,i){e=e||0,i=i||e,this.set_addons_price(e),this.set_addons_regular_price(i);e=JSON.stringify(t);_.isEqual(this.get("selected_addons"),e)||(k.console_log("debug:models","\nUpdating 'Component_Selection_Model': \""+p.get_title()+'", Attribute: "selected_addons"...'),k.debug_indent_incr(),this.set({selected_addons:e}),k.debug_indent_decr())},update_nyp:function(t,e){this.get("selected_nyp")!==t&&(k.console_log("debug:models","\nUpdating 'Component_Selection_Model': \""+p.get_title()+'", Attribute: "nyp_price": '+t),this.set_price(e),this.set_regular_price(e),k.debug_indent_incr(),this.set({selected_nyp:t}),k.debug_indent_decr())},update_active_variations_data:function(){if("variable"===this.get_type()){k.console_log("debug:models",'\nUpdating "'+p.get_title()+'" variations data...');for(var t,e,i=p.get_selected_variation(!1),o=p.component_options_model.get("options_state"),n=this.get_available_variations_data(),s=[],a=0,c=n.length;a<c;a++)if(t=n[a].variation_id.toString(),e=_.includes(o.active,t),!1===p.hide_disabled_variations()){var r=!1,d=M.extend(!0,{},n[a]);if(!e)for(var l in parseInt(i,10)===parseInt(t,10)?d.variation_is_valid=!1:d.variation_is_active=!1,d.attributes)if(d.attributes.hasOwnProperty(l)&&""===d.attributes[l]){r=!0;break}r||s.push(d)}else e?s.push(n[a]):parseInt(i,10)===parseInt(t,10)&&((d=M.extend(!0,{},n[a])).variation_is_valid=!1,s.push(d));this.selected_product_data.active_variations_data=s}},has_pending_updates:function(){return"variable"===this.get_type()&&!1===this.get_variation_data()}}))(e)}},p.WC_CP_Views=function(A){this.Composite_Viewport_Scroller=function(t){return new(o.View.extend({scroll_viewport_target:!1,summary_element_scroll_location:!1,is_scroll_anchored:null,initialize:function(){var t=this;setTimeout(function(){t.is_scroll_anchoring_supported()},100),"single"===A.settings.layout?A.actions.add_action("show_step",this.autoscroll_single,10,this):"paged"===A.settings.layout?(A.actions.add_action("active_step_changed",this.autoscroll_paged,120,this),A.actions.add_action("active_step_transition_end",this.autoscroll_paged_relocated,10,this),"componentized"===A.settings.layout_variation&&A.actions.add_action("active_step_transition",this.save_summary_element_scroll_location,10,this)):"progressive"===A.settings.layout&&A.actions.add_action("active_step_transition_end",this.autoscroll_progressive,10,this),A.actions.add_action("component_options_update_requested",this.component_options_update_requested,10,this),A.actions.add_action("component_selection_details_updated",this.selection_details_updated,10,this),A.actions.add_action("component_selection_details_animated",this.selection_details_animated,10,this),A.actions.add_action("component_selection_details_relocation_ended",this.selection_details_relocation_ended,10,this)},reset_summary_element_scroll_location:function(){this.summary_element_scroll_location=!1},save_summary_element_scroll_location:function(t){t.is_component()&&A.is_finalized&&!1===this.summary_element_scroll_location&&(t=A.composite_summary_view.get_summary_element(t.component_id))&&(this.summary_element_scroll_location=this.get_scroll_location(t,{viewport_only:!1}))},component_options_update_requested:function(t,e,i,o){"reload"===i&&!1===o&&A.composite_viewport_scroller.scroll_viewport(t.$component_pagination.filter(".top"),{offset:50,duration:200,partial:!0,queue:!1,on_complete:function(){A.is_finalized&&"yes"===wc_composite_params.accessible_focus_enabled&&t.$component_pagination.filter(".top").find(".woocommerce-result-count").trigger("focus")}})},selection_details_relocation_ended:function(t){t.component_selection_view.flushing_component_options&&setTimeout(function(){t.$component_content.slideDown(250),A.composite_viewport_scroller.scroll_viewport("relative",{offset:-t.$component_summary.outerHeight(!0),timeout:0,duration:250,queue:!1})},200)},selection_details_updated:function(t){A.is_finalized&&!t.can_autotransition()&&(t.is_current()||t.component_selection_view.is_actioned())&&this.autoscroll_selection_details(t,"updated")},selection_details_animated:function(t){t.can_autotransition()||this.autoscroll_selection_details(t,"animated")},autoscroll_selection_details:function(t,e){var i=t.component_selection_view,o=!0,n=t.$component_content_scroll_target;if(""!==t.get_selected_product(!1)){if(i.is_relocated()){if("animated"!==e)return;n=i.$relocation_target,o=!1}else if("animated"===e)return;A.is_initialized&&A.composite_viewport_scroller.scroll_viewport(n,{timeout:50,duration:250,queue:!1,partial:o,scroll_method:"quarter",always_on_complete:!0,on_complete:function(){t.has_options_style("thumbnails")&&"yes"===wc_composite_params.accessible_focus_enabled&&t.$component_summary_content.find(".composited_product_title").trigger("focus")}})}},autoscroll_single:function(t){A.is_initialized&&A.composite_viewport_scroller.scroll_viewport(t.$el,{partial:!1,duration:250,queue:!1})},autoscroll_paged:function(t){var e,i;A.is_initialized&&(i=e=!1,t.is_component()?t.component_selection_view.is_relocated()||(i="helper"):(e=this.summary_element_scroll_location,this.reset_summary_element_scroll_location(),i=!1!==e?"summary_element":"helper"),"helper"===i?A.composite_viewport_scroller.scroll_viewport(A.$composite_transition_helper,{timeout:0,partial:!1,duration:A.$composite_form.hasClass("small_width")&&"componentized"!==A.settings.layout_variation?500:240,queue:!1}):"summary_element"===i&&A.composite_viewport_scroller.scroll_viewport("absolute",{timeout:0,partial:!1,duration:A.$composite_form.hasClass("small_width")&&"componentized"!==A.settings.layout_variation?500:240,queue:!1,offset:e}))},autoscroll_paged_relocated:function(t){var e=A.is_initialized,i=t.is_component(),t=!!i&&t;i&&t.component_selection_view.is_relocated()&&e&&A.composite_viewport_scroller.scroll_viewport(t.$component_content,{timeout:0,partial:!1,duration:250,queue:!1,scroll_method:"middle"})},autoscroll_progressive:function(t){A.is_initialized&&t.$el.hasClass("autoscrolled")&&(t.$step_title.wc_cp_is_in_viewport(!1)||A.composite_viewport_scroller.scroll_viewport(t.$el,{timeout:0,partial:!1,duration:250,queue:!1}))},get_scroll_location:function(t,e){var i=!1,o=$wc_cp_window,n=void 0===e.partial||e.partial,s=void 0===e.offset?50:e.offset,_=void 0!==e.scroll_method&&e.scroll_method,e=void 0===e.viewport_only||e.viewport_only;return"relative"===t?i=o.scrollTop()-s:"absolute"===t?i=s:0<t.length&&t.is(":visible")&&(!1===e||!1===t.wc_cp_is_in_viewport(n))&&(e=s,e="bottom"===_||t.hasClass("scroll_bottom")?o.height()-t.outerHeight(!0)-s:"middle"===_?o.height()/3*2-t.outerHeight(!0)-s:"quarter"===_?o.height()/4+s:parseInt(wc_composite_params.scroll_viewport_top_offset,10)+s,i=t.offset().top-e,t.offset().top<i)&&(i=t.offset().top),i},scroll_viewport:function(e,i){function t(){var t;(o=d.get_scroll_location(e,i))?(o>r.height()-c.height()&&(o=r.height()-c.height()-100),this.scroll_viewport_target||(t=$wc_cp_html.scrollTop(),this.scroll_viewport_target=$wc_cp_body,t?$wc_cp_html.scrollTop($wc_cp_html.scrollTop()-1):$wc_cp_html.scrollTop($wc_cp_html.scrollTop()+1),t!=$wc_cp_html.scrollTop()&&(this.scroll_viewport_target=$wc_cp_html)),A.console_log("debug:animations","\nStarting viewport auto-scrolling..."),this.scroll_viewport_target.animate({scrollTop:o},{duration:s,queue:_,complete:function(){A.console_log("debug:animations","\nEnded viewport auto-scrolling.")},always:l})):a&&l()}var o,n=void 0===i.timeout?5:i.timeout,s=void 0===i.duration?250:i.duration,_=void 0!==i.queue&&i.queue,a=void 0!==i.always_on_complete&&i.always_on_complete,c=$wc_cp_window,r=$wc_cp_document,d=this,l=void 0===i.on_complete||!1===i.on_complete?function(){return!1}:i.on_complete;0<n?setTimeout(function(){t()},n):t()},is_scroll_anchoring_supported:function(){var t,e;return null===this.is_scroll_anchored&&(t=$wc_cp_window.scrollTop(),e=M('<div style="height:5px;"></div>'),window.scroll(0,t+10),$wc_cp_body.prepend(e),this.is_scroll_anchored=$wc_cp_window.scrollTop()!==t+10,e.remove(),window.scroll(0,t)),this.is_scroll_anchored},illusion_scroll:function(t){if(void 0===t||void 0===t.target||!t.target)return null;var e,i=this,o=t.target,n=$wc_cp_window.scrollTop(),s=void 0!==t.type?t.type:"hide",t=!0,_=0;if("hide"===s){if("none"===o.css("display"))return null}else if("none"!==o.css("display"))return null;return"hide"!==s&&o.css({height:"0",display:"block"}),(t=o.offset().top<n&&!1===o.wc_cp_is_in_viewport(!0))&&("hide"!==s&&o.css({height:"",position:"absolute"}),t=1<=(_=void 0===(_=o.get(0).getBoundingClientRect().height)?o.outerHeight():_)),"hide"!==s&&o.css({height:"",position:"",display:"none"}),t&&(e="hide"===s?n-Math.round(_):n+Math.round(_),setTimeout(function(){i.is_scroll_anchoring_supported()||window.scroll(0,e),"hide"===s?o.hide():o.show()},10)),t}}))(t)},this.Composite_Status_View=function(t){return new(o.View.extend({is_active:!1,template:!1,worker:!1,$el_content:!1,initialize:function(t){var i=this;this.template=wp.template("wc_cp_composite_status"),this.$el_content=t.$el_content,this.listenTo(this.model,"change:status_messages",this.status_changed);this.worker=new function(){var e=this;this.timer=!1,this.tasks=[],this.last_added_task=[],this.is_idle=function(){return!1===this.timer},this.work=function(){var t;0<e.tasks.length?(t=e.tasks.shift(),i.render(t),e.timer=setTimeout(function(){e.work()},400)):(clearTimeout(e.timer),e.timer=!1)},this.add_task=function(e){var t=[],t=_.pluck(_.where(this.last_added_task,{is_old:!1}),"message_content").length<e.length?_.map(e,function(t){return{message_content:t,is_old:!1}}):_.map(_.where(this.last_added_task,{is_old:!1}),function(t){return{message_content:t.message_content,is_old:!1===_.includes(e,t.message_content)}});this.last_added_task=t,this.tasks.push(t),_.where(t,{is_old:!0}).length===t.length&&this.tasks.push([])}}},render:function(t){var e=this;0===t.length?(A.console_log("debug:views","\nHiding composite status view..."),this.$el.removeClass("visible"),setTimeout(function(){e.$el.removeClass("active")},200),this.is_active=!1):(A.console_log("debug:views","\nUpdating composite status view..."),this.$el_content.html(this.template(t)),!1===this.is_active?(this.$el.addClass("active"),setTimeout(function(){e.$el.addClass("visible")},5),this.is_active=!0):setTimeout(function(){e.$el.find(".message:not(.current)").addClass("old")},100))},status_changed:function(){var t=this.model.get("status_messages");0<t.length?this.worker.add_task(_.pluck(t,"message_content")):this.worker.add_task([]),this.worker.is_idle()&&this.worker.work()}}))(t)},this.Composite_Validation_View=function(t){return new(o.View.extend({render_timer:!1,is_in_widget:!1,template:!1,initialize:function(t){this.template=wp.template("wc_cp_validation_message"),this.is_in_widget=t.is_in_widget,A.actions.add_action("composite_validation_message_changed",this.render,100,this)},render:function(){var t=this,e=this.model;A.console_log("debug:views","\nScheduled update of composite validation view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"."),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){t.render_task(e)},10)},render_task:function(t){A.console_log("debug:views","\nUpdating composite validation view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"...");t=t.get("validation_messages");0<t.length?(this.$el.html(this.template(t)),this.$el.removeClass("inactive"),this.is_in_widget?this.$el.show():this.$el.slideDown(200)):(this.$el.addClass("inactive"),this.is_in_widget?this.$el.hide():this.$el.slideUp(200))}}))(t)},this.Composite_Price_View=function(t){return new(o.View.extend({render_timer:!1,is_in_widget:!1,suffix:"",suffix_contains_price_incl:!1,suffix_contains_price_excl:!1,$addons_totals:!1,show_addons_totals:!1,initialize:function(t){this.is_in_widget=t.is_in_widget,this.is_in_widget||"yes"!==wc_composite_params.is_pao_installed||(this.$addons_totals=A.$composite_data.find("#product-addons-total"),this.has_addons()?1==this.$addons_totals.data("show-sub-total")&&(this.$addons_totals.data("show-sub-total",0),this.$el.after(this.$addons_totals),this.show_addons_totals=!0,A.$composite_data.trigger("woocommerce-product-addons-update"),A.$composite_data.on("updated_addons",{view:this},this.updated_addons_handler)):this.$addons_totals=!1),""!==wc_composite_params.price_display_suffix&&(this.suffix=' <small class="woocommerce-price-suffix">'+wc_composite_params.price_display_suffix+"</small>",this.suffix_contains_price_incl=-1<wc_composite_params.price_display_suffix.indexOf("{price_including_tax}"),this.suffix_contains_price_excl=-1<wc_composite_params.price_display_suffix.indexOf("{price_excluding_tax}")),A.actions.add_action("composite_totals_changed",this.render,100,this),A.actions.add_action("composite_validation_status_changed",this.render,100,this)},has_addons:function(){return"yes"===wc_composite_params.is_pao_installed&&this.$addons_totals&&0<this.$addons_totals.length},updated_addons_handler:function(t){t.data.view;A.actions.do_action("composite_totals_changed"),t.stopPropagation()},get_addons_raw_price:function(){var t=0;if(this.has_addons()){var e=this.$addons_totals.data("price_data"),i=A.data_model.price_data.base_price_tax_ratios;if(e)for(var o=0,n=e.length;o<n;o++){var s,_,a=e[o];a.is_custom_price?(s=!(!i||void 0===i.incl)&&Number(i.incl),_=!(!i||void 0===i.excl)&&Number(i.excl),"incl"===wc_composite_params.tax_display_shop&&"no"===wc_composite_params.prices_include_tax?t+=a.cost_raw/(s||1):"excl"===wc_composite_params.tax_display_shop&&"yes"===wc_composite_params.prices_include_tax?t+=a.cost_raw/(_||1):t+=a.cost_raw):"quantity_based"===a.price_type?t+=a.cost_raw_pu:"flat_fee"===a.price_type?t+=a.cost_raw:"percentage_based"===a.price_type&&(t+=a.cost_raw_pct*A.data_model.price_data.base_price)}}return t},get_price_html:function(t){var e,i,o=this.model,n=void 0===t?o.price_data:t,s=void 0===t?o.get("totals"):t.totals,_=wc_composite_params.i18n_total?'<span class="total">'+wc_composite_params.i18n_total+"</span>":"",a="";return this.has_addons()&&(e=(n=M.extend(!0,{},n)).addons_price||this.get_addons_raw_price(),i=n.addons_regular_price||e,e||i)&&(0<e&&(n.base_price=Number(n.base_price)+Number(e)),0<i&&(n.base_regular_price=Number(n.base_regular_price)+Number(i)),n=o.calculate_subtotals(!1,n,1),s=o.calculate_totals(n)),a=0===s.price&&"yes"===n.show_free_string?wc_composite_params.i18n_price_format.replace("%t",_).replace("%p",wc_composite_params.i18n_free).replace("%s",""):(e=wc_cp_price_format(s.price),i=wc_cp_price_format(s.regular_price),o=this.get_formatted_price_suffix(s),s.regular_price>s.price&&(e=wc_composite_params.i18n_strikeout_price_string.replace("%f",i).replace("%t",e)),wc_composite_params.i18n_price_format.replace("%t",_).replace("%p",e).replace("%s",o)),A.filters.apply_filters("composite_price_html",[a='<p class="price">'+a+"</p>",this,t])},get_formatted_price_suffix:function(t){var e=this.model,i=this.suffix;return t=void 0===t?e.get("totals"):t,i=""!==i&&(this.suffix_contains_price_incl&&(i=i.replace("{price_including_tax}",wc_cp_price_format(t.price_incl_tax))),this.suffix_contains_price_excl)?i.replace("{price_excluding_tax}",wc_cp_price_format(t.price_excl_tax)):i},render:function(){var t=this,e=this.model;A.console_log("debug:views","\nScheduled update of composite price view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"."),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){t.render_task(e)},10)},render_task:function(t){var t=(t.get("passes_validation")||"no"===A.settings.hide_total_on_validation_fail)&&(t.price_data.total!==t.price_data.base_display_price||"yes"===t.price_data.has_price_range);A.console_log("debug:views","\nUpdating composite price view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),t?(t=this.get_price_html(),this.$el.html(t),this.$el.removeClass("inactive"),this.is_in_widget?this.$el.show():this.$el.slideDown(200)):(this.$el.addClass("inactive"),this.is_in_widget?this.$el.hide():this.$el.slideUp(200))}}))(t)},this.Composite_Availability_View=function(t){return new(o.View.extend({$composite_stock_status:!1,is_in_widget:!1,render_timer:!1,initialize:function(t){this.is_in_widget=t.is_in_widget,0<A.$composite_data.find(".composite_wrap p.stock").length&&(this.$composite_stock_status=A.$composite_data.find(".composite_wrap p.stock").clone()),A.actions.add_action("composite_availability_message_changed",this.render,100,this)},render:function(){var t=this,e=this.model;A.console_log("debug:views","\nScheduled update of composite availability view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"."),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){t.render_task(e)},10)},render_task:function(t){A.console_log("debug:views","\nUpdating composite availability view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"...");var e=this.get_insufficient_stock_components_string();e?(this.$el.html(e),this.is_in_widget?this.$el.show():this.$el.slideDown(200)):!1!==this.$composite_stock_status?(this.$el.html(this.$composite_stock_status),this.is_in_widget?this.$el.show():this.$el.slideDown(200)):this.is_in_widget?this.$el.hide():this.$el.slideUp(200)},get_insufficient_stock_components:function(){for(var t=[],e=0,i=A.get_components(),o=i.length;e<o;e++)i[e].step_validation_model.get("is_in_stock")||t.push(i[e].component_id);return t},get_insufficient_stock_components_string:function(){var t=this.get_insufficient_stock_components(),e="";return e=0<t.length?wc_composite_params.i18n_insufficient_stock.replace("%s",wc_cp_join(_.map(t,function(t){return A.api.get_step_title(t)}))):e}}))(t)},this.Composite_Add_To_Cart_Button_View=function(t){return new(o.View.extend({render_timer:!1,is_in_widget:!1,$el_button:!1,$el_qty:!1,widget_qty_synced:!1,initialize:function(t){var s=this.model;this.is_in_widget=t.is_in_widget,this.$el_button=t.$el_button,this.$el_qty=this.$el.find(".quantity input.qty"),A.actions.add_action("composite_availability_status_changed",this.render,100,this),A.actions.add_action("composite_validation_status_changed",this.render,100,this),this.is_in_widget||(-1<window.navigator.userAgent.indexOf("Edge")&&A.$composite_form.on("submit",function(){A.$composite_form.attr("action",window.location.href)}),this.$el_button.on("click",function(t){if(s.get("passes_validation")&&s.get("is_in_stock"))for(var e=0,i=A.get_steps(),o=i.length;e<o;e++){var n=i[e];n.$el.find("select, input").each(function(){M(this).prop("disabled",!1)}),n.is_component()&&!1===n.step_visibility_model.get("is_visible")&&(n.$el.find("select[required], input[required]").prop("required",!1),n.$component_summary_content.append('<input name="wccp_component_selection_nil['+n.step_id+']" value="1"/>'))}else t.preventDefault(),window.alert(wc_composite_params.i18n_validation_issues)})),this.is_in_widget&&(this.$el_button.on("click",function(){A.composite_add_to_cart_button_view.$el_button.trigger("click")}),0<this.$el_qty.length)&&(this.$el_qty.on("change",{view:this},function(t){t=t.data.view;t.widget_qty_synced||(A.console_log("debug:views","\nCopying widget #"+t.is_in_widget+" quantity value into composite add-to-cart quantity field..."),t.widget_qty_synced=!0,A.composite_add_to_cart_button_view.$el_qty.val(t.$el_qty.val()).trigger("change"),t.widget_qty_synced=!1)}),A.composite_add_to_cart_button_view.$el_qty.on("change",{view:this},function(t){t=t.data.view;A.console_log("debug:views","\nCopying composite add-to-cart quantity value into widget #"+t.is_in_widget+" quantity field..."),t.$el_qty.val(A.composite_add_to_cart_button_view.$el_qty.val()).trigger("change")}))},render:function(){var t=this,e=this.model;A.console_log("debug:views","\nScheduled update of composite add-to-cart button view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"."),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){t.render_task(e)},10)},render_task:function(t){A.console_log("debug:views","\nUpdating composite add-to-cart button view"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),0===t.get("validation_messages").length&&t.get("is_in_stock")?"new"===A.settings.button_behaviour||this.is_in_widget?this.$el_button.removeClass("disabled"):this.$el.slideDown(200):"new"===A.settings.button_behaviour||this.is_in_widget?this.$el_button.addClass("disabled"):this.$el.slideUp(200)}}))(t)},this.Composite_Pagination_View=function(t){return new(o.View.extend({template:!1,template_html:"",initialize:function(){this.template=wp.template("wc_cp_composite_pagination"),A.actions.add_action("step_access_changed",this.step_access_changed_handler,100,this),A.actions.add_action("step_visibility_changed",this.step_visibility_changed_handler,100,this),A.actions.add_action("active_step_changed",this.active_step_changed_handler,100,this),this.$el.on("click",".pagination_element a",this.clicked_pagination_element)},step_visibility_changed_handler:function(){this.render()},step_access_changed_handler:function(){this.render()},active_step_changed_handler:function(){this.render()},clicked_pagination_element:function(){var t;return M(this).blur(),A.has_transition_lock||!M(this).hasClass("inactive")&&(t=M(this).closest(".pagination_element").data("item_id"),t=A.get_step(t))&&A.navigate_to_step(t),!1},render:function(){var t=[];if(!A.is_initialized)return!1;A.console_log("debug:views","\nRendering pagination view elements...");for(var e=0,i=A.get_steps(),o=i.length;e<o;e++){var n,s=i[e];s.is_visible()&&(n={element_id:s.step_id,element_link:s.get_route(),element_title:s.get_title(),element_class:"",element_state_class:""},s.is_current()?(n.element_state_class="inactive",n.element_class="pagination_element_current"):s.is_locked()&&(n.element_state_class="inactive"),t.push(n))}var t=A.filters.apply_filters("composite_pagination_view_data",[t]),_=this.template(t);_!==this.template_html?(this.template_html=_,this.$el.html(_)):A.console_log("debug:views","...skipped!")}}))(t)},this.Composite_Summary_View=function(t){return new(o.View.extend({update_content_timers:{},update_height_timers:{},view_elements:{},is_in_widget:!1,template:!1,suffix:"",suffix_contains_price_incl:!1,suffix_contains_price_excl:!1,$carousel_wrapper:!1,$carousel_buttons:!1,$carousel_button_prev:!1,$carousel_button_next:!1,carousel_offset:0,initialize:function(t){var o=this;this.template=wp.template("wc_cp_summary_element_content"),this.is_in_widget=t.is_in_widget,this.$carousel_wrapper=this.$el.parent(),""!==wc_composite_params.price_display_suffix&&(this.suffix=' <small class="woocommerce-price-suffix">'+wc_composite_params.price_display_suffix+"</small>",this.suffix_contains_price_incl=-1<wc_composite_params.price_display_suffix.indexOf("{price_including_tax}"),this.suffix_contains_price_excl=-1<wc_composite_params.price_display_suffix.indexOf("{price_excluding_tax}"));for(var e=0,i=A.get_steps(),n=i.length;e<n;e++)i[e].step_validation_model.on("change:passes_validation",function(t){return function(){o.render_element_content(i[t])}}(e));for(var s=0,_=A.get_components(),a=_.length;s<a;s++)o.view_elements[_[s].component_id]={$summary_element:o.$el.find(".summary_element_"+_[s].component_id),$summary_element_wrapper:o.$el.find(".summary_element_"+_[s].component_id+" .summary_element_wrapper"),$summary_element_inner:o.$el.find(".summary_element_"+_[s].component_id+" .summary_element_wrapper_inner"),template_html:"",content_data:{},load_height:0};A.actions.add_action("step_access_changed",this.step_access_changed_handler,100,this),A.actions.add_action("step_visibility_changed",this.step_visibility_changed_handler,100,this),A.actions.add_action("component_quantity_changed",this.quantity_changed_handler,100,this),A.actions.add_action("component_selection_changed",this.selection_changed_handler,100,this),A.actions.add_action("component_selection_content_changed",this.selection_changed_handler,100,this),A.actions.add_action("component_totals_changed",this.component_totals_changed_handler,100,this),"single"!==A.settings.layout&&A.actions.add_action("active_step_transition_start",this.active_step_changed_handler,100,this),this.$el.on("click",".summary_element_select",this.clicked_summary_element),this.is_in_widget&&1<this.get_columns()&&(this.$carousel_buttons=this.$el.closest(".widget_composite_summary_details_wrapper").find(".summary_carousel_button"),this.$carousel_button_prev=this.$carousel_buttons.first(),this.$carousel_button_next=this.$carousel_buttons.last(),this.$carousel_button_prev.on("click",{view:this},this.clicked_carousel_button_prev),this.$carousel_button_next.on("click",{view:this},this.clicked_carousel_button_next),"yes"===A.settings.summary_carousel_autoscroll&&A.actions.add_action("active_step_transition_end",this.sync_carousel_pos,100,this),$wc_cp_window.resize(function(){if(!A.is_initialized)return!1;var t=o.get_columns(),e=o.get_carousel_viewport_width(),i=o.get_summary_element_indexes().length;o.$el.css({width:t<i?e*i/t:e})}))},step_access_changed_handler:function(t){this.render_element_state(t)},step_visibility_changed_handler:function(t){this.render_element_visibility(t),this.render_columns(t.step_index);for(var e=0,i=A.get_components(),o=i.length;e<o;e++)i[e].is_visible()&&e>t.step_index&&this.view_elements[i[e].step_id].content_data.element_index&&this.view_elements[i[e].step_id].content_data.element_index!==i[e].get_title_index()&&this.render_element_content(i[e])},active_step_changed_handler:function(){this.render_state()},selection_changed_handler:function(t){this.render_element_content(t)},quantity_changed_handler:function(t){this.render_element_content(t)},component_totals_changed_handler:function(t){this.render_element_content(t)},clicked_summary_element:function(){var t;return A.has_transition_lock||M(this).hasClass("disabled")||(t=M(this).closest(".summary_element").data("item_id"),!1===(t=A.get_step(t)))||t.is_current()&&"single"!==A.settings.layout||A.navigate_to_step(t),!1},clicked_carousel_button_next:function(t){M(this).hasClass("inactive")||t.data.view.scroll_carousel("incr")},clicked_carousel_button_prev:function(t){M(this).hasClass("inactive")||t.data.view.scroll_carousel("decr")},get_columns:function(){return parseInt(this.$el.data("summary_columns"),10)},get_carousel_viewport_width:function(){var t=null;return t=1<this.get_columns()&&this.is_in_widget&&void 0===(t=this.$carousel_wrapper.get(0).getBoundingClientRect().width)?this.$carousel_wrapper.width():t},get_summary_element:function(t){return!!this.view_elements[t]&&this.view_elements[t].$summary_element},get_summary_element_indexes:function(){for(var t=[],e=0,i=A.get_steps(),o=i.length;e<o;e++)i[e].is_component()&&i[e].is_visible()&&t.push(i[e].step_index);return t},get_element_price_html:function(t){var e,i,o=A.data_model.price_data,n="";return t.is_component()&&t.is_subtotal_visible()&&t.passes_validation()&&(i=(t=t).component_id,e="variable"===t.get_selected_product_type()?t.get_selected_variation(!1):t.get_selected_product(!1),t=t.get_selected_quantity(),0<e)&&0<t&&(e=A.data_model.get("component_"+i+"_totals"),n="no"===o.is_priced_individually[i]&&0===e.price&&0===e.regular_price?"":(t=wc_cp_price_format(e.price),o=wc_cp_price_format(e.regular_price),i=this.get_formatted_price_suffix(e),'<span class="price summary_element_content">'+(t=e.regular_price>e.price?wc_composite_params.i18n_strikeout_price_string.replace("%f",o).replace("%t",t):t)+i+"</span>")),n},get_formatted_price_suffix:function(t){var e=this.model,i=this.suffix;return t=void 0===t?e.get("totals"):t,i=""!==i&&(this.suffix_contains_price_incl&&(i=i.replace("{price_including_tax}",wc_cp_price_format(t.price_incl_tax))),this.suffix_contains_price_excl)?i.replace("{price_excluding_tax}",wc_cp_price_format(t.price_excl_tax)):i},sync_carousel_pos:function(t){if(t.is_component()){for(var e=this.get_columns(),i=this.get_summary_element_indexes(),o=i.length,n=this.get_carousel_viewport_width(),s=this.carousel_offset,_=1/o*(e<o?n*o/e:n),a=0,c=0,r=i.length;c<r;c++)if(i[c]===t.step_index){a=c*_;break}n+s-1<a&&this.scroll_carousel(a-(e-1)*_),a<s-1&&this.scroll_carousel(a)}},scroll_carousel:function(t){var e,i,o,n,s;M(this).hasClass("inactive")||("incr"!==t&&"decr"!==t&&(t=parseInt(t,10)),e=this.get_columns(),n=this.get_summary_element_indexes().length,i=this.get_carousel_viewport_width(),o=this.carousel_offset,s=1/n*(n=e<n?i*n/e:i),"incr"===t?o+=Math.round(e*A.settings.summary_carousel_scroll_coeff)*s:"decr"===t?o-=Math.round(e*A.settings.summary_carousel_scroll_coeff)*s:o=t,(o=(o=1<o+i-n?n-i:o)<1?0:o)<1?this.$carousel_button_prev.addClass("inactive"):this.$carousel_button_prev.removeClass("inactive"),1<o+i+s-n?this.$carousel_button_next.addClass("inactive"):this.$carousel_button_next.removeClass("inactive"),this.carousel_offset=o,this.$el.css({transform:"translateX(-"+o+"px)"}))},render_columns:function(t){if(!A.is_initialized)return!1;var e,i,o,n,s=0,_=this.get_columns(),a=this;A.console_log("debug:views","\nUpdating summary view element columns..."),t=void 0===t?0:t,1<_&&a.is_in_widget&&(i=e=0,o=this.get_summary_element_indexes().length,n=this.get_carousel_viewport_width(),t=0,i=1/o*(e=_<o?n*o/_:n),_<o?a.$carousel_buttons.removeClass("disabled"):a.$carousel_buttons.addClass("disabled"),1<a.carousel_offset+n-e&&(a.carousel_offset=e-n),a.carousel_offset<1?a.$carousel_button_prev.addClass("inactive"):a.$carousel_button_prev.removeClass("inactive"),1<a.carousel_offset+n+i-e?a.$carousel_button_next.addClass("inactive"):a.$carousel_button_next.removeClass("inactive"),a.$el.css({width:e,transform:"translateX(-"+a.carousel_offset+"px)"}));for(var c=0,r=A.get_steps(),d=r.length;c<d;c++){var l,p=r[c];void 0!==a.view_elements[p.step_id]&&(p.step_index<t?p.is_visible()&&s++:(l="",p.is_visible()&&((++s-1)%_!=0&&1!=_||(l+=" first"),s%_==0)&&(l+=" last"),1<_&&a.is_in_widget?a.view_elements[p.step_id].$summary_element.removeClass("first last"):a.view_elements[p.step_id].$summary_element.removeClass("first last").addClass(l)))}},render_visibility:function(){if(!A.is_initialized)return!1;A.console_log("debug:views","\nRendering summary view element visibility"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),A.debug_indent_incr();for(var t=0,e=A.get_steps(),i=e.length;t<i;t++)this.render_element_visibility(e[t]);A.debug_indent_decr()},render_state:function(){if(!A.is_initialized)return!1;A.console_log("debug:views","\nRendering summary view element states"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),A.debug_indent_incr();for(var t=0,e=A.get_steps(),i=e.length;t<i;t++)this.render_element_state(e[t]);A.debug_indent_decr()},render_content:function(){A.console_log("debug:views","\nRendering summary view element contents"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),A.debug_indent_incr();for(var t=0,e=A.get_steps(),i=e.length;t<i;t++)this.render_element_content(e[t]);A.debug_indent_decr()},render:function(){A.console_log("debug:views","\nRendering summary view elements"+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),A.debug_indent_incr(),this.render_visibility(),this.render_state(),this.render_columns(),this.render_content(),A.debug_indent_decr()},render_element_content:function(t){var e;return!!A.is_initialized&&void 0!==(e=this).view_elements[t.step_id]&&!t.component_selection_model.has_pending_updates()&&(A.console_log("debug:views",'\nScheduled update of "'+t.get_title()+'" summary view element content'+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"."),void 0!==this.update_content_timers[t.step_index]&&clearTimeout(e.update_content_timers[t.step_index]),void(this.update_content_timers[t.step_index]=setTimeout(function(){e.render_element_content_task(t)},10)))},render_element_content_task:function(t){var i,e,o,n,s,_,a,c,r,d;t.is_component()&&(A.console_log("debug:views",'\nRendering "'+t.get_title()+'" summary view element content'+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),i=this,o=(e=t).component_id,n=this.view_elements[o].$summary_element_wrapper,s=this.view_elements[o].$summary_element_inner,_=this.view_elements[o].template_html,a={element_index:t.get_title_index(),element_title:t.get_title(),element_selection_title:"",element_action:"",element_label:"",element_button_classes:"",element_image_src:"",element_image_srcset:"",element_image_sizes:"",element_image_title:"",element_price:"",element_availability_text:""},c=!1,d=0,i.update_height_timers[t.step_index]||(void 0===(d=s.get(0).getBoundingClientRect().height)&&(d=s.outerHeight()),this.view_elements[o].load_height=d,n.css("height",this.view_elements[o].load_height)),a.element_selection_title=e.get_selected_product_title(!0,!1),a.element_is_in_widget=this.is_in_widget,a.element_button_link=e.get_route(),a.element_availability_text=e.get_availability_text_for_summary(),a.element_selection_title&&e.passes_validation()?e.is_static()&&!e.is_selected_product_configurable()?a.element_action=wc_composite_params.i18n_summary_static_component:a.element_action=wc_composite_params.i18n_summary_configured_component:(d=t.get_selected_product(),r=t.get_selected_product_type(),a.element_action=wc_composite_params.i18n_summary_empty_component,0<d&&"simple"!==r&&"invalid-product"!==r&&(a.element_action=wc_composite_params.i18n_summary_pending_component)),a.element_label=wc_composite_params.i18n_summary_action_label.replace("%a",a.element_action).replace("%c",a.element_title),(c=!1===(c=e.get_selected_product_image_data(!1))?e.get_placeholder_image_data():c)&&(a.element_image_src=c.image_src,a.element_image_srcset=c.image_srcset||"",a.element_image_sizes=c.image_sizes||"",a.element_image_title=c.image_title),a.element_price=this.get_element_price_html(t),a=A.filters.apply_filters("component_summary_element_content_data",[a,e,this]),(d=this.template(a))!==_?(this.view_elements[o].template_html=d,this.view_elements[o].content_data=a,s.html(d)):A.console_log("debug:views","...skipped!"),e.passes_validation()?n.addClass("configured"):n.removeClass("configured"),A.actions.do_action("component_summary_content_updated",[e,this]),void 0!==this.update_height_timers[t.step_index]&&clearTimeout(i.update_height_timers[t.step_index]),this.update_height_timers[t.step_index]=setTimeout(function(){var e;e=s.find(".summary_element_image img"),new p.WC_CP_Async_Task(function(){var t=!1;if(c.image_src&&e.is(":visible")&&0===e.height()&&!1===e.get(0).complete&&this.get_async_time()<5e3)return!(t=!0);t||this.done()},50).complete(function(){var t=s.outerHeight(!0),e=!1;i.$el.is(":visible")&&1<Math.abs(t-i.view_elements[o].load_height)?e=!0:n.css({height:"auto"}),e&&n.wc_cp_animate_height(t,200,{start:function(){A.console_log("debug:animations","Starting updated summary element content animation...")},complete:function(){A.console_log("debug:animations","Ended updated summary element content animation."),n.css({height:"auto"})}})}),i.update_height_timers[t.step_index]=0},200))},render_element_visibility:function(t){var e;return!!A.is_initialized&&void 0!==this.view_elements[t.step_id]&&(e=this.view_elements[t.step_id].$summary_element,A.console_log("debug:views",'\nUpdating "'+t.get_title()+'" summary view element visibility'+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),void(!1===t.is_visible()?e.addClass("hidden"):e.removeClass("hidden")))},render_element_state:function(t){var e;return!!A.is_initialized&&void 0!==this.view_elements[t.step_id]&&(e=this.view_elements[t.step_id].$summary_element_wrapper,A.console_log("debug:views",'\nUpdating "'+t.get_title()+'" summary view element state'+(this.is_in_widget?" (widget #"+this.is_in_widget+")":"")+"..."),void(t.is_current()?(e.removeClass("disabled"),"single"!==A.settings.layout&&e.addClass("selected")):t.is_locked()?(e.removeClass("selected"),e.addClass("disabled")):(e.removeClass("disabled"),e.removeClass("selected"))))}}))(t)},this.Composite_Navigation_View=function(t){return new(o.View.extend({render_timer:!1,render_movable_timer:!1,updated_buttons_data:{},navi_in_step:!1,template:!1,$el_progressive:A.$composite_form.find(".composite_navigation.progressive"),$el_paged_top:A.$composite_navigation_top,$el_paged_bottom:A.$composite_navigation_bottom,$el_paged_movable:A.$composite_navigation_movable,initialize:function(){this.template=wp.template("wc_cp_composite_navigation"),A.actions.add_action("component_selection_changed",this.selection_changed_handler,110,this),A.actions.add_action("component_quantity_changed",this.quantity_changed_handler,10,this),A.actions.add_action("component_selection_details_updated",this.selection_details_updated_handler,10,this),A.actions.add_action("component_selection_content_changed",this.selection_content_changed_handler,100,this),A.actions.add_action("active_step_transition_start",this.active_step_transition_start_handler,110,this),A.actions.add_action("component_options_state_rendered",this.options_state_rendered_handler,20,this),this.$el.on("click",".page_button",this.clicked_navigation_button)},selection_details_updated_handler:function(t){t.is_current()&&this.render_movable_task()},selection_content_changed_handler:function(){if(!A.is_initialized)return!1;this.render_change()},selection_changed_handler:function(t){return!!A.is_initialized&&(t.can_autotransition()?(A.show_next_step(),!1):void this.render_change())},quantity_changed_handler:function(t){if(!A.is_initialized)return!1;this.render_change()},active_step_transition_start_handler:function(){clearTimeout(this.render_timer),this.render("transition")},options_state_rendered_handler:function(t,e){if(!A.is_initialized)return!1;t.is_current()&&_.includes(e,"thumbnails")&&t.component_selection_view.is_relocated()&&this.render_movable()},clicked_navigation_button:function(){var t=M(this);return t.hasClass("inactive")||A.has_transition_lock||(t.hasClass("next")?A.get_next_step()?A.show_next_step():A.composite_viewport_scroller.scroll_viewport(A.$composite_form.find(".scroll_final_step"),{partial:!1,duration:250,queue:!1}):A.show_previous_step()),!1},update_buttons:function(){var t={prev_btn:{btn_classes:"",btn_text:"",btn_link:"",btn_label:"",btn_active:!0},next_btn:{btn_classes:"",btn_text:"",btn_link:"",btn_label:"",btn_active:!0}};!1!==this.updated_buttons_data.button_next_link&&(t.next_btn.btn_link=this.updated_buttons_data.button_next_link),!1!==this.updated_buttons_data.button_prev_link&&(t.prev_btn.btn_link=this.updated_buttons_data.button_prev_link),!1!==this.updated_buttons_data.button_next_html&&(t.next_btn.btn_text=this.updated_buttons_data.button_next_html),!1!==this.updated_buttons_data.button_prev_html&&(t.prev_btn.btn_text=this.updated_buttons_data.button_prev_html),!1!==this.updated_buttons_data.button_next_label&&(t.next_btn.btn_label=this.updated_buttons_data.button_next_label),!1!==this.updated_buttons_data.button_prev_label&&(t.prev_btn.btn_label=this.updated_buttons_data.button_prev_label),!1===this.updated_buttons_data.button_next_visible&&(t.next_btn.btn_classes="invisible",t.next_btn.btn_active=!1),!1===this.updated_buttons_data.button_next_active&&(t.next_btn.btn_classes+=" inactive",t.next_btn.btn_active=!1),!1===this.updated_buttons_data.button_prev_visible&&(t.prev_btn.btn_classes="invisible inactive",t.prev_btn.btn_active=!1),this.$el.html(this.template(t))},render_change:function(){var t=this;A.console_log("debug:views","\nScheduling navigation UI update..."),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){t.render("change")},40)},render:function(t){A.console_log("debug:views","\nRendering navigation UI...");var e,i,o=A.get_current_step(),n=A.get_next_step(),s=A.get_previous_step(),_=this;this.updated_buttons_data={button_next_link:!1,button_prev_link:!1,button_next_label:!1,button_prev_label:!1,button_next_html:!1,button_prev_html:!1,button_next_visible:!1,button_prev_visible:!1,button_next_active:!1},"transition"===t&&"paged"===A.settings.layout&&"componentized"===A.settings.layout_variation&&(o.is_review()?this.$el_paged_bottom.hide():this.$el_paged_bottom.show()),n&&(this.updated_buttons_data.button_next_link=n.get_route()),s&&(this.updated_buttons_data.button_prev_link=s.get_route()),o.is_component()&&(n&&"componentized"!==A.settings.layout_variation?(this.updated_buttons_data.button_next_html=wc_composite_params.i18n_next_step.replace("%s",n.get_title()),this.updated_buttons_data.button_next_label=n.is_review()?wc_composite_params.i18n_final_step:wc_composite_params.i18n_next_step_label.replace("%s",n.get_title()),this.updated_buttons_data.button_next_visible=!0):n&&"paged"===A.settings.layout&&(this.updated_buttons_data.button_next_html=wc_composite_params.i18n_final_step,this.updated_buttons_data.button_next_label=wc_composite_params.i18n_final_step,this.updated_buttons_data.button_next_visible=!0)),o.passes_validation()||"componentized"===A.settings.layout_variation&&o.is_component()?(n&&(this.updated_buttons_data.button_next_active=!0),s&&"paged"===A.settings.layout&&s.is_component()?(this.updated_buttons_data.button_prev_html=wc_composite_params.i18n_previous_step.replace("%s",s.get_title()),this.updated_buttons_data.button_prev_label=wc_composite_params.i18n_previous_step_label.replace("%s",s.get_title()),this.updated_buttons_data.button_prev_visible=!0):(this.updated_buttons_data.button_prev_html="",this.updated_buttons_data.button_prev_label="")):s&&s.is_component()&&(0<(i=s.get_selected_product())||"0"===i||""===i&&s.is_optional())&&"paged"===A.settings.layout&&(this.updated_buttons_data.button_prev_html=wc_composite_params.i18n_previous_step.replace("%s",s.get_title()),this.updated_buttons_data.button_prev_label=wc_composite_params.i18n_previous_step_label.replace("%s",s.get_title()),this.updated_buttons_data.button_prev_visible=!0),"progressive"===A.settings.layout?(e=_.$el_progressive,_.navi_in_step!==o.step_id?e.slideUp({duration:200,always:function(){_.update_buttons(),e.appendTo(o.$inner_el).hide(),_.navi_in_step=o.step_id,setTimeout(function(){var t=!1;o.is_last()||o.passes_validation()&&!n.has_toggle()&&(t=!0),t&&e.slideDown({duration:200,queue:!1})},200)}}):(_.update_buttons(),i=!1,o.is_last()||o.passes_validation()&&!n.has_toggle()&&(i=!0),i?e.slideDown(200):e.slideUp(200))):"paged"===A.settings.layout&&(_.navi_in_step!==o.step_id&&(o.$el.prepend(_.$el_paged_top),o.$el.append(_.$el_paged_bottom),_.navi_in_step=o.step_id),_.update_buttons(),"transition"===t)&&_.render_movable_task()},render_movable:function(){var t=this;A.console_log("debug:views","\nScheduling movable navigation visibility update..."),clearTimeout(t.render_movable_timer),t.render_movable_timer=setTimeout(function(){t.render_movable_task()},10)},render_movable_task:function(){var t,e,i,o,n,s=A.get_current_step();s.is_component()&&s.has_options_style("thumbnails")&&0<s.get_selected_product(!1)&&(t=0<s.$component_content.find(".composite_navigation").length,e=!1,s.append_results()&&s.component_selection_view.is_relocated()&&(i=s.$component_options.find(".component_option_thumbnail_container").not(".hidden"),o=s.$component_options.find(".component_option_thumbnail.selected").closest(".component_option_thumbnail_container"),o=i.index(o)+1,n=A.$composite_form.width()>wc_composite_params.small_width_threshold&&!1===A.$composite_form.hasClass("legacy_width")?s.component_options_view.get_columns():1,Math.ceil(o/n)===Math.ceil(i.length/n))&&(e=!0),t||e||(this.$el_paged_movable.appendTo(s.$component_summary),t=!0),t)&&(e||s.is_static()?this.$el_paged_movable.addClass("hidden"):this.$el_paged_movable.removeClass("hidden"))}}))(t)},this.Composite_Widget_View=function(t){return new(o.View.extend({show_hide_timer:!1,initialize:function(t){this.$el.removeClass("cp-no-js"),this.validation_view=new A.view_classes.Composite_Validation_View({is_in_widget:t.widget_count,el:this.$el.find(".widget_composite_summary_error .composite_message"),model:A.data_model}),this.price_view=new A.view_classes.Composite_Price_View({is_in_widget:t.widget_count,el:this.$el.find(".widget_composite_summary_price .composite_price"),model:A.data_model}),this.availability_view=new A.view_classes.Composite_Availability_View({is_in_widget:t.widget_count,el:this.$el.find(".widget_composite_summary_availability .composite_availability"),model:A.data_model}),this.add_to_cart_button_view=new A.view_classes.Composite_Add_To_Cart_Button_View({is_in_widget:t.widget_count,el:this.$el.find(".widget_composite_summary_button .composite_button"),$el_button:this.$el.find(".widget_composite_summary_button .composite_button .composite_add_to_cart_button"),model:A.data_model}),this.composite_summary_view=new A.view_classes.Composite_Summary_View({is_in_widget:t.widget_count,el:this.$el.find(".widget_composite_summary_elements")}),A.actions.do_action("widget_view_initialized",[t,this]),"paged"===A.settings.layout?A.actions.add_action("active_step_changed",this.active_step_changed_handler,100,this):this.show_hide()},active_step_changed_handler:function(){this.show_hide()},show_hide:function(){var t=this;clearTimeout(t.show_hide_timer),this.show_hide_timer=setTimeout(function(){t.show_hide_task()},20)},show_hide_task:function(){var t=this,e=0,i=A.get_current_step().is_review(),o=void 0===this.$el.data("is_hidden"),n=void 0!==A.settings.show_widget_in_review_step&&"yes"===A.settings.show_widget_in_review_step?"yes":"no";i&&"no"==n?(this.$el.data("is_hidden",!0),A.console_log("debug:animations","Starting widget slide-up animation..."),this.$el.hasClass("widget_position_default")&&(e=250,this.$el.addClass("summary_widget_inactive")),setTimeout(function(){t.$el.slideUp({duration:250,always:function(){A.console_log("debug:animations","Ended widget slide-up animation."),t.$el.addClass("summary_widget_hidden").show()}})},e)):(this.$el.data("is_hidden")||o)&&(this.$el.data("is_hidden",!1),A.console_log("debug:animations","Starting widget slide-down animation..."),o?this.$el.show().removeClass("summary_widget_hidden"):this.$el.hide().removeClass("summary_widget_hidden").slideDown({duration:250,always:function(){A.console_log("debug:animations","Ended widget slide-down animation.")}}),setTimeout(function(){t.$el.removeClass("summary_widget_inactive")},10))}}))(t)},this.Step_Validation_View=function(t,e){var _=t;return new(o.View.extend({render_timer:!1,render_html:!1,template:!1,event_type:"",rendered_product:"",initialize:function(){var t=this;this.template=wp.template("wc_cp_validation_message"),this.listenTo(this.model,"change:component_messages",function(){if(!_.is_current()||void 0===_.$component_message)return!1;A.console_log("debug:views",'\nScheduling "'+_.get_title()+'" validation message update...'),clearTimeout(t.render_timer),t.render_timer=setTimeout(function(){if(t.prepare_render("change"),_.can_autotransition())return!1;t.render(),t.rendered_product=_.component_selection_view.get_rendered_product()},10)}),"single"!==A.settings.layout&&A.actions.add_action("active_step_changed_"+_.step_id,this.active_step_changed_handler,100,this),"single"!==A.settings.layout&&A.actions.add_action("active_step_transition_end_"+_.step_id,this.active_step_transition_end_handler,100,this),A.actions.add_action("component_selection_details_relocation_started",this.relocation_started_handler,100,this),A.actions.add_action("component_selection_details_relocation_ended",this.relocation_ended_handler,100,this),A.actions.add_action("component_selection_details_relocation_container_created",this.relocation_container_created_handler,100,this)},relocation_started_handler:function(t){t.step_id===_.step_id&&(t=_.$component_message.filter(".top"),A.console_log("debug:views",'\nHiding "'+_.get_title()+'" validation message to prepare for component details relocation...'),t)&&!1===A.composite_viewport_scroller.illusion_scroll({target:t,type:"hide"})&&t.slideUp(200)},relocation_container_created_handler:function(t){t.step_id===_.step_id&&(A.console_log("debug:views",'\nMoving "'+_.get_title()+'" validation message into relocation target...'),t=_.$component_message.filter(".top"))&&_.component_selection_view.$relocation_target.prepend(t)},relocation_ended_handler:function(t){t.step_id===_.step_id&&(t=_.$component_message.filter(".top"),A.console_log("debug:views",'\nMoving "'+_.get_title()+'" validation message back to its original position...'),t)&&_.component_selection_view.$relocation_origin.after(t)},active_step_changed_handler:function(){if(!_.is_current()||void 0===_.$component_message)return!1;this.prepare_render("transition"),!1===this.render_html&&this.render(),this.rendered_product=_.component_selection_view.get_rendered_product()},active_step_transition_end_handler:function(){if(!_.is_current()||void 0===_.$component_message)return!1;!1!==this.render_html&&(clearTimeout(this.render_timer),this.render()),this.rendered_product=_.component_selection_view.get_rendered_product()},prepare_render:function(t){this.event_type=""===this.event_type?t:this.event_type,A.console_log("debug:views",'\nPreparing "'+_.get_title()+'" validation message update...'),this.render_html=!1,!!(_.passes_validation()||"componentized"===A.settings.layout_variation&&_.is_component())||_.is_last()&&"progressive"!==!A.settings.layout||0<(t=_.get_validation_messages()).length&&(this.render_html=this.template(t)),"transition"===this.event_type&&!1===this.render_html&&("progressive"===A.settings.layout?_.has_toggle()&&_.$component_message.hide():"paged"===A.settings.layout&&_.$component_message.hide())},render:function(){var t,s=this;A.console_log("debug:views",'\nUpdating "'+_.get_title()+'" validation message...'),"progressive"===A.settings.layout?(t="transition"===this.event_type?200:1,setTimeout(function(){!1!==s.render_html&&_.$component_message.html(s.render_html),!1===s.render_html?_.$component_message.slideUp(200):_.$component_message.slideDown(200)},t)):"paged"===A.settings.layout&&_.$component_message.each(function(t,e){var i=!1,o=M(e),n=o.hasClass("top"),e=n&&"change"===s.event_type&&_.component_selection_view.is_relocated()&&s.rendered_product!==_.component_selection_view.get_rendered_product()?_.component_selection_view.get_animation_duration("close")+50:0;setTimeout(function(){!1!==s.render_html&&_.$component_message.html(s.render_html),!1===(i=n?A.composite_viewport_scroller.illusion_scroll({target:o,type:!1===s.render_html?"hide":"show"}):i)&&(!1===s.render_html?o.slideUp(200):o.slideDown(200))},e)}),this.event_type=""}}))(e)},this.Step_Title_View=function(e,t){var i=e;return new(o.View.extend({$step_title_index:!1,initialize:function(){this.$step_title_index=i.$step_title.find(".step_index"),e.is_component&&i.has_toggle()&&(this.$el.on("click",this.clicked_title_handler),"progressive"===A.settings.layout)&&(A.actions.add_action("step_access_changed",this.step_access_changed_handler,100,this),A.actions.add_action("active_step_changed",this.active_step_changed_handler,100,this)),!1!==this.$step_title_index&&A.actions.add_action("step_visibility_changed",this.step_visibility_changed_handler,100,this)},clicked_title_handler:function(){if(i.has_toggle())if("single"===A.settings.layout)wc_cp_toggle_element(i.$el,i.$component_inner);else{if(i.is_current()){if("progressive"!==A.settings.layout)return!1;e.toggle_step("open",!0)}if(M(this).hasClass("inactive"))return!1;A.navigate_to_step(i)}return!1},step_access_changed_handler:function(t){t.step_id===i.step_id&&this.render_navigation_state()},active_step_changed_handler:function(){this.render_navigation_state()},render_navigation_state:function(){"progressive"===A.settings.layout&&i.has_toggle()&&(A.console_log("debug:views",'\nUpdating "'+i.get_title()+'" component title state...'),$button=this.$el.find(".component_title_button"),!i.is_current()&&i.is_locked()?(this.$el.addClass("inactive"),$button.attr("aria-disabled","true"),$button.attr("disabled","disabled")):(this.$el.removeClass("inactive"),$button.removeAttr("aria-disabled disabled")))},render_index:function(){var t;return!!A.is_initialized&&!1!==this.$step_title_index&&(t=e.get_title_index(),void this.$step_title_index.text(t))},step_visibility_changed_handler:function(t){if(i.step_index<t.step_index)return!1;this.render_index()}}))(t)},this.Component_Pagination_View=function(t,e){var i=t;return new(o.View.extend({template:!1,initialize:function(){this.template=wp.template("wc_cp_options_pagination"),this.listenTo(this.model,"change:page change:pages",this.render),i.$el.on("click",".component_pagination a.component_pagination_element",{view:this},this.load_page),i.$el.on("click",".component_pagination .component_options_load_more",{view:this},this.load_more)},load_page:function(){var t=parseInt(M(this).data("page_num"),10);return 0<t&&(A.block(i.$component_options),i.component_options_view.$blocked_element=i.$component_options,i.component_options_view.update_options({page:t},"reload")),!1},load_more:function(){var t=parseInt(i.component_options_model.get("page"),10),e=parseInt(i.component_options_model.get("pages"),10);return 0<t&&t<e&&(A.block(i.$component_options),i.component_options_view.$blocked_element=i.$component_options,i.component_options_view.update_options({page:t+1},"append")),!1},render:function(){if(!A.is_initialized)return!1;var t=this.model,t={page:t.get("page"),pages:t.get("pages"),range_mid:i.get_pagination_range(),range_end:i.get_pagination_range("end"),pages_in_range:2*(i.get_pagination_range()+i.get_pagination_range("end"))+1,i18n_page_of_pages:wc_composite_params.i18n_page_of_pages.replace("%p",t.get("page")).replace("%t",t.get("pages"))};A.console_log("debug:views",'\nRendering "'+i.get_title()+'" options pagination...'),i.append_results()?t.page<t.pages?this.$el.slideDown(200):this.$el.slideUp(200):this.$el.html(this.template(t))}}))(e)},this.Component_Options_View=function(t,e){var V=t;return new(o.View.extend({templates:{dropdown:!1,thumbnails:!1,radios:!1},reference_price:0,reference_option:!1,update_action:"",load_height:0,$blocked_element:!1,append_results_retry_count:0,must_reload_options:!1,is_lazy_load_pending:!1,has_invalid_empty_option:!1,changes:{dropdown:{changed:!1,to:""},thumbnails:{changed:!1,to:""},radios:{changed:!1,to:""},variations:{changed:!1,to:[]}},initialize:function(){this.templates.dropdown=wp.template("wc_cp_options_dropdown"),this.templates.thumbnails=wp.template("wc_cp_options_thumbnails"),this.templates.radios=wp.template("wc_cp_options_radio_buttons"),V._last_focused_radio_id=null,V.$el.on("click",".component_filter_option .toggle_filter_option",{view:this},this.activate_filter),V.$el.on("click",".component_filters .reset_component_filter",{view:this},this.reset_filter),V.$el.on("click",".component_filters .reset_component_filters",{view:this},this.reset_filters),V.$el.on("change",".component_ordering select",{view:this},this.order_by),V.$el.on("click",".component_filter_title .component_filter_name",{view:this},this.toggle_filter),"progressive"===A.settings.layout&&V.$el.on("click",".block_component_selections_inner",{view:this},this.clicked_blocked_area),V.has_options_style("thumbnails")&&(V.$el.on("click",".component_option_thumbnail",{view:this},this.selected_thumbnail),V.$el.on("keydown",".component_option_thumbnail",{view:this},this.handle_thumbnail_keydown)),V.has_options_style("radios")&&V.$el.on("change",".component_option_radio_buttons input",{view:this},this.clicked_radio),A.actions.add_action("component_options_loaded_"+V.step_id,this.updated_options,10,this),A.actions.add_action("component_options_state_changed_"+V.step_id,this.render,10,this),A.actions.add_action("component_selection_changed",this.component_selection_changed_handler,100,this),A.actions.add_action("component_selection_content_changed",this.component_selection_changed_handler,100,this),this.listenTo(this.model,"change:options_in_scenarios",this.options_in_scenarios_changed),"paged"!==A.settings.layout&&"progressive"!==A.settings.layout||A.actions.add_action("show_step",this.maybe_reload_options,10,this)},component_selection_changed_handler:function(t){V.step_id!==t.step_id||V.component_selection_model.has_pending_updates()||(V.is_priced_individually()&&"relative"===V.get_price_display_format()||this.has_invalid_empty_option)&&V.component_options_view.render()},maybe_reload_options:function(t){if(V.step_id!==(t=void 0===t?V:t).step_id||!A.is_initialized)return!1;(V.is_lazy_loaded()||this.must_reload_options)&&(this.must_reload_options?this.scenarios_changed_load_options():V.is_lazy_loaded()&&this.lazy_load_options())},lazy_load_options:function(){var t=this;V.set_lazy_loaded(!1),A.console_log("debug:views",'\nLazy loading "'+V.get_title()+'" options...'),A.block(V.$component_options),t.$blocked_element=V.$component_options,A.data_model.add_status_message(V.component_id,wc_composite_params.i18n_loading_options.replace("%s",V.get_title())),setTimeout(function(){t.update_options({page:V.component_options_model.get("page")},"reload",!0)},500)},options_in_scenarios_changed:function(){this.model.reload_options_on_scenarios_change()&&(this.must_reload_options=!0,"single"===A.settings.layout?this.scenarios_changed_load_options():A.console_log("debug:views",'\nScheduling "'+V.get_title()+'" options reload...'))},scenarios_changed_load_options:function(){var t=this;A.console_log("debug:views",'\nReloading "'+V.get_title()+'" options...'),this.must_reload_options=!1,V.set_lazy_loaded(!1),A.block(V.$component_options),this.$blocked_element=V.$component_options,A.data_model.add_status_message(V.component_id,wc_composite_params.i18n_loading_options.replace("%s",V.get_title())),setTimeout(function(){t.update_options({page:1},"reload",!0)},500)},clicked_blocked_area:function(){return A.navigate_to_step(V),!1},handle_thumbnail_keydown:function(t){var e=M(".component_option_thumbnail"),i=M(this),o=e.index(i),n=!1;"ArrowRight"===t.key||"ArrowDown"===t.key?(o=(o+1)%e.length,e.eq(o).focus(),n=!0):"ArrowLeft"===t.key||"ArrowUp"===t.key?(o=(o-1+e.length)%e.length,e.eq(o).focus(),n=!0):" "!==t.key&&"Enter"!==t.key||(i.click(),n=!0),n&&t.preventDefault()},selected_thumbnail:function(){var t=M(this);return!(!V.$el.hasClass("disabled")&&!t.hasClass("disabled")&&(t.hasClass("selected")||(t=t.data("val"),V.$component_options_select.val(t).trigger("change")),1))},clicked_radio:function(){var t=M(this),e=t.closest(".component_option_radio_button");if(V._last_focused_radio_id=t.attr("id"),V.$el.hasClass("disabled")||e.hasClass("disabled"))return!0;e.hasClass("selected")||(e=t.val(),V.$component_options_select.val(e).trigger("change"))},toggle_filter:function(){var t=M(this).closest(".component_filter"),e=t.find(".component_filter_content");return wc_cp_toggle_element(t,e,!1,200),!1},activate_filter:function(t){var e,i=M(this);return V.$el.hasClass("disabled")||(t=t.data.view,(e=i.closest(".component_filter_option")).hasClass("selected")?(e.removeClass("selected"),e.find(".toggle_filter_option").attr("aria-checked","false")):("yes"!==(i=i.closest(".component_filter")).data("multiselect")&&((i=i.find(".component_filter_option.selected")).removeClass("selected"),i.find(".toggle_filter_option").attr("aria-checked","false")),e.addClass("selected"),e.find(".toggle_filter_option").attr("aria-checked","true")),t.update_filters_ui(),A.block(V.$component_filters),t.$blocked_element=V.$component_filters,t.update_options({page:1,filters:V.find_active_filters()},"reload")),!1},reset_filter:function(t){var e=M(this),t=t.data.view,e=e.closest(".component_filter").find(".component_filter_option.selected");return 0!=e.length&&(e.removeClass("selected"),e.find(".toggle_filter_option").attr("aria-checked","false"),t.update_filters_ui(),A.block(V.$component_filters),t.$blocked_element=V.$component_filters,t.update_options({page:1,filters:V.find_active_filters()},"reload")),!1},reset_filters:function(t){M(this).blur();var t=t.data.view,e=V.$component_filters.find(".component_filter_option.selected");return 0!=e.length&&(e.removeClass("selected"),e.find(".toggle_filter_option").attr("aria-checked","false"),t.update_filters_ui(),A.block(V.$component_filters),t.$blocked_element=V.$component_filters,t.update_options({page:1,filters:V.find_active_filters()},"reload")),!1},update_filters_ui:function(){var t=V.$component_filters.find(".component_filter"),e=!0;if(0==t.length)return!1;t.each(function(){var t=M(this);0==t.find(".component_filter_option.selected").length?t.removeClass("active"):(t.addClass("active"),e=!1)}),e?V.$component_filters.removeClass("filtered"):V.$component_filters.addClass("filtered")},order_by:function(t){var e=M(this),t=t.data.view,e=e.val();return A.block(V.$component_options),t.$blocked_element=V.$component_options,t.update_options({page:1,orderby:e},"reload"),!1},get_columns:function(){var t=null;return V.has_options_style("thumbnails")?(t=parseInt(V.$component_thumbnail_options.data("component_option_columns"),10),isNaN(t)&&(t=void 0!==V.$component_thumbnail_options.data("columns")?parseInt(V.$component_thumbnail_options.data("columns"),10):1)):V.has_options_style("radios")&&(t=1),t},get_reference_option_data:function(){return{option_id:this.reference_option,option_price:this.reference_price}},get_empty_option_title:function(t){t=t&&wc_composite_params[t]?wc_composite_params[t]:wc_composite_params.i18n_no_option;return A.filters.apply_filters("component_empty_option_title",[t.replace("%s",V.get_title()),V])},render:function(t){if(!A.is_initialized)return!1;this.is_lazy_load_pending=!1,V.is_lazy_loaded()&&(this.is_lazy_load_pending=!0,!V.is_current()&&"single"!==A.settings.layout||this.lazy_load_options()),t=void 0!==t&&t,A.console_log("debug:views",'\nRendering "'+V.get_title()+'" options in view...');var e=this,i=V.component_options_model,o=V.get_price_display_format(),n=i.get("options_state").active,s=V.get_selected_product(!1),a=M.extend(!0,[],i.available_options_data);e.changes.dropdown.changed=!1,e.changes.thumbnails.changed=!1,e.changes.radios.changed=!1,e.changes.variations.changed=!1,A.is_finalized&&s!==e.reference_option||"relative"!==V.get_price_display_format()||!V.has_valid_selections(!1)||(e.reference_price=A.data_model.calculate_component_subtotals(V,A.data_model.price_data,1).price,e.reference_option=s);for(var c=0,r=a.length;c<r;c++){var d=a[c],l=d.option_id,l=_.includes(n,l);a[c].is_disabled=!l,a[c].is_hidden=a[c].is_disabled&&V.hide_disabled_products(),a[c].is_selected=a[c].option_id===s,a[c].option_button_text=d.is_configurable?wc_composite_params.i18n_configure_option_button:wc_composite_params.i18n_select_option_button,a[c].option_button_label=(d.is_configurable?wc_composite_params.i18n_configure_option_button_label:wc_composite_params.i18n_select_option_button_label).replace("%s",d.option_title),a[c].option_display_title=d.option_title,a[c].option_price_html=V.get_formatted_option_price_html(a[c])}for(var p=M.extend(!0,[],a),m=0,u=p.length;m<u;m++){var h,g=p[m];p[m].is_selected=g.is_selected&&V.is_selected_product_valid(),g.option_price_html&&V.has_options_style("dropdowns")&&(h="relative"===o?wc_composite_params.i18n_dropdown_title_relative_price:wc_composite_params.i18n_dropdown_title_price,p[m].option_display_title=this.is_lazy_load_pending?wc_composite_params.i18n_lazy_loading_options:h.replace("%t",g.option_display_title).replace("%p",g.option_price_html))}var i=!1,v=!1,f=!1;if(e.has_invalid_empty_option=!1,0===n.length?(i=!0,z="i18n_no_options"):(z=V.is_optional()?"i18n_no_option":"i18n_select_option",V.maybe_is_optional()?(!(i=!0)===V.is_selected_product_valid()&&(v=!0),!1===V.is_optional()&&(""===s&&(v=!0),f=!0,z="i18n_no_option")):!1===V.is_static()&&V.show_placeholder_option()?i=!0:""===s&&!1===V.show_placeholder_option()?e.has_invalid_empty_option=i=!0:!1===V.is_selected_product_valid()&&!1===V.show_placeholder_option()&&(e.has_invalid_empty_option=v=!0)),i&&(i={option_id:"",option_display_title:e.get_empty_option_title(z),is_disabled:f,is_hidden:f&&V.hide_disabled_products(),is_selected:""===s&&!1===v},"relative"===o&&V.has_options_style("dropdowns")&&V.maybe_is_optional()&&(i.option_price_html="",i.option_price_data={price:0,regular_price:0,max_price:0,max_regular_price:0,min_qty:1,discount:""},z=V.get_formatted_option_price_html(i))&&(i.option_display_title=wc_composite_params.i18n_dropdown_title_relative_price.replace("%t",i.option_display_title).replace("%p",z)),this.is_lazy_load_pending&&(i.option_display_title=wc_composite_params.i18n_lazy_loading_options),p.unshift(i)),v&&p.unshift({option_id:"",option_display_title:e.get_empty_option_title("i18n_select_option"),is_disabled:!1,is_hidden:!1,is_selected:!1}),e.changes.dropdown.changed=!0,e.changes.dropdown.to=e.templates.dropdown(p),!1===t){if(V.has_options_style("thumbnails")){var b=_.where(a,{is_in_view:!0}),w=e.get_columns(),y=0;if(0<b.length)for(var $=0,x=b.length;$<x;$++){var k=b[$];b[$].outer_classes=k.is_hidden?"hidden":"",b[$].inner_classes=k.is_disabled?"disabled":"",b[$].inner_classes+=k.option_id===s?" selected":"",b[$].inner_classes+=k.is_appended?" appended":"",!1===k.is_hidden&&((++y-1)%w!=0&&1!=w||(b[$].outer_classes+=" first"),y%w==0)&&(b[$].outer_classes+=" last")}this.is_lazy_load_pending&&(b.is_lazy_loading=!0);f=e.templates.thumbnails(b);f.replace(/ selected/g,"")!==e.changes.thumbnails.to.replace(/ selected/g,"")?(e.changes.thumbnails.changed=!0,e.changes.thumbnails.to=f):A.console_log("debug:views","...skipped!")}else if(V.has_options_style("radios")){var C=_.where(a,{is_in_view:!0}),z=!1,i=V.maybe_is_optional()&&!1===V.is_optional(),v=i&&V.hide_disabled_products();if(V.maybe_is_optional()?z=!0:!1===V.is_static()&&V.show_placeholder_option()&&(v=z=!0),z&&(t={option_id:"",option_display_title:wc_composite_params.i18n_no_option.replace("%s",V.get_title()),is_disabled:i,is_hidden:v,is_selected:""===s},"relative"===o&&V.maybe_is_optional()&&(t.option_price_html="",t.option_price_data={price:0,regular_price:0,max_price:0,max_regular_price:0,min_qty:1,discount:""},f=V.get_formatted_option_price_html(t))&&(t.option_price_html=f),C.unshift(t)),0<C.length)for(var q=0,S=C.length;q<S;q++){var T=C[q];C[q].outer_classes=T.is_hidden?"hidden":"",C[q].inner_classes=T.is_disabled?"disabled":"",C[q].inner_classes+=T.option_id===s?" selected":"",C[q].option_suffix=""===T.option_id?"0":T.option_id,C[q].option_group_id=V.component_id}this.is_lazy_load_pending&&(C.is_lazy_loading=!0),C.title=V.get_title(),e.changes.radios.changed=!0,e.changes.radios.to=e.templates.radios(C)}"variable"===V.get_selected_product_type()&&(z=V.component_selection_model.get_active_variations_data(),e.changes.variations.changed=!_.isEqual(e.changes.variations.to,z),e.changes.variations.to=z)}0<(i=_.keys(_.pick(e.changes,function(t){return t.changed}))).length&&(A.actions.do_action("component_options_state_render",[V,i]),e.changes.dropdown.changed&&V.$component_options_select.html(e.changes.dropdown.to),e.changes.thumbnails.changed&&(V.$component_thumbnail_options.html(e.changes.thumbnails.to),"reload"===e.update_action)&&V.$component_selections.removeClass("refresh_component_options"),e.changes.radios.changed&&(V.$component_radio_button_options.html(e.changes.radios.to),V._last_focused_radio_id)&&(v=M("#"+V._last_focused_radio_id)).length&&v.is(":radio")&&v.focus(),e.changes.variations.changed&&V.component_selection_view.get_rendered_product()===s&&(A.console_log("debug:views",'\nVariations data in "'+V.get_title()+'" has changed. Reinitializing variations view...'),V.$component_summary_content.data("product_variations",V.component_selection_model.get_active_variations_data()),A.debug_indent_incr(),V.$component_summary_content.triggerHandler("reload_product_variations"),A.debug_indent_decr()),A.actions.do_action("component_options_state_rendered",[V,i]))},update_options:function(t,e,i){i=void 0!==i&&i,"reload"===(this.update_action=e)&&V.$component_selections.addClass("refresh_component_options"),this.load_height=V.$component_options.get(0).getBoundingClientRect().height,void 0===this.load_height&&(this.load_height=V.$component_options.outerHeight()),V.$component_options.css("height",this.load_height),setTimeout(function(){V.component_options_model.request_options(t,e)},200),A.actions.do_action("component_options_update_requested",[V,t,e,i])},updated_options:function(){if(!1===this.$blocked_element)return!1;if("append"===this.update_action&&V.hide_disabled_products()&&V.$component_thumbnail_options.find(".appended:not(.disabled)").length<V.get_results_per_page()){var t=this.model.get("page")<this.model.get("pages");if(t=t&&10<this.append_results_retry_count&&!1===window.confirm(wc_composite_params.i18n_reload_threshold_exceeded.replace("%s",V.get_title()))?!1:t)return this.append_results_retry_count++,this.model.request_options({page:this.model.get("page")+1},"append"),!1;this.append_results_retry_count=0}(V.is_current()||"single"===A.settings.layout)&&this.is_lazy_load_pending&&this.render();var o=V.$component_thumbnail_options.find(".component_option_thumbnails_container"),n=o.find(".component_option_thumbnail_container:not(.hidden) img"),e=this;new p.WC_CP_Async_Task(function(){var e=!1,i=this;0<n.length&&o.is(":visible")&&n.each(function(){var t=M(this);if(0===t.height()&&!1===t.get(0).complete&&i.get_async_time()<2e4)return!(e=!0)}),e||this.done()},50).complete(function(){e.animate_options()})},get_animation_duration:function(t){return A.filters.apply_filters("component_component_options_animation_duration",[250,t,V])},animate_options:function(){"append"===this.update_action&&V.$component_thumbnail_options.find(".appended").removeClass("appended");var t=this,e=V.$component_options_inner.outerHeight(!0),i=!1;1<Math.abs(e-t.load_height)?i=!0:V.$component_options.css("height","auto");i?(A.console_log("debug:animations","Starting component options height animation..."),V.$component_options.wc_cp_animate_height(e,t.get_animation_duration(this.update_action),{complete:function(){V.$component_options.css({height:"auto"}),A.console_log("debug:animations","Ended component options height animation."),setTimeout(function(){t.unblock()},100)}})):setTimeout(function(){t.unblock()},250),A.actions.do_action("component_options_updated",[V])},unblock:function(){V.$component_selections.removeClass("refresh_component_options"),A.unblock(this.$blocked_element),this.$blocked_element=!1,A.data_model.remove_status_message(V.component_id),this.update_action="",A.actions.do_action("component_options_refreshed",[V])},is_updating:function(){return!1!==this.$blocked_element}}))(e)},this.Component_Selection_View=function(t,e){var l=t;return new(o.View.extend({templates:{},$relocation_origin:!1,relocated:!1,relocating:!1,relocating_to_origin:!1,$relocation_target:!1,$relocation_reference:!1,load_height:0,render_addons_totals_timer:!1,flushing_component_options:!1,blocked:!1,actioned:!1,rendered_product:"",initialize:function(){this.templates={selection_title:wp.template("wc_cp_component_selection_title"),selection_title_html:""},l.$el.on("change",".component_options select.component_options_select",{view:this},this.option_changed),l.$el.on("woocommerce_variation_has_changed",{view:this},function(t){var e=l.$component_summary_content.find(".single_variation_wrap .variations_button input.variation_id").val(),i=l.$component_summary_content.find(".variations"),o={meta_data:[]};(e=e||"")&&0<i.length&&(o.meta_data=wc_cp_get_variation_data(i,!1)),t.data.view.model.update_selected_variation(e,o),l.$component_variations_reset_wrapper&&(t.data.view.model.get("selected_variation")?l.$component_variations_reset_wrapper.slideDown(200):l.$component_variations_reset_wrapper.slideUp(200)),l.step_validation_model.get("is_in_stock")&&l.$component_quantity.trigger("change"),l.has_wc_core_gallery_class||l.$component_summary_content.find(".composited_product_images").removeClass("images")}),l.$el.on("woocommerce_variation_select_change",function(){l.has_wc_core_gallery_class||l.$component_summary.find(".composited_product_images").addClass("images"),l.component_selection_model.set_price(0),l.component_selection_model.set_regular_price(0),l.component_selection_model.set_tax_ratios(!1),l.component_selection_model.set_stock_status("")}),l.$el.on("found_variation",function(t,e){l.component_selection_model.set_price(e.price),l.component_selection_model.set_regular_price(e.regular_price),l.component_selection_model.set_tax_ratios(e.tax_ratios),e.is_in_stock||l.component_selection_model.set_stock_status("out-of-stock")}),l.$el.on("input change",".component_wrap input.qty",{view:this},function(t){var e=t.data.view,t="change"===t.type&&("yes"===wc_composite_params.force_min_max_qty_input||e.is_blocked()),e=e.get_updated_quantity(t);t&&M(this).val(e),l.component_selection_model.update_selected_quantity(e)}),l.$el.on("wc-composite-component-loaded",function(){var t,e;void 0!==window.WC_PAO&&("bundle"===l.get_selected_product_type()?(l.component_selection_model.set_addons_form(new window.WC_PAO.Form(l.$component_summary_content.find(".bundle_data.cart"))),(e=l.get_bundle_script(this.component_id))&&(M.each(e.bundled_items,function(t,e){e.has_addons()&&new window.WC_PAO.Form(e.$bundled_item_cart)}),e.match_bundled_items_addons_forms())):l.has_addons()&&l.component_selection_model.set_addons_form(new window.WC_PAO.Form(l.$component_summary_content))),"yes"===wc_composite_params.photoswipe_enabled&&"undefined"!=typeof PhotoSwipe?(e=l.$component_summary_content.find(".composited_product_images"),M.fn.wc_product_gallery?e.wc_product_gallery({zoom_enabled:!1,flexslider_enabled:!1}):A.console_log("warning","Failed to initialize PhotoSwipe for composited product images. Your theme declares PhotoSwipe support, but function '$.fn.wc_product_gallery' is undefined."),0<(e=e.find("a.placeholder_image")).length&&e.on("click",function(){return!1})):M.isFunction(M.fn.prettyPhoto)&&(t=(e=l.$component_summary_content.find('a[data-rel^="prettyPhoto"]')).not(".placeholder_image"),e=e.filter(".placeholder_image"),0<t.length&&t.prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1}),0<e.length)&&e.on("click",function(){return!1})}),l.$el.on("click",".clear_component_options",function(){var t,e;return"yes"===wc_composite_params.accessible_focus_enabled&&l.$step_title_aria&&l.$step_title_aria.trigger("focus"),M(this).hasClass("reset_component_options")||(0<(t=l.$component_options_select.find('option[value=""]')).length&&!1===t.first().prop("disabled")&&l.$component_options_select.val("").trigger("change"),l.has_options_style("thumbnails")&&(e=(t=l.$component_thumbnail_options.find(".component_option_thumbnail")).first(),t.attr("tabindex","-1"),e.attr("tabindex","0"),e.focus())),!1}),l.$el.on("click",".reset_component_options",function(){var t=l.$component_options_select.find('option[value=""]');return l.unblock_step_inputs(),l.set_active(),0<t.length&&!1===t.first().prop("disabled")&&l.$component_options_select.val("").trigger("change"),l.block_next_steps(),!1}),l.$el.on("updated_addons",{view:this},this.updated_addons_handler),l.$el.on("woocommerce-nyp-updated-item",this.updated_nyp_handler),"yes"===wc_composite_params.relocated_content_reset_on_return&&A.actions.add_action("active_step_transition",this.active_step_transition_handler,100,this),A.actions.add_action("component_options_state_changed_"+l.step_id,this.options_state_changed_handler,100,this),A.actions.add_action("component_options_state_render",this.options_state_render_handler,10,this),A.actions.add_action("component_options_state_rendered",this.options_state_rendered_handler,10,this),A.actions.add_action("component_options_state_rendered",this.options_state_rendered_autoselect_attributes,30,this),A.actions.add_action("component_selection_details_updated_"+l.step_id,this.refresh_selection_title,10,this),A.actions.add_action("component_selection_changed",this.component_selection_changed_handler,100,this),l.maybe_autotransition()&&A.actions.add_action("active_step_transition_end",this.active_step_transition_end_handler,10,this),this.listenTo(this.model,"selected_product_data_load_error",this.selection_data_load_error),this.listenTo(l.component_options_model,"component_options_data_loaded",this.component_options_flush_handler),A.actions.add_action("component_quantity_changed",this.quantity_changed_handler,100,this),A.actions.add_action("component_addons_changed",this.addons_changed_handler,100,this),A.actions.add_action("component_selection_changed",this.addons_changed_handler,100,this)},get_updated_quantity:function(t){var e=l.$component_quantity,i=parseFloat(e.val()),o=parseFloat(e.attr("min")),e=parseFloat(e.attr("max"));return t&&(0<=o&&(i<o||isNaN(i))&&(i=o),0<e)&&e<i&&(i=e),isNaN(i)&&(i=0),parseInt(i,10)},get_rendered_product:function(){return this.rendered_product},get_animation_duration:function(t){var e=l.is_current()||"single"===A.settings.layout?220:0;return A.filters.apply_filters("component_selection_change_animation_duration",[e,t="open"!==t&&"close"!==t?"open":t,l])},active_step_transition_handler:function(t){l.step_id===t.step_id&&this.is_relocated()&&this.reset_relocated_content()},options_state_changed_handler:function(){A.is_initialized&&this.get_rendered_product()===this.model.get("selected_product")&&this.update_selection_title()},options_state_render_handler:function(t,e){l.step_id===t.step_id&&_.includes(e,"thumbnails")&&this.is_relocated()&&l.$el.append(this.$relocation_target.hide())},options_state_rendered_handler:function(t,e){l.step_id===t.step_id&&_.includes(e,"thumbnails")&&this.is_relocated()&&(t=this.get_new_relocation_data()).relocate&&(this.$relocation_reference=t.reference,this.$relocation_reference.after(this.$relocation_target),this.$relocation_target.show())},options_state_rendered_autoselect_attributes:function(t,e){l.step_id===t.step_id&&t.autoselect_attributes()&&_.includes(e,"variations")&&this.autoselect_attributes()&&l.$component_summary_content.find(".variations select").last().trigger("change")},autoselect_attributes:function(){for(var t,e,i,o=_.where(l.component_selection_model.get_active_variations_data(),{variation_is_active:!0}),n=!1,s="",a={},c=0,r=o.length;c<r;c++)if(o.hasOwnProperty(c)){var d=o[c].attributes;for(s in d)d.hasOwnProperty(s)&&(""===d[s]?a[s]="":""!==a[s]&&(void 0===a[s]&&(a[s]=[]),a[s].push(d[s]),a[s]=_.uniq(a[s])))}for(s in a)a.hasOwnProperty(s)&&""!==a[s]&&1===a[s].length&&(e=(t=a[s].pop()).replace(/"/g,'\\"'),!(i=l.$component_summary_content.find('.variations select[data-attribute_name="'+s+'"]')).val())&&i.find('option[value="'+e+'"]')&&(n=!0,i.val(t));return n},quantity_changed_handler:function(t){t.step_id===l.step_id&&(this.update_selection_title(this.model),t=this.get_updated_addons_data())&&l.component_selection_model.update_selected_addons(t.data,t.raw_price,t.raw_regular_price)},addons_changed_handler:function(t){var e;return t.step_id===l.step_id&&!!A.is_initialized&&(e=this,clearTimeout(e.render_addons_totals_timer),void(e.render_addons_totals_timer=setTimeout(function(){e.render_addons_totals()},10)))},get_updated_addons_data:function(){if(!l.has_addons())return!1;for(var t=0,e=0,i=l.$component_addons_totals?l.$component_addons_totals.data("price_data"):[],o=l.get_selected_quantity(),n=A.data_model.price_data.price_tax_ratios[l.component_id],s=0,_=i.length;s<_;s++){var a,c,r,d=i[s];l.is_priced_individually()?d.is_custom_price?(r=0,a=!(!n||void 0===n.incl)&&Number(n.incl),c=!(!n||void 0===n.excl)&&Number(n.excl),r="incl"===wc_composite_params.tax_display_shop&&"no"===wc_composite_params.prices_include_tax?d.cost_raw/(a||1):"excl"===wc_composite_params.tax_display_shop&&"yes"===wc_composite_params.prices_include_tax?d.cost_raw/(c||1):d.cost_raw,e+=r=o?r/o:0,t+=r):"quantity_based"===d.price_type?(e+=d.cost_raw_pu,t+=d.cost_raw_pu):"flat_fee"===d.price_type?(e+=o?d.cost_raw/o:0,t+=o?d.cost_raw/o:0):"percentage_based"===d.price_type&&(e+=d.cost_raw_pct*A.data_model.price_data.regular_prices[l.component_id],t+=d.cost_raw_pct*A.data_model.price_data.prices[l.component_id]):t=e=0,i[s].qty=o,i[s].raw_price=t,i[s].raw_regular_price=e}return{data:i,raw_price:t=t||0,raw_regular_price:e=e||t}},updated_addons_handler:function(t){var e;M(t.target).hasClass("bundled_item_cart_content")||l.has_addons()&&(e=t.data.view.get_updated_addons_data(),l.component_addons_totals_html&&l.$component_addons_totals.html(l.component_addons_totals_html),e&&l.component_selection_model.update_selected_addons(e.data,e.raw_price,e.raw_regular_price),t.stopPropagation())},render_addons_totals:function(){var t,e,i,o;l.has_addons()&&(t=A.data_model.price_data,e=A.data_model.price_data.price_tax_ratios[l.component_id],o=(o=t.addons_prices[l.component_id])||0,l.show_addons_totals)&&(l.passes_validation()&&(i=l.get_selected_quantity(),0<A.data_model.get_taxed_totals(o,o,e,i).price)?(t=Number(t.prices[l.component_id])+Number(o),t=wc_cp_price_format((o=A.data_model.get_taxed_totals(t,t,e,i)).price),e=A.composite_price_view.get_formatted_price_suffix(o),i='<span class="price"><span class="subtotal">'+wc_composite_params.i18n_subtotal+"</span>"+t+e+"</span>",l.component_addons_totals_html=i,l.$component_addons_totals.html(i).slideDown(200)):l.$component_addons_totals.slideUp(200))},updated_nyp_handler:function(){var t,e;l.is_nyp()&&(e=0<(t=l.$component_summary_content.find(".nyp")).length?Number(t.data("price")):0,l.component_selection_model.update_nyp(t.find("input.amount").val(),e))},refresh_selection_title:function(){this.templates.selection_title_html="",this.update_selection_title(this.model)},update_selection_title:function(t){t=void 0===t?this.model:t,0<l.get_selected_product(!1)&&(A.console_log("debug:views",'\nUpdating "'+l.get_title()+'" selection title...'),this.update_selection_title_task(t))},get_updated_selection_title:function(t){var t=parseInt(t.get("selected_quantity"),10),e=l.get_selected_product_title(!1),t=1<t?wc_composite_params.i18n_qty_string.replace("%s",t):"";return wc_composite_params.i18n_title_string.replace("%t",e).replace("%q",t).replace("%p","")},update_selection_title_task:function(t){var e=l.$component_summary_content.find(".composited_product_title_wrapper"),t={tag:"h3",show_title:"yes"===e.data("show_title"),show_selection_ui:!l.is_static(),show_reset_ui:l.show_placeholder_option()&&!1===l.maybe_is_optional()||l.is_optional()||!1===l.is_selected_product_valid(),selection_title:this.get_updated_selection_title(t),selection_title_aria:wc_composite_params.i18n_selection_title_aria.replace("%s",l.get_selected_product_title(!1)),selection_data:t.get_product_data()},t=this.templates.selection_title(t);t!==this.templates.selection_title_html&&(this.templates.selection_title_html=t,e.html(t)),"invalid-product"!==l.get_selected_product_type()||0!==(e=l.$component_options_select.find('option[value=""]')).length&&!e.first().prop("disabled")||l.$component_summary_content.find(".clear_component_options").remove()},block:function(){this.blocked=!0,A.block(l.$component_options)},unblock:function(){this.blocked=!1,l.$component_content.removeClass("updating"),l.$component_thumbnail_options.find(".loading").removeClass("loading"),A.unblock(l.$component_options)},is_blocked:function(){return this.blocked},is_actioned:function(){return this.actioned},option_changed:function(t){var t=t.data.view,e=M(this).val();return t.actioned=!0,t.set_option(e),!1},set_option:function(t){var e,i,o=this;if(l.get_selected_product(!1)===t)return!1;l.has_options_style("thumbnails")?(i=l.$component_thumbnail_options.find(".selected"),e=l.$component_thumbnail_options.find("#component_option_thumbnail_"+t),i.removeClass("selected").attr("aria-selected","false").attr("tabindex","-1"),e.addClass("selected loading").attr("aria-selected","true").attr("tabindex","0")):l.has_options_style("radios")&&((i=l.$component_radio_button_options.find(".selected")).removeClass("selected"),i.find("input").prop("checked",!1),l.$component_options.find("#component_option_radio_button_"+(""===t?"0":t)).addClass("selected").find("input").prop("checked",!0)),""!==t?(this.block(),l.$component_content.addClass("updating"),setTimeout(function(){o.model.update_selection(t)},120)):o.model.update_selection("")},selection_data_load_error:function(){var t,e=l.get_selected_product(!1);l.$component_options_select.val(e).trigger("change"),this.unblock(),l.has_options_style("thumbnails")?(l.$component_thumbnail_options.find(".selected").removeClass("selected"),l.$component_thumbnail_options.find("#component_option_thumbnail_"+e).addClass("selected")):l.has_options_style("radios")&&((t=l.$component_radio_button_options.find(".selected")).removeClass("selected"),t.find("input").prop("checked",!1),l.$component_options.find("#component_option_radio_button_"+(""===e?"0":e)).addClass("selected").find("input").prop("checked",!0)),window.alert(wc_composite_params.i18n_selection_request_timeout)},render_default:function(){var t=this.model.get("selected_product");(this.rendered_product=t)?this.render_content():this.reset_content()},component_selection_changed_handler:function(t){return l.step_id===t.step_id&&!l.can_autotransition()&&void this.maybe_render()},active_step_transition_end_handler:function(){this.maybe_render()},maybe_render:function(){var t=this.model.get("selected_product");return!!A.is_initialized&&this.get_rendered_product()!==t&&void this.render()},render:function(){var t,e,i=this,o=this.model.get("selected_product");this.rendered_product=o,A.console_log("debug:views",'\nPreparing "'+l.get_title()+'" selection view...'),i.prepare_relocation(),o?i.is_relocating()?(i.is_relocating_to_origin()?(A.console_log("debug:animations","Starting component content height animation..."),l.$component_content.wc_cp_animate_height(0,i.get_animation_duration("close"),{complete:function(){A.console_log("debug:animations","Ended component content height animation."),i.reset_relocated_content(),i.render_content()}})):l.$component_content.offset().top<i.$relocation_reference.offset().top&&!1===l.$component_content.wc_cp_is_in_viewport(!0)?(t=0,e=i.load_height,setTimeout(function(){t=$wc_cp_window.scrollTop()-Math.round(e),setTimeout(function(){A.composite_viewport_scroller.is_scroll_anchoring_supported()||window.scroll(0,t),l.$component_content.css({height:0}),setTimeout(function(){i.render_content()},10)},50)},50)):(A.console_log("debug:animations","Starting component content height animation..."),l.$component_content.wc_cp_animate_height(0,i.get_animation_duration("close"),{complete:function(){A.console_log("debug:animations","Ended component content height animation."),i.render_content()}})),i.load_height=0):(l.$component_content.css({height:i.load_height}),i.render_content()):(A.console_log("debug:animations","Starting component content height animation..."),l.$component_content.wc_cp_animate_height(0,i.get_animation_duration("close"),{complete:function(){A.console_log("debug:animations","Ended component content height animation."),i.reset_content(),l.$component_content.css({height:"auto"})}}))},prepare_relocation:function(){var t=this,e=this.model.get("selected_product"),i=this.can_relocate();t.load_height=l.$component_content.get(0).getBoundingClientRect().height,void 0===t.load_height&&(t.load_height=l.$component_content.outerHeight()),t.relocating=!1,t.relocating_to_origin=!1,i&&!1===t.$relocation_origin&&(t.$relocation_origin=M('<div class="component_content_origin">'),l.$component_content.before(t.$relocation_origin)),i&&""!==e&&l.is_current()?(i=t.get_new_relocation_data()).relocate&&(t.$relocation_reference=i.reference,t.relocating=i.relocate):t.is_relocated()&&(t.relocating=!0,t.relocating_to_origin=!0),t.relocating&&(A.actions.do_action("component_selection_details_relocation_started",[l]),l.$component_content.addClass("relocating"))},maybe_relocate_content:function(){var t=this;t.is_relocating()&&(t.is_relocated()?t.$relocation_reference.after(t.$relocation_target):(t.$relocation_target=M('<li class="component_option_content_container">'),t.$relocation_reference.after(t.$relocation_target),l.$component_content.appendTo(t.$relocation_target),A.actions.do_action("component_selection_details_relocation_container_created",[l])),t.relocated=!0,l.$component_content.addClass("relocated"))},render_content:function(){var t,e=this,i=e.model.get_product_data().product_html;A.console_log("debug:views",'\nRendering "'+l.get_title()+'" selection view content...'),l.reset_scripts(),e.maybe_relocate_content(),l.$component_summary_content.addClass("populated"),l.$component_summary_content.html(i),e.rendered_content(),A.is_finalized&&(t=l.is_current()?l.$component_summary_content.find("img"):[],new p.WC_CP_Async_Task(function(){var e=!1,i=this;0<t.length&&t.each(function(){var t=M(this);if(t.is(":visible")&&0===t.height()&&!1===t.get(0).complete&&i.get_async_time()<1e4)return!(e=!0)}),e||this.done()},50).complete(function(){setTimeout(function(){e.is_relocated()&&l.$component_content.removeClass("relocating"),e.animate_rendered_content(),e.actioned=!1},300)}))},rendered_content:function(){A.console_log("debug:views",'\nInitializing "'+l.get_title()+'" view content scripts...'),A.debug_indent_incr(),0<this.model.get("selected_product")?l.init_scripts():l.init_scripts(!1),A.debug_indent_decr(),A.console_log("debug:views",'\nDone initializing "'+l.get_title()+'" view content scripts.'),A.actions.do_action("component_selection_details_updated",[l])},reset_content:function(){l.reset_scripts(),l.$component_summary_content.html(""),l.$component_summary_content.removeClass("populated"),0<l.$el.find(".composite_navigation.movable").length&&A.$composite_navigation_movable.addClass("hidden"),this.reset_relocated_content(),this.rendered_content(),l.$component_content.removeClass("relocating")},animate_rendered_content:function(){var t=l.$component_summary.outerHeight(!0),e=!1,i=this;(l.is_current()||"single"===A.settings.layout)&&(i.is_relocating()||1<Math.abs(t-this.load_height))?e=!0:l.$component_content.css("height","auto"),e?(A.console_log("debug:animations","Starting updated content height animation..."),l.$component_content.wc_cp_animate_height(t,i.get_animation_duration("open"),{complete:function(){A.console_log("debug:animations","Ended updated content height animation."),l.$component_content.css({height:"auto"}),i.unblock(),A.actions.do_action("component_selection_details_animated",[l])}})):(i.unblock(),A.actions.do_action("component_selection_details_animated",[l]))},component_options_flush_handler:function(t,e){this.is_relocated()&&"reload"===e&&"success"===t.result&&(this.flushing_component_options=!0,l.$component_content.hide(),this.reset_relocated_content(),this.flushing_component_options=!1)},reset_relocated_content:function(){var t=this;this.is_relocated()&&(t.$relocation_origin.after(l.$component_content),A.actions.do_action("component_selection_details_relocation_ended",[l]),t.$relocation_origin.remove(),t.$relocation_target.remove(),t.$relocation_origin=!1,t.$relocation_target=!1,t.$relocation_reference=!1,t.relocated=!1,t.relocating=!1,l.$component_content.removeClass("relocated"))},is_initializing_view_content:function(){return l.initializing_scripts},can_relocate:function(){var t=!1;return t="paged"===A.settings.layout&&l.append_results()&&l.has_options_style("thumbnails")&&"off"!==l.get_relocation_mode()&&(this.is_relocated()||"forced"===l.get_relocation_mode()||"adaptive"===l.get_relocation_mode()&&1<parseInt(l.component_options_model.get("page"),10))?!0:t},is_relocated:function(){return this.relocated},is_relocating:function(){return this.relocating},is_relocating_to_origin:function(){return this.relocating_to_origin},get_new_relocation_data:function(){var t=!1,e=!1,i=l.$component_options.find(".component_option_thumbnail.selected").closest(".component_option_thumbnail_container"),o=i.outerWidth(!0)/l.$component_options.outerWidth(),o=i.hasClass("last")||.6<o?i:i.nextAll(".last").first();return{relocate:t=0===(e=0<o.length?o:l.$component_options.find(".component_option_thumbnail_container").last()).next(".component_option_content_container").length?!0:t,reference:e}}}))(e)}},p.WC_CP_Actions_Dispatcher=function(o){var n=this,s={},a={},c={add_action:function(t,e,i,o){e={callback:e,priority:i,context:o},i=(i=a[t])?(i.push(e),this.sort_actions(i)):[e];a[t]=i},remove_action:function(t,e,i){var o,n,s;if(a[t])if(e)if(o=a[t],i)for(s=o.length;s--;)(n=o[s]).callback===e&&n.context===i&&o.splice(s,1);else for(s=o.length;s--;)o[s].callback===e&&o.splice(s,1);else a[t]=[]},sort_actions:function(t){for(var e,i,o,n=1,s=t.length;n<s;n++){for(e=t[n],i=n;(o=t[i-1])&&o.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t},do_action:function(t,e){var i=a[t];if(!i)return!1;for(var o=0,n=i.length;o<n;o++)i[o].callback.apply(i[o].context,e);return!0}};this.init=function(){o.console_log("debug:events","\nInitializing Actions Dispatcher...");for(var t=0,e=o.get_steps(),i=e.length;t<i;t++)!function(i){i.is_component()&&(i.component_selection_model.on("change:selected_product change:selected_variation change:selected_variation_data",function(t){var e=M.extend(!0,{},t.changed);_.isEqual(e,s[i.step_id])||(s[i.step_id]=e,n.do_action("component_selection_changed",[i,t.changed]))}),i.component_selection_model.on("change:selected_quantity",function(){n.do_action("component_quantity_changed",[i])}),i.component_selection_model.on("change:selected_addons",function(){n.do_action("component_selection_content_changed",[i]),n.do_action("component_addons_changed",[i])}),i.component_selection_model.on("change:selected_nyp",function(){n.do_action("component_nyp_changed",[i]),n.do_action("component_selection_content_changed",[i])}),i.component_options_model.on("change:options_state",function(){n.do_action("component_options_state_changed",[i])}),i.component_options_model.on("change:available_options",function(){n.do_action("available_options_changed",[i])}),o.data_model.on("change:component_"+i.step_id+"_totals",function(){n.do_action("component_totals_changed",[i])}),i.$el.on("woocommerce-composited-product-update",function(){n.do_action("component_selection_changed",[i])})),i.step_access_model.on("change:is_locked",function(){n.do_action("step_access_changed",[i])}),i.step_visibility_model.on("change:is_visible",function(){n.do_action("step_visibility_changed",[i])}),i.step_validation_model.on("change:composite_messages",function(){n.do_action("component_validation_message_changed",[i])}),i.step_validation_model.on("change:passes_validation",function(){n.do_action("component_validation_status_changed",[i])}),i.step_validation_model.on("change:is_in_stock",function(){n.do_action("component_availability_changed",[i])})}(e[t]);n.add_action("show_step",function(t){n.do_action("show_step_"+t.step_id)},0,this),n.add_action("active_step_changed",function(t){n.do_action("active_step_changed_"+t.step_id)},0,this),n.add_action("active_step_transition_start",function(t){n.do_action("active_step_transition_start_"+t.step_id)},0,this),n.add_action("active_step_transition_end",function(t){n.do_action("active_step_transition_end_"+t.step_id)},0,this),n.add_action("component_options_state_changed",function(t){n.do_action("component_options_state_changed_"+t.step_id)},0,this),n.add_action("available_options_changed",function(t){n.do_action("available_options_changed_"+t.step_id)},0,this),n.add_action("component_selection_details_updated",function(t){n.do_action("component_selection_details_updated_"+t.step_id)},0,this),n.add_action("component_options_loaded",function(t){n.do_action("component_options_loaded_"+t.step_id),t.$el.trigger("wc-composite-component-options-loaded",[t,o])},0,this),n.add_action("component_scripts_initialized",function(t){n.do_action("component_scripts_initialized_"+t.step_id),t.$el.trigger("wc-composite-component-loaded",[t,o])},0,this),n.add_action("component_scripts_reset",function(t){n.do_action("component_scripts_reset_"+t.step_id),t.$el.trigger("wc-composite-component-unloaded",[t,o])},0,this),o.scenarios.on("active_scenarios_changed",function(t){n.do_action("active_scenarios_changed",[t])}),o.scenarios.on("active_scenarios_updated",function(t){n.do_action("active_scenarios_updated",[t])}),o.scenarios.on("hidden_components_changed",function(t){n.do_action("hidden_components_changed",[t])}),o.data_model.on("change:totals",function(){n.do_action("composite_totals_changed")}),o.data_model.on("change:passes_validation",function(){n.do_action("composite_validation_status_changed")}),o.data_model.on("change:validation_messages",function(){n.do_action("composite_validation_message_changed")}),o.data_model.on("change:is_in_stock",function(){n.do_action("composite_availability_status_changed")}),o.data_model.on("change:stock_statuses",function(){n.do_action("composite_availability_message_changed")})},this.add_action=function(t,e,i,o){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),c.add_action(t,e,i,o)),n},this.do_action=function(t,e){return"string"==typeof t&&c.do_action(t,e),n},this.remove_action=function(t,e){return"string"==typeof t&&c.remove_action(t,e),n}},p.WC_CP_Filters_Manager=function(){var n=this,_={},s={add_filter:function(t,e,i,o){e={callback:e,priority:i,context:o},i=(i=_[t])?(i.push(e),this.sort_filters(i)):[e];_[t]=i},remove_filter:function(t,e,i){var o,n,s;if(_[t])if(e)if(o=_[t],i)for(s=o.length;s--;)(n=o[s]).callback===e&&n.context===i&&o.splice(s,1);else for(s=o.length;s--;)o[s].callback===e&&o.splice(s,1);else _[t]=[]},sort_filters:function(t){for(var e,i,o,n=1,s=t.length;n<s;n++){for(e=t[n],i=n;(o=t[i-1])&&o.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t},apply_filters:function(t,e){var i=_[t];if(i)for(var o=0,n=i.length;o<n;o++)e[0]=i[o].callback.apply(i[o].context,e);return e[0]}};this.add_filter=function(t,e,i,o){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),s.add_filter(t,e,i,o)),n},this.apply_filters=function(t,e){if("string"==typeof t)return s.apply_filters(t,e)},this.remove_filter=function(t,e){return"string"==typeof t&&s.remove_filter(t,e),n}},p.WC_CP_Scenarios_Manager=function(S){var T=this,V={scenario_data:S.$composite_data.data("scenario_data"),active_scenarios:{},hidden_components:[]};_.extend(T,o.Events),this.init=function(){for(var t,e=this.get_scenario_actions(),i=e.length-1;0<=i;i--)t=e[i],this.is_scenario_action_managed(t)&&(V.active_scenarios[t]=[]);S.actions.add_action("available_options_changed",this.available_options_changed_handler,-10,this),S.actions.add_action("component_selection_changed",this.selection_changed_handler,10,this),S.console_log("debug:events","\nInitializing Scenarios Manager..."),S.debug_indent_incr(),T.update_active_scenarios(_.first(S.steps),!1,!1),S.debug_indent_decr(),S.console_log("debug:events","\nScenarios Manager initialized.\n")},this.get_scenarios_by_type=function(t){return this.filter_scenarios_by_type(this.get_scenario_data().scenarios,t)},this.get_scenario_actions=function(){return _.keys(V.scenario_data.action_settings)},this.get_scenario_action_settings=function(t){return V.scenario_data.action_settings[t]||[]},this.is_scenario_action_managed=function(t){return"yes"===T.get_scenario_action_settings(t).is_managed},this.is_scenario_action_calculation=function(t,e){return _.includes(T.get_scenario_action_settings(t).calculation,e)},this.get_active_scenarios=function(){return V.active_scenarios},this.get_active_scenarios_by_type=function(t){return V.active_scenarios[t]||[]},this.get_scenario_data=function(){return V.scenario_data},this.set_scenario_data=function(t,e){!1===(e=e||!1)?V.scenario_data=t:V.scenario_data.scenario_data[e]=t},this.merge_scenario_data=function(t,e){if(!1===(e=e||!1)){for(var i in t)if(t.hasOwnProperty(i))for(var o in t[i])t[i].hasOwnProperty(o)&&(V.scenario_data.scenario_data[i][o]=t[i][o])}else for(var n in t)t.hasOwnProperty(n)&&(V.scenario_data.scenario_data[e][n]=t[n])},this.set_conditional_options_scenario_data=function(t,e){V.scenario_data.conditional_options_data[e]=t},this.merge_conditional_options_scenario_data=function(t,e){for(var i in t)t.hasOwnProperty(i)&&(V.scenario_data.conditional_options_data[e][i]=t[i])},this.selection_changed_handler=function(t){S.console_log("debug:scenarios",'\nUpdating active scenarios in response to "'+t.get_title()+'" selection state change...'),S.debug_indent_incr(),this.update_active_scenarios(t),S.debug_indent_decr()},this.available_options_changed_handler=function(t){S.console_log("debug:scenarios",'\nUpdating active scenarios in response to "'+t.get_title()+'" options state change...'),S.debug_indent_incr(),this.update_active_scenarios(t),S.debug_indent_decr()},this.update_active_scenarios=function(t){var e,i=V.active_scenarios,o=V.hidden_components,n={},s=[],a=this.get_scenario_actions();n.conditional_components=this.calculate_active_scenarios("conditional_components"),o.length!==V.hidden_components.length||o.length!==_.intersection(o,V.hidden_components).length?(S.console_log("debug:scenarios","\nHidden components changed: - ["+o+"]=> ["+V.hidden_components+"]"),s.push("conditional_components"),this.trigger("hidden_components_changed",t)):S.console_log("debug:scenarios","\nHidden components unchanged.");for(var c=0;c<a.length;c++)"conditional_components"!==(e=a[c])&&this.is_scenario_action_managed(e)&&(n[e]=this.calculate_active_scenarios(e),i[e].length===n[e].length&&i[e].length===_.intersection(i[e],n[e]).length||s.push(e));if(s.length){V.active_scenarios=n;for(var r=s.length-1;0<=r;r--)S.console_log("debug:scenarios",'\nActive "'+(e=s[r])+'" scenarios changed: - ['+i[e]+"]=> ["+n[e]+"]");this.trigger("active_scenarios_changed",t,s)}else S.console_log("debug:scenarios","\nActive scenarios unchanged.");this.trigger("active_scenarios_updated",t)},this.calculate_active_scenarios=function(t,e,i,o){var n=!!e&&e.step_index,s=T.get_scenarios_by_type(t);if("compat_group"===t&&0===s.length&&s.push("0"),0===s.length)return[];e&&e.is_review()&&(n=1e3);var a=this.is_scenario_action_calculation(t,"preemptive"),c=this.is_scenario_action_calculation(t,"masked"),r=this.is_scenario_action_calculation(t,"strict"),d=this.is_scenario_action_calculation(t,"skip_invalid"),l=a?s:[],p=[],m=[];S.console_log("debug:scenarios",'\nCalculating active "'+t+'" Scenarios...\n');for(var u=0,h=S.get_components(),g=h.length;u<g;u++){var v=h[u];if(0<v.step_index)if("conditional_components"===t){var f,b=!0,w=l,y=(c&&p.length&&(S.console_log("debug:scenarios",'Removing "conditional_component" scenarios where all scenario shaping components ('+p+") are masked..."),w=T.filter_unmatched_scenarios(w,p)),r&&(S.console_log("debug:scenarios",'Removing "conditional_component" scenarios with conditions that are partially matched...'),w=T.clean_partially_matched_scenarios(w,p)),S.console_log("debug:scenarios",'Removing "conditional_component" scenarios that contain hidden components which require a selection in order to be matched...'),w=T.clean_hidden_component_scenarios(w,m),S.console_log("debug:scenarios",'Calculating "'+v.get_title()+'" visibility...'),S.debug_indent_incr(),S.console_log("debug:scenarios",'Active "Hide Components" Scenarios: ['+w+"]"),T.get_scenario_data().scenario_settings.conditional_components);if(0<w.length&&void 0!==y)for(var $ in y)y.hasOwnProperty($)&&(f=y[$],_.includes(w,$.toString()))&&_.includes(f,v.component_id.toString())&&(b=!1);if(b?S.console_log("debug:scenarios","Component is visible."):(m.push(v.component_id.toString()),S.console_log("debug:scenarios","Component is hidden.")),S.debug_indent_decr(),!b)continue}else if(!v.is_visible())continue;if(!e||!o||parseInt(v.step_index,10)!==parseInt(n,10)){if(e&&i&&v.step_index>n)break;var x=v.get_selected_product(!1),k=v.get_selected_product_type(),C="variable"===k?v.get_selected_variation(!1):"";if(""===x){if(!v.maybe_is_optional()&&d)continue;x="0"}if(null!==x&&0<=x){var z=T.get_scenario_data().scenario_data[v.component_id],q=[];if("variable"===k){if(a||C)q=x in z?T.filter_scenarios_by_type(z[x],t):[];else if(!C&&!(q=x+"_empty"in z?T.filter_scenarios_by_type(z[x+"_empty"],t):[]).length){S.console_log("debug:scenarios","Selection #"+x+' of "'+v.get_title()+'" not contributing to the active "'+t+'" Scenarios.');continue}}else q=x in z?T.filter_scenarios_by_type(z[x],t):[];S.console_log("debug:scenarios","Selection #"+x+' of "'+v.get_title()+'" in Scenarios: ['+q+"]");x=a||0!==p.length?_.intersection(l,q):q;"variable"===k&&0<C&&0<x.length&&(q=C in z?T.filter_scenarios_by_type(z[C],t):[],S.console_log("debug:scenarios","Variation selection #"+C+' of "'+v.get_title()+'" in Scenarios: ['+q+"]"),x=_.intersection(x,q)),(!d||0<x.length)&&(p.push(v.component_id),S.console_log("debug:scenarios","Active Scenarios: ["+x+"]"),l=x)}}}return"conditional_components"===t&&(V.hidden_components=m),c&&p.length&&(S.console_log("debug:scenarios","Removing scenarios where all scenario shaping components ("+p+") are masked..."),l=T.filter_unmatched_scenarios(l,p)),r&&(S.console_log("debug:scenarios","Removing scenarios that contain any non-shaping + non-masked components..."),l=T.clean_partially_matched_scenarios(l,p)),S.console_log("debug:scenarios","Calculated scenarios: ["+l+"]\n"),l},this.filter_unmatched_scenarios=function(t,e){var i=this.get_scenario_data().scenario_settings.masked_components,o=t.length,n=[];if(0<e.length){if(0<o)for(var s=0;s<o;s++){for(var _=t[s],a=!0,c=0,r=e.length;c<r;c++){var d=e[c];if(-1==M.inArray(d.toString(),i[_])){a=!1;break}}a||n.push(_)}}else n=t;return n=0===n.length&&0<o?t:n},this.filter_scenarios_by_type=function(t,e){var i,o=[],n=t.length;if(0<n)for(var s=0;s<n;s++)("0"===(i=t[s])&&"compat_group"===e||"all"===e||-1<M.inArray(e,this.get_scenario_data().scenario_settings.scenario_actions[i]))&&o.push(i);return o},this.clean_masked_component_scenarios=function(t,e){var i,o=this.get_scenario_data().scenario_settings.masked_components,n=t.length,s=[];if(0<n)for(var _=0;_<n;_++)i=t[_],-1==M.inArray(e.toString(),o[i])&&s.push(i);return s},this.get_masked_component_scenarios=function(t,e){var i,o=this.get_scenario_data().scenario_settings.masked_components,n=t.length,s=[];if(0<n)for(var _=0;_<n;_++)i=t[_],-1<M.inArray(e.toString(),o[i])&&s.push(i);return s},this.get_unmasked_component_scenarios=function(t,e){var i,o=this.get_scenario_data().scenario_settings.masked_components,n=t.length,s=[];if(0<n)for(var _=0;_<n;_++)i=t[_],-1===M.inArray(e.toString(),o[i])&&s.push(i);return s},this.get_unmatched_component_scenarios=function(t,e){var i,o=this.get_scenario_data().scenario_settings.masked_components,n=this.get_scenario_data().scenario_settings.any_components,s=t.length,_=[];if(0<s)for(var a=0;a<s;a++)i=t[a],-1===M.inArray(e.toString(),o[i])&&-1===M.inArray(e.toString(),n[i])&&_.push(i);return _},this.clean_partially_matched_scenarios=function(t,e){for(var i=_.difference(_.pluck(S.get_components(),"component_id"),e),o=0,n=i.length;o<n;o++)t=_.difference(t,this.get_unmatched_component_scenarios(t,i[o]));return t},this.clean_hidden_component_scenarios=function(t,e){for(var i=0,o=e.length;i<o;i++)t=_.difference(t,this.get_unmasked_component_scenarios(t,e[i]));return t},this.is_component_hidden=function(t){return _.includes(V.hidden_components,t.toString())},this.get_hidden_components=function(){return V.hidden_components}},p.WC_CP_Step_Factory=function(){function o(t,e,i){this.composite=t,this.$step=e,this.step_index=i,this.init_step()}o.prototype.init_step=function(){this.step_id=this.$step.data("item_id"),this.step_title=this.$step.data("nav_title"),this.step_slug=this.composite.settings.slugs[this.step_id],this._component_messages=[],this._composite_messages=[],this._is_component=this.$step.hasClass("component"),this._is_review=this.$step.hasClass("cart"),this._is_current=this.$step.hasClass("active"),this._is_previous=this.$step.hasClass("prev"),this._is_next=this.$step.hasClass("next"),this._is_last=this.$step.hasClass("last"),this._toggled=this.$step.hasClass("toggled"),this._autotransition=this.$step.hasClass("autotransition"),this._autoselect_attributes=this.$step.hasClass("autoselect_attributes"),this.$el=this.$step,this.$inner_el=this.$step.find(".component_inner"),this.$step_title=this.$step.find(".step_title_wrapper"),this.$step_title_aria=this.$step_title.find(".aria_title"),this.$step_title_button=this.$step_title.find(".component_title_button"),this.composite.actions.add_action("step_visibility_changed",this.step_visibility_changed_handler,10,this)},o.prototype.step_visibility_changed_handler=function(){var t=this.composite;if("paged"!==t.settings.layout&&(!1===this.is_visible()?t.is_initialized?this.$el.slideUp(200):this.$el.hide():this.$el.slideDown(200)),!t.is_initialized)return!1;this.is_current()&&t.set_current_step(t.get_current_step())},o.prototype.maybe_autotransition=function(){return this._autotransition&&"single"!==this.composite.settings.layout},o.prototype.can_autotransition=function(){return this.maybe_autotransition()&&this.passes_validation()&&this.is_in_stock(!1)&&0<this.get_selected_product()&&"invalid-product"!==this.get_selected_product_type()&&!1===this.is_selected_product_configurable()&&("progressive"!==this.composite.settings.layout||!this.is_last())},o.prototype.autoselect_attributes=function(){return this._autoselect_attributes},o.prototype.is_animating=function(){return this.$el.hasClass("animating")},o.prototype.has_toggle=function(){return this._toggled},o.prototype.is_locked=function(){var t=this.step_access_model.get("is_locked");return this.composite.filters.apply_filters("step_is_locked",[t,this])},o.prototype.is_visible=function(){return this.step_visibility_model.get("is_visible")},o.prototype.lock=function(){this.step_access_model.set({locked:!0})},o.prototype.unlock=function(){this.step_access_model.set({locked:!1})},o.prototype.get_title_index=function(){var e=this,t=this.composite,t=_.filter(t.get_steps(),function(t){if(!1===t.step_visibility_model.get("is_visible")&&t.step_index<e.step_index)return t}).length;return this.step_index+1-t},o.prototype.get_title=function(){return this.step_title},o.prototype.get_slug=function(){return this.step_slug},o.prototype.get_route=function(){return"#"+this.step_slug},o.prototype.get_element=function(){return this.$el},o.prototype.is_review=function(){return this._is_review},o.prototype.is_component=function(){return this._is_component},o.prototype.get_component=function(){return!!this._is_component&&this},o.prototype.is_current=function(){return this._is_current},o.prototype.is_next=function(){return this._is_next},o.prototype.is_previous=function(){return this._is_previous},o.prototype.is_last=function(){return this._is_last},o.prototype.show_step=function(){if(this.is_locked()||this.is_animating())return!1;var t=this.is_current(),e=this.composite;"single"===e.settings.layout&&e.is_initialized&&this.toggle_step("open",!0),t&&e.is_initialized||this.set_active(),e.actions.do_action("show_step",[this])},o.prototype.get_step_transition_duration=function(t){var e=0;return"opacity"===t?e=200:"height"===t?e=150:"toggle"===t&&(e=300),this.composite.filters.apply_filters("component_step_transition_animation_duration",[e,t,this])},o.prototype.set_active=function(){var i,o=this,n=this.composite,t=n.settings.layout,e=n.get_current_step(),s=e.$el,_=o.$el,a=0;n.set_current_step(o),n.actions.do_action("active_step_transition",[this]),e.step_id!==o.step_id?"paged"===t?(n.$composite_form_blocker.addClass("blocked"),n.has_transition_lock=!0,setTimeout(function(){var t=o.get_step_transition_duration("opacity")-10,e=o.get_step_transition_duration("height")-10;s.css({transition:"opacity "+t/1e3+"s","-webkit-transition":"opacity "+t/1e3+"s"}),setTimeout(function(){s.addClass("faded"),_.addClass("faded invisible")},1),setTimeout(function(){void 0===(a=s.get(0).getBoundingClientRect().height)&&(a=s.outerHeight()),s.addClass("invisible"),s.css({height:a+"px",overflow:"hidden",transition:"height "+e/1e3+"s ease-in-out","-webkit-transition":"height "+e/1e3+"s ease-in-out"}),_.css({height:"0px",overflow:"hidden",transition:"height "+e/1e3+"s ease-in-out","-webkit-transition":"height "+e/1e3+"s ease-in-out"}).show(),n.actions.do_action("active_step_transition_start",[o]),n.console_log("debug:animations","Starting transition..."),setTimeout(function(){i=_.get(0).scrollHeight,s.css({height:"0px"}),_.css({height:i+"px"})},1),setTimeout(function(){s.hide(),s.removeClass("faded invisible"),s.css({height:"",overflow:"",transition:"","-webkit-transition":""}),_.css({height:"",overflow:"",transition:"opacity "+t/1e3+"s","-webkit-transition":"opacity "+t/1e3+"s"}),setTimeout(function(){n.console_log("debug:animations","Transition ended."),n.actions.do_action("active_step_transition_end",[o]),_.css({transition:"","-webkit-transition":""}),"yes"===wc_composite_params.accessible_focus_enabled&&o.$step_title_aria&&o.$step_title_aria.trigger("focus")},10+t),setTimeout(function(){_.removeClass("faded invisible")},1),n.has_transition_lock=!1,n.$composite_form_blocker.removeClass("blocked")},10+e)},10+t)},5)):("progressive"===t&&o.update_block_state(),n.has_transition_lock=!0,setTimeout(function(){n.actions.do_action("active_step_transition_start",[o])},5),setTimeout(function(){n.actions.do_action("active_step_transition_end",[o]),n.has_transition_lock=!1},o.get_step_transition_duration("toggle")+50)):o.$el.show(),n.actions.do_action("active_step_changed",[this])},o.prototype.update_block_state=function(){if("progressive"!==this.composite.settings.layout)return!1;for(var t=0,e=this.composite.get_steps(),i=e.length;t<i;t++)e[t].step_index<this.step_index&&(e[t].block_step_inputs(),e[t].$el.hasClass("block-open")||e[t].toggle_step("closed",!0));this.unblock_step_inputs(),this.unblock_step(),this.block_next_steps()},o.prototype.unblock_step=function(){this.toggle_step("open",!0),this.$el.removeClass("blocked")},o.prototype.block_next_steps=function(){for(var t=this.step_index,e=0,i=this.composite.get_steps(),o=i.length;e<o;e++)t<e&&(i[e].$el.hasClass("disabled")&&i[e].unblock_step_inputs(),i[e].block_step())},o.prototype.block_step=function(){this.$el.addClass("blocked"),this.toggle_step("closed",!1)},o.prototype.toggle_step=function(t,e,i){this.has_toggle()&&("open"===t?this.$el.hasClass("closed")&&wc_cp_toggle_element(this.$el,this.$inner_el,i,this.get_step_transition_duration("toggle")):"closed"===t&&this.$el.hasClass("open")&&wc_cp_toggle_element(this.$el,this.$inner_el,i,this.get_step_transition_duration("toggle")),e?(this.$step_title.removeClass("inactive"),this.$step_title_button.removeAttr("aria-disabled")):(this.$step_title.addClass("inactive"),this.$step_title_button.attr("aria-disabled","true")))},o.prototype.unblock_step_inputs=function(){this.$el.removeClass("disabled"),this.$el.find(".clear_component_options").html(wc_composite_params.i18n_clear_selection).removeClass("reset_component_options")},o.prototype.block_step_inputs=function(){this.$el.addClass("disabled"),this.has_toggle()&&!this.$el.hasClass("block-open")||this.$el.find(".clear_component_options").html(wc_composite_params.i18n_reset_selection).addClass("reset_component_options")},o.prototype.is_blocked=function(){return this.$el.hasClass("blocked")},o.prototype.has_blocked_inputs=function(){return this.$el.hasClass("disabled")},o.prototype.add_validation_message=function(t,e){("composite"===(e=void 0===e?"component":e)?this._composite_messages:this._component_messages).push(t.toString())},o.prototype.get_validation_messages=function(t){var e="composite"===(t=void 0===t?"component":t)?this._composite_messages:this._component_messages;return this.composite.filters.apply_filters("step_validation_messages",[e,t,this])},o.prototype.validate=function(){var t,e,i=!0,o=!0;this._component_messages=[],this._composite_messages=[],this.is_component()&&(t=this.get_selected_product(),e=this.get_selected_product_type(),(i=this.has_valid_selections())||(0<t?"invalid-product"===e?this.add_validation_message(wc_composite_params.i18n_item_unavailable_text,"composite"):("variable"===e&&(this.is_selected_variation_valid()?""===this.component_selection_model.get("selected_variation")&&(this.add_validation_message(wc_composite_params.i18n_select_product_options),this.add_validation_message(wc_composite_params.i18n_select_product_options_for,"composite")):(this.add_validation_message(wc_composite_params.i18n_selected_product_options_invalid),this.add_validation_message(wc_composite_params.i18n_selected_product_options_invalid,"composite"))),this.has_valid_quantity()||(this.add_validation_message(wc_composite_params.i18n_select_product_quantity),this.add_validation_message(wc_composite_params.i18n_select_product_quantity_for,"composite")),this.is_nyp()&&!this.is_valid_nyp()&&(this.add_validation_message(wc_composite_params.i18n_enter_valid_price),this.add_validation_message(wc_composite_params.i18n_enter_valid_price_for,"composite")),this.has_pending_required_addons()?(this.add_validation_message(wc_composite_params.i18n_select_product_addons),this.add_validation_message(wc_composite_params.i18n_select_product_addons_for,"composite")):this.has_valid_addons()||(this.add_validation_message(wc_composite_params.i18n_review_product_addons),this.add_validation_message(wc_composite_params.i18n_review_product_addons_for,"composite"))):this.is_selected_product_valid()?(this.add_validation_message(wc_composite_params.i18n_select_component_option),this.add_validation_message(wc_composite_params.i18n_select_component_option_for,"composite")):(this.add_validation_message(wc_composite_params.i18n_selected_product_invalid),this.add_validation_message(wc_composite_params.i18n_selected_product_invalid,"composite"))),this.is_in_stock()||(o=!1)),i=this.composite.filters.apply_filters("step_is_valid",[i,this]),this.composite.actions.do_action("validate_step",[this,i]),this.step_validation_model.update(i,o)},o.prototype.passes_validation=function(){return this.step_validation_model.get("passes_validation")};function n(t,e,i){o.call(this,t,e,i),this.init_component()}function t(){}t.prototype=o.prototype,((n.prototype=new t).constructor=n).prototype.init_component=function(){this.initializing_scripts=!1,this.component_index=this.step_index,this.component_id=this.$step.attr("data-item_id"),this.component_title=this.$step.data("nav_title"),this._hide_disabled_products=this.$step.hasClass("hide-incompatible-products"),this._hide_disabled_variations=this.$step.hasClass("hide-incompatible-variations"),this._is_static=this.$step.hasClass("static"),this._is_lazy_loaded=this.$step.hasClass("lazy-load"),this.$component_summary=this.$step.find(".component_summary"),this.$component_summary_content=this.$step.find(".component_summary > .content"),this.$component_selections=this.$step.find(".component_selections"),this.$component_content=this.$step.find(".component_content"),this.$component_options=this.$step.find(".component_options"),this.$component_filters=this.$step.find(".component_filters"),this.$component_ordering=this.$step.find(".component_ordering select"),this.$component_options_inner=this.$step.find(".component_options_inner"),this.$component_inner=this.$step.find(".component_inner"),this.$component_pagination=this.$step.find(".component_pagination"),this.$component_message=this.$step.find(".component_message"),this.$component_quantity=this.$component_summary_content.find(".component_wrap input.qty"),this.$component_options_select=this.$component_options.find("select.component_options_select"),this.$component_thumbnail_options=this.$component_options.find(".component_option_thumbnails"),this.$component_radio_button_options=this.$component_options.find(".component_option_radio_buttons"),this.$component_content_scroll_target=this.$step.find(".scroll_show_component_details"),this.component_addons_totals_html="",this.$component_addons_totals=!1,this.$component_selection_gallery=!1,this.$component_variations_reset_wrapper=!1,this.show_addons_totals=!1,this.has_wc_core_gallery_class=!1,0===this.$component_content_scroll_target.length&&(this.$component_content_scroll_target=this.$component_content)},n.prototype.is_lazy_loaded=function(){return this._is_lazy_loaded},n.prototype.set_lazy_loaded=function(t){this._is_lazy_loaded=t},n.prototype.append_results=function(){return"yes"===this.composite.settings.pagination_data[this.step_id].append_results},n.prototype.get_results_per_page=function(){return this.composite.settings.pagination_data[this.step_id].results_per_page},n.prototype.get_max_results=function(){return this.composite.settings.pagination_data[this.step_id].max_results},n.prototype.get_pagination_range=function(t){return this.composite.settings.pagination_data[this.step_id]["end"===(t=void 0===t?"mid":t)?"pagination_range_end":"pagination_range"]},n.prototype.get_relocation_mode=function(){return this.composite.settings.pagination_data[this.step_id].relocation_mode},n.prototype.get_selected_product=function(t,e){return void 0===e&&(e=!1),(t=void 0===t?!0:t)&&!this.is_selected_product_valid()||e&&!this.is_visible()?null:this.component_selection_model.get("selected_product")},n.prototype.get_selected_variation=function(t){return(t=void 0===t?!0:t)&&!this.is_selected_variation_valid()?null:this.component_selection_model.get("selected_variation")},n.prototype.get_selected_quantity=function(){return!1===this.is_visible()?0:this.component_selection_model.get("selected_quantity")},n.prototype.get_selected_product_type=function(){return this.component_selection_model.get_type()},n.prototype.get_selected_product_title=function(t,e){if(t=void 0!==t&&t,(e=void 0!==e&&e)&&!this.is_selected_product_valid())return"";var i,o=this.get_selected_product(!1),e=this.get_selected_quantity(),n="",s="",_="";if(""===o)n=wc_composite_params.i18n_no_selection;else if(""!==o&&0<this.component_options_model.available_options_data.length)for(var a=0,c=this.component_options_model.available_options_data,r=c.length;a<r;a++)if(c[a].option_id===o){n=c[a].option_title;break}return(n=this.composite.filters.apply_filters("component_selection_title",[n,this]))&&t&&(s=""===o?'<span class="content_product_title none">'+n+"</span>":(i=1<e?"<strong>"+wc_composite_params.i18n_qty_string.replace("%s",e)+"</strong>":"",s=wc_composite_params.i18n_title_string.replace("%t",n).replace("%q",i).replace("%p",""),'<span class="content_product_title">'+(s=(_=this.get_selected_product_meta(!0))?wc_composite_params.i18n_selected_product_string.replace("%t",s).replace("%m",_):s)+"</span>"),s=this.composite.filters.apply_filters("component_selection_formatted_title",[s,n,e,_,this])),t?s:n},n.prototype.get_selected_product_meta=function(t){t=void 0!==t&&t;var e="",i=[...this.component_selection_model.get_meta_data()],i=this.composite.filters.apply_filters("component_selection_meta",[i,this]),o=JSON.parse(this.component_selection_view.model.attributes.selected_addons);if(o&&0!==o.length&&(formatted_contents="",o.forEach(function(t){formatted_contents=formatted_contents+'<span class="summary_element_addon summary_element_data">'+t.name+"</span>"}),i.push({meta_key:wc_composite_params.i18n_summary_add_ons_prompt,meta_value:formatted_contents})),0<i.length&&t){for(var e='<ul class="content_product_meta">',n=0,s=i.length;n<s;n++)e=e+'<li class="meta_element"><span class="meta_key">'+i[n].meta_key+':</span> <span class="meta_value">'+i[n].meta_value+"</span>",n!==s-1&&(e+='<span class="meta_element_sep">, </span>'),e+="</li>";e=this.composite.filters.apply_filters("component_selection_formatted_meta",[e+="</ul>",i,this])}return t?e:i},n.prototype.get_selected_product_image_data=function(t){var e;return!((t=void 0===t||t)&&!this.is_selected_product_valid())&&(e=0<this.get_selected_variation(t)&&this.component_selection_model.get_variation_image_data(),0<this.get_selected_variation(t)&&e?e:this.component_selection_model.get_product_image_data())},n.prototype.is_selected_product_configurable=function(){var t=this.component_options_model.get_option_data(this.get_selected_product());return!(!t||!t.is_configurable)},n.prototype.is_selected_product_valid=function(t){return void 0===t&&(t=this.component_options_model.get("options_state").active),""===this.component_selection_model.get("selected_product")||_.includes(t,this.component_selection_model.get("selected_product"))},n.prototype.is_selected_variation_valid=function(t){return void 0===t&&(t=this.component_options_model.get("options_state").active),""===this.component_selection_model.get("selected_variation")||_.includes(t,this.component_selection_model.get("selected_variation"))},n.prototype.has_valid_selections=function(t){var e=this.get_selected_product(t=void 0===t||t),i=this.get_selected_variation(t),o=this.get_selected_product_type(),n=!1;return this.is_visible()?""===e?(this.is_optional()||!1===t&&this.maybe_is_optional())&&(n=!0):0<e&&"invalid-product"!==o&&("variable"===o?(i||0===this.get_selected_quantity()&&this.composite.is_initialized)&&(n=!0):"simple"!==o&&"bundle"!==o&&"none"!==o&&0!==this.get_selected_quantity()||(n=!0)):n=!0,(n=(n=n&&this.is_visible()?this.has_valid_quantity():n)&&this.is_visible()&&this.is_nyp()?this.is_valid_nyp():n)&&this.is_visible()&&this.has_addons()&&(n=this.has_valid_addons()),this.composite.filters.apply_filters("component_is_valid",[n,t,this])},n.prototype.has_valid_quantity=function(){var t=this.$component_summary_content.find(".component_wrap input.qty"),e=!0;return 0<t.length&&t.each(function(){e&&!this.checkValidity()&&""!==this.value&&(this.reportValidity(),e=!1)}),e},n.prototype.has_valid_addons=function(){var t=!0,e=this.component_selection_model.get_addons_form();return t=e&&e.$addons?e.validation.validate():t},n.prototype.has_pending_required_addons=function(){var t=!1,e=this.component_selection_model.get_addons_form();return e&&e.$addons&&(e=e.validation.getValidationState(),M.each(e,function(){if(!this.validation&&"required"===this.reason)return!(t=!0)})),t},n.prototype.hide_disabled_products=function(){return this.composite.filters.apply_filters("component_hide_disabled_products",[this._hide_disabled_products,this])},n.prototype.hide_disabled_variations=function(){return this.composite.filters.apply_filters("component_hide_disabled_variations",[this._hide_disabled_variations,this])},n.prototype.find_pagination_param=function(t){var e=this.$component_pagination.first().data("pagination_data"),i=1;return e&&("page"===t?i=e.page:"pages"===t&&(i=e.pages)),i},n.prototype.find_order_by=function(){var t="";return t=0<this.$component_ordering.length?this.$component_ordering.val():t},n.prototype.find_active_filters=function(){var t=this.$component_filters,o={};return 0!=t.length&&t.find(".component_filter_option.selected").each(function(){var t=M(this).closest(".component_filter").data("filter_type"),e=M(this).closest(".component_filter").data("filter_id"),i=M(this).data("option_id");t in o?e in o[t]||(o[t][e]=[]):(o[t]={},o[t][e]=[]),o[t][e].push(i)}),o},n.prototype.find_options_data=function(){return this.$component_options.data("options_data")},n.prototype.is_in_stock=function(t){var e=!0;return e=(!(t=void 0===t||t)||0<this.get_selected_quantity())&&"out-of-stock"===this.component_selection_model.get_stock_status()&&("variable"!==this.get_selected_product_type()||0<this.get_selected_variation(!1))?!1:e},n.prototype.get_availability_text_for_summary=function(){return this.component_selection_model.get_availability_text_for_summary()},n.prototype.is_nyp=function(){var t=this.component_options_model.get_option_data(this.get_selected_product());return!(!t||!t.is_nyp)},n.prototype.is_valid_nyp=function(){var t,e=this.$component_summary_content.find(".nyp");return!(t=e&&M.fn.wc_nyp_get_script_object?e.wc_nyp_get_script_object():t)||t.isValid()},n.prototype.has_options_style=function(t){return this.$el.hasClass("options-style-"+t)},n.prototype.get_bundle_script=function(){var t=!1;return t=void 0!==wc_pb_bundle_scripts[this.component_id]?wc_pb_bundle_scripts[this.component_id]:t},n.prototype.has_addons=function(){var t=this.component_options_model.get_option_data(this.get_selected_product());return!(!t||!t.has_addons)},n.prototype.init_scripts=function(t){var e,i,o,n;void 0===t&&(t=!0),this.$component_quantity=this.$component_summary_content.find(".component_wrap input.qty"),this.$component_selection_gallery=!1,this.has_wc_core_gallery_class=!1,this.component_addons_totals_html="",this.$component_addons_totals=!1,this.show_addons_totals=!1,t&&(this.initializing_scripts=!0,this.init_qty_input(),t=this.get_selected_product_type(),e=this.$component_summary_content,this.$component_selection_gallery=this.$component_summary_content.find(".composited_product_images"),this.$component_selection_gallery&&(this.has_wc_core_gallery_class=this.$component_selection_gallery.hasClass("images")),this.has_addons()?(this.$component_addons_totals="bundle"===t?e.find(".bundle_data #product-addons-total"):e.find("#product-addons-total"),1==this.$component_addons_totals.data("show-sub-total")&&(this.$component_addons_totals.data("show-sub-total",0),this.show_addons_totals="bundle"!==t)):this.$component_addons_totals=!1,"variable"===t?(e.hasClass("cart")||e.addClass("cart"),e.hasClass("variations_form")||e.addClass("variations_form"),this.$component_summary_content.data("product_variations",this.component_selection_model.get_active_variations_data()),0<(i=this.$component_summary_content.find(".variations")).length&&(this.$component_variations_reset_wrapper=i.find(".reset_variations_wrapper"),0===this.$component_variations_reset_wrapper.length&&(this.$component_variations_reset_wrapper=!1),o=this.component_selection_model.get_active_variations_data(),n=wc_cp_get_variation_data(i,!1,!0),0===this.get_matching_variations(o,n).length&&i.find("select").val(""),this.autoselect_attributes())&&this.component_selection_view.autoselect_attributes(),e.wc_variation_form(),e.find(".variations select").last().trigger("change"),e.find("div").stop(!0,!0)):"bundle"===t?(e.hasClass("bundle_form")||e.addClass("bundle_form"),e.find(".bundle_data").wc_pb_bundle_form(),e.find("div").stop(!0,!0)):e.hasClass("cart")||e.addClass("cart"),this.initializing_scripts=!1),this.composite.actions.do_action("component_scripts_initialized",[this])},n.prototype.get_matching_variations=function(t,e){for(var i=[],o=0,n=t.length;o<n;o++){var s=t[o];s.variation_is_active&&this.is_matching_variation(s.attributes,e)&&i.push(s)}return i},n.prototype.is_matching_variation=function(t,e){var i,o,n,s=!0;for(i in t)t.hasOwnProperty(i)&&(o=t[i],n=e[i],void 0!==o)&&void 0!==n&&0!==o.length&&0!==n.length&&o!==n&&(s=!1);return s},n.prototype.reset_scripts=function(){this.$component_summary_content.removeClass("variations_form bundle_form cart"),this.$component_summary_content.off().find("*").off(),this.composite.actions.do_action("component_scripts_reset",[this])},n.prototype.get_step=function(){return this.composite.get_step(this.component_id)},n.prototype.is_static=function(){return this._is_static},n.prototype.is_optional=function(){var t=_.includes(this.component_options_model.get("options_state").active,"");return this.composite.filters.apply_filters("component_is_optional",[t,this])},n.prototype.maybe_is_optional=function(){return"yes"===this.composite.settings.optional_data[this.step_id]},n.prototype.show_placeholder_option=function(){return"yes"===this.composite.settings.show_placeholder_option[this.step_id]},n.prototype.is_selected_product_price_visible=function(){return"yes"===this.composite.settings.selected_product_price_visibility_data[this.step_id]},n.prototype.is_subtotal_visible=function(){return"yes"===this.composite.settings.subtotal_visibility_data[this.step_id]},n.prototype.is_priced_individually=function(){return"yes"===this.composite.data_model.price_data.is_priced_individually[this.component_id]},n.prototype.get_price_display_format=function(){return this.composite.settings.price_display_data[this.step_id].format},n.prototype.get_formatted_option_price_html=function(t){var e,i,o,n,s,_,a,c,r,d,l,p,m=this,u=this.composite,h=m.get_price_display_format(),g=t.option_price_html,v=t.option_price_data;return!m.is_priced_individually()||"relative"!==h||(e=!(h=!1),s=(o="yes"===u.settings.price_display_data[m.step_id].is_relative_to_default)&&t.option_id===m.component_options_view.reference_option,i=m.component_options_view.get_reference_option_data(),n=m.has_valid_selections(!1),o&&!1===i.option_id&&(o=!1),g=(h=(e=!1===n&&!1===o?"yes"!==u.settings.price_display_data[m.step_id].show_absolute_if_invalid:e)&&(s||!1===o&&(!1===n||t.is_selected))?!0:h)?"":(s=u.data_model.calculate_component_subtotals(m,u.data_model.price_data,1),h=o?i.option_price:s.price,i=e?h:0,o=(h=t.is_selected&&e&&o&&n)?s.price:parseFloat(v.price),n=h?s.regular_price:parseFloat(v.regular_price),s=parseFloat(o)-parseFloat(i),a=_=0,h=!1===h&&(o<v.max_price||""===v.max_price),c=1<v.min_qty?wc_composite_params.i18n_per_unit_string:"",l=d=p=r="",p=m.get_formatted_price_html(s,e),m.has_options_style("dropdowns")?(o<n&&(!(r=v.discount?wc_composite_params.i18n_discount_string.replace("%s",wc_cp_number_round(v.discount,1)):r)&&o<n&&(r=wc_composite_params.i18n_discount_string.replace("%s",wc_cp_number_round(100*(n-o)/n,1))),r=u.filters.apply_filters("formatted_option_price_discount_suffix",[r,v,this])),h&&(p=""===v.max_price?wc_composite_params.i18n_price_from_string_plain.replace("%p",p):(a=parseFloat(v.max_price)-parseFloat(i),l=m.get_formatted_price_html(a,e,s),wc_composite_params.i18n_price_range_string_plain.replace("%f",p).replace("%t",l))),p=wc_composite_params.i18n_price_string.replace("%p",p).replace("%q",c).replace("%d",r)):(o<n&&(!h||""===v.max_price)&&(_=parseFloat(n)-parseFloat(i),d=m.get_formatted_price_html(_,e,s),p=wc_composite_params.i18n_strikeout_price_string.replace("%f",d).replace("%t",p)),h&&(p=""===v.max_price?wc_composite_params.i18n_price_from_string.replace("%p",p):(a=parseFloat(v.max_price)-parseFloat(i),l=m.get_formatted_price_html(a,e,s),(!1===e?wc_composite_params.i18n_price_range_string_absolute:wc_composite_params.i18n_price_range_string).replace("%f",p).replace("%t",l)))),p))||(m.has_options_style("thumbnails")?g="&nbsp;":m.has_options_style("radios")&&(g="&mdash;")),u.filters.apply_filters("formatted_option_price_html",[g,t,this])},n.prototype.get_formatted_price_html=function(t,e,i){var o="",n=wc_cp_price_format(Math.abs(t),this.has_options_style("dropdowns"));return i=void 0!==i&&i,o=(o=(e=void 0!==e&&e)?0<t||0==t&&!i||!(t<0)&&0<=i?"+":"-":o)&&this.has_options_style("dropdowns")?o:'<span class="relative-price-prefix">'+o+"</span>",wc_composite_params.i18n_price_signed.replace("%s",o).replace("%p",n)},n.prototype.init_qty_input=function(){"yes"===wc_composite_params.show_quantity_buttons&&this.$component_summary_content.find("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />'),"hidden"===this.$component_quantity.attr("type")&&(this.$component_quantity.attr("min",this.$component_quantity.val()),this.$component_quantity.attr("max",this.$component_quantity.val()));var t=this.composite.is_finalized?this.get_selected_quantity():this.$component_quantity.val();"yes"===this.composite.settings.component_qty_restore&&this.get_selected_product(!1)&&this.$component_quantity.val(t),this.$component_quantity.trigger("change")},n.prototype.get_placeholder_image_data=function(){return void 0!==this.composite.settings.image_data[this.step_id]&&this.composite.settings.image_data[this.step_id]},this.create_component=function(t,e,i){return new n(t,e,i)},this.create_step=function(t,e,i){return e.hasClass("component")?this.create_component(t,e,i):new o(t,e,i)}},p.WC_CP_Async_Task=function(e,i){var o=this,t=!1,n=0,s=function(t){return t};i=i||100,e=e.bind(this),this.is_done=function(){return t},this.get_async_time=function(){return n},this.run=function(t){setTimeout(function(){t=e(t),o.is_done()?s(t):(n+=i,o.run(t))},i)},this.done=function(){t=!0},this.complete=function(t){s=t},this.run()},$wc_cp_document.ready(function(){($wc_cp_body=M(document.body)).on("quick-view-displayed",function(){M(".quick-view .composite_form .composite_data").each(function(){M(this).wc_composite_form()})}),$wc_cp_window.resize(function(){for(var t in wc_cp_composite_scripts)wc_cp_composite_scripts.hasOwnProperty(t)&&(clearTimeout(wc_cp_composite_scripts[t].timers.on_resize_timer),wc_cp_composite_scripts[t].timers.on_resize_timer=setTimeout(function(t){return function(){wc_cp_composite_scripts[t].on_resize_handler()}}(t),50))}),M.fn.wc_composite_form=function(){if(!M(this).hasClass("composite_data"))return!0;var t=M(this).data("container_id"),e=M(this).closest(".composite_form");if(void 0!==wc_cp_composite_scripts[t]){e.find("*").off();for(var i=0,o=wc_cp_composite_scripts[t].get_components(),n=o.length;i<n;i++)o[i].reset_scripts()}wc_cp_composite_scripts[t]=new s({$composite_form:e,$composite_data:M(this)}),e.data("script_id",t),wc_cp_composite_scripts[t].init()},M(".composite_form .composite_data").each(function(){M(this).wc_composite_form()})})}(jQuery,Backbone);