2023-03-17 22:34:04 +00:00
|
|
|
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=246)}({1:function(e,t){e.exports=jQuery},11:function(e,t,n){var o=n(3).default;e.exports=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},178:function(e,t,n){"use strict";(function(e){var o=n(23),i=n(179),a=n(6),r=wp.Backbone.View.extend({tagName:"tfoot",className:"add-new",template:wp.template("edd-admin-tax-rates-table-add"),events:{"click button":"addTaxRate",keypress:"maybeAddTaxRate","change #tax_rate_country":"setCountry","keyup #tax_rate_region":"setRegion","change #tax_rate_region":"setRegion",'change input[type="checkbox"]':"setGlobal","keyup #tax_rate_amount":"setAmount","change #tax_rate_amount":"setAmount"},initialize:function(){this.model=new o.a({global:!0,unsaved:!0}),this.listenTo(this.model,"change:country",this.updateRegion),this.listenTo(this.model,"change:global",this.updateRegion)},render:function(){return wp.Backbone.View.prototype.render.apply(this,arguments),this.$el.find("select").each((function(){var t=e(this);t.chosen(Object(a.a)(t))})),this},updateRegion:function(){var t=this,n={action:"edd_get_shop_states",country:this.model.get("country"),nonce:eddTaxRates.nonce,field_name:"tax_rate_region"};e.post(ajaxurl,n,(function(e){t.views.set("#tax_rate_region_wrapper",new i.a({states:e,global:t.model.get("global")}))}))},setCountry:function(e){var t=e.target.options[e.target.selectedIndex].value,n=document.getElementById("tax_rate_region_global");"all"===t?(t="*",n.checked=!0,this.model.set("region",""),this.model.set("global",!0),n.readOnly=!0,n.disabled=!0):(n.disabled=!1,n.readOnly=!1),this.model.set("country",t)},setRegion:function(e){var t;t=e.target.value?e.target.value:e.target.options[e.target.selectedIndex].value,this.model.set("region",t)},setGlobal:function(e){var t=e.target.checked;this.model.set("global",t),!0===t&&this.model.set("region","")},setAmount:function(e){this.model.set("amount",e.target.value)},maybeAddTaxRate:function(e){13===e.keyCode&&this.addTaxRate(e)},addTaxRate:function(e){e.preventDefault();var t=eddTaxRates.i18n;if(this.model.get("country")){var n=this.model.get("region"),o=this.model.get("country"),i=""===this.model.get("region");if("*"===o&&(o="",n="",i=!1),this.collection.where({region:n,country:o,global:i,status:"active"}).length>0){var a=(""===o?"*":o)+(""===n?"":": "+n);alert(t.duplicateRate.replace("%s",'"'.concat(a,'"')))}else this.model.get("amount")<0?alert(t.negativeTax):(0==this.model.get("amount")&&confirm(t.emptyTax),this.collection.add(_.extend(this.model.attributes,{id:this.model.cid})),this.render(),this.initialize())}else alert(t.emptyCountry)}});t.a=r}).call(this,n(1))},179:function(e,t,n){"use strict";(function(e){var o=n(6),i=wp.Backbone.View.extend({initialize:function(e){_.extend(this,e)},render:function(){this.global||("nostates"===this.states?this.setElement('<input type="text" id="tax_rate_region" />'):(this.$el.html(this.states),this.$el.find("select").each((function(){var t=e(this);t.chosen(O
|