if(typeof Marionette<"u"){var o=window.Marionette.Object.extend({initialize:function(){var e=window.Backbone.Radio.channel("forms");this.listenTo(e,"before:submit",this.beforeSubmit),this.listenTo(window.Backbone.Radio.channel("calc"),"change:field",this.changeCalcField),this.listenTo(window.Backbone.Radio.channel("fields"),"blur:field",this.blurField)},beforeSubmit(e){return e.removeError("gpos"),e.addExtra("extra",{_wp_refreshed_fragments:window.gpos.fragment._wp_refreshed_fragments,_wp_fragment:window.gpos.fragment._wp_fragment,_gpos_nonce:jQuery("input[name='_gpos_nonce']").val(),post_id:window.gpos.post_id}),e},changeCalcField(e){var t;const n=((t=window.gpos.platform_data)==null?void 0:t.nf_forms_total_calc)||!1;n&&e.attributes.name===n&&window.gposDispatchAmount({amount:e.attributes.value,currency:window.gpos.platform_data.currency})},blurField(e,n){var a;const t=((a=window.gpos.platform_data)==null?void 0:a.nf_forms_total_field)||!1;t&&n.attributes.key===t&&window.gposDispatchAmount({amount:n.attributes.value,currency:window.gpos.platform_data.currency})}});new o}
