{"version":3,"sources":["jsdelivr-header.js","/npm/3d-print-price-calculator@0.0.1/getPrice.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,MAAQ,QAAQ,SAChB,gBAAkB,QAAQ,wBAC1B,oBAAsB,QAAQ,4BAElC,OAAO,QAAU,SAAkB,EAAa,GAC3C,EAAe,MAAM,oBAAoB,GAG7C,GAAI,MAAM,EAAa,gBAAkB,EAAa,cAAgB,GAAK,EAAa,cAAgB,IACvG,MAAM,IAAI,MAAM,2BAA6B,EAAa,eAI3D,QAAmC,IAAxB,EAAa,OACvB,MAAM,IAAI,MAAM,4BAA8B,EAAa,QAG5D,GAA0B,MAAtB,EAAa,MAChB,OAAO,gBAAgB,EAAa,EAAa,QAC3C,GAA0B,MAAtB,EAAa,MACvB,OAAO,gBAAgB,EAAmC,UAAtB,EAAa,QAEjD,MAAM,IAAI,MAAM,+BAAiC,EAAa,MAEhE","file":"/npm/3d-print-price-calculator@0.0.1/getPrice.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/3d-print-price-calculator@0.0.1/getPrice.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var xtend = require('xtend')\nvar priceCalculator = require('./priceCalculator.js')\nvar defaultPrintOptions = require('./defaultPrintOptions.js')\n\nmodule.exports = function getPrice(printOptions,admeshOutput) {\n\tvar printOptions = xtend(defaultPrintOptions,printOptions)\n\n\t//make sure percentages are numbers and between 0 and 100\n\tif (isNaN(printOptions.percentInfill) || printOptions.percentInfill < 0 || printOptions.percentInfill > 100){\n\t\tthrow new Error('invalid percent infill: ' + printOptions.percentInfill)\n\t}\n\n\t//make sure admeshOutput has volume\n\tif (typeof admeshOutput.volume === 'undefined') {\n\t\tthrow new Error('undefined admesh volume: ' + admeshOutput.volume)\n\t}\n\n\tif (printOptions.units == \"mm\"){\n\t\treturn priceCalculator(printOptions,admeshOutput.volume)\n\t} else if (printOptions.units == \"in\"){\n\t\treturn priceCalculator(printOptions,admeshOutput.volume * 16387.064)\n\t} else {\n\t\tthrow new Error('invalid print option units: ' + printOptions.units)\n\t}\n}\n"]}