1var DriMailingLibrary=function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){void 0===t&&(t={});t&&"object"==typeof t&&(this.model=this.extendDefaults({mailing_flag:"n",product_mailing_exceptions:[],mailing_config_range:{},is_valid_for_mailing:!1},t))}return t.prototype.renderMailingWidget=function(t){"y"==this.model.mailing_flag&&this.validateSpecsForMailing(t)},t.prototype.validateSpecsForMailing=function(t){var e=t.selected_specs,i=this.model.mailing_config_range,n=this.model.product_mailing_exceptions;if(this.withinMailingPostageRange(t,i)){this.model.is_valid_for_mailing=!0;var r=this;0!=n.length&&(e=Object.keys(e).map(function(t){return 1*e[t]}),n.forEach(function(t){var i=JSON.parse(t),n=Object.keys(i).length;i=Object.keys(i).map(function(t){return 1*i[t]});var a=r.arrayIntersect(e,i).length;a>0&&n==a&&(r.model.is_valid_for_mailing=!1)}))}else this.model.is_valid_for_mailing=!1},t.prototype.withinMailingPostageRange=function(t,e){var i=parseFloat(t.selected_quantity),n=parseFloat(t.selected_dimensions.width),r=parseFloat(t.selected_dimensions.height),a=n>=r?n/r:r/n,o=parseFloat(t.weight),l=this.convertPoundsToOunce(o/i),s=!1;for(var u in e)if(e.hasOwnProperty(u)){var f=e[u];if(this.validWithinConfigRange(i,f.min_quantity,f.max_quantity)&&(this.validWithinConfigRange(n,f.min_width,f.max_width)&&this.validWithinConfigRange(r,f.min_height,f.max_height)||this.validWithinConfigRange(r,f.min_width,f.max_width)&&this.validWithinConfigRange(n,f.min_height,f.max_height))&&this.validWithinConfigRange(a,f.min_aspect_ratio,f.max_aspect_ratio)&&this.validWithinConfigRange(l,f.min_weight,f.max_weight)){s=!0;break}}return s},t.prototype.validWithinConfigRange=function(t,e,i){var n=null!=e,r=null!=i;return t=parseFloat(t),e=parseFloat(e),i=parseFloat(i),!!(!n&&!r||n&&!r&&t>=e||r&&!n&&t<=i||n&&r&&this.withinRange(t,e,i))},t.prototype.convertPoundsToOunce=function(t){return 16*t},t.prototype.withinRange=function(t,e,i){return parseFloat(t)>=parseFloat(e)&&parseFloat(t)<=parseFloat(i)},t.prototype.arrayIntersect=function(t,e){return t.filter(function(t){return e.indexOf(t)>-1}).filter(function(t,e,i){return i.indexOf(t)===e})},t.prototype.extendDefaults=function(t,e){var i;for(i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},t}();e.MailingLibrary=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.