{"version":3,"sources":["../assets/scripts/number.js"],"names":["$","setSelectionRange","rangeStart","rangeEnd","this","createTextRange","range","collapse","moveStart","moveEnd","select","focus","getSelection","part","pos","value","length","toLowerCase","document","selection","stored_range","selectionStart","selectionEnd","createRange","duplicate","expand","setEndPoint","text","_keydown","codes","46","188","109","190","191","192","220","222","221","219","173","187","186","189","110","shifts","96","49","50","51","52","53","54","55","56","57","48","45","61","91","93","92","59","39","44","47","fn","number","decimals","dec_point","thousands_sep","u_dec","charCodeAt","toString","slice","regex_dec_num","RegExp","regex_dec","is","on","keydown.format","e","$this","data","code","keyCode","which","chara","start","apply","end","val","setPos","hasOwnProperty","shiftKey","String","fromCharCode","match","key","ctrlKey","metaKey","preventDefault","init","c","Array","join","isPartialSelection","Math","max","indexOf","isFinite","altKey","keyup.format","paste.format","original","originalEvent","window","clipboardData","getData","each","num","replace","arguments","origHookGet","origHookSet","isPlainObject","valHooks","isFunction","get","set","el","Number","toLocaleString","charAt","abs","u_sep","n","s","toFixedFix","round","split","jQuery"],"mappings":"CAYA,SAAAA,GAEA,YAUA,SAAAC,GAAAC,EAAAC,GAGA,GAAAC,KAAAC,gBACA,CACA,GAAAC,GAAAF,KAAAC,iBACAC,GAAAC,UAAA,GACAD,EAAAE,UAAA,YAAAN,GACAI,EAAAG,QAAA,YAAAN,EAAAD,GACAI,EAAAI,aAIAN,MAAAH,oBAEAG,KAAAO,QACAP,KAAAH,kBAAAC,EAAAC,IAWA,QAAAS,GAAAC,GAEA,GAAAC,GAAAV,KAAAW,MAAAC,MAKA,IAFAH,EAAA,SAAAA,EAAAI,cAAA,QAAA,MAEAC,SAAAC,UAAA,CAEA,GAAAC,GAAAC,EAAAC,EAAAhB,EAAAY,SAAAC,UAAAI,aAWA,OATAH,GAAAd,EAAAkB,YAGAJ,EAAAK,OAAA,YAEAL,EAAAM,YAAA,WAAApB,GAEAe,EAAAD,EAAAO,KAAAX,OAAAV,EAAAqB,KAAAX,OACAM,EAAAD,EAAAf,EAAAqB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H,IAAAI,MAAA,KACAH,EAAA,GAAAzH,OAAA,IACAyH,EAAA,GAAAA,EAAA,GAAAhB,QAAA,0BAAAnD,KAEAmE,EAAA,IAAA,IAAAzH,OAAAoD,IACAqE,EAAA,GAAAA,EAAA,IAAA,GACAA,EAAA,IAAA,GAAAjC,OAAApC,EAAAqE,EAAA,GAAAzH,OAAA,GAAAyF,KAAA,MAEAgC,EAAAhC,KAAApC,KAGAwE","file":"number.js","sourcesContent":["/**\n * jQuery number plug-in 2.1.5\n * Copyright 2012, Digital Fusion\n * Licensed under the MIT license.\n * http://opensource.teamdf.com/license/\n *\n * A jQuery plugin which implements a permutation of phpjs.org's number_format to provide\n * simple number formatting, insertion, and as-you-type masking of a number.\n *\n * @author\tSam Sehnert\n * @docs\thttp://www.teamdf.com/web/jquery-number-format-redux/196/\n */\n(function($){\n\n\t\"use strict\";\n\n\t/**\n\t * Method for selecting a range of characters in an input/textarea.\n\t *\n\t * @param int rangeStart\t\t\t: Where we want the selection to start.\n\t * @param int rangeEnd\t\t\t\t: Where we want the selection to end.\n\t *\n\t * @return void;\n\t */\n\tfunction setSelectionRange( rangeStart, rangeEnd )\n\t{\n\t\t// Check which way we need to define the text range.\n\t\tif( this.createTextRange )\n\t\t{\n\t\t\tvar range = this.createTextRange();\n\t\t\t\trange.collapse( true );\n\t\t\t\trange.moveStart( 'character',\trangeStart );\n\t\t\t\trange.moveEnd( 'character',\t\trangeEnd-rangeStart );\n\t\t\t\trange.select();\n\t\t}\n\n\t\t// Alternate setSelectionRange method for supporting browsers.\n\t\telse if( this.setSelectionRange )\n\t\t{\n\t\t\tthis.focus();\n\t\t\tthis.setSelectionRange( rangeStart, rangeEnd );\n\t\t}\n\t}\n\n\t/**\n\t * Get the selection position for the given part.\n\t *\n\t * @param string part\t\t\t: Options, 'Start' or 'End'. The selection position to get.\n\t *\n\t * @return int : The index position of the selection part.\n\t */\n\tfunction getSelection( part )\n\t{\n\t\tvar pos\t= this.value.length;\n\n\t\t// Work out the selection part.\n\t\tpart = ( part.toLowerCase() == 'start' ? 'Start' : 'End' );\n\n\t\tif( document.selection ){\n\t\t\t// The current selection\n\t\t\tvar range = document.selection.createRange(), stored_range, selectionStart, selectionEnd;\n\t\t\t// We'll use this as a 'dummy'\n\t\t\tstored_range = range.duplicate();\n\t\t\t// Select all text\n\t\t\t//stored_range.moveToElementText( this );\n\t\t\tstored_range.expand('textedit');\n\t\t\t// Now move 'dummy' end point to end point of original range\n\t\t\tstored_range.setEndPoint( 'EndToEnd', range );\n\t\t\t// Now we can calculate start and end points\n\t\t\tselectionStart = stored_range.text.length - range.text.length;\n\t\t\tselectionEnd = selectionStart + range.text.length;\n\t\t\treturn part == 'Start' ? selectionStart : selectionEnd;\n\t\t}\n\n\t\telse if(typeof(this['selection'+part])!=\"undefined\")\n\t\t{\n\t\t\tpos = this['selection'+part];\n\t\t}\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Substitutions for keydown keycodes.\n\t * Allows conversion from e.which to ascii characters.\n\t */\n\tvar _keydown = {\n\t\tcodes : {\n\t\t\t46 : 127,\n\t\t\t188 : 44,\n\t\t\t109 : 45,\n\t\t\t190 : 46,\n\t\t\t191 : 47,\n\t\t\t192 : 96,\n\t\t\t220 : 92,\n\t\t\t222 : 39,\n\t\t\t221 : 93,\n\t\t\t219 : 91,\n\t\t\t173 : 45,\n\t\t\t187 : 61, //IE Key codes\n\t\t\t186 : 59, //IE Key codes\n\t\t\t189 : 45, //IE Key codes\n\t\t\t110 : 46 //IE Key codes\n\t\t},\n\t\tshifts : {\n\t\t\t96 : \"~\",\n\t\t\t49 : \"!\",\n\t\t\t50 : \"@\",\n\t\t\t51 : \"#\",\n\t\t\t52 : \"$\",\n\t\t\t53 : \"%\",\n\t\t\t54 : \"^\",\n\t\t\t55 : \"&\",\n\t\t\t56 : \"*\",\n\t\t\t57 : \"(\",\n\t\t\t48 : \")\",\n\t\t\t45 : \"_\",\n\t\t\t61 : \"+\",\n\t\t\t91 : \"{\",\n\t\t\t93 : \"}\",\n\t\t\t92 : \"|\",\n\t\t\t59 : \":\",\n\t\t\t39 : \"\\\"\",\n\t\t\t44 : \"<\",\n\t\t\t46 : \">\",\n\t\t\t47 : \"?\"\n\t\t}\n\t};\n\n\t/**\n\t * jQuery number formatter plugin. This will allow you to format numbers on an element.\n\t *\n\t * @params proxied for format_number method.\n\t *\n\t * @return : The jQuery collection the method was called with.\n\t */\n\t$.fn.number = function( number, decimals, dec_point, thousands_sep ){\n\n\t\t// Enter the default thousands separator, and the decimal placeholder.\n\t\tthousands_sep\t= (typeof thousands_sep === 'undefined') ? ',' : thousands_sep;\n\t\tdec_point\t\t= (typeof dec_point === 'undefined') ? '.' : dec_point;\n\t\tdecimals\t\t= (typeof decimals === 'undefined' ) ? 0 : decimals;\n\n\t\t// Work out the unicode character for the decimal placeholder.\n\t\tvar u_dec\t\t\t= ('\\\\u'+('0000'+(dec_point.charCodeAt(0).toString(16))).slice(-4)),\n\t\t\tregex_dec_num\t= new RegExp('[^'+u_dec+'0-9]','g'),\n\t\t\tregex_dec\t\t= new RegExp(u_dec,'g');\n\n\t\t// If we've specified to take the number from the target element,\n\t\t// we loop over the collection, and get the number.\n\t\tif( number === true )\n\t\t{\n\t\t\t// If this element is a number, then we add a keyup\n\t\t\tif( this.is('input:text') )\n\t\t\t{\n\t\t\t\t// Return the jquery collection.\n\t\t\t\treturn this.on({\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Handles keyup events, re-formatting numbers.\n\t\t\t\t\t *\n\t\t\t\t\t * Uses 'data' object to keep track of important information.\n\t\t\t\t\t *\n\t\t\t\t\t * data.c\n\t\t\t\t\t * This variable keeps track of where the caret *should* be. It works out the position as\n\t\t\t\t\t * the number of characters from the end of the string. E.g., '1^,234.56' where ^ denotes the caret,\n\t\t\t\t\t * would be index -7 (e.g., 7 characters from the end of the string). At the end of both the key down\n\t\t\t\t\t * and key up events, we'll re-position the caret to wherever data.c tells us the cursor should be.\n\t\t\t\t\t * This gives us a mechanism for incrementing the cursor position when we come across decimals, commas\n\t\t\t\t\t * etc. This figure typically doesn't increment for each keypress when to the left of the decimal,\n\t\t\t\t\t * but does when to the right of the decimal.\n\t\t\t\t\t *\n\t\t\t\t\t * @param object e\t\t\t: the keyup event object.s\n\t\t\t\t\t *\n\t\t\t\t\t * @return void;\n\t\t\t\t\t */\n\t\t\t\t\t'keydown.format' : function(e){\n\n\t\t\t\t\t\t// Define variables used in the code below.\n\t\t\t\t\t\tvar $this\t= $(this),\n\t\t\t\t\t\t\tdata\t= $this.data('numFormat'),\n\t\t\t\t\t\t\tcode\t= (e.keyCode ? e.keyCode : e.which),\n\t\t\t\t\t\t\tchara\t= '', //unescape(e.originalEvent.keyIdentifier.replace('U+','%u')),\n\t\t\t\t\t\t\tstart\t= getSelection.apply(this,['start']),\n\t\t\t\t\t\t\tend\t\t= getSelection.apply(this,['end']),\n\t\t\t\t\t\t\tval\t\t= '',\n\t\t\t\t\t\t\tsetPos\t= false;\n\n\t\t\t\t\t\t// Webkit (Chrome & Safari) on windows screws up the keyIdentifier detection\n\t\t\t\t\t\t// for numpad characters. I've disabled this for now, because while keyCode munging\n\t\t\t\t\t\t// below is hackish and ugly, it actually works cross browser & platform.\n\n//\t\t\t\t\t\tif( typeof e.originalEvent.keyIdentifier !== 'undefined' )\n//\t\t\t\t\t\t{\n//\t\t\t\t\t\t\tchara = unescape(e.originalEvent.keyIdentifier.replace('U+','%u'));\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\telse\n//\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (_keydown.codes.hasOwnProperty(code)) {\n\t\t\t\t\t\t\t\tcode = _keydown.codes[code];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!e.shiftKey && (code >= 65 && code <= 90)){\n\t\t\t\t\t\t\t\tcode += 32;\n\t\t\t\t\t\t\t} else if (!e.shiftKey && (code >= 69 && code <= 105)){\n\t\t\t\t\t\t\t\tcode -= 48;\n\t\t\t\t\t\t\t} else if (e.shiftKey && _keydown.shifts.hasOwnProperty(code)){\n\t\t\t\t\t\t\t\t//get shifted keyCode value\n\t\t\t\t\t\t\t\tchara = _keydown.shifts[code];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif( chara == '' ) chara = String.fromCharCode(code);\n//\t\t\t\t\t\t}\n\n\n\n\n\t\t\t\t\t\t// Stop executing if the user didn't type a number key, a decimal character, backspace, or delete.\n\t\t\t\t\t\tif( code != 8 && code != 45 && code != 127 && chara != dec_point && !chara.match(/[0-9]/) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// We need the original keycode now...\n\t\t\t\t\t\t\tvar key = (e.keyCode ? e.keyCode : e.which);\n\t\t\t\t\t\t\tif( // Allow control keys to go through... (delete, backspace, tab, enter, escape etc)\n\t\t\t\t\t\t\t\tkey == 46 || key == 8 || key == 127 || key == 9 || key == 27 || key == 13 ||\n\t\t\t\t\t\t\t\t// Allow: Ctrl+A, Ctrl+R, Ctrl+P, Ctrl+S, Ctrl+F, Ctrl+H, Ctrl+B, Ctrl+J, Ctrl+T, Ctrl+Z, Ctrl++, Ctrl+-, Ctrl+0\n\t\t\t\t\t\t\t\t( (key == 65 || key == 82 || key == 80 || key == 83 || key == 70 || key == 72 || key == 66 || key == 74 || key == 84 || key == 90|| key == 61 || key == 173 || key == 48) && ( e.ctrlKey || e.metaKey ) === true ) ||\n\t\t\t\t\t\t\t\t// Allow: Ctrl+V, Ctrl+C, Ctrl+X\n\t\t\t\t\t\t\t\t( (key == 86 || key == 67 || key == 88) && ( e.ctrlKey || e.metaKey ) === true ) ||\n\t\t\t\t\t\t\t\t// Allow: home, end, left, right\n\t\t\t\t\t\t\t\t( (key >= 35 && key <= 39) ) ||\n\t\t\t\t\t\t\t\t// Allow: F1-F12\n\t\t\t\t\t\t\t\t( (key >= 112 && key <= 123) )\n\t\t\t\t\t\t\t){\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// But prevent all other keys.\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The whole lot has been selected, or if the field is empty...\n\t\t\t\t\t\tif( start == 0 && end == this.value.length ) //|| $this.val() == 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( code == 8 )\t\t// Backspace\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Blank out the field, but only if the data object has already been instantiated.\n\t\t\t\t\t\t\t\tstart = end = 1;\n\t\t\t\t\t\t\t\tthis.value = '';\n\n\t\t\t\t\t\t\t\t// Reset the cursor position.\n\t\t\t\t\t\t\t\tdata.init = (decimals>0?-1:0);\n\t\t\t\t\t\t\t\tdata.c = (decimals>0?-(decimals+1):0);\n\t\t\t\t\t\t\t\tsetSelectionRange.apply(this, [0,0]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( chara == dec_point )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart = end = 1;\n\t\t\t\t\t\t\t\tthis.value = '0'+ dec_point + (new Array(decimals+1).join('0'));\n\n\t\t\t\t\t\t\t\t// Reset the cursor position.\n\t\t\t\t\t\t\t\tdata.init = (decimals>0?1:0);\n\t\t\t\t\t\t\t\tdata.c = (decimals>0?-(decimals+1):0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( code == 45 )\t// Negative sign\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart = end = 2;\n\t\t\t\t\t\t\t\tthis.value = '-0'+dec_point + (new Array(decimals+1).join('0'));\n\n\t\t\t\t\t\t\t\t// Reset the cursor position.\n\t\t\t\t\t\t\t\tdata.init = (decimals>0?1:0);\n\t\t\t\t\t\t\t\tdata.c = (decimals>0?-(decimals+1):0);\n\n\t\t\t\t\t\t\t\tsetSelectionRange.apply(this, [2,2]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Reset the cursor position.\n\t\t\t\t\t\t\t\tdata.init = (decimals>0?-1:0);\n\t\t\t\t\t\t\t\tdata.c = (decimals>0?-(decimals):0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Otherwise, we need to reset the caret position\n\t\t\t\t\t\t// based on the users selection.\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.c = end-this.value.length;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Track if partial selection was used\n\t\t\t\t\t\tdata.isPartialSelection = start == end ? false : true;\n\n\t\t\t\t\t\t// If the start position is before the decimal point,\n\t\t\t\t\t\t// and the user has typed a decimal point, we need to move the caret\n\t\t\t\t\t\t// past the decimal place.\n\t\t\t\t\t\tif( decimals > 0 && chara == dec_point && start == this.value.length-decimals-1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.c++;\n\t\t\t\t\t\t\tdata.init = Math.max(0,data.init);\n\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Ignore negative sign unless at beginning of number (and it's not already present)\n\t\t\t\t\t\telse if( code == 45 && (start != 0 || this.value.indexOf('-') == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the user is just typing the decimal place,\n\t\t\t\t\t\t// we simply ignore it.\n\t\t\t\t\t\telse if( chara == dec_point )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.init = Math.max(0,data.init);\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If hitting the delete key, and the cursor is before a decimal place,\n\t\t\t\t\t\t// we simply move the cursor to the other side of the decimal place.\n\t\t\t\t\t\telse if( decimals > 0 && code == 127 && start == this.value.length-decimals-1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Just prevent default but don't actually move the caret here because it's done in the keyup event\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If hitting the backspace key, and the cursor is behind a decimal place,\n\t\t\t\t\t\t// we simply move the cursor to the other side of the decimal place.\n\t\t\t\t\t\telse if( decimals > 0 && code == 8 && start == this.value.length-decimals )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tdata.c--;\n\n\t\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If hitting the delete key, and the cursor is to the right of the decimal\n\t\t\t\t\t\t// we replace the character after the caret with a 0.\n\t\t\t\t\t\telse if( decimals > 0 && code == 127 && start > this.value.length-decimals-1 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( this.value === '' ) return;\n\n\t\t\t\t\t\t\t// If the character following is not already a 0,\n\t\t\t\t\t\t\t// replace it with one.\n\t\t\t\t\t\t\tif( this.value.slice(start, start+1) != '0' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tval = this.value.slice(0, start) + '0' + this.value.slice(start+1);\n\t\t\t\t\t\t\t\t// The regex replacement below removes negative sign from numbers...\n\t\t\t\t\t\t\t\t// not sure why they're necessary here when none of the other cases use them\n\t\t\t\t\t\t\t\t//$this.val(val.replace(regex_dec_num,'').replace(regex_dec,dec_point));\n\t\t\t\t\t\t\t\t$this.val(val);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If hitting the backspace key, and the cursor is to the right of the decimal\n\t\t\t\t\t\t// (but not directly to the right) we replace the character preceding the\n\t\t\t\t\t\t// caret with a 0.\n\t\t\t\t\t\telse if( decimals > 0 && code == 8 && start > this.value.length-decimals )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( this.value === '' ) return;\n\n\t\t\t\t\t\t\t// If the character preceding is not already a 0,\n\t\t\t\t\t\t\t// replace it with one.\n\t\t\t\t\t\t\tif( this.value.slice(start-1, start) != '0' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tval = this.value.slice(0, start-1) + '0' + this.value.slice(start);\n\t\t\t\t\t\t\t\t// The regex replacement below removes negative sign from numbers...\n\t\t\t\t\t\t\t\t// not sure why they're necessary here when none of the other cases use them\n\t\t\t\t\t\t\t\t//$this.val(val.replace(regex_dec_num,'').replace(regex_dec,dec_point));\n\t\t\t\t\t\t\t\t$this.val(val);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tdata.c--;\n\n\t\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the delete key was pressed, and the character immediately\n\t\t\t\t\t\t// after the caret is a thousands_separator character, simply\n\t\t\t\t\t\t// step over it.\n\t\t\t\t\t\telse if( code == 127 && this.value.slice(start, start+1) == thousands_sep )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Just prevent default but don't actually move the caret here because it's done in the keyup event\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the backspace key was pressed, and the character immediately\n\t\t\t\t\t\t// before the caret is a thousands_separator character, simply\n\t\t\t\t\t\t// step over it.\n\t\t\t\t\t\telse if( code == 8 && this.value.slice(start-1, start) == thousands_sep )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tdata.c--;\n\n\t\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If the caret is to the right of the decimal place, and the user is entering a\n\t\t\t\t\t\t// number, remove the following character before putting in the new one.\n\t\t\t\t\t\telse if(\n\t\t\t\t\t\t\tdecimals > 0 &&\n\t\t\t\t\t\t\tstart == end &&\n\t\t\t\t\t\t\tthis.value.length > decimals+1 &&\n\t\t\t\t\t\t\tstart > this.value.length-decimals-1 && isFinite(+chara) &&\n\t\t\t\t\t\t\t!e.metaKey && !e.ctrlKey && !e.altKey && chara.length === 1\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// If the character preceding is not already a 0,\n\t\t\t\t\t\t\t// replace it with one.\n\t\t\t\t\t\t\tif( end === this.value.length )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tval = this.value.slice(0, start-1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tval = this.value.slice(0, start)+this.value.slice(start+1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Reset the position.\n\t\t\t\t\t\t\tthis.value = val;\n\t\t\t\t\t\t\tsetPos = start;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If we need to re-position the characters.\n\t\t\t\t\t\tif( setPos !== false )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log('Setpos keydown: ', setPos );\n\t\t\t\t\t\t\tsetSelectionRange.apply(this, [setPos, setPos]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Store the data on the element.\n\t\t\t\t\t\t$this.data('numFormat', data);\n\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Handles keyup events, re-formatting numbers.\n\t\t\t\t\t *\n\t\t\t\t\t * @param object e\t\t\t: the keyup event object.s\n\t\t\t\t\t *\n\t\t\t\t\t * @return void;\n\t\t\t\t\t */\n\t\t\t\t\t'keyup.format' : function(e){\n\n\t\t\t\t\t\t// Store these variables for use below.\n\t\t\t\t\t\tvar $this\t= $(this),\n\t\t\t\t\t\t\tdata\t= $this.data('numFormat'),\n\t\t\t\t\t\t\tcode\t= (e.keyCode ? e.keyCode : e.which),\n\t\t\t\t\t\t\tstart\t= getSelection.apply(this,['start']),\n\t\t\t\t\t\t\tend\t\t= getSelection.apply(this,['end']),\n\t\t\t\t\t\t\tsetPos;\n\n\n\t\t\t\t\t\t// Check for negative characters being entered at the start of the string.\n\t\t\t\t\t\t// If there's any kind of selection, just ignore the input.\n\t\t\t\t\t\tif( start === 0 && end === 0 && ( code === 189 || code === 109 ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this.val('-'+$this.val());\n\n\t\t\t\t\t\t\tstart\t\t= 1;\n\t\t\t\t\t\t\tdata.c\t\t= 1-this.value.length;\n\t\t\t\t\t\t\tdata.init\t= 1;\n\n\t\t\t\t\t\t\t$this.data('numFormat', data);\n\n\t\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\t\tsetSelectionRange.apply(this, [setPos, setPos]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Stop executing if the user didn't type a number key, a decimal, or a comma.\n\t\t\t\t\t\tif( this.value === '' || (code < 48 || code > 57) && (code < 96 || code > 105 ) && code !== 8 && code !== 46 && code !== 110 ) return;\n\n\t\t\t\t\t\t// Re-format the textarea.\n\t\t\t\t\t\t$this.val($this.val());\n\n\t\t\t\t\t\tif( decimals > 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// If we haven't marked this item as 'initialized'\n\t\t\t\t\t\t\t// then do so now. It means we should place the caret just\n\t\t\t\t\t\t\t// before the decimal. This will never be un-initialized before\n\t\t\t\t\t\t\t// the decimal character itself is entered.\n\t\t\t\t\t\t\tif( data.init < 1 )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstart\t\t= this.value.length-decimals-( data.init < 0 ? 1 : 0 );\n\t\t\t\t\t\t\t\tdata.c\t\t= start-this.value.length;\n\t\t\t\t\t\t\t\tdata.init\t= 1;\n\n\t\t\t\t\t\t\t\t$this.data('numFormat', data);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Increase the cursor position if the caret is to the right\n\t\t\t\t\t\t\t// of the decimal place, and the character pressed isn't the backspace key.\n\t\t\t\t\t\t\telse if( start > this.value.length-decimals && code != 8 )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdata.c++;\n\n\t\t\t\t\t\t\t\t// Store the data, now that it's changed.\n\t\t\t\t\t\t\t\t$this.data('numFormat', data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Move caret to the right after delete key pressed\n\t\t\t\t\t\tif (code == 46 && !data.isPartialSelection)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdata.c++;\n\n\t\t\t\t\t\t\t// Store the data, now that it's changed.\n\t\t\t\t\t\t\t$this.data('numFormat', data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//console.log( 'Setting pos: ', start, decimals, this.value.length + data.c, this.value.length, data.c );\n\n\t\t\t\t\t\t// Set the selection position.\n\t\t\t\t\t\tsetPos = this.value.length+data.c;\n\t\t\t\t\t\tsetSelectionRange.apply(this, [setPos, setPos]);\n\t\t\t\t\t},\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Reformat when pasting into the field.\n\t\t\t\t\t *\n\t\t\t\t\t * @param object e \t\t: jQuery event object.\n\t\t\t\t\t *\n\t\t\t\t\t * @return false : prevent default action.\n\t\t\t\t\t */\n\t\t\t\t\t'paste.format' : function(e){\n\n\t\t\t\t\t\t// Defint $this. It's used twice!.\n\t\t\t\t\t\tvar $this\t\t= $(this),\n\t\t\t\t\t\t\toriginal\t= e.originalEvent,\n\t\t\t\t\t\t\tval\t\t= null;\n\n\t\t\t\t\t\t// Get the text content stream.\n\t\t\t\t\t\tif (window.clipboardData && window.clipboardData.getData) { // IE\n\t\t\t\t\t\t\tval = window.clipboardData.getData('Text');\n\t\t\t\t\t\t} else if (original.clipboardData && original.clipboardData.getData) {\n\t\t\t\t\t\t\tval = original.clipboardData.getData('text/plain');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do the reformat operation.\n\t\t\t\t\t\t$this.val(val);\n\n\t\t\t\t\t\t// Stop the actual content from being pasted.\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t})\n\n\t\t\t\t// Loop each element (which isn't blank) and do the format.\n\t\t\t\t.each(function(){\n\n\t\t\t\t\tvar $this = $(this).data('numFormat',{\n\t\t\t\t\t\tc\t\t\t\t: -(decimals+1),\n\t\t\t\t\t\tdecimals\t\t: decimals,\n\t\t\t\t\t\tthousands_sep\t: thousands_sep,\n\t\t\t\t\t\tdec_point\t\t: dec_point,\n\t\t\t\t\t\tregex_dec_num\t: regex_dec_num,\n\t\t\t\t\t\tregex_dec\t\t: regex_dec,\n\t\t\t\t\t\tinit\t\t\t: this.value.indexOf('.') ? true : false\n\t\t\t\t\t});\n\n\t\t\t\t\t// Return if the element is empty.\n\t\t\t\t\tif( this.value === '' ) return;\n\n\t\t\t\t\t// Otherwise... format!!\n\t\t\t\t\t$this.val($this.val());\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// return the collection.\n\t\t\t\treturn this.each(function(){\n\t\t\t\t\tvar $this = $(this), num = +$this.text().replace(regex_dec_num,'').replace(regex_dec,'.');\n\t\t\t\t\t$this.number( !isFinite(num) ? 0 : +num, decimals, dec_point, thousands_sep );\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Add this number to the element as text.\n\t\treturn this.text( $.number.apply(window,arguments) );\n\t};\n\n\t//\n\t// Create .val() hooks to get and set formatted numbers in inputs.\n\t//\n\n\t// We check if any hooks already exist, and cache\n\t// them in case we need to re-use them later on.\n\tvar origHookGet = null, origHookSet = null;\n\n\t// Check if a text valHook already exists.\n\tif( $.isPlainObject( $.valHooks.text ) )\n\t{\n\t\t// Preserve the original valhook function\n\t\t// we'll call this for values we're not\n\t\t// explicitly handling.\n\t\tif( $.isFunction( $.valHooks.text.get ) ) origHookGet = $.valHooks.text.get;\n\t\tif( $.isFunction( $.valHooks.text.set ) ) origHookSet = $.valHooks.text.set;\n\t}\n\telse\n\t{\n\t\t// Define an object for the new valhook.\n\t\t$.valHooks.text = {};\n\t}\n\n\t/**\n\t* Define the valHook to return normalised field data against an input\n\t* which has been tagged by the number formatter.\n\t*\n\t* @param object el\t\t\t: The raw DOM element that we're getting the value from.\n\t*\n\t* @return mixed : Returns the value that was written to the element as a\n\t*\t\t\t\t javascript number, or undefined to let jQuery handle it normally.\n\t*/\n\t$.valHooks.text.get = function( el ){\n\n\t\t// Get the element, and its data.\n\t\tvar $this\t= $(el), num, negative,\n\t\t\tdata\t= $this.data('numFormat');\n\n\t\t// Does this element have our data field?\n\t\tif( !data )\n\t\t{\n\t\t\t// Check if the valhook function already existed\n\t\t\tif( $.isFunction( origHookGet ) )\n\t\t\t{\n\t\t\t\t// There was, so go ahead and call it\n\t\t\t\treturn origHookGet(el);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No previous function, return undefined to have jQuery\n\t\t\t\t// take care of retrieving the value\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Remove formatting, and return as number.\n\t\t\tif( el.value === '' ) return '';\n\n\n\t\t\t// Convert to a number.\n\t\t\tnum = +(el.value\n\t\t\t\t.replace( data.regex_dec_num, '' )\n\t\t\t\t.replace( data.regex_dec, '.' ));\n\n\t\t\t// If we've got a finite number, return it.\n\t\t\t// Otherwise, simply return 0.\n\t\t\t// Return as a string... thats what we're\n\t\t\t// used to with .val()\n\t\t\treturn (el.value.indexOf('-') === 0 ? '-' : '')+( isFinite( num ) ? num : 0 );\n\t\t}\n\t};\n\n\t/**\n\t* A valhook which formats a number when run against an input\n\t* which has been tagged by the number formatter.\n\t*\n\t* @param object el\t\t: The raw DOM element (input element).\n\t* @param float\t\t\t: The number to set into the value field.\n\t*\n\t* @return mixed : Returns the value that was written to the element,\n\t*\t\t\t\t or undefined to let jQuery handle it normally.\n\t*/\n\t$.valHooks.text.set = function( el, val )\n\t{\n\t\t// Get the element, and its data.\n\t\tvar $this\t= $(el),\n\t\t\tdata\t= $this.data('numFormat');\n\n\t\t// Does this element have our data field?\n\t\tif( !data )\n\t\t{\n\n\t\t\t// Check if the valhook function already exists\n\t\t\tif( $.isFunction( origHookSet ) )\n\t\t\t{\n\t\t\t\t// There was, so go ahead and call it\n\t\t\t\treturn origHookSet(el,val);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No previous function, return undefined to have jQuery\n\t\t\t\t// take care of retrieving the value\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar num = $.number( val, data.decimals, data.dec_point, data.thousands_sep );\n\n\t\t\t// Make sure empties are set with correct signs.\n//\t\t\tif(val.indexOf('-') === 0 && +num === 0)\n//\t\t\t{\n//\t\t\t\tnum = '-'+num;\n//\t\t\t}\n\n\t\t\treturn $.isFunction(origHookSet) ? origHookSet(el, num) : el.value = num;\n\t\t}\n\t};\n\n\t/**\n\t * The (modified) excellent number formatting method from PHPJS.org.\n\t * http://phpjs.org/functions/number_format/\n\t *\n\t * @modified by Sam Sehnert (teamdf.com)\n\t *\t- don't redefine dec_point, thousands_sep... just overwrite with defaults.\n\t *\t- don't redefine decimals, just overwrite as numeric.\n\t *\t- Generate regex for normalizing pre-formatted numbers.\n\t *\n\t * @param float number\t\t\t: The number you wish to format, or TRUE to use the text contents\n\t *\t\t\t\t\t\t\t\t of the element as the number. Please note that this won't work for\n\t *\t\t\t\t\t\t\t\t elements which have child nodes with text content.\n\t * @param int decimals\t\t\t: The number of decimal places that should be displayed. Defaults to 0.\n\t * @param string dec_point\t\t: The character to use as a decimal point. Defaults to '.'.\n\t * @param string thousands_sep\t: The character to use as a thousands separator. Defaults to ','.\n\t *\n\t * @return string : The formatted number as a string.\n\t */\n\t$.number = function( number, decimals, dec_point, thousands_sep ){\n\t\t// Set the default values here, instead so we can use them in the replace below.\n\t\tthousands_sep\t= (typeof thousands_sep === 'undefined') ? ( new Number(1000).toLocaleString() !== '1000' ? new Number(1000).toLocaleString().charAt(1) : '' ) : thousands_sep;\n\t\tdec_point\t\t= (typeof dec_point === 'undefined') ? new Number(0.1).toLocaleString().charAt(1) : dec_point;\n\t\tdecimals\t\t= !isFinite(+decimals) ? 0 : Math.abs(decimals);\n\n\t\t// Work out the unicode representation for the decimal place and thousand sep.\n\t\tvar u_dec = ('\\\\u'+('0000'+(dec_point.charCodeAt(0).toString(16))).slice(-4));\n\t\tvar u_sep = ('\\\\u'+('0000'+(thousands_sep.charCodeAt(0).toString(16))).slice(-4));\n\n\t\t// Fix the number, so that it's an actual number.\n\t\tnumber = (number + '')\n\t\t\t.replace('\\.', dec_point) // because the number if passed in as a float (having . as decimal point per definition) we need to replace this with the passed in decimal point character\n\t\t\t.replace(new RegExp(u_sep,'g'),'')\n\t\t\t.replace(new RegExp(u_dec,'g'),'.')\n\t\t\t.replace(new RegExp('[^0-9+\\-Ee.]','g'),'');\n\n\t\tvar n = !isFinite(+number) ? 0 : +number,\n\t\t\ts = '',\n\t\t\ttoFixedFix = function (n, decimals) {\n\t\t\t\treturn '' + (+(Math.round(('' + n).indexOf('e') > 0 ? n : n + 'e+' + decimals) + 'e-' + decimals));\n\t\t\t};\n\n\t\t// Fix for IE parseFloat(0.55).toFixed(0) = 0;\n\t\ts = (decimals ? toFixedFix(n, decimals) : '' + Math.round(n)).split('.');\n\t\tif (s[0].length > 3) {\n\t\t\ts[0] = s[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g, thousands_sep);\n\t\t}\n\t\tif ((s[1] || '').length < decimals) {\n\t\t\ts[1] = s[1] || '';\n\t\t\ts[1] += new Array(decimals - s[1].length + 1).join('0');\n\t\t}\n\t\treturn s.join(dec_point);\n\t}\n\n})(jQuery);"],"sourceRoot":"assets/scripts/"}