isomorfeus-preact 10.5.0 → 10.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1080) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +29 -0
  3. data/lib/isomorfeus/preact/config.rb +19 -35
  4. data/lib/isomorfeus/preact/imports.rb +30 -0
  5. data/lib/isomorfeus/preact_view_helper.rb +34 -42
  6. data/lib/isomorfeus-preact.rb +6 -4
  7. data/lib/lucid_app/context.rb +9 -9
  8. data/lib/preact/version.rb +1 -1
  9. data/node_modules/.bin/loose-envify +12 -0
  10. data/node_modules/.bin/loose-envify.cmd +17 -0
  11. data/node_modules/.bin/loose-envify.ps1 +28 -0
  12. data/node_modules/.package-lock.json +278 -0
  13. data/node_modules/@babel/runtime/LICENSE +22 -0
  14. data/node_modules/@babel/runtime/README.md +19 -0
  15. data/node_modules/@babel/runtime/helpers/AsyncGenerator.js +99 -0
  16. data/node_modules/@babel/runtime/helpers/AwaitValue.js +6 -0
  17. data/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +31 -0
  18. data/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +12 -0
  19. data/node_modules/@babel/runtime/helpers/arrayWithHoles.js +6 -0
  20. data/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +8 -0
  21. data/node_modules/@babel/runtime/helpers/assertThisInitialized.js +10 -0
  22. data/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +57 -0
  23. data/node_modules/@babel/runtime/helpers/asyncIterator.js +16 -0
  24. data/node_modules/@babel/runtime/helpers/asyncToGenerator.js +38 -0
  25. data/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +8 -0
  26. data/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +8 -0
  27. data/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +23 -0
  28. data/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +10 -0
  29. data/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +14 -0
  30. data/node_modules/@babel/runtime/helpers/classCallCheck.js +8 -0
  31. data/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +8 -0
  32. data/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +8 -0
  33. data/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +10 -0
  34. data/node_modules/@babel/runtime/helpers/classNameTDZError.js +6 -0
  35. data/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +11 -0
  36. data/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +11 -0
  37. data/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +9 -0
  38. data/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +10 -0
  39. data/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +8 -0
  40. data/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +12 -0
  41. data/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +10 -0
  42. data/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +9 -0
  43. data/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +6 -0
  44. data/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +14 -0
  45. data/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +14 -0
  46. data/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +15 -0
  47. data/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +9 -0
  48. data/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +6 -0
  49. data/node_modules/@babel/runtime/helpers/construct.js +26 -0
  50. data/node_modules/@babel/runtime/helpers/createClass.js +18 -0
  51. data/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +61 -0
  52. data/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +25 -0
  53. data/node_modules/@babel/runtime/helpers/createSuper.js +25 -0
  54. data/node_modules/@babel/runtime/helpers/decorate.js +401 -0
  55. data/node_modules/@babel/runtime/helpers/defaults.js +17 -0
  56. data/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +25 -0
  57. data/node_modules/@babel/runtime/helpers/defineProperty.js +17 -0
  58. data/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +95 -0
  59. data/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +3 -0
  60. data/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +28 -0
  61. data/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +9 -0
  62. data/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +3 -0
  63. data/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +4 -0
  64. data/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +7 -0
  65. data/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +54 -0
  66. data/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +13 -0
  67. data/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +35 -0
  68. data/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +4 -0
  69. data/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +5 -0
  70. data/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +20 -0
  71. data/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +7 -0
  72. data/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +11 -0
  73. data/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +5 -0
  74. data/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
  75. data/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +5 -0
  76. data/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +7 -0
  77. data/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +3 -0
  78. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +6 -0
  79. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +6 -0
  80. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +5 -0
  81. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +7 -0
  82. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +4 -0
  83. data/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +7 -0
  84. data/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +7 -0
  85. data/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +5 -0
  86. data/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +3 -0
  87. data/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +8 -0
  88. data/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +8 -0
  89. data/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +9 -0
  90. data/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +5 -0
  91. data/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +3 -0
  92. data/node_modules/@babel/runtime/helpers/esm/construct.js +18 -0
  93. data/node_modules/@babel/runtime/helpers/esm/createClass.js +15 -0
  94. data/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +57 -0
  95. data/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +21 -0
  96. data/node_modules/@babel/runtime/helpers/esm/createSuper.js +19 -0
  97. data/node_modules/@babel/runtime/helpers/esm/decorate.js +396 -0
  98. data/node_modules/@babel/runtime/helpers/esm/defaults.js +14 -0
  99. data/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +22 -0
  100. data/node_modules/@babel/runtime/helpers/esm/defineProperty.js +14 -0
  101. data/node_modules/@babel/runtime/helpers/esm/extends.js +17 -0
  102. data/node_modules/@babel/runtime/helpers/esm/get.js +20 -0
  103. data/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +6 -0
  104. data/node_modules/@babel/runtime/helpers/esm/inherits.js +15 -0
  105. data/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +6 -0
  106. data/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +9 -0
  107. data/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +3 -0
  108. data/node_modules/@babel/runtime/helpers/esm/instanceof.js +7 -0
  109. data/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +5 -0
  110. data/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +51 -0
  111. data/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +3 -0
  112. data/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +12 -0
  113. data/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +3 -0
  114. data/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +29 -0
  115. data/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +14 -0
  116. data/node_modules/@babel/runtime/helpers/esm/jsx.js +46 -0
  117. data/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +9 -0
  118. data/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +5 -0
  119. data/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +3 -0
  120. data/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +3 -0
  121. data/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +3 -0
  122. data/node_modules/@babel/runtime/helpers/esm/objectSpread.js +19 -0
  123. data/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +39 -0
  124. data/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +19 -0
  125. data/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +14 -0
  126. data/node_modules/@babel/runtime/helpers/esm/package.json +3 -0
  127. data/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +11 -0
  128. data/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +3 -0
  129. data/node_modules/@babel/runtime/helpers/esm/set.js +51 -0
  130. data/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
  131. data/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +7 -0
  132. data/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +7 -0
  133. data/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +7 -0
  134. data/node_modules/@babel/runtime/helpers/esm/superPropBase.js +9 -0
  135. data/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +11 -0
  136. data/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +8 -0
  137. data/node_modules/@babel/runtime/helpers/esm/tdz.js +3 -0
  138. data/node_modules/@babel/runtime/helpers/esm/temporalRef.js +5 -0
  139. data/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +1 -0
  140. data/node_modules/@babel/runtime/helpers/esm/toArray.js +7 -0
  141. data/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +7 -0
  142. data/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +13 -0
  143. data/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +6 -0
  144. data/node_modules/@babel/runtime/helpers/esm/typeof.js +15 -0
  145. data/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +9 -0
  146. data/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +6 -0
  147. data/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +37 -0
  148. data/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +65 -0
  149. data/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +3 -0
  150. data/node_modules/@babel/runtime/helpers/extends.js +21 -0
  151. data/node_modules/@babel/runtime/helpers/get.js +27 -0
  152. data/node_modules/@babel/runtime/helpers/getPrototypeOf.js +10 -0
  153. data/node_modules/@babel/runtime/helpers/inherits.js +19 -0
  154. data/node_modules/@babel/runtime/helpers/inheritsLoose.js +10 -0
  155. data/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +12 -0
  156. data/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +6 -0
  157. data/node_modules/@babel/runtime/helpers/instanceof.js +10 -0
  158. data/node_modules/@babel/runtime/helpers/interopRequireDefault.js +8 -0
  159. data/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +54 -0
  160. data/node_modules/@babel/runtime/helpers/isNativeFunction.js +6 -0
  161. data/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +15 -0
  162. data/node_modules/@babel/runtime/helpers/iterableToArray.js +6 -0
  163. data/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +32 -0
  164. data/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +17 -0
  165. data/node_modules/@babel/runtime/helpers/jsx.js +50 -0
  166. data/node_modules/@babel/runtime/helpers/maybeArrayLike.js +13 -0
  167. data/node_modules/@babel/runtime/helpers/newArrowCheck.js +8 -0
  168. data/node_modules/@babel/runtime/helpers/nonIterableRest.js +6 -0
  169. data/node_modules/@babel/runtime/helpers/nonIterableSpread.js +6 -0
  170. data/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +6 -0
  171. data/node_modules/@babel/runtime/helpers/objectSpread.js +23 -0
  172. data/node_modules/@babel/runtime/helpers/objectSpread2.js +42 -0
  173. data/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +23 -0
  174. data/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +17 -0
  175. data/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +16 -0
  176. data/node_modules/@babel/runtime/helpers/readOnlyError.js +6 -0
  177. data/node_modules/@babel/runtime/helpers/set.js +55 -0
  178. data/node_modules/@babel/runtime/helpers/setPrototypeOf.js +12 -0
  179. data/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +10 -0
  180. data/node_modules/@babel/runtime/helpers/slicedToArray.js +14 -0
  181. data/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +14 -0
  182. data/node_modules/@babel/runtime/helpers/superPropBase.js +13 -0
  183. data/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +14 -0
  184. data/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +11 -0
  185. data/node_modules/@babel/runtime/helpers/tdz.js +6 -0
  186. data/node_modules/@babel/runtime/helpers/temporalRef.js +10 -0
  187. data/node_modules/@babel/runtime/helpers/temporalUndefined.js +4 -0
  188. data/node_modules/@babel/runtime/helpers/toArray.js +14 -0
  189. data/node_modules/@babel/runtime/helpers/toConsumableArray.js +14 -0
  190. data/node_modules/@babel/runtime/helpers/toPrimitive.js +17 -0
  191. data/node_modules/@babel/runtime/helpers/toPropertyKey.js +11 -0
  192. data/node_modules/@babel/runtime/helpers/typeof.js +22 -0
  193. data/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +13 -0
  194. data/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +10 -0
  195. data/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +45 -0
  196. data/node_modules/@babel/runtime/helpers/wrapRegExp.js +72 -0
  197. data/node_modules/@babel/runtime/helpers/writeOnlyError.js +6 -0
  198. data/node_modules/@babel/runtime/package.json +848 -0
  199. data/node_modules/@babel/runtime/regenerator/index.js +1 -0
  200. data/node_modules/css-in-js-utils/Changelog.md +16 -0
  201. data/node_modules/css-in-js-utils/LICENSE +21 -0
  202. data/node_modules/css-in-js-utils/README.md +241 -0
  203. data/node_modules/css-in-js-utils/lib/__tests__/assignStyle-test.js +117 -0
  204. data/node_modules/css-in-js-utils/lib/__tests__/camelCaseProperty-test.js +15 -0
  205. data/node_modules/css-in-js-utils/lib/__tests__/cssifyDeclaration-test.js +15 -0
  206. data/node_modules/css-in-js-utils/lib/__tests__/cssifyObject-test.js +31 -0
  207. data/node_modules/css-in-js-utils/lib/__tests__/isPrefixedProperty-test.js +19 -0
  208. data/node_modules/css-in-js-utils/lib/__tests__/isPrefixedValue-test.js +19 -0
  209. data/node_modules/css-in-js-utils/lib/__tests__/isUnitlessProperty-test.js +43 -0
  210. data/node_modules/css-in-js-utils/lib/__tests__/normalizeProperty-test.js +21 -0
  211. data/node_modules/css-in-js-utils/lib/__tests__/resolveArrayValue-test.js +17 -0
  212. data/node_modules/css-in-js-utils/lib/__tests__/unprefixProperty-test.js +19 -0
  213. data/node_modules/css-in-js-utils/lib/__tests__/unprefixValue-test.js +20 -0
  214. data/node_modules/css-in-js-utils/lib/assignStyle.js +37 -0
  215. data/node_modules/css-in-js-utils/lib/camelCaseProperty.js +15 -0
  216. data/node_modules/css-in-js-utils/lib/cssifyDeclaration.js +17 -0
  217. data/node_modules/css-in-js-utils/lib/cssifyObject.js +34 -0
  218. data/node_modules/css-in-js-utils/lib/hyphenateProperty.js +17 -0
  219. data/node_modules/css-in-js-utils/lib/index.js +71 -0
  220. data/node_modules/css-in-js-utils/lib/isPrefixedProperty.js +12 -0
  221. data/node_modules/css-in-js-utils/lib/isPrefixedValue.js +12 -0
  222. data/node_modules/css-in-js-utils/lib/isUnitlessProperty.js +64 -0
  223. data/node_modules/css-in-js-utils/lib/normalizeProperty.js +21 -0
  224. data/node_modules/css-in-js-utils/lib/resolveArrayValue.js +19 -0
  225. data/node_modules/css-in-js-utils/lib/unprefixProperty.js +13 -0
  226. data/node_modules/css-in-js-utils/lib/unprefixValue.js +16 -0
  227. data/node_modules/css-in-js-utils/package.json +56 -0
  228. data/node_modules/css-tree/CHANGELOG.md +590 -0
  229. data/node_modules/css-tree/LICENSE +19 -0
  230. data/node_modules/css-tree/README.md +130 -0
  231. data/node_modules/css-tree/data/index.js +103 -0
  232. data/node_modules/css-tree/data/patch.json +721 -0
  233. data/node_modules/css-tree/dist/csstree.js +12606 -0
  234. data/node_modules/css-tree/dist/csstree.min.js +1 -0
  235. data/node_modules/css-tree/lib/common/List.js +576 -0
  236. data/node_modules/css-tree/lib/common/OffsetToLocation.js +91 -0
  237. data/node_modules/css-tree/lib/common/SyntaxError.js +82 -0
  238. data/node_modules/css-tree/lib/common/TokenStream.js +219 -0
  239. data/node_modules/css-tree/lib/common/adopt-buffer.js +10 -0
  240. data/node_modules/css-tree/lib/convertor/create.js +28 -0
  241. data/node_modules/css-tree/lib/convertor/index.js +3 -0
  242. data/node_modules/css-tree/lib/definition-syntax/SyntaxError.js +14 -0
  243. data/node_modules/css-tree/lib/definition-syntax/generate.js +129 -0
  244. data/node_modules/css-tree/lib/definition-syntax/index.js +6 -0
  245. data/node_modules/css-tree/lib/definition-syntax/parse.js +568 -0
  246. data/node_modules/css-tree/lib/definition-syntax/tokenizer.js +55 -0
  247. data/node_modules/css-tree/lib/definition-syntax/walk.js +52 -0
  248. data/node_modules/css-tree/lib/generator/create.js +66 -0
  249. data/node_modules/css-tree/lib/generator/index.js +4 -0
  250. data/node_modules/css-tree/lib/generator/sourceMap.js +95 -0
  251. data/node_modules/css-tree/lib/index.js +1 -0
  252. data/node_modules/css-tree/lib/lexer/Lexer.js +466 -0
  253. data/node_modules/css-tree/lib/lexer/error.js +127 -0
  254. data/node_modules/css-tree/lib/lexer/generic-an-plus-b.js +236 -0
  255. data/node_modules/css-tree/lib/lexer/generic-urange.js +159 -0
  256. data/node_modules/css-tree/lib/lexer/generic.js +585 -0
  257. data/node_modules/css-tree/lib/lexer/index.js +3 -0
  258. data/node_modules/css-tree/lib/lexer/match-graph.js +455 -0
  259. data/node_modules/css-tree/lib/lexer/match.js +639 -0
  260. data/node_modules/css-tree/lib/lexer/prepare-tokens.js +73 -0
  261. data/node_modules/css-tree/lib/lexer/search.js +65 -0
  262. data/node_modules/css-tree/lib/lexer/structure.js +163 -0
  263. data/node_modules/css-tree/lib/lexer/trace.js +79 -0
  264. data/node_modules/css-tree/lib/parser/create.js +304 -0
  265. data/node_modules/css-tree/lib/parser/index.js +4 -0
  266. data/node_modules/css-tree/lib/parser/sequence.js +54 -0
  267. data/node_modules/css-tree/lib/syntax/atrule/font-face.js +8 -0
  268. data/node_modules/css-tree/lib/syntax/atrule/import.js +40 -0
  269. data/node_modules/css-tree/lib/syntax/atrule/index.js +7 -0
  270. data/node_modules/css-tree/lib/syntax/atrule/media.js +12 -0
  271. data/node_modules/css-tree/lib/syntax/atrule/page.js +12 -0
  272. data/node_modules/css-tree/lib/syntax/atrule/supports.js +89 -0
  273. data/node_modules/css-tree/lib/syntax/config/lexer.js +9 -0
  274. data/node_modules/css-tree/lib/syntax/config/mix.js +140 -0
  275. data/node_modules/css-tree/lib/syntax/config/parser.js +25 -0
  276. data/node_modules/css-tree/lib/syntax/config/walker.js +3 -0
  277. data/node_modules/css-tree/lib/syntax/create.js +77 -0
  278. data/node_modules/css-tree/lib/syntax/function/expression.js +7 -0
  279. data/node_modules/css-tree/lib/syntax/function/var.js +43 -0
  280. data/node_modules/css-tree/lib/syntax/index.js +21 -0
  281. data/node_modules/css-tree/lib/syntax/node/AnPlusB.js +297 -0
  282. data/node_modules/css-tree/lib/syntax/node/Atrule.js +107 -0
  283. data/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js +51 -0
  284. data/node_modules/css-tree/lib/syntax/node/AttributeSelector.js +165 -0
  285. data/node_modules/css-tree/lib/syntax/node/Block.js +91 -0
  286. data/node_modules/css-tree/lib/syntax/node/Brackets.js +34 -0
  287. data/node_modules/css-tree/lib/syntax/node/CDC.js +19 -0
  288. data/node_modules/css-tree/lib/syntax/node/CDO.js +19 -0
  289. data/node_modules/css-tree/lib/syntax/node/ClassSelector.js +29 -0
  290. data/node_modules/css-tree/lib/syntax/node/Combinator.js +55 -0
  291. data/node_modules/css-tree/lib/syntax/node/Comment.js +36 -0
  292. data/node_modules/css-tree/lib/syntax/node/Declaration.js +169 -0
  293. data/node_modules/css-tree/lib/syntax/node/DeclarationList.js +49 -0
  294. data/node_modules/css-tree/lib/syntax/node/Dimension.js +29 -0
  295. data/node_modules/css-tree/lib/syntax/node/Function.js +40 -0
  296. data/node_modules/css-tree/lib/syntax/node/Hash.js +26 -0
  297. data/node_modules/css-tree/lib/syntax/node/IdSelector.js +27 -0
  298. data/node_modules/css-tree/lib/syntax/node/Identifier.js +20 -0
  299. data/node_modules/css-tree/lib/syntax/node/MediaFeature.js +76 -0
  300. data/node_modules/css-tree/lib/syntax/node/MediaQuery.js +68 -0
  301. data/node_modules/css-tree/lib/syntax/node/MediaQueryList.js +36 -0
  302. data/node_modules/css-tree/lib/syntax/node/Nth.js +51 -0
  303. data/node_modules/css-tree/lib/syntax/node/Number.js +18 -0
  304. data/node_modules/css-tree/lib/syntax/node/Operator.js +21 -0
  305. data/node_modules/css-tree/lib/syntax/node/Parentheses.js +34 -0
  306. data/node_modules/css-tree/lib/syntax/node/Percentage.js +27 -0
  307. data/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js +61 -0
  308. data/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js +62 -0
  309. data/node_modules/css-tree/lib/syntax/node/Ratio.js +66 -0
  310. data/node_modules/css-tree/lib/syntax/node/Raw.js +87 -0
  311. data/node_modules/css-tree/lib/syntax/node/Rule.js +54 -0
  312. data/node_modules/css-tree/lib/syntax/node/Selector.js +32 -0
  313. data/node_modules/css-tree/lib/syntax/node/SelectorList.js +39 -0
  314. data/node_modules/css-tree/lib/syntax/node/String.js +18 -0
  315. data/node_modules/css-tree/lib/syntax/node/StyleSheet.js +81 -0
  316. data/node_modules/css-tree/lib/syntax/node/TypeSelector.js +53 -0
  317. data/node_modules/css-tree/lib/syntax/node/UnicodeRange.js +173 -0
  318. data/node_modules/css-tree/lib/syntax/node/Url.js +69 -0
  319. data/node_modules/css-tree/lib/syntax/node/Value.js +19 -0
  320. data/node_modules/css-tree/lib/syntax/node/WhiteSpace.js +26 -0
  321. data/node_modules/css-tree/lib/syntax/node/index.js +42 -0
  322. data/node_modules/css-tree/lib/syntax/pseudo/common/nth.js +9 -0
  323. data/node_modules/css-tree/lib/syntax/pseudo/common/nthWithOfClause.js +9 -0
  324. data/node_modules/css-tree/lib/syntax/pseudo/common/selectorList.js +7 -0
  325. data/node_modules/css-tree/lib/syntax/pseudo/dir.js +7 -0
  326. data/node_modules/css-tree/lib/syntax/pseudo/has.js +7 -0
  327. data/node_modules/css-tree/lib/syntax/pseudo/index.js +12 -0
  328. data/node_modules/css-tree/lib/syntax/pseudo/lang.js +7 -0
  329. data/node_modules/css-tree/lib/syntax/pseudo/matches.js +1 -0
  330. data/node_modules/css-tree/lib/syntax/pseudo/not.js +1 -0
  331. data/node_modules/css-tree/lib/syntax/pseudo/nth-child.js +1 -0
  332. data/node_modules/css-tree/lib/syntax/pseudo/nth-last-child.js +1 -0
  333. data/node_modules/css-tree/lib/syntax/pseudo/nth-last-of-type.js +1 -0
  334. data/node_modules/css-tree/lib/syntax/pseudo/nth-of-type.js +1 -0
  335. data/node_modules/css-tree/lib/syntax/pseudo/slotted.js +7 -0
  336. data/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js +3 -0
  337. data/node_modules/css-tree/lib/syntax/scope/default.js +87 -0
  338. data/node_modules/css-tree/lib/syntax/scope/index.js +5 -0
  339. data/node_modules/css-tree/lib/syntax/scope/selector.js +80 -0
  340. data/node_modules/css-tree/lib/syntax/scope/value.js +5 -0
  341. data/node_modules/css-tree/lib/tokenizer/char-code-definitions.js +249 -0
  342. data/node_modules/css-tree/lib/tokenizer/const.js +40 -0
  343. data/node_modules/css-tree/lib/tokenizer/index.js +591 -0
  344. data/node_modules/css-tree/lib/tokenizer/utils.js +243 -0
  345. data/node_modules/css-tree/lib/utils/clone.js +21 -0
  346. data/node_modules/css-tree/lib/utils/createCustomError.js +17 -0
  347. data/node_modules/css-tree/lib/utils/names.js +104 -0
  348. data/node_modules/css-tree/lib/walker/create.js +284 -0
  349. data/node_modules/css-tree/lib/walker/index.js +4 -0
  350. data/node_modules/css-tree/package.json +60 -0
  351. data/node_modules/csstype/LICENSE +19 -0
  352. data/node_modules/csstype/README.md +273 -0
  353. data/node_modules/csstype/index.d.ts +20553 -0
  354. data/node_modules/csstype/index.js.flow +6278 -0
  355. data/node_modules/csstype/package.json +62 -0
  356. data/node_modules/error-stack-parser/CHANGELOG.md +53 -0
  357. data/node_modules/error-stack-parser/LICENSE +19 -0
  358. data/node_modules/error-stack-parser/README.md +44 -0
  359. data/node_modules/error-stack-parser/dist/error-stack-parser.js +202 -0
  360. data/node_modules/error-stack-parser/dist/error-stack-parser.min.js +2 -0
  361. data/node_modules/error-stack-parser/dist/error-stack-parser.min.js.map +1 -0
  362. data/node_modules/error-stack-parser/error-stack-parser.d.ts +66 -0
  363. data/node_modules/error-stack-parser/error-stack-parser.js +202 -0
  364. data/node_modules/error-stack-parser/package.json +63 -0
  365. data/node_modules/fastest-stable-stringify/.eslintrc.yml +26 -0
  366. data/node_modules/fastest-stable-stringify/.travis.yml +7 -0
  367. data/node_modules/fastest-stable-stringify/LICENSE +18 -0
  368. data/node_modules/fastest-stable-stringify/README.md +44 -0
  369. data/node_modules/fastest-stable-stringify/benchmark/index.js +32 -0
  370. data/node_modules/fastest-stable-stringify/benchmark/test.json +215 -0
  371. data/node_modules/fastest-stable-stringify/example/key_cmp.js +7 -0
  372. data/node_modules/fastest-stable-stringify/example/nested.js +3 -0
  373. data/node_modules/fastest-stable-stringify/example/str.js +3 -0
  374. data/node_modules/fastest-stable-stringify/example/value_cmp.js +7 -0
  375. data/node_modules/fastest-stable-stringify/index.js +60 -0
  376. data/node_modules/fastest-stable-stringify/package.json +54 -0
  377. data/node_modules/fastest-stable-stringify/test/bench.js +20 -0
  378. data/node_modules/fastest-stable-stringify/test/nested.js +24 -0
  379. data/node_modules/fastest-stable-stringify/test/str.js +52 -0
  380. data/node_modules/fastest-stable-stringify/test/to-json.js +22 -0
  381. data/node_modules/hyphenate-style-name/LICENSE +28 -0
  382. data/node_modules/hyphenate-style-name/README.md +28 -0
  383. data/node_modules/hyphenate-style-name/index.cjs.js +21 -0
  384. data/node_modules/hyphenate-style-name/index.js +19 -0
  385. data/node_modules/hyphenate-style-name/package.json +42 -0
  386. data/node_modules/inline-style-prefixer/CHANGELOG.md +195 -0
  387. data/node_modules/inline-style-prefixer/LICENSE +22 -0
  388. data/node_modules/inline-style-prefixer/README.md +100 -0
  389. data/node_modules/inline-style-prefixer/es/createPrefixer.js +47 -0
  390. data/node_modules/inline-style-prefixer/es/data.js +12 -0
  391. data/node_modules/inline-style-prefixer/es/generator/generatePluginList.js +21 -0
  392. data/node_modules/inline-style-prefixer/es/generator/generatePrefixMap.js +75 -0
  393. data/node_modules/inline-style-prefixer/es/generator/index.js +69 -0
  394. data/node_modules/inline-style-prefixer/es/generator/maps/pluginMap.js +108 -0
  395. data/node_modules/inline-style-prefixer/es/generator/maps/propertyMap.js +38 -0
  396. data/node_modules/inline-style-prefixer/es/index.js +26 -0
  397. data/node_modules/inline-style-prefixer/es/plugins/backgroundClip.js +7 -0
  398. data/node_modules/inline-style-prefixer/es/plugins/calc.js +11 -0
  399. data/node_modules/inline-style-prefixer/es/plugins/crossFade.js +12 -0
  400. data/node_modules/inline-style-prefixer/es/plugins/cursor.js +16 -0
  401. data/node_modules/inline-style-prefixer/es/plugins/filter.js +12 -0
  402. data/node_modules/inline-style-prefixer/es/plugins/flex.js +10 -0
  403. data/node_modules/inline-style-prefixer/es/plugins/flexboxIE.js +67 -0
  404. data/node_modules/inline-style-prefixer/es/plugins/flexboxOld.js +33 -0
  405. data/node_modules/inline-style-prefixer/es/plugins/gradient.js +14 -0
  406. data/node_modules/inline-style-prefixer/es/plugins/grid.js +129 -0
  407. data/node_modules/inline-style-prefixer/es/plugins/imageSet.js +12 -0
  408. data/node_modules/inline-style-prefixer/es/plugins/index.js +17 -0
  409. data/node_modules/inline-style-prefixer/es/plugins/logical.js +35 -0
  410. data/node_modules/inline-style-prefixer/es/plugins/position.js +5 -0
  411. data/node_modules/inline-style-prefixer/es/plugins/sizing.js +26 -0
  412. data/node_modules/inline-style-prefixer/es/plugins/transition.js +75 -0
  413. data/node_modules/inline-style-prefixer/es/utils/addNewValuesOnly.js +15 -0
  414. data/node_modules/inline-style-prefixer/es/utils/capitalizeString.js +3 -0
  415. data/node_modules/inline-style-prefixer/es/utils/isObject.js +3 -0
  416. data/node_modules/inline-style-prefixer/es/utils/prefixProperty.js +22 -0
  417. data/node_modules/inline-style-prefixer/es/utils/prefixValue.js +11 -0
  418. data/node_modules/inline-style-prefixer/lib/createPrefixer.js +66 -0
  419. data/node_modules/inline-style-prefixer/lib/data.js +17 -0
  420. data/node_modules/inline-style-prefixer/lib/generator/generatePluginList.js +32 -0
  421. data/node_modules/inline-style-prefixer/lib/generator/generatePrefixMap.js +86 -0
  422. data/node_modules/inline-style-prefixer/lib/generator/index.js +85 -0
  423. data/node_modules/inline-style-prefixer/lib/generator/maps/pluginMap.js +113 -0
  424. data/node_modules/inline-style-prefixer/lib/generator/maps/propertyMap.js +43 -0
  425. data/node_modules/inline-style-prefixer/lib/index.js +78 -0
  426. data/node_modules/inline-style-prefixer/lib/plugins/backgroundClip.js +13 -0
  427. data/node_modules/inline-style-prefixer/lib/plugins/calc.js +21 -0
  428. data/node_modules/inline-style-prefixer/lib/plugins/crossFade.js +22 -0
  429. data/node_modules/inline-style-prefixer/lib/plugins/cursor.js +22 -0
  430. data/node_modules/inline-style-prefixer/lib/plugins/filter.js +22 -0
  431. data/node_modules/inline-style-prefixer/lib/plugins/flex.js +16 -0
  432. data/node_modules/inline-style-prefixer/lib/plugins/flexboxIE.js +73 -0
  433. data/node_modules/inline-style-prefixer/lib/plugins/flexboxOld.js +39 -0
  434. data/node_modules/inline-style-prefixer/lib/plugins/gradient.js +26 -0
  435. data/node_modules/inline-style-prefixer/lib/plugins/grid.js +136 -0
  436. data/node_modules/inline-style-prefixer/lib/plugins/imageSet.js +22 -0
  437. data/node_modules/inline-style-prefixer/lib/plugins/index.js +69 -0
  438. data/node_modules/inline-style-prefixer/lib/plugins/logical.js +41 -0
  439. data/node_modules/inline-style-prefixer/lib/plugins/position.js +11 -0
  440. data/node_modules/inline-style-prefixer/lib/plugins/sizing.js +32 -0
  441. data/node_modules/inline-style-prefixer/lib/plugins/transition.js +92 -0
  442. data/node_modules/inline-style-prefixer/lib/utils/addNewValuesOnly.js +21 -0
  443. data/node_modules/inline-style-prefixer/lib/utils/capitalizeString.js +9 -0
  444. data/node_modules/inline-style-prefixer/lib/utils/isObject.js +9 -0
  445. data/node_modules/inline-style-prefixer/lib/utils/prefixProperty.js +32 -0
  446. data/node_modules/inline-style-prefixer/lib/utils/prefixValue.js +17 -0
  447. data/node_modules/inline-style-prefixer/package.json +79 -0
  448. data/node_modules/isobject/LICENSE +21 -0
  449. data/node_modules/isobject/README.md +122 -0
  450. data/node_modules/isobject/index.d.ts +5 -0
  451. data/node_modules/isobject/index.js +12 -0
  452. data/node_modules/isobject/package.json +74 -0
  453. data/node_modules/js-tokens/CHANGELOG.md +151 -0
  454. data/node_modules/js-tokens/LICENSE +21 -0
  455. data/node_modules/js-tokens/README.md +240 -0
  456. data/node_modules/js-tokens/index.js +23 -0
  457. data/node_modules/js-tokens/package.json +30 -0
  458. data/node_modules/loose-envify/LICENSE +21 -0
  459. data/node_modules/loose-envify/README.md +45 -0
  460. data/node_modules/loose-envify/cli.js +16 -0
  461. data/node_modules/loose-envify/custom.js +4 -0
  462. data/node_modules/loose-envify/index.js +3 -0
  463. data/node_modules/loose-envify/loose-envify.js +36 -0
  464. data/node_modules/loose-envify/package.json +36 -0
  465. data/node_modules/loose-envify/replace.js +65 -0
  466. data/node_modules/mdn-data/LICENSE +116 -0
  467. data/node_modules/mdn-data/README.md +56 -0
  468. data/node_modules/mdn-data/api/index.js +3 -0
  469. data/node_modules/mdn-data/api/inheritance.json +2681 -0
  470. data/node_modules/mdn-data/api/inheritance.schema.json +31 -0
  471. data/node_modules/mdn-data/css/at-rules.json +560 -0
  472. data/node_modules/mdn-data/css/at-rules.schema.json +132 -0
  473. data/node_modules/mdn-data/css/definitions.json +77 -0
  474. data/node_modules/mdn-data/css/index.js +8 -0
  475. data/node_modules/mdn-data/css/properties.json +9163 -0
  476. data/node_modules/mdn-data/css/properties.schema.json +402 -0
  477. data/node_modules/mdn-data/css/selectors.json +927 -0
  478. data/node_modules/mdn-data/css/selectors.schema.json +36 -0
  479. data/node_modules/mdn-data/css/syntaxes.json +761 -0
  480. data/node_modules/mdn-data/css/syntaxes.schema.json +15 -0
  481. data/node_modules/mdn-data/css/types.json +265 -0
  482. data/node_modules/mdn-data/css/types.schema.json +32 -0
  483. data/node_modules/mdn-data/css/units.json +199 -0
  484. data/node_modules/mdn-data/css/units.schema.json +28 -0
  485. data/node_modules/mdn-data/index.js +5 -0
  486. data/node_modules/mdn-data/l10n/css.json +1567 -0
  487. data/node_modules/mdn-data/l10n/index.js +3 -0
  488. data/node_modules/mdn-data/package.json +39 -0
  489. data/node_modules/nano-css/.circleci/config.yml +85 -0
  490. data/node_modules/nano-css/.eslintrc.yml +27 -0
  491. data/node_modules/nano-css/.github/FUNDING.yml +3 -0
  492. data/node_modules/nano-css/.github/workflows/nodejs.yml +23 -0
  493. data/node_modules/nano-css/CHANGELOG.md +362 -0
  494. data/node_modules/nano-css/LICENSE +24 -0
  495. data/node_modules/nano-css/README.md +70 -0
  496. data/node_modules/nano-css/addon/__dev__/warnOnMissingDependencies.js +25 -0
  497. data/node_modules/nano-css/addon/__tests__/__snapshots__/reset.test.js.snap +407 -0
  498. data/node_modules/nano-css/addon/__tests__/__snapshots__/tachyons.test.js.snap +43 -0
  499. data/node_modules/nano-css/addon/__tests__/amp.server.dev.test.js +6 -0
  500. data/node_modules/nano-css/addon/__tests__/amp.server.test.js +223 -0
  501. data/node_modules/nano-css/addon/__tests__/atoms.dev.test.js +5 -0
  502. data/node_modules/nano-css/addon/__tests__/atoms.server.dev.test.js +8 -0
  503. data/node_modules/nano-css/addon/__tests__/atoms.server.test.js +6 -0
  504. data/node_modules/nano-css/addon/__tests__/atoms.test.js +49 -0
  505. data/node_modules/nano-css/addon/__tests__/cssom.server.test.js +12 -0
  506. data/node_modules/nano-css/addon/__tests__/emmet/emmet.dev.test.js +5 -0
  507. data/node_modules/nano-css/addon/__tests__/emmet/emmet.server.dev.test.js +8 -0
  508. data/node_modules/nano-css/addon/__tests__/emmet/emmet.server.test.js +6 -0
  509. data/node_modules/nano-css/addon/__tests__/emmet/emmet.test.js +219 -0
  510. data/node_modules/nano-css/addon/__tests__/env.js +6 -0
  511. data/node_modules/nano-css/addon/__tests__/extract.server.test.js +159 -0
  512. data/node_modules/nano-css/addon/__tests__/index.server.dev.test.js +6 -0
  513. data/node_modules/nano-css/addon/__tests__/index.server.test.js +4 -0
  514. data/node_modules/nano-css/addon/__tests__/index.test.js +257 -0
  515. data/node_modules/nano-css/addon/__tests__/jsx.dev.test.js +5 -0
  516. data/node_modules/nano-css/addon/__tests__/jsx.server.dev.test.js +6 -0
  517. data/node_modules/nano-css/addon/__tests__/jsx.server.test.js +4 -0
  518. data/node_modules/nano-css/addon/__tests__/jsx.test.js +33 -0
  519. data/node_modules/nano-css/addon/__tests__/keyframes.dev.test.js +5 -0
  520. data/node_modules/nano-css/addon/__tests__/keyframes.server.dev.test.js +6 -0
  521. data/node_modules/nano-css/addon/__tests__/keyframes.server.test.js +4 -0
  522. data/node_modules/nano-css/addon/__tests__/keyframes.test.js +131 -0
  523. data/node_modules/nano-css/addon/__tests__/limit.server.test.js +54 -0
  524. data/node_modules/nano-css/addon/__tests__/nesting.test.js +85 -0
  525. data/node_modules/nano-css/addon/__tests__/prefixer.test.js +121 -0
  526. data/node_modules/nano-css/addon/__tests__/put.dev.test.js +5 -0
  527. data/node_modules/nano-css/addon/__tests__/put.server.dev.test.js +6 -0
  528. data/node_modules/nano-css/addon/__tests__/put.server.test.js +4 -0
  529. data/node_modules/nano-css/addon/__tests__/put.test.js +75 -0
  530. data/node_modules/nano-css/addon/__tests__/reset.test.js +38 -0
  531. data/node_modules/nano-css/addon/__tests__/rule.dev.test.js +5 -0
  532. data/node_modules/nano-css/addon/__tests__/rule.server.dev.test.js +7 -0
  533. data/node_modules/nano-css/addon/__tests__/rule.server.test.js +5 -0
  534. data/node_modules/nano-css/addon/__tests__/rule.test.js +57 -0
  535. data/node_modules/nano-css/addon/__tests__/setup.js +7 -0
  536. data/node_modules/nano-css/addon/__tests__/sheet.test.js +74 -0
  537. data/node_modules/nano-css/addon/__tests__/snake.test.js +124 -0
  538. data/node_modules/nano-css/addon/__tests__/tachyons.test.js +45 -0
  539. data/node_modules/nano-css/addon/__tests__/units.dev.test.js +5 -0
  540. data/node_modules/nano-css/addon/__tests__/units.server.dev.test.js +6 -0
  541. data/node_modules/nano-css/addon/__tests__/units.server.test.js +4 -0
  542. data/node_modules/nano-css/addon/__tests__/units.test.js +41 -0
  543. data/node_modules/nano-css/addon/__tests__/validate.dev.test.js +5 -0
  544. data/node_modules/nano-css/addon/__tests__/validate.test.js +69 -0
  545. data/node_modules/nano-css/addon/__tests__/vcssom.server.test.js +14 -0
  546. data/node_modules/nano-css/addon/__tests__/virtual.dev.test.js +5 -0
  547. data/node_modules/nano-css/addon/__tests__/virtual.server.dev.test.js +6 -0
  548. data/node_modules/nano-css/addon/__tests__/virtual.server.test.js +4 -0
  549. data/node_modules/nano-css/addon/__tests__/virtual.test.js +225 -0
  550. data/node_modules/nano-css/addon/amp.d.ts +5 -0
  551. data/node_modules/nano-css/addon/amp.js +156 -0
  552. data/node_modules/nano-css/addon/animate/fadeIn.js +22 -0
  553. data/node_modules/nano-css/addon/animate/fadeInDown.js +25 -0
  554. data/node_modules/nano-css/addon/animate/fadeInScale.js +25 -0
  555. data/node_modules/nano-css/addon/animate/fadeOut.js +23 -0
  556. data/node_modules/nano-css/addon/animate/fadeOutScale.js +21 -0
  557. data/node_modules/nano-css/addon/array.d.ts +5 -0
  558. data/node_modules/nano-css/addon/array.js +33 -0
  559. data/node_modules/nano-css/addon/atoms.d.ts +243 -0
  560. data/node_modules/nano-css/addon/atoms.js +63 -0
  561. data/node_modules/nano-css/addon/cache.d.ts +8 -0
  562. data/node_modules/nano-css/addon/cache.js +17 -0
  563. data/node_modules/nano-css/addon/component.d.ts +7 -0
  564. data/node_modules/nano-css/addon/component.js +26 -0
  565. data/node_modules/nano-css/addon/cssom.d.ts +17 -0
  566. data/node_modules/nano-css/addon/cssom.js +36 -0
  567. data/node_modules/nano-css/addon/decorator.d.ts +7 -0
  568. data/node_modules/nano-css/addon/decorator.js +43 -0
  569. data/node_modules/nano-css/addon/drule.d.ts +8 -0
  570. data/node_modules/nano-css/addon/drule.js +27 -0
  571. data/node_modules/nano-css/addon/dsheet.d.ts +8 -0
  572. data/node_modules/nano-css/addon/dsheet.js +36 -0
  573. data/node_modules/nano-css/addon/emmet.d.ts +614 -0
  574. data/node_modules/nano-css/addon/emmet.js +177 -0
  575. data/node_modules/nano-css/addon/extract.d.ts +5 -0
  576. data/node_modules/nano-css/addon/extract.js +59 -0
  577. data/node_modules/nano-css/addon/global.d.ts +8 -0
  578. data/node_modules/nano-css/addon/global.js +19 -0
  579. data/node_modules/nano-css/addon/googleFont.d.ts +8 -0
  580. data/node_modules/nano-css/addon/googleFont.js +43 -0
  581. data/node_modules/nano-css/addon/hydrate.d.ts +7 -0
  582. data/node_modules/nano-css/addon/hydrate.js +28 -0
  583. data/node_modules/nano-css/addon/hyperstyle.js +27 -0
  584. data/node_modules/nano-css/addon/important.js +38 -0
  585. data/node_modules/nano-css/addon/jsx.js +60 -0
  586. data/node_modules/nano-css/addon/keyframes.d.ts +34 -0
  587. data/node_modules/nano-css/addon/keyframes.js +61 -0
  588. data/node_modules/nano-css/addon/limit.js +26 -0
  589. data/node_modules/nano-css/addon/nesting.js +37 -0
  590. data/node_modules/nano-css/addon/pipe.js +57 -0
  591. data/node_modules/nano-css/addon/prefixer.js +79 -0
  592. data/node_modules/nano-css/addon/ref.js +87 -0
  593. data/node_modules/nano-css/addon/reset/EricMeyer.js +48 -0
  594. data/node_modules/nano-css/addon/reset/EricMeyerCondensed.js +44 -0
  595. data/node_modules/nano-css/addon/reset/Minimalistic.js +16 -0
  596. data/node_modules/nano-css/addon/reset/Minimalistic2.js +17 -0
  597. data/node_modules/nano-css/addon/reset/Minimalistic3.js +18 -0
  598. data/node_modules/nano-css/addon/reset/Normalize.js +83 -0
  599. data/node_modules/nano-css/addon/reset/PoorMan.js +25 -0
  600. data/node_modules/nano-css/addon/reset/ShaunInman.js +42 -0
  601. data/node_modules/nano-css/addon/reset/Siolon.js +34 -0
  602. data/node_modules/nano-css/addon/reset/Tantek.js +31 -0
  603. data/node_modules/nano-css/addon/reset/Tripoli.js +75 -0
  604. data/node_modules/nano-css/addon/reset/Universal.js +23 -0
  605. data/node_modules/nano-css/addon/reset/Yahoo.js +43 -0
  606. data/node_modules/nano-css/addon/reset-font.js +24 -0
  607. data/node_modules/nano-css/addon/rtl.js +15 -0
  608. data/node_modules/nano-css/addon/rule.d.ts +26 -0
  609. data/node_modules/nano-css/addon/rule.js +39 -0
  610. data/node_modules/nano-css/addon/sheet.d.ts +22 -0
  611. data/node_modules/nano-css/addon/sheet.js +45 -0
  612. data/node_modules/nano-css/addon/snake.js +141 -0
  613. data/node_modules/nano-css/addon/sourcemaps.js +96 -0
  614. data/node_modules/nano-css/addon/spread.js +23 -0
  615. data/node_modules/nano-css/addon/stable.js +7 -0
  616. data/node_modules/nano-css/addon/style.js +33 -0
  617. data/node_modules/nano-css/addon/styled.js +161 -0
  618. data/node_modules/nano-css/addon/stylis/plugin-onRule.js +43 -0
  619. data/node_modules/nano-css/addon/stylis.js +28 -0
  620. data/node_modules/nano-css/addon/tachyons.js +215 -0
  621. data/node_modules/nano-css/addon/unitless.js +78 -0
  622. data/node_modules/nano-css/addon/units.d.ts +89 -0
  623. data/node_modules/nano-css/addon/units.js +27 -0
  624. data/node_modules/nano-css/addon/useStyles.js +24 -0
  625. data/node_modules/nano-css/addon/util/cloneElement.js +11 -0
  626. data/node_modules/nano-css/addon/util/transformComponentDynamic.js +50 -0
  627. data/node_modules/nano-css/addon/util/transformComponentStatic.js +26 -0
  628. data/node_modules/nano-css/addon/validate.js +82 -0
  629. data/node_modules/nano-css/addon/vcssom/__tests__/cssToTree.test.js +159 -0
  630. data/node_modules/nano-css/addon/vcssom/cssToTree.d.ts +15 -0
  631. data/node_modules/nano-css/addon/vcssom/cssToTree.js +42 -0
  632. data/node_modules/nano-css/addon/vcssom/removeRule.d.ts +3 -0
  633. data/node_modules/nano-css/addon/vcssom/removeRule.js +15 -0
  634. data/node_modules/nano-css/addon/vcssom.d.ts +72 -0
  635. data/node_modules/nano-css/addon/vcssom.js +97 -0
  636. data/node_modules/nano-css/addon/virtual.js +107 -0
  637. data/node_modules/nano-css/addon/withStyles.js +32 -0
  638. data/node_modules/nano-css/index.d.ts +4 -0
  639. data/node_modules/nano-css/index.js +138 -0
  640. data/node_modules/nano-css/package.json +145 -0
  641. data/node_modules/nano-css/preset/react.js +43 -0
  642. data/node_modules/nano-css/preset/sheet.d.ts +5 -0
  643. data/node_modules/nano-css/preset/sheet.js +27 -0
  644. data/node_modules/nano-css/preset/vdom.js +40 -0
  645. data/node_modules/nano-css/prettier.config.js +13 -0
  646. data/node_modules/nano-css/renovate.json +3 -0
  647. data/node_modules/nano-css/types/common.d.ts +14 -0
  648. data/node_modules/nano-css/types/demo.ts +7 -0
  649. data/node_modules/nano-css/types/nano.d.ts +171 -0
  650. data/node_modules/object-assign/index.js +90 -0
  651. data/node_modules/object-assign/license +21 -0
  652. data/node_modules/object-assign/package.json +42 -0
  653. data/node_modules/object-assign/readme.md +61 -0
  654. data/node_modules/preact/LICENSE +21 -0
  655. data/node_modules/preact/README.md +187 -0
  656. data/node_modules/preact/compat/LICENSE +21 -0
  657. data/node_modules/preact/compat/dist/compat.js +2 -0
  658. data/node_modules/preact/compat/dist/compat.js.map +1 -0
  659. data/node_modules/preact/compat/dist/compat.mjs +2 -0
  660. data/node_modules/preact/compat/dist/compat.mjs.map +1 -0
  661. data/node_modules/preact/compat/dist/compat.modern.js +2 -0
  662. data/node_modules/preact/compat/dist/compat.modern.js.map +1 -0
  663. data/node_modules/preact/compat/dist/compat.module.js +2 -0
  664. data/node_modules/preact/compat/dist/compat.module.js.map +1 -0
  665. data/node_modules/preact/compat/dist/compat.umd.js +2 -0
  666. data/node_modules/preact/compat/dist/compat.umd.js.map +1 -0
  667. data/node_modules/preact/compat/jsx-dev-runtime.js +1 -0
  668. data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -0
  669. data/node_modules/preact/compat/jsx-runtime.js +1 -0
  670. data/node_modules/preact/compat/jsx-runtime.mjs +1 -0
  671. data/node_modules/preact/compat/package.json +19 -0
  672. data/node_modules/preact/compat/scheduler.js +15 -0
  673. data/node_modules/preact/compat/scheduler.mjs +23 -0
  674. data/node_modules/preact/compat/server.js +15 -0
  675. data/node_modules/preact/compat/server.mjs +4 -0
  676. data/node_modules/preact/compat/src/Children.js +21 -0
  677. data/node_modules/preact/compat/src/PureComponent.js +15 -0
  678. data/node_modules/preact/compat/src/forwardRef.js +51 -0
  679. data/node_modules/preact/compat/src/index.d.ts +140 -0
  680. data/node_modules/preact/compat/src/index.js +187 -0
  681. data/node_modules/preact/compat/src/internal.d.ts +47 -0
  682. data/node_modules/preact/compat/src/memo.js +34 -0
  683. data/node_modules/preact/compat/src/portals.js +80 -0
  684. data/node_modules/preact/compat/src/render.js +219 -0
  685. data/node_modules/preact/compat/src/suspense-list.d.ts +14 -0
  686. data/node_modules/preact/compat/src/suspense-list.js +126 -0
  687. data/node_modules/preact/compat/src/suspense.d.ts +15 -0
  688. data/node_modules/preact/compat/src/suspense.js +270 -0
  689. data/node_modules/preact/compat/src/util.js +28 -0
  690. data/node_modules/preact/compat/test-utils.js +1 -0
  691. data/node_modules/preact/debug/LICENSE +21 -0
  692. data/node_modules/preact/debug/dist/debug.js +2 -0
  693. data/node_modules/preact/debug/dist/debug.js.map +1 -0
  694. data/node_modules/preact/debug/dist/debug.mjs +2 -0
  695. data/node_modules/preact/debug/dist/debug.mjs.map +1 -0
  696. data/node_modules/preact/debug/dist/debug.modern.js +2 -0
  697. data/node_modules/preact/debug/dist/debug.modern.js.map +1 -0
  698. data/node_modules/preact/debug/dist/debug.module.js +2 -0
  699. data/node_modules/preact/debug/dist/debug.module.js.map +1 -0
  700. data/node_modules/preact/debug/dist/debug.umd.js +2 -0
  701. data/node_modules/preact/debug/dist/debug.umd.js.map +1 -0
  702. data/node_modules/preact/debug/package.json +18 -0
  703. data/node_modules/preact/debug/src/check-props.js +54 -0
  704. data/node_modules/preact/debug/src/component-stack.js +146 -0
  705. data/node_modules/preact/debug/src/constants.js +3 -0
  706. data/node_modules/preact/debug/src/debug.js +442 -0
  707. data/node_modules/preact/debug/src/index.js +6 -0
  708. data/node_modules/preact/debug/src/internal.d.ts +82 -0
  709. data/node_modules/preact/debug/src/util.js +11 -0
  710. data/node_modules/preact/devtools/LICENSE +21 -0
  711. data/node_modules/preact/devtools/dist/devtools.js +2 -0
  712. data/node_modules/preact/devtools/dist/devtools.js.map +1 -0
  713. data/node_modules/preact/devtools/dist/devtools.mjs +2 -0
  714. data/node_modules/preact/devtools/dist/devtools.mjs.map +1 -0
  715. data/node_modules/preact/devtools/dist/devtools.modern.js +2 -0
  716. data/node_modules/preact/devtools/dist/devtools.modern.js.map +1 -0
  717. data/node_modules/preact/devtools/dist/devtools.module.js +2 -0
  718. data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -0
  719. data/node_modules/preact/devtools/dist/devtools.umd.js +2 -0
  720. data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -0
  721. data/node_modules/preact/devtools/package.json +16 -0
  722. data/node_modules/preact/devtools/src/devtools.js +10 -0
  723. data/node_modules/preact/devtools/src/index.d.ts +8 -0
  724. data/node_modules/preact/devtools/src/index.js +15 -0
  725. data/node_modules/preact/dist/preact.js +2 -0
  726. data/node_modules/preact/dist/preact.js.map +1 -0
  727. data/node_modules/preact/dist/preact.min.js +2 -0
  728. data/node_modules/preact/dist/preact.min.js.map +1 -0
  729. data/node_modules/preact/dist/preact.mjs +2 -0
  730. data/node_modules/preact/dist/preact.mjs.map +1 -0
  731. data/node_modules/preact/dist/preact.module.js +2 -0
  732. data/node_modules/preact/dist/preact.module.js.map +1 -0
  733. data/node_modules/preact/dist/preact.umd.js +2 -0
  734. data/node_modules/preact/dist/preact.umd.js.map +1 -0
  735. data/node_modules/preact/hooks/LICENSE +21 -0
  736. data/node_modules/preact/hooks/dist/hooks.js +2 -0
  737. data/node_modules/preact/hooks/dist/hooks.js.map +1 -0
  738. data/node_modules/preact/hooks/dist/hooks.mjs +2 -0
  739. data/node_modules/preact/hooks/dist/hooks.mjs.map +1 -0
  740. data/node_modules/preact/hooks/dist/hooks.modern.js +2 -0
  741. data/node_modules/preact/hooks/dist/hooks.modern.js.map +1 -0
  742. data/node_modules/preact/hooks/dist/hooks.module.js +2 -0
  743. data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -0
  744. data/node_modules/preact/hooks/dist/hooks.umd.js +2 -0
  745. data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -0
  746. data/node_modules/preact/hooks/package.json +26 -0
  747. data/node_modules/preact/hooks/src/index.d.ts +133 -0
  748. data/node_modules/preact/hooks/src/index.js +386 -0
  749. data/node_modules/preact/hooks/src/internal.d.ts +75 -0
  750. data/node_modules/preact/jsx-runtime/LICENSE +21 -0
  751. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js +2 -0
  752. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -0
  753. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs +2 -0
  754. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.modern.js +2 -0
  755. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.modern.js.map +1 -0
  756. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js +2 -0
  757. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -0
  758. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js +2 -0
  759. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -0
  760. data/node_modules/preact/jsx-runtime/package.json +19 -0
  761. data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -0
  762. data/node_modules/preact/jsx-runtime/src/index.js +77 -0
  763. data/node_modules/preact/package.json +270 -0
  764. data/node_modules/preact/src/cjs.js +3 -0
  765. data/node_modules/preact/src/clone-element.js +34 -0
  766. data/node_modules/preact/src/component.js +225 -0
  767. data/node_modules/preact/src/constants.js +3 -0
  768. data/node_modules/preact/src/create-context.js +68 -0
  769. data/node_modules/preact/src/create-element.js +97 -0
  770. data/node_modules/preact/src/diff/catch-error.js +38 -0
  771. data/node_modules/preact/src/diff/children.js +347 -0
  772. data/node_modules/preact/src/diff/index.js +514 -0
  773. data/node_modules/preact/src/diff/props.js +158 -0
  774. data/node_modules/preact/src/index.d.ts +310 -0
  775. data/node_modules/preact/src/index.js +13 -0
  776. data/node_modules/preact/src/internal.d.ts +146 -0
  777. data/node_modules/preact/src/jsx.d.ts +962 -0
  778. data/node_modules/preact/src/options.js +16 -0
  779. data/node_modules/preact/src/render.js +75 -0
  780. data/node_modules/preact/src/util.js +27 -0
  781. data/node_modules/preact/test-utils/dist/testUtils.js +2 -0
  782. data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -0
  783. data/node_modules/preact/test-utils/dist/testUtils.mjs +2 -0
  784. data/node_modules/preact/test-utils/dist/testUtils.mjs.map +1 -0
  785. data/node_modules/preact/test-utils/dist/testUtils.modern.js +2 -0
  786. data/node_modules/preact/test-utils/dist/testUtils.modern.js.map +1 -0
  787. data/node_modules/preact/test-utils/dist/testUtils.module.js +2 -0
  788. data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -0
  789. data/node_modules/preact/test-utils/dist/testUtils.umd.js +2 -0
  790. data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -0
  791. data/node_modules/preact/test-utils/package.json +19 -0
  792. data/node_modules/preact/test-utils/src/index.d.ts +3 -0
  793. data/node_modules/preact/test-utils/src/index.js +117 -0
  794. data/node_modules/preact-deep-force-update/.babelrc +8 -0
  795. data/node_modules/preact-deep-force-update/.eslintrc +66 -0
  796. data/node_modules/preact-deep-force-update/.npmignore +2 -0
  797. data/node_modules/preact-deep-force-update/.travis.yml +3 -0
  798. data/node_modules/preact-deep-force-update/LICENSE +21 -0
  799. data/node_modules/preact-deep-force-update/README.md +53 -0
  800. data/node_modules/preact-deep-force-update/dist/deep-force-update.js +36 -0
  801. data/node_modules/preact-deep-force-update/dist/deep-force-update.js.map +1 -0
  802. data/node_modules/preact-deep-force-update/dist/deep-force-update.min.js +2 -0
  803. data/node_modules/preact-deep-force-update/dist/deep-force-update.min.js.map +1 -0
  804. data/node_modules/preact-deep-force-update/karma.conf.js +32 -0
  805. data/node_modules/preact-deep-force-update/package.json +80 -0
  806. data/node_modules/preact-deep-force-update/rollup.config.js +17 -0
  807. data/node_modules/preact-deep-force-update/src/index.js +27 -0
  808. data/node_modules/preact-deep-force-update/test/index.js +50 -0
  809. data/node_modules/preact-render-to-string/LICENSE +21 -0
  810. data/node_modules/preact-render-to-string/README.md +102 -0
  811. data/node_modules/preact-render-to-string/dist/commonjs.js +2 -0
  812. data/node_modules/preact-render-to-string/dist/commonjs.js.map +1 -0
  813. data/node_modules/preact-render-to-string/dist/index.d.ts +16 -0
  814. data/node_modules/preact-render-to-string/dist/index.js +1 -0
  815. data/node_modules/preact-render-to-string/dist/index.js.map +1 -0
  816. data/node_modules/preact-render-to-string/dist/index.mjs +2 -0
  817. data/node_modules/preact-render-to-string/dist/index.module.js +2 -0
  818. data/node_modules/preact-render-to-string/dist/index.module.js.map +1 -0
  819. data/node_modules/preact-render-to-string/dist/jsx-entry.js +2 -0
  820. data/node_modules/preact-render-to-string/dist/jsx-entry.js.map +1 -0
  821. data/node_modules/preact-render-to-string/dist/jsx.d.ts +13 -0
  822. data/node_modules/preact-render-to-string/dist/jsx.js +1 -0
  823. data/node_modules/preact-render-to-string/dist/jsx.js.map +1 -0
  824. data/node_modules/preact-render-to-string/dist/jsx.mjs +2 -0
  825. data/node_modules/preact-render-to-string/dist/jsx.modern.js +2 -0
  826. data/node_modules/preact-render-to-string/dist/jsx.modern.js.map +1 -0
  827. data/node_modules/preact-render-to-string/dist/jsx.module.js +2 -0
  828. data/node_modules/preact-render-to-string/dist/jsx.module.js.map +1 -0
  829. data/node_modules/preact-render-to-string/dist/preact-render-to-string-tests.d.ts +1 -0
  830. data/node_modules/preact-render-to-string/jsx.js +1 -0
  831. data/node_modules/preact-render-to-string/package.json +139 -0
  832. data/node_modules/preact-render-to-string/src/index.d.ts +16 -0
  833. data/node_modules/preact-render-to-string/src/index.js +438 -0
  834. data/node_modules/preact-render-to-string/src/jsx.d.ts +13 -0
  835. data/node_modules/preact-render-to-string/src/jsx.js +76 -0
  836. data/node_modules/preact-render-to-string/src/polyfills.js +8 -0
  837. data/node_modules/preact-render-to-string/src/preact-render-to-string-tests.d.ts +1 -0
  838. data/node_modules/preact-render-to-string/src/util.js +78 -0
  839. data/node_modules/preact-render-to-string/typings.json +5 -0
  840. data/node_modules/pretty-format/.npmignore +3 -0
  841. data/node_modules/pretty-format/LICENSE.md +15 -0
  842. data/node_modules/pretty-format/README.md +94 -0
  843. data/node_modules/pretty-format/index.js +343 -0
  844. data/node_modules/pretty-format/package.json +26 -0
  845. data/node_modules/pretty-format/plugins/ReactElement.js +74 -0
  846. data/node_modules/pretty-format/plugins/ReactTestComponent.js +58 -0
  847. data/node_modules/pretty-format/printString.js +7 -0
  848. data/node_modules/react/LICENSE +21 -0
  849. data/node_modules/react/README.md +13 -0
  850. data/node_modules/react/build-info.json +8 -0
  851. data/node_modules/react/cjs/react-jsx-dev-runtime.development.js +1203 -0
  852. data/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +9 -0
  853. data/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +9 -0
  854. data/node_modules/react/cjs/react-jsx-runtime.development.js +1221 -0
  855. data/node_modules/react/cjs/react-jsx-runtime.production.min.js +10 -0
  856. data/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +10 -0
  857. data/node_modules/react/cjs/react.development.js +2333 -0
  858. data/node_modules/react/cjs/react.production.min.js +23 -0
  859. data/node_modules/react/index.js +7 -0
  860. data/node_modules/react/jsx-dev-runtime.js +7 -0
  861. data/node_modules/react/jsx-runtime.js +7 -0
  862. data/node_modules/react/package.json +39 -0
  863. data/node_modules/react/umd/react.development.js +3357 -0
  864. data/node_modules/react/umd/react.production.min.js +31 -0
  865. data/node_modules/react/umd/react.profiling.min.js +36 -0
  866. data/node_modules/react-dom/LICENSE +21 -0
  867. data/node_modules/react-dom/README.md +54 -0
  868. data/node_modules/react-dom/build-info.json +8 -0
  869. data/node_modules/react-dom/cjs/react-dom-server.browser.development.js +4342 -0
  870. data/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +51 -0
  871. data/node_modules/react-dom/cjs/react-dom-server.node.development.js +4383 -0
  872. data/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +52 -0
  873. data/node_modules/react-dom/cjs/react-dom-test-utils.development.js +2118 -0
  874. data/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +43 -0
  875. data/node_modules/react-dom/cjs/react-dom.development.js +26262 -0
  876. data/node_modules/react-dom/cjs/react-dom.production.min.js +297 -0
  877. data/node_modules/react-dom/cjs/react-dom.profiling.min.js +310 -0
  878. data/node_modules/react-dom/index.js +38 -0
  879. data/node_modules/react-dom/package.json +49 -0
  880. data/node_modules/react-dom/profiling.js +38 -0
  881. data/node_modules/react-dom/server.browser.js +7 -0
  882. data/node_modules/react-dom/server.js +3 -0
  883. data/node_modules/react-dom/server.node.js +7 -0
  884. data/node_modules/react-dom/test-utils.js +7 -0
  885. data/node_modules/react-dom/umd/react-dom-server.browser.development.js +4341 -0
  886. data/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +46 -0
  887. data/node_modules/react-dom/umd/react-dom-test-utils.development.js +2136 -0
  888. data/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +35 -0
  889. data/node_modules/react-dom/umd/react-dom.development.js +26292 -0
  890. data/node_modules/react-dom/umd/react-dom.production.min.js +245 -0
  891. data/node_modules/react-dom/umd/react-dom.profiling.min.js +252 -0
  892. data/node_modules/regenerator-runtime/LICENSE +21 -0
  893. data/node_modules/regenerator-runtime/README.md +31 -0
  894. data/node_modules/regenerator-runtime/package.json +19 -0
  895. data/node_modules/regenerator-runtime/path.js +11 -0
  896. data/node_modules/regenerator-runtime/runtime.js +754 -0
  897. data/node_modules/rtl-css-js/CHANGELOG.md +5 -0
  898. data/node_modules/rtl-css-js/LICENSE +20 -0
  899. data/node_modules/rtl-css-js/README.md +205 -0
  900. data/node_modules/rtl-css-js/core/package.json +6 -0
  901. data/node_modules/rtl-css-js/core.d.ts +163 -0
  902. data/node_modules/rtl-css-js/core.esm.d.ts +1 -0
  903. data/node_modules/rtl-css-js/core.esm.js +9 -0
  904. data/node_modules/rtl-css-js/dist/cjs/convert-a10c80e3.js +509 -0
  905. data/node_modules/rtl-css-js/dist/cjs/core.js +30 -0
  906. data/node_modules/rtl-css-js/dist/cjs/index.js +7 -0
  907. data/node_modules/rtl-css-js/dist/esm/convert-09159978.js +487 -0
  908. data/node_modules/rtl-css-js/dist/esm/core.js +1 -0
  909. data/node_modules/rtl-css-js/dist/esm/index.js +5 -0
  910. data/node_modules/rtl-css-js/dist/rtl-css-js.core.umd.js +519 -0
  911. data/node_modules/rtl-css-js/dist/rtl-css-js.core.umd.js.map +1 -0
  912. data/node_modules/rtl-css-js/dist/rtl-css-js.core.umd.min.js +2 -0
  913. data/node_modules/rtl-css-js/dist/rtl-css-js.core.umd.min.js.map +1 -0
  914. data/node_modules/rtl-css-js/dist/rtl-css-js.umd.js +496 -0
  915. data/node_modules/rtl-css-js/dist/rtl-css-js.umd.js.map +1 -0
  916. data/node_modules/rtl-css-js/dist/rtl-css-js.umd.min.js +2 -0
  917. data/node_modules/rtl-css-js/dist/rtl-css-js.umd.min.js.map +1 -0
  918. data/node_modules/rtl-css-js/package.json +66 -0
  919. data/node_modules/rtl-css-js/types.d.ts +8 -0
  920. data/node_modules/scheduler/LICENSE +21 -0
  921. data/node_modules/scheduler/README.md +9 -0
  922. data/node_modules/scheduler/build-info.json +8 -0
  923. data/node_modules/scheduler/cjs/scheduler-tracing.development.js +347 -0
  924. data/node_modules/scheduler/cjs/scheduler-tracing.production.min.js +9 -0
  925. data/node_modules/scheduler/cjs/scheduler-tracing.profiling.min.js +16 -0
  926. data/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +665 -0
  927. data/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +19 -0
  928. data/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +206 -0
  929. data/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +13 -0
  930. data/node_modules/scheduler/cjs/scheduler.development.js +646 -0
  931. data/node_modules/scheduler/cjs/scheduler.production.min.js +20 -0
  932. data/node_modules/scheduler/index.js +7 -0
  933. data/node_modules/scheduler/package.json +40 -0
  934. data/node_modules/scheduler/tracing-profiling.js +7 -0
  935. data/node_modules/scheduler/tracing.js +7 -0
  936. data/node_modules/scheduler/umd/scheduler-tracing.development.js +80 -0
  937. data/node_modules/scheduler/umd/scheduler-tracing.production.min.js +80 -0
  938. data/node_modules/scheduler/umd/scheduler-tracing.profiling.min.js +80 -0
  939. data/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +664 -0
  940. data/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +18 -0
  941. data/node_modules/scheduler/umd/scheduler.development.js +152 -0
  942. data/node_modules/scheduler/umd/scheduler.production.min.js +146 -0
  943. data/node_modules/scheduler/umd/scheduler.profiling.min.js +146 -0
  944. data/node_modules/scheduler/unstable_mock.js +7 -0
  945. data/node_modules/scheduler/unstable_post_task.js +7 -0
  946. data/node_modules/source-map/CHANGELOG.md +301 -0
  947. data/node_modules/source-map/LICENSE +28 -0
  948. data/node_modules/source-map/README.md +742 -0
  949. data/node_modules/source-map/dist/source-map.debug.js +3234 -0
  950. data/node_modules/source-map/dist/source-map.js +3233 -0
  951. data/node_modules/source-map/dist/source-map.min.js +2 -0
  952. data/node_modules/source-map/dist/source-map.min.js.map +1 -0
  953. data/node_modules/source-map/lib/array-set.js +121 -0
  954. data/node_modules/source-map/lib/base64-vlq.js +140 -0
  955. data/node_modules/source-map/lib/base64.js +67 -0
  956. data/node_modules/source-map/lib/binary-search.js +111 -0
  957. data/node_modules/source-map/lib/mapping-list.js +79 -0
  958. data/node_modules/source-map/lib/quick-sort.js +114 -0
  959. data/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  960. data/node_modules/source-map/lib/source-map-generator.js +425 -0
  961. data/node_modules/source-map/lib/source-node.js +413 -0
  962. data/node_modules/source-map/lib/util.js +488 -0
  963. data/node_modules/source-map/package.json +73 -0
  964. data/node_modules/source-map/source-map.d.ts +98 -0
  965. data/node_modules/source-map/source-map.js +8 -0
  966. data/node_modules/sourcemap-codec/CHANGELOG.md +64 -0
  967. data/node_modules/sourcemap-codec/LICENSE +21 -0
  968. data/node_modules/sourcemap-codec/README.md +63 -0
  969. data/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js +124 -0
  970. data/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js.map +1 -0
  971. data/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js +135 -0
  972. data/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js.map +1 -0
  973. data/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
  974. data/node_modules/sourcemap-codec/package.json +53 -0
  975. data/node_modules/stack-generator/.eslintrc.yml +32 -0
  976. data/node_modules/stack-generator/CHANGELOG.md +18 -0
  977. data/node_modules/stack-generator/CONTRIBUTING.md +27 -0
  978. data/node_modules/stack-generator/LICENSE +19 -0
  979. data/node_modules/stack-generator/README.md +28 -0
  980. data/node_modules/stack-generator/bower.json +33 -0
  981. data/node_modules/stack-generator/component.json +17 -0
  982. data/node_modules/stack-generator/dist/stack-generator.js +45 -0
  983. data/node_modules/stack-generator/dist/stack-generator.min.js +2 -0
  984. data/node_modules/stack-generator/dist/stack-generator.min.js.map +1 -0
  985. data/node_modules/stack-generator/karma.conf.ci.js +108 -0
  986. data/node_modules/stack-generator/karma.conf.js +26 -0
  987. data/node_modules/stack-generator/package.json +53 -0
  988. data/node_modules/stack-generator/stack-generator.js +45 -0
  989. data/node_modules/stackframe/.eslintrc.yml +29 -0
  990. data/node_modules/stackframe/CHANGELOG.md +39 -0
  991. data/node_modules/stackframe/CONTRIBUTING.md +28 -0
  992. data/node_modules/stackframe/LICENSE +19 -0
  993. data/node_modules/stackframe/README.md +78 -0
  994. data/node_modules/stackframe/bower.json +31 -0
  995. data/node_modules/stackframe/component.json +16 -0
  996. data/node_modules/stackframe/dist/stackframe.js +143 -0
  997. data/node_modules/stackframe/dist/stackframe.min.js +2 -0
  998. data/node_modules/stackframe/dist/stackframe.min.js.map +1 -0
  999. data/node_modules/stackframe/karma.conf.ci.js +105 -0
  1000. data/node_modules/stackframe/karma.conf.js +23 -0
  1001. data/node_modules/stackframe/package.json +51 -0
  1002. data/node_modules/stackframe/stackframe-tests.ts +47 -0
  1003. data/node_modules/stackframe/stackframe.d.ts +74 -0
  1004. data/node_modules/stackframe/stackframe.js +143 -0
  1005. data/node_modules/stacktrace-gps/CHANGELOG.md +60 -0
  1006. data/node_modules/stacktrace-gps/LICENSE +19 -0
  1007. data/node_modules/stacktrace-gps/README.md +89 -0
  1008. data/node_modules/stacktrace-gps/dist/polyfills.js +5 -0
  1009. data/node_modules/stacktrace-gps/dist/stacktrace-gps-with-polyfills.min.js +2 -0
  1010. data/node_modules/stacktrace-gps/dist/stacktrace-gps-with-polyfills.min.js.map +1 -0
  1011. data/node_modules/stacktrace-gps/dist/stacktrace-gps.js +342 -0
  1012. data/node_modules/stacktrace-gps/dist/stacktrace-gps.min.js +2 -0
  1013. data/node_modules/stacktrace-gps/dist/stacktrace-gps.min.js.map +1 -0
  1014. data/node_modules/stacktrace-gps/node_modules/source-map/CHANGELOG.md +301 -0
  1015. data/node_modules/stacktrace-gps/node_modules/source-map/LICENSE +28 -0
  1016. data/node_modules/stacktrace-gps/node_modules/source-map/README.md +729 -0
  1017. data/node_modules/stacktrace-gps/node_modules/source-map/dist/source-map.debug.js +3056 -0
  1018. data/node_modules/stacktrace-gps/node_modules/source-map/dist/source-map.js +3055 -0
  1019. data/node_modules/stacktrace-gps/node_modules/source-map/dist/source-map.min.js +2 -0
  1020. data/node_modules/stacktrace-gps/node_modules/source-map/dist/source-map.min.js.map +1 -0
  1021. data/node_modules/stacktrace-gps/node_modules/source-map/lib/array-set.js +104 -0
  1022. data/node_modules/stacktrace-gps/node_modules/source-map/lib/base64-vlq.js +140 -0
  1023. data/node_modules/stacktrace-gps/node_modules/source-map/lib/base64.js +67 -0
  1024. data/node_modules/stacktrace-gps/node_modules/source-map/lib/binary-search.js +111 -0
  1025. data/node_modules/stacktrace-gps/node_modules/source-map/lib/mapping-list.js +79 -0
  1026. data/node_modules/stacktrace-gps/node_modules/source-map/lib/quick-sort.js +114 -0
  1027. data/node_modules/stacktrace-gps/node_modules/source-map/lib/source-map-consumer.js +1082 -0
  1028. data/node_modules/stacktrace-gps/node_modules/source-map/lib/source-map-generator.js +404 -0
  1029. data/node_modules/stacktrace-gps/node_modules/source-map/lib/source-node.js +407 -0
  1030. data/node_modules/stacktrace-gps/node_modules/source-map/lib/util.js +417 -0
  1031. data/node_modules/stacktrace-gps/node_modules/source-map/package.json +71 -0
  1032. data/node_modules/stacktrace-gps/node_modules/source-map/source-map.js +8 -0
  1033. data/node_modules/stacktrace-gps/package.json +66 -0
  1034. data/node_modules/stacktrace-gps/stacktrace-gps.js +342 -0
  1035. data/node_modules/stacktrace-js/CHANGELOG.md +97 -0
  1036. data/node_modules/stacktrace-js/LICENSE +19 -0
  1037. data/node_modules/stacktrace-js/README.md +186 -0
  1038. data/node_modules/stacktrace-js/dist/stacktrace-with-promises-and-json-polyfills.js +5405 -0
  1039. data/node_modules/stacktrace-js/dist/stacktrace-with-promises-and-json-polyfills.min.js +3 -0
  1040. data/node_modules/stacktrace-js/dist/stacktrace-with-promises-and-json-polyfills.min.js.map +1 -0
  1041. data/node_modules/stacktrace-js/dist/stacktrace.js +3025 -0
  1042. data/node_modules/stacktrace-js/dist/stacktrace.min.js +2 -0
  1043. data/node_modules/stacktrace-js/dist/stacktrace.min.js.map +1 -0
  1044. data/node_modules/stacktrace-js/package.json +82 -0
  1045. data/node_modules/stacktrace-js/stacktrace-js.d.ts +134 -0
  1046. data/node_modules/stacktrace-js/stacktrace.js +227 -0
  1047. data/node_modules/stylis/LICENSE +21 -0
  1048. data/node_modules/stylis/README.md +152 -0
  1049. data/node_modules/stylis/dist/stylis.mjs +2 -0
  1050. data/node_modules/stylis/dist/stylis.mjs.map +1 -0
  1051. data/node_modules/stylis/dist/umd/package.json +1 -0
  1052. data/node_modules/stylis/dist/umd/stylis.js +2 -0
  1053. data/node_modules/stylis/dist/umd/stylis.js.map +1 -0
  1054. data/node_modules/stylis/index.js +7 -0
  1055. data/node_modules/stylis/package.json +164 -0
  1056. data/node_modules/stylis/src/Enum.js +20 -0
  1057. data/node_modules/stylis/src/Middleware.js +107 -0
  1058. data/node_modules/stylis/src/Parser.js +184 -0
  1059. data/node_modules/stylis/src/Prefixer.js +119 -0
  1060. data/node_modules/stylis/src/Serializer.js +34 -0
  1061. data/node_modules/stylis/src/Tokenizer.js +244 -0
  1062. data/node_modules/stylis/src/Utility.js +109 -0
  1063. data/node_modules/wouter-preact/cjs/index.js +180 -0
  1064. data/node_modules/wouter-preact/cjs/matcher.js +72 -0
  1065. data/node_modules/wouter-preact/cjs/package.json +1 -0
  1066. data/node_modules/wouter-preact/cjs/react-deps.js +75 -0
  1067. data/node_modules/wouter-preact/cjs/static-location.js +21 -0
  1068. data/node_modules/wouter-preact/cjs/use-location.js +94 -0
  1069. data/node_modules/wouter-preact/index.d.ts +110 -0
  1070. data/node_modules/wouter-preact/index.js +178 -0
  1071. data/node_modules/wouter-preact/matcher.d.ts +30 -0
  1072. data/node_modules/wouter-preact/matcher.js +66 -0
  1073. data/node_modules/wouter-preact/package.json +33 -0
  1074. data/node_modules/wouter-preact/react-deps.js +15 -0
  1075. data/node_modules/wouter-preact/static-location.d.ts +16 -0
  1076. data/node_modules/wouter-preact/static-location.js +17 -0
  1077. data/node_modules/wouter-preact/use-location.d.ts +43 -0
  1078. data/node_modules/wouter-preact/use-location.js +86 -0
  1079. data/package.json +10 -0
  1080. metadata +1097 -24
@@ -0,0 +1,3 @@
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.StackTrace=e()}}(function(){var e;return function(){function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}return e}()({1:[function(t,n,r){!function(o,i){"use strict";"function"==typeof e&&e.amd?e("error-stack-parser",["stackframe"],i):"object"==typeof r?n.exports=i(t("stackframe")):o.ErrorStackParser=i(o.StackFrame)}(this,function(e){"use strict";var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=t.exec(e.replace(/[()]/g,""));return[n[1],n[2]||void 0,n[3]||void 0]},parseV8OrIE:function(t){var r=t.stack.split("\n").filter(function(e){return!!e.match(n)},this);return r.map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/);n=r?n.replace(r[0],""):n;var o=n.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:o.pop()),a=o.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:a,fileName:s,lineNumber:i[1],columnNumber:i[2],source:t})},this)},parseFFOrSafari:function(t){var n=t.stack.split("\n").filter(function(e){return!e.match(r)},this);return n.map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(n),o=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(n,""));return new e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),o=[],i=2,a=r.length;i<a;i+=2){var s=n.exec(r[i]);s&&o.push(new e({fileName:s[2],lineNumber:s[1],source:r[i]}))}return o},parseOpera10:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),o=[],i=0,a=r.length;i<a;i+=2){var s=n.exec(r[i]);s&&o.push(new e({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:r[i]}))}return o},parseOpera11:function(n){var r=n.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this);return r.map(function(t){var n,r=t.split("@"),o=this.extractLocation(r.pop()),i=r.shift()||"",a=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:a,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})},this)}}})},{stackframe:2}],2:[function(t,n,r){!function(t,o){"use strict";"function"==typeof e&&e.amd?e("stackframe",[],o):"object"==typeof r?n.exports=o():t.StackFrame=o()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}function r(e){if(e)for(var n=0;n<u.length;n++)void 0!==e[u[n]]&&this["set"+t(u[n])](e[u[n]])}var o=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],a=["fileName","functionName","source"],s=["args"],u=o.concat(i,a,s);r.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof r)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new r(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},r.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),o=e.substring(0,t),i=e.substring(t+1,n).split(","),a=e.substring(n+1);if(0===a.indexOf("@"))var s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a,""),u=s[1],c=s[2],l=s[3];return new r({functionName:o,args:i||void 0,fileName:u,lineNumber:c||void 0,columnNumber:l||void 0})};for(var c=0;c<o.length;c++)r.prototype["get"+t(o[c])]=n(o[c]),r.prototype["set"+t(o[c])]=function(e){return function(t){this[e]=Boolean(t)}}(o[c]);for(var l=0;l<i.length;l++)r.prototype["get"+t(i[l])]=n(i[l]),r.prototype["set"+t(i[l])]=function(t){return function(n){if(!e(n))throw new TypeError(t+" must be a Number");this[t]=Number(n)}}(i[l]);for(var f=0;f<a.length;f++)r.prototype["get"+t(a[f])]=n(a[f]),r.prototype["set"+t(a[f])]=function(e){return function(t){this[e]=String(t)}}(a[f]);return r})},{}],3:[function(t,n,r){(function(o,i){!function(t,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o():"function"==typeof e&&e.amd?e(o):t.ES6Promise=o()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function n(e){return"function"==typeof e}function r(e){W=e}function a(e){V=e}function s(){return function(){return o.nextTick(p)}}function u(){return function(){Y(p)}}function c(){var e=0,t=new Q(p),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=p,function(){return e.port2.postMessage(0)}}function f(){var e=setTimeout;return function(){return e(p,1)}}function p(){for(var e=0;e<H;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}H=0}function h(){try{var e=t,n=e("vertx");return Y=n.runOnLoop||n.runOnContext,u()}catch(r){return f()}}function g(e,t){var n=arguments,r=this,o=new this.constructor(m);void 0===o[oe]&&R(o);var i=r._state;return i?!function(){var e=n[i-1];V(function(){return k(i,o,e,r._result)})}():T(r,o,e,t),o}function d(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(m);return O(n,e),n}function m(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function y(){return new TypeError("A promises callback cannot return that same promise.")}function _(e){try{return e.then}catch(t){return ue.error=t,ue}}function w(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function b(e,t,n){V(function(e){var r=!1,o=w(n,t,function(n){r||(r=!0,t!==n?O(e,n):E(e,n))},function(t){r||(r=!0,N(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,N(e,o))},e)}function C(e,t){t._state===ae?E(e,t._result):t._state===se?N(e,t._result):T(t,void 0,function(t){return O(e,t)},function(t){return N(e,t)})}function A(e,t,r){t.constructor===e.constructor&&r===g&&t.constructor.resolve===d?C(e,t):r===ue?N(e,ue.error):void 0===r?E(e,t):n(r)?b(e,t,r):E(e,t)}function O(t,n){t===n?N(t,v()):e(n)?A(t,n,_(n)):E(t,n)}function S(e){e._onerror&&e._onerror(e._result),L(e)}function E(e,t){e._state===ie&&(e._result=t,e._state=ae,0!==e._subscribers.length&&V(L,e))}function N(e,t){e._state===ie&&(e._state=se,e._result=t,V(S,e))}function T(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ae]=n,o[i+se]=r,0===i&&e._state&&V(L,e)}function L(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?k(n,r,o,i):o(i);e._subscribers.length=0}}function M(){this.error=null}function j(e,t){try{return e(t)}catch(n){return ce.error=n,ce}}function k(e,t,r,o){var i=n(r),a=void 0,s=void 0,u=void 0,c=void 0;if(i){if(a=j(r,o),a===ce?(c=!0,s=a.error,a=null):u=!0,t===a)return void N(t,y())}else a=o,u=!0;t._state!==ie||(i&&u?O(t,a):c?N(t,s):e===ae?E(t,a):e===se&&N(t,a))}function x(e,t){try{t(function(t){O(e,t)},function(t){N(e,t)})}catch(n){N(e,n)}}function P(){return le++}function R(e){e[oe]=le++,e._state=void 0,e._result=void 0,e._subscribers=[]}function F(e,t){this._instanceConstructor=e,this.promise=new e(m),this.promise[oe]||R(this.promise),Z(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?E(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&E(this.promise,this._result))):N(this.promise,U())}function U(){return new Error("Array Methods must be provided an Array")}function $(e){return new F(this,e).promise}function G(e){var t=this;return new t(Z(e)?function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function D(e){var t=this,n=new t(m);return N(n,e),n}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function J(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(e){this[oe]=P(),this._result=this._state=void 0,this._subscribers=[],m!==e&&("function"!=typeof e&&B(),this instanceof q?x(this,e):J())}function I(){var e=void 0;if("undefined"!=typeof i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(t){}if("[object Promise]"===r&&!n.cast)return}e.Promise=q}var z=void 0;z=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Z=z,H=0,Y=void 0,W=void 0,V=function(e,t){ne[H]=e,ne[H+1]=t,H+=2,2===H&&(W?W(p):re())},X="undefined"!=typeof window?window:void 0,K=X||{},Q=K.MutationObserver||K.WebKitMutationObserver,ee="undefined"==typeof self&&"undefined"!=typeof o&&"[object process]"==={}.toString.call(o),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3),re=void 0;re=ee?s():Q?c():te?l():void 0===X&&"function"==typeof t?h():f();var oe=Math.random().toString(36).substring(16),ie=void 0,ae=1,se=2,ue=new M,ce=new M,le=0;return F.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===ie&&n<e;n++)this._eachEntry(t[n],n)},F.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===d){var o=_(e);if(o===g&&e._state!==ie)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===q){var i=new n(m);A(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},F.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===ie&&(this._remaining--,e===se?N(r,n):this._result[t]=n),0===this._remaining&&E(r,this._result)},F.prototype._willSettleAt=function(e,t){var n=this;T(e,void 0,function(e){return n._settledAt(ae,t,e)},function(e){return n._settledAt(se,t,e)})},q.all=$,q.race=G,q.resolve=d,q.reject=D,q._setScheduler=r,q._setAsap=a,q._asap=V,q.prototype={constructor:q,then:g,"catch":function(e){return this.then(null,e)}},I(),q.polyfill=I,q.Promise=q,q})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:5}],4:[function(t,n,r){(function(t){(function(){function o(e,t){function n(e){if(n[e]!==m)return n[e];var o;if("bug-string-char-index"==e)o="a"!="a"[0];else if("json"==e)o=n("json-stringify")&&n("json-parse");else{var a,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u=t.stringify,l="function"==typeof u&&_;if(l){(a=function(){return 1}).toJSON=a;try{l="0"===u(0)&&"0"===u(new r)&&'""'==u(new i)&&u(y)===m&&u(m)===m&&u()===m&&"1"===u(a)&&"[1]"==u([a])&&"[null]"==u([m])&&"null"==u(null)&&"[null,null,null]"==u([m,y,null])&&u({a:[a,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===u(null,a)&&"[\n 1,\n 2\n]"==u([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==u(new c((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==u(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==u(new c((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==u(new c((-1)))}catch(f){l=!1}}o=l}if("json-parse"==e){var p=t.parse;if("function"==typeof p)try{if(0===p("0")&&!p(!1)){a=p(s);var h=5==a.a.length&&1===a.a[0];if(h){try{h=!p('"\t"')}catch(f){}if(h)try{h=1!==p("01")}catch(f){}if(h)try{h=1!==p("1.")}catch(f){}}}}catch(f){h=!1}o=h}}return n[e]=!!o}e||(e=u.Object()),t||(t=u.Object());var r=e.Number||u.Number,i=e.String||u.String,s=e.Object||u.Object,c=e.Date||u.Date,l=e.SyntaxError||u.SyntaxError,f=e.TypeError||u.TypeError,p=e.Math||u.Math,h=e.JSON||u.JSON;"object"==typeof h&&h&&(t.stringify=h.stringify,t.parse=h.parse);var g,d,m,v=s.prototype,y=v.toString,_=new c((-0xc782b5b800cec));try{_=_.getUTCFullYear()==-109252&&0===_.getUTCMonth()&&1===_.getUTCDate()&&10==_.getUTCHours()&&37==_.getUTCMinutes()&&6==_.getUTCSeconds()&&708==_.getUTCMilliseconds()}catch(w){}if(!n("json")){var b="[object Function]",C="[object Date]",A="[object Number]",O="[object String]",S="[object Array]",E="[object Boolean]",N=n("bug-string-char-index");if(!_)var T=p.floor,L=[0,31,59,90,120,151,181,212,243,273,304,334],M=function(e,t){return L[t]+365*(e-1970)+T((e-1969+(t=+(t>1)))/4)-T((e-1901+t)/100)+T((e-1601+t)/400)};if((g=v.hasOwnProperty)||(g=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=y?g=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,g=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,g.call(this,e)}),d=function(e,t){var n,r,o,i=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(o in r)g.call(r,o)&&i++;return n=r=null,i?d=2==i?function(e,t){var n,r={},o=y.call(e)==b;for(n in e)o&&"prototype"==n||g.call(r,n)||!(r[n]=1)||!g.call(e,n)||t(n)}:function(e,t){var n,r,o=y.call(e)==b;for(n in e)o&&"prototype"==n||!g.call(e,n)||(r="constructor"===n)||t(n);(r||g.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],d=function(e,t){var n,o,i=y.call(e)==b,s=!i&&"function"!=typeof e.constructor&&a[typeof e.hasOwnProperty]&&e.hasOwnProperty||g;for(n in e)i&&"prototype"==n||!s.call(e,n)||t(n);for(o=r.length;n=r[--o];s.call(e,n)&&t(n));}),d(e,t)},!n("json-stringify")){var j={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},k="000000",x=function(e,t){return(k+(t||0)).slice(-e)},P="\\u00",R=function(e){for(var t='"',n=0,r=e.length,o=!N||r>10,i=o&&(N?e.split(""):e);n<r;n++){var a=e.charCodeAt(n);switch(a){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=j[a];break;default:if(a<32){t+=P+x(2,a.toString(16));break}t+=o?i[n]:e.charAt(n)}}return t+'"'},F=function(e,t,n,r,o,i,a){var s,u,c,l,p,h,v,_,w,b,N,L,j,k,P,U;try{s=t[e]}catch($){}if("object"==typeof s&&s)if(u=y.call(s),u!=C||g.call(s,"toJSON"))"function"==typeof s.toJSON&&(u!=A&&u!=O&&u!=S||g.call(s,"toJSON"))&&(s=s.toJSON(e));else if(s>-1/0&&s<1/0){if(M){for(p=T(s/864e5),c=T(p/365.2425)+1970-1;M(c+1,0)<=p;c++);for(l=T((p-M(c,0))/30.42);M(c,l+1)<=p;l++);p=1+p-M(c,l),h=(s%864e5+864e5)%864e5,v=T(h/36e5)%24,_=T(h/6e4)%60,w=T(h/1e3)%60,b=h%1e3}else c=s.getUTCFullYear(),l=s.getUTCMonth(),p=s.getUTCDate(),v=s.getUTCHours(),_=s.getUTCMinutes(),w=s.getUTCSeconds(),b=s.getUTCMilliseconds();s=(c<=0||c>=1e4?(c<0?"-":"+")+x(6,c<0?-c:c):x(4,c))+"-"+x(2,l+1)+"-"+x(2,p)+"T"+x(2,v)+":"+x(2,_)+":"+x(2,w)+"."+x(3,b)+"Z"}else s=null;if(n&&(s=n.call(t,e,s)),null===s)return"null";if(u=y.call(s),u==E)return""+s;if(u==A)return s>-1/0&&s<1/0?""+s:"null";if(u==O)return R(""+s);if("object"==typeof s){for(k=a.length;k--;)if(a[k]===s)throw f();if(a.push(s),N=[],P=i,i+=o,u==S){for(j=0,k=s.length;j<k;j++)L=F(j,s,n,r,o,i,a),N.push(L===m?"null":L);U=N.length?o?"[\n"+i+N.join(",\n"+i)+"\n"+P+"]":"["+N.join(",")+"]":"[]"}else d(r||s,function(e){var t=F(e,s,n,r,o,i,a);t!==m&&N.push(R(e)+":"+(o?" ":"")+t)}),U=N.length?o?"{\n"+i+N.join(",\n"+i)+"\n"+P+"}":"{"+N.join(",")+"}":"{}";return a.pop(),U}};t.stringify=function(e,t,n){var r,o,i,s;if(a[typeof t]&&t)if((s=y.call(t))==b)o=t;else if(s==S){i={};for(var u,c=0,l=t.length;c<l;u=t[c++],s=y.call(u),(s==O||s==A)&&(i[u]=1));}if(n)if((s=y.call(n))==A){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else s==O&&(r=n.length<=10?n:n.slice(0,10));return F("",(u={},u[""]=e,u),o,i,r,"",[])}}if(!n("json-parse")){var U,$,G=i.fromCharCode,D={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},B=function(){throw U=$=null,l()},J=function(){for(var e,t,n,r,o,i=$,a=i.length;U<a;)switch(o=i.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=N?i.charAt(U):i[U],U++,e;case 34:for(e="@",U++;U<a;)if(o=i.charCodeAt(U),o<32)B();else if(92==o)switch(o=i.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=D[o],U++;break;case 117:for(t=++U,n=U+4;U<n;U++)o=i.charCodeAt(U),o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||B();e+=G("0x"+i.slice(t,U));break;default:B()}else{if(34==o)break;for(o=i.charCodeAt(U),t=U;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;B();default:if(t=U,45==o&&(r=!0,o=i.charCodeAt(++U)),o>=48&&o<=57){for(48==o&&(o=i.charCodeAt(U+1),o>=48&&o<=57)&&B(),r=!1;U<a&&(o=i.charCodeAt(U),o>=48&&o<=57);U++);if(46==i.charCodeAt(U)){for(n=++U;n<a&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==U&&B(),U=n}if(o=i.charCodeAt(U),101==o||69==o){for(o=i.charCodeAt(++U),43!=o&&45!=o||U++,n=U;n<a&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==U&&B(),U=n}return+i.slice(t,U)}if(r&&B(),"true"==i.slice(U,U+4))return U+=4,!0;if("false"==i.slice(U,U+5))return U+=5,!1;if("null"==i.slice(U,U+4))return U+=4,null;B()}return"$"},q=function(e){var t,n;if("$"==e&&B(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=J(),"]"!=e;n||(n=!0))n&&(","==e?(e=J(),"]"==e&&B()):B()),","==e&&B(),t.push(q(e));return t}if("{"==e){for(t={};e=J(),"}"!=e;n||(n=!0))n&&(","==e?(e=J(),"}"==e&&B()):B()),","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==J()||B(),t[e.slice(1)]=q(J());return t}B()}return e},I=function(e,t,n){var r=z(e,t,n);r===m?delete e[t]:e[t]=r},z=function(e,t,n){var r,o=e[t];if("object"==typeof o&&o)if(y.call(o)==S)for(r=o.length;r--;)I(o,r,n);else d(o,function(e){I(o,e,n)});return n.call(e,t,o)};t.parse=function(e,t){var n,r;return U=0,$=""+e,n=q(J()),"$"!=J()&&B(),U=$=null,t&&y.call(t)==b?z((r={},r[""]=n,r),"",t):n}}}return t.runInContext=o,t}var i="function"==typeof e&&e.amd,a={"function":!0,object:!0},s=a[typeof r]&&r&&!r.nodeType&&r,u=a[typeof window]&&window||this,c=s&&a[typeof n]&&n&&!n.nodeType&&"object"==typeof t&&t;if(!c||c.global!==c&&c.window!==c&&c.self!==c||(u=c),s&&!i)o(u,s);else{var l=u.JSON,f=u.JSON3,p=!1,h=o(u,u.JSON3={noConflict:function(){return p||(p=!0,u.JSON=l,u.JSON3=f,l=f=null),h}});u.JSON={parse:h.parse,stringify:h.stringify}}i&&e(function(){return h})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){m&&g&&(m=!1,g.length?d=g.concat(d):v=-1,d.length&&u())}function u(){if(!m){var e=i(s);m=!0;for(var t=d.length;t;){for(g=d,d=[];++v<t;)g&&g[v].run();v=-1,t=d.length}g=null,m=!1,a(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var f,p,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var g,d=[],m=!1,v=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new c(e,t)),1!==d.length||m||i(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.prependListener=l,h.prependOnceListener=l,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],6:[function(e,t,n){function r(){this._array=[],this._set=Object.create(null)}var o=e("./util"),i=Object.prototype.hasOwnProperty;r.fromArray=function(e,t){for(var n=new r,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n},r.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,t){var n=o.toSetString(e),r=i.call(this._set,n),a=this._array.length;r&&!t||this._array.push(e),r||(this._set[n]=a)},r.prototype.has=function(e){var t=o.toSetString(e);return i.call(this._set,t)},r.prototype.indexOf=function(e){var t=o.toSetString(e);if(i.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},n.ArraySet=r},{"./util":12}],7:[function(e,t,n){function r(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var t=1===(1&e),n=e>>1;return t?-n:n}var i=e("./base64"),a=5,s=1<<a,u=s-1,c=s;n.encode=function(e){var t,n="",o=r(e);do t=o&u,o>>>=a,o>0&&(t|=c),n+=i.encode(t);while(o>0);return n},n.decode=function(e,t,n){var r,s,l=e.length,f=0,p=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(s=i.decode(e.charCodeAt(t++)),s===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(s&c),s&=u,f+=s<<p,p+=a}while(r);n.value=o(f),n.rest=t}},{"./base64":8}],8:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var t=65,n=90,r=97,o=122,i=48,a=57,s=43,u=47,c=26,l=52;return t<=e&&e<=n?e-t:r<=e&&e<=o?e-r+c:i<=e&&e<=a?e-i+l:e==s?62:e==u?63:-1}},{}],9:[function(e,t,n){function r(e,t,o,i,a,s){var u=Math.floor((t-e)/2)+e,c=a(o,i[u],!0);return 0===c?u:c>0?t-u>1?r(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t<i.length?t:-1:u:u-e>1?r(e,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var a=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===o(t[a],t[a-1],!0);)--a;return a}},{}],10:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function o(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,n,a){if(n<a){var s=o(n,a),u=n-1;r(e,s,a);for(var c=e[a],l=n;l<a;l++)t(e[l],c)<=0&&(u+=1,r(e,u,l));r(e,u+1,l);var f=u+1;i(e,t,n,f-1),i(e,t,f+1,a)}}n.quickSort=function(e,t){i(e,t,0,e.length-1)}},{}],11:[function(e,t,n){function r(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new a(t):new o(t)}function o(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=s.getArg(t,"version"),r=s.getArg(t,"sources"),o=s.getArg(t,"names",[]),i=s.getArg(t,"sourceRoot",null),a=s.getArg(t,"sourcesContent",null),u=s.getArg(t,"mappings"),l=s.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);r=r.map(String).map(s.normalize).map(function(e){return i&&s.isAbsolute(i)&&s.isAbsolute(e)?s.relative(i,e):e}),this._names=c.fromArray(o.map(String),!0),this._sources=c.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=a,this._mappings=u,this.file=l}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=s.getArg(t,"version"),o=s.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new c,this._names=new c;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=s.getArg(e,"offset"),n=s.getArg(t,"line"),o=s.getArg(t,"column");if(n<i.line||n===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=t,{generatedOffset:{generatedLine:n+1,generatedColumn:o+1},consumer:new r(s.getArg(e,"map"))}})}var s=e("./util"),u=e("./binary-search"),c=e("./array-set").ArraySet,l=e("./base64-vlq"),f=e("./quick-sort").quickSort;r.fromSourceMap=function(e){return o.fromSourceMap(e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},r.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,t,n){var o,i=t||null,a=n||r.GENERATED_ORDER;switch(a){case r.GENERATED_ORDER:o=this._generatedMappings;break;case r.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;o.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=u&&(t=s.join(u,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,i)},r.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),n={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(null!=this.sourceRoot&&(n.source=s.relative(this.sourceRoot,n.source)),!this._sources.has(n.source))return[];n.source=this._sources.indexOf(n.source);var r=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var a=i.originalLine;i&&i.originalLine===a;)r.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==c;)r.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r},n.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.fromSourceMap=function(e){var t=Object.create(o.prototype),n=t._names=c.fromArray(e._names.toArray(),!0),r=t._sources=c.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],l=t.__originalMappings=[],p=0,h=a.length;p<h;p++){var g=a[p],d=new i;d.generatedLine=g.generatedLine,d.generatedColumn=g.generatedColumn,g.source&&(d.source=r.indexOf(g.source),d.originalLine=g.originalLine,d.originalColumn=g.originalColumn,g.name&&(d.name=n.indexOf(g.name)),l.push(d)),u.push(d)}return f(t.__originalMappings,s.compareByOriginalPositions),t},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?s.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,t){for(var n,r,o,a,u,c=1,p=0,h=0,g=0,d=0,m=0,v=e.length,y=0,_={},w={},b=[],C=[];y<v;)if(";"===e.charAt(y))c++,y++,p=0;else if(","===e.charAt(y))y++;else{for(n=new i,n.generatedLine=c,a=y;a<v&&!this._charIsMappingSeparator(e,a);a++);if(r=e.slice(y,a),o=_[r])y+=r.length;else{for(o=[];y<a;)l.decode(e,y,w),u=w.value,y=w.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");_[r]=o}n.generatedColumn=p+o[0],p=n.generatedColumn,o.length>1&&(n.source=d+o[1],d+=o[1],n.originalLine=h+o[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=g+o[3],g=n.originalColumn,o.length>4&&(n.name=m+o[4],m+=o[4])),C.push(n),"number"==typeof n.originalLine&&b.push(n)}f(C,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,f(b,s.compareByOriginalPositions),this.__originalMappings=b},o.prototype._findMapping=function(e,t,n,r,o,i){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=s.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=s.join(this.sourceRoot,i)));var a=s.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:s.getArg(o,"originalLine",null),column:s.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;
2
+ if(null!=this.sourceRoot&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=s.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,a.prototype=Object.create(r.prototype),a.prototype.constructor=r,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=u.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n?n:e.generatedColumn-t.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],o=r.consumer.sourceContentFor(e,!0);if(o)return o}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer.sources.indexOf(s.getArg(e,"source"))!==-1){var r=n.consumer.generatedPositionFor(e);if(r){var o={line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)};return o}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var a=o[i],u=r.consumer._sources.at(a.source);null!==r.consumer.sourceRoot&&(u=s.join(r.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var c=r.consumer._names.at(a.name);this._names.add(c),c=this._names.indexOf(c);var l={source:u,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}f(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),f(this.__originalMappings,s.compareByOriginalPositions)},n.IndexedSourceMapConsumer=a},{"./array-set":6,"./base64-vlq":7,"./binary-search":9,"./quick-sort":10,"./util":12}],12:[function(e,t,n){function r(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function o(e){var t=e.match(v);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var t=e,r=o(e);if(r){if(!r.path)return e;t=r.path}for(var a,s=n.isAbsolute(t),u=t.split(/\/+/),c=0,l=u.length-1;l>=0;l--)a=u[l],"."===a?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return t=u.join("/"),""===t&&(t=s?"/":"."),r?(r.path=t,i(r)):t}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),r=o(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),i(n);if(n||t.match(y))return t;if(r&&!r.host&&!r.path)return r.host=t,i(r);var s="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=s,i(r)):s}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function c(e){return e}function l(e){return p(e)?"$"+e:e}function f(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t,n){var r=e.source-t.source;return 0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r||n?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=e.generatedLine-t.generatedLine,0!==r?r:e.name-t.name))))}function g(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r||n?r:(r=e.source-t.source,0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:e.name-t.name))))}function d(e,t){return e===t?0:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=d(e.source,t.source),0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name)))))}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,y=/^data:.+\,.+$/;n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(v)},n.relative=u;var _=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=_?c:l,n.fromSetString=_?c:f,n.compareByOriginalPositions=h,n.compareByGeneratedPositionsDeflated=g,n.compareByGeneratedPositionsInflated=m},{}],13:[function(e,t,n){arguments[4][2][0].apply(n,arguments)},{dup:2}],14:[function(t,n,r){!function(o,i){"use strict";"function"==typeof e&&e.amd?e("stack-generator",["stackframe"],i):"object"==typeof r?n.exports=i(t("stackframe")):o.StackGenerator=i(o.StackFrame)}(this,function(e){return{backtrace:function(t){var n=[],r=10;"object"==typeof t&&"number"==typeof t.maxStackSize&&(r=t.maxStackSize);for(var o=arguments.callee;o&&n.length<r&&o.arguments;){for(var i=new Array(o.arguments.length),a=0;a<i.length;++a)i[a]=o.arguments[a];/function(?:\s+([\w$]+))+\s*\(/.test(o.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:i})):n.push(new e({args:i}));try{o=o.caller}catch(s){break}}return n}}})},{stackframe:13}],15:[function(e,t,n){arguments[4][2][0].apply(n,arguments)},{dup:2}],16:[function(t,n,r){!function(o,i){"use strict";"function"==typeof e&&e.amd?e("stacktrace-gps",["source-map","stackframe"],i):"object"==typeof r?n.exports=i(t("source-map/lib/source-map-consumer"),t("stackframe")):o.StackTraceGPS=i(o.SourceMap||o.sourceMap,o.StackFrame)}(this,function(e,t){"use strict";function n(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("get",e),r.onerror=n,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?t(r.responseText):n(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function r(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function o(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function i(e,t){for(var n=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(t,20),a=0;a<i;++a){var s=r[t-a-1],u=s.indexOf("//");if(u>=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=n.length,l=0;l<c;l++){var f=n[l].exec(o);if(f&&f[1])return f[1]}}}}function a(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function s(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function u(e){for(var t,n,r=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;n=r.exec(e);)t=n[1];if(t)return t;throw new Error("sourceMappingURL not found")}function c(e,n,r){return new Promise(function(o,i){var a=n.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(a.source){var s=n.sourceContentFor(a.source);s&&(r[a.source]=s),o(new t({functionName:a.name||e.functionName,args:e.args,fileName:a.source,lineNumber:a.line,columnNumber:a.column}))}else i(new Error("Could not get original source for given stackframe and source map"))})}return function l(f){return this instanceof l?(f=f||{},this.sourceCache=f.sourceCache||{},this.sourceMapConsumerCache=f.sourceMapConsumerCache||{},this.ajax=f.ajax||n,this._atob=f.atob||r,this._get=function(e){return new Promise(function(t,n){var r="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(f.offline&&!r)n(new Error("Cannot make network requests in offline mode"));else if(r){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,i=e.match(o);if(i){var a=i[0].length,s=e.substr(a),u=this._atob(s);this.sourceCache[e]=u,t(u)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var c=this.ajax(e,{method:"get"});this.sourceCache[e]=c,c.then(t,n)}}.bind(this))},this._getSourceMapConsumer=function(t,n){return new Promise(function(r){if(this.sourceMapConsumerCache[t])r(this.sourceMapConsumerCache[t]);else{var i=new Promise(function(r,i){return this._get(t).then(function(t){"string"==typeof t&&(t=o(t.replace(/^\)\]\}'/,""))),"undefined"==typeof t.sourceRoot&&(t.sourceRoot=n),r(new e.SourceMapConsumer(t))},i)}.bind(this));this.sourceMapConsumerCache[t]=i,r(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,n){this.getMappedLocation(e).then(function(e){function n(){t(e)}this.findFunctionName(e).then(t,n)["catch"](n)}.bind(this),n)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(n,r){s(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,a=e.columnNumber,s=i(r,o,a);n(s?new t({functionName:s,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:a}):e)},r)["catch"](r)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(t,n){a(),s(e);var r=this.sourceCache,o=e.fileName;this._get(o).then(function(n){var i=u(n),a="data:"===i.substr(0,5),s=o.substring(0,o.lastIndexOf("/")+1);return"/"===i[0]||a||/^https?:\/\/|^\/\//i.test(i)||(i=s+i),this._getSourceMapConsumer(i,s).then(function(n){return c(e,n,r).then(t)["catch"](function(){t(e)})})}.bind(this),n)["catch"](n)}.bind(this))})):new l(f)}})},{"source-map/lib/source-map-consumer":11,stackframe:15}],17:[function(e,t,n){Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"undefined"==typeof Promise&&ES6Promise.polyfill(),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},o=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,o.prototype=new r,o}),Array.prototype.map||(Array.prototype.map=function(e,t){if(void 0===this||null===this)throw new TypeError("this is null or not defined");var n,r=Object(this),o=r.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");arguments.length>1&&(n=t);for(var i=new Array(o),a=0;a<o;){var s,u;a in r&&(s=r[a],u=e.call(n,s,a,r),i[a]=u),a++}return i}),Array.prototype.filter||(Array.prototype.filter=function(e){if(void 0===this||null===this)throw new TypeError("this is null or not defined");var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(var r=[],o=arguments.length>=2?arguments[1]:void 0,i=0;i<n;i++)if(i in t){var a=t[i];e.call(o,a,i,t)&&r.push(a)}return r}),Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var n,r;if(null===this||void 0===this)throw new TypeError(" this is null or not defined");var o=Object(this),i=o.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),r=0;r<i;){var a;r in o&&(a=o[r],e.call(n,a,r,o)),r++}})},{}],18:[function(t,n,r){!function(o,i){"use strict";"function"==typeof e&&e.amd?e("stacktrace",["error-stack-parser","stack-generator","stacktrace-gps"],i):"object"==typeof r?n.exports=i(t("error-stack-parser"),t("stack-generator"),t("stacktrace-gps")):o.StackTrace=i(o.ErrorStackParser,o.StackGenerator,o.StackTraceGPS)}(this,function(e,t,n){function r(e,t){var n={};return[e,t].forEach(function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}),n}function o(e){return e.stack||e["opera#sourceloc"]}function i(e,t){return"function"==typeof t?e.filter(t):e}var a={filter:function(e){return(e.functionName||"").indexOf("StackTrace$$")===-1&&(e.functionName||"").indexOf("ErrorStackParser$$")===-1&&(e.functionName||"").indexOf("StackTraceGPS$$")===-1&&(e.functionName||"").indexOf("StackGenerator$$")===-1},sourceCache:{}},s=function(){try{throw new Error}catch(e){return e}};return{get:function(e){var t=s();return o(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function(n){n=r(a,n);var u=s(),c=o(u)?e.parse(u):t.backtrace(n);return i(c,n.filter)},fromError:function(t,o){o=r(a,o);var s=new n(o);return new Promise(function(n){var r=i(e.parse(t),o.filter);n(Promise.all(r.map(function(e){return new Promise(function(t){function n(){t(e)}s.pinpoint(e).then(t,n)["catch"](n)})})))}.bind(this))},generateArtificially:function(e){e=r(a,e);var n=t.backtrace(e);return"function"==typeof e.filter&&(n=n.filter(e.filter)),Promise.resolve(n)},instrument:function(e,t,n,r){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var i=function(){try{return this.get().then(t,n)["catch"](n),e.apply(r||this,arguments)}catch(i){throw o(i)&&this.fromError(i).then(t,n)["catch"](n),i}}.bind(this);return i.__stacktraceOriginalFn=e,i},deinstrument:function(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function(e,t,n,r){return new Promise(function(o,i){var a=new XMLHttpRequest;if(a.onerror=i,a.onreadystatechange=function(){4===a.readyState&&(a.status>=200&&a.status<400?o(a.responseText):i(new Error("POST to "+t+" failed with status: "+a.status)))},a.open("post",t),a.setRequestHeader("Content-Type","application/json"),r&&"object"==typeof r.headers){var s=r.headers;for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&a.setRequestHeader(u,s[u])}var c={stack:e};void 0!==n&&null!==n&&(c.message=n),a.send(JSON.stringify(c))})}}})},{"error-stack-parser":1,"stack-generator":14,"stacktrace-gps":16}]},{},[3,4,17,18])(18)});
3
+ //# sourceMappingURL=stacktrace-with-promises-and-json-polyfills.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["node_modules/browser-pack/_prelude.js","node_modules/error-stack-parser/error-stack-parser.js","stacktrace-with-promises-and-json-polyfills.js","node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","node_modules/es6-promise/dist/es6-promise.js","node_modules/json3/lib/json3.js","node_modules/process/browser.js","node_modules/source-map/lib/array-set.js","node_modules/source-map/lib/base64-vlq.js","node_modules/source-map/lib/base64.js","node_modules/source-map/lib/binary-search.js","node_modules/source-map/lib/quick-sort.js","node_modules/source-map/lib/source-map-consumer.js","node_modules/source-map/lib/util.js","node_modules/stack-generator/stack-generator.js","node_modules/stacktrace-gps/stacktrace-gps.js","polyfills.js","stacktrace.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","StackTrace","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","root","factory","ErrorStackParser","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","extractLocation","urlLike","indexOf","regExp","parts","exec","replace","undefined","filtered","split","filter","line","map","sanitizedLine","location","tokens","slice","locationParts","pop","functionName","join","fileName","lineNumber","columnNumber","source","functionNameRegex","matches","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","functionCall","shift","args","stackframe","2","_isNumber","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","obj","props","booleanProps","numericProps","stringProps","arrayProps","concat","prototype","getArgs","setArgs","v","Object","toString","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFileName","getLineNumber","getColumnNumber","getFunctionName","getIsEval","fromString","argsStartIndex","argsEndIndex","lastIndexOf","locationString","Boolean","j","Number","k","String","3","process","ES6Promise","objectOrFunction","x","isFunction","setScheduler","scheduleFn","customSchedulerFn","setAsap","asapFn","asap","useNextTick","nextTick","flush","useVertxTimer","vertxNext","useMutationObserver","iterations","observer","BrowserMutationObserver","node","document","createTextNode","observe","characterData","data","useMessageChannel","channel","MessageChannel","port1","onmessage","port2","postMessage","useSetTimeout","globalSetTimeout","setTimeout","callback","queue","arg","attemptVertx","vertx","runOnLoop","runOnContext","then","onFulfillment","onRejection","_arguments","arguments","parent","child","constructor","noop","PROMISE_ID","makePromise","_state","invokeCallback","_result","subscribe","resolve","object","Constructor","promise","_resolve","selfFulfillment","cannotReturnOwn","getThen","GET_THEN_ERROR","tryThen","value","fulfillmentHandler","rejectionHandler","handleForeignThenable","thenable","sealed","fulfill","reason","_reject","_label","handleOwnThenable","FULFILLED","REJECTED","handleMaybeThenable","maybeThenable","then$$","publishRejection","_onerror","publish","PENDING","_subscribers","subscribers","settled","detail","ErrorObject","tryCatch","TRY_CATCH_ERROR","hasCallback","succeeded","failed","initializePromise","resolver","nextId","id","Enumerator","input","_instanceConstructor","isArray","_input","_remaining","Array","_enumerate","validationError","all","entries","race","reject","_","needsResolver","needsNew","Promise","polyfill","local","Function","P","promiseToString","cast","_isArray","scheduleFlush","browserWindow","browserGlobal","MutationObserver","WebKitMutationObserver","isNode","isWorker","Uint8ClampedArray","importScripts","Math","random","_eachEntry","entry","resolve$$","_then","_settledAt","_willSettleAt","state","enumerator","_setScheduler","_setAsap","_asap","catch","_process","4","runInContext","context","has","name","undef","isSupported","serialized","stringify","stringifySupported","isExtended","toJSON","getClass","Date","exception","parseSupported","SyntaxError","nativeJSON","isProperty","forEach","objectProto","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","functionClass","dateClass","numberClass","stringClass","arrayClass","booleanClass","charIndexBuggy","floor","Months","getDay","year","month","hasOwnProperty","property","members","__proto__","original","Properties","size","valueOf","isConstructor","hasProperty","objectTypes","Escapes","92","34","8","12","10","13","9","leadingZeroes","toPaddedString","width","unicodePrefix","quote","index","useCharIndex","symbols","charCode","charCodeAt","serialize","properties","whitespace","indentation","className","date","time","hours","minutes","seconds","milliseconds","results","element","prefix","Index","Source","fromCharCode","Unescapes","47","98","116","110","102","114","abort","lex","begin","position","isSigned","get","hasMembers","update","walk","isLoader","function","freeExports","nodeType","freeGlobal","JSON","previousJSON","isRestored","JSON3","noConflict","5","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queueIndex","drainQueue","timeout","run","Item","array","apply","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","6","ArraySet","_array","_set","create","util","fromArray","aArray","aAllowDuplicates","set","add","getOwnPropertyNames","aStr","sStr","toSetString","isDuplicate","idx","at","aIdx","toArray","./util","7","toVLQSigned","aValue","fromVLQSigned","isNegative","shifted","base64","VLQ_BASE_SHIFT","VLQ_BASE","VLQ_BASE_MASK","VLQ_CONTINUATION_BIT","encode","digit","encoded","vlq","decode","aIndex","aOutParam","continuation","strLen","rest","./base64","intToCharMap","number","bigA","bigZ","littleA","littleZ","zero","nine","plus","slash","littleOffset","numberOffset","recursiveSearch","aLow","aHigh","aNeedle","aHaystack","aCompare","aBias","mid","cmp","LEAST_UPPER_BOUND","GREATEST_LOWER_BOUND","search","swap","ary","y","temp","randomIntInRange","low","high","round","doQuickSort","comparator","pivotIndex","pivot","q","quickSort","11","SourceMapConsumer","aSourceMap","sourceMap","sections","IndexedSourceMapConsumer","BasicSourceMapConsumer","getArg","sources","names","sourceRoot","sourcesContent","mappings","file","_version","normalize","isAbsolute","relative","_names","_sources","_mappings","Mapping","generatedLine","generatedColumn","originalLine","originalColumn","lastOffset","column","_sections","s","url","offset","offsetLine","offsetColumn","generatedOffset","consumer","binarySearch","base64VLQ","fromSourceMap","__generatedMappings","defineProperty","_parseMappings","__originalMappings","_charIsMappingSeparator","aSourceRoot","GENERATED_ORDER","ORIGINAL_ORDER","eachMapping","aCallback","aContext","aOrder","order","_generatedMappings","_originalMappings","mapping","allGeneratedPositionsFor","aArgs","needle","_findMapping","compareByOriginalPositions","lastColumn","smc","_sourceRoot","_generateSourcesContent","_file","generatedMappings","destGeneratedMappings","destOriginalMappings","srcMapping","destMapping","segment","end","previousGeneratedColumn","previousOriginalLine","previousOriginalColumn","previousSource","previousName","cachedSegments","originalMappings","compareByGeneratedPositionsDeflated","aMappings","aLineName","aColumnName","aComparator","computeColumnSpans","nextMapping","lastGeneratedColumn","Infinity","originalPositionFor","hasContentsOfAllSources","some","sc","sourceContentFor","aSource","nullOnMissing","urlParse","fileUriAbsPath","scheme","path","generatedPositionFor","sectionIndex","section","bias","every","content","generatedPosition","ret","sectionMappings","adjustedMapping","./array-set","./base64-vlq","./binary-search","./quick-sort","aName","aDefaultValue","aUrl","urlRegexp","auth","host","port","urlGenerate","aParsedUrl","aPath","part","up","splice","aRoot","aPathUrl","aRootUrl","dataUrlRegexp","joined","level","substr","identity","isProtoString","fromSetString","mappingA","mappingB","onlyCompareOriginal","onlyCompareGenerated","strcmp","aStr1","aStr2","compareByGeneratedPositionsInflated","supportsNullProto","dup","14","StackGenerator","backtrace","opts","maxStackSize","curr","callee","test","RegExp","$1","caller","15","16","StackTraceGPS","SourceMap","_xdr","req","XMLHttpRequest","open","onerror","onreadystatechange","readyState","status","responseText","send","_atob","b64str","atob","_parseJson","string","_findFunctionName","syntaxes","maxLines","min","commentPos","m","_ensureSupportedEnvironment","_ensureStackFrameIsLegit","_findSourceMappingURL","lastSourceMappingUrl","matchSourceMappingUrl","sourceMappingUrlRegExp","_extractLocationInfoFromSourceMapSource","sourceMapConsumer","sourceCache","loc","mappedSource","sourceMapConsumerCache","ajax","_get","isDataUrl","offline","supportedEncodingRegexp","sourceMapStart","encodedSource","xhrPromise","method","bind","_getSourceMapConsumer","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","pinpoint","getMappedLocation","mappedStackFrame","resolveMappedStackFrame","findFunctionName","guessedFunctionName","source-map/lib/source-map-consumer","17","oThis","fToBind","NoOp","fBound","thisArg","T","O","A","kValue","mappedValue","res","val","18","_merge","first","second","target","prop","_isShapedLikeParsableError","err","_filtered","stackframes","_options","_generateError","fromError","generateArtificially","getSync","gps","sf","resolveOriginal","stackFrames","instrument","fn","errback","__stacktraceOriginalFn","instrumented","deinstrument","report","errorMsg","requestOptions","setRequestHeader","headers","header","reportPayload","error-stack-parser","stack-generator","stacktrace-gps"],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,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AAAQ,KAAAzS,KAAAnG,UAAAse,Yf2jKGC,qBAAqB,EAAEC,kBAAkB,GAAGC,iBAAiB,UAAU,EAAE,EAAE,GAAG,KAAK","file":"stacktrace-with-promises-and-json-polyfills.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.StackTrace = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n\n},{\"stackframe\":2}],2:[function(require,module,exports){\n(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n\n},{}],3:[function(require,module,exports){\n(function (process,global){\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 3.3.1\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n return function () {\n vertxNext(flush);\n };\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\npolyfill();\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n\n}).call(this,require('_process'),typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{\"_process\":5}],4:[function(require,module,exports){\n(function (global){\n/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal[\"global\"] === freeGlobal || freeGlobal[\"window\"] === freeGlobal || freeGlobal[\"self\"] === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root[\"Object\"]());\n exports || (exports = root[\"Object\"]());\n\n // Native constructor aliases.\n var Number = context[\"Number\"] || root[\"Number\"],\n String = context[\"String\"] || root[\"String\"],\n Object = context[\"Object\"] || root[\"Object\"],\n Date = context[\"Date\"] || root[\"Date\"],\n SyntaxError = context[\"SyntaxError\"] || root[\"SyntaxError\"],\n TypeError = context[\"TypeError\"] || root[\"TypeError\"],\n Math = context[\"Math\"] || root[\"Math\"],\n nativeJSON = context[\"JSON\"] || root[\"JSON\"];\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty, forEach, undef;\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n try {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n // Safari < 2.0.2 stores the internal millisecond time value correctly,\n // but clips the values returned by the date methods to the range of\n // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n } catch (exception) {}\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n }\n\n // Internal: Determines if a property is a direct property of the given\n // object. Delegates to the native `Object#hasOwnProperty` method.\n if (!(isProperty = objectProto.hasOwnProperty)) {\n isProperty = function (property) {\n var members = {}, constructor;\n if ((members.__proto__ = null, members.__proto__ = {\n // The *proto* property cannot be set multiple times in recent\n // versions of Firefox and SeaMonkey.\n \"toString\": 1\n }, members).toString != getClass) {\n // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but\n // supports the mutable *proto* property.\n isProperty = function (property) {\n // Capture and break the object's prototype chain (see section 8.6.2\n // of the ES 5.1 spec). The parenthesized expression prevents an\n // unsafe transformation by the Closure Compiler.\n var original = this.__proto__, result = property in (this.__proto__ = null, this);\n // Restore the original prototype chain.\n this.__proto__ = original;\n return result;\n };\n } else {\n // Capture a reference to the top-level `Object` constructor.\n constructor = members.constructor;\n // Use the `constructor` property to simulate `Object#hasOwnProperty` in\n // other environments.\n isProperty = function (property) {\n var parent = (this.constructor || constructor).prototype;\n return property in this && !(property in parent && this[property] === parent[property]);\n };\n }\n members = null;\n return isProperty.call(this, property);\n };\n }\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n forEach = function (object, callback) {\n var size = 0, Properties, members, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n members = new Properties();\n for (property in members) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(members, property)) {\n size++;\n }\n }\n Properties = members = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n members = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));\n };\n } else if (size == 2) {\n // Safari <= 2.0.4 enumerates shadowed properties twice.\n forEach = function (object, callback) {\n // Create a set of iterated properties.\n var members = {}, isFunction = getClass.call(object) == functionClass, property;\n for (property in object) {\n // Store each property name to prevent double enumeration. The\n // `prototype` property of functions is not enumerated due to cross-\n // environment inconsistencies.\n if (!(isFunction && property == \"prototype\") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forEach(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var quote = function (value) {\n var result = '\"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;\n var symbols = useCharIndex && (charIndexBuggy ? value.split(\"\") : value);\n for (; index < length; index++) {\n var charCode = value.charCodeAt(index);\n // If the character is a control character, append its Unicode or\n // shorthand escape sequence; otherwise, append the character as-is.\n switch (charCode) {\n case 8: case 9: case 10: case 12: case 13: case 34: case 92:\n result += Escapes[charCode];\n break;\n default:\n if (charCode < 32) {\n result += unicodePrefix + toPaddedString(2, charCode.toString(16));\n break;\n }\n result += useCharIndex ? symbols[index] : value.charAt(index);\n }\n }\n return result + '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;\n try {\n // Necessary for host object support.\n value = object[property];\n } catch (exception) {}\n if (typeof value == \"object\" && value) {\n className = getClass.call(value);\n if (className == dateClass && !isProperty.call(value, \"toJSON\")) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n if (getDay) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n } else {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n }\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n } else {\n value = null;\n }\n } else if (typeof value.toJSON == \"function\" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, \"toJSON\"))) {\n // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the\n // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3\n // ignores all `toJSON` methods on these objects unless they are\n // defined directly on an instance.\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n if (value === null) {\n return \"null\";\n }\n className = getClass.call(value);\n if (className == booleanClass) {\n // Booleans are represented literally.\n return \"\" + value;\n } else if (className == numberClass) {\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n } else if (className == stringClass) {\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undef ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forEach(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undef) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n if ((className = getClass.call(filter)) == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));\n }\n }\n if (width) {\n if ((className = getClass.call(width)) == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n for (whitespace = \"\", width > 10 && (width = 10); whitespace.length < width; whitespace += \" \");\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n if (source.slice(Index, Index + 4) == \"true\") {\n Index += 4;\n return true;\n } else if (source.slice(Index, Index + 5) == \"false\") {\n Index += 5;\n return false;\n } else if (source.slice(Index, Index + 4) == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undef) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forEach` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(value, length, callback);\n }\n } else {\n forEach(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports[\"runInContext\"] = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root[\"JSON3\"],\n isRestored = false;\n\n var JSON3 = runInContext(root, (root[\"JSON3\"] = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root[\"JSON3\"] = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n\n},{}],5:[function(require,module,exports){\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n},{}],6:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = util.toSetString(aStr);\n var isDuplicate = has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n this._set[sStr] = idx;\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n},{\"./util\":12}],7:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n},{\"./base64\":8}],8:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n},{}],9:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n},{}],10:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n},{}],11:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n},{\"./array-set\":6,\"./base64-vlq\":7,\"./binary-search\":9,\"./quick-sort\":10,\"./util\":12}],12:[function(require,module,exports){\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n},{}],13:[function(require,module,exports){\narguments[4][2][0].apply(exports,arguments)\n},{\"dup\":2}],14:[function(require,module,exports){\n(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n\n},{\"stackframe\":13}],15:[function(require,module,exports){\narguments[4][2][0].apply(exports,arguments)\n},{\"dup\":2}],16:[function(require,module,exports){\n(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace-gps', ['source-map', 'stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('source-map/lib/source-map-consumer'), require('stackframe'));\n } else {\n root.StackTraceGPS = factory(root.SourceMap || root.sourceMap, root.StackFrame);\n }\n}(this, function(SourceMap, StackFrame) {\n 'use strict';\n\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param {String} url\n * @returns {Promise} with response text if fulfilled\n */\n function _xdr(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('get', url);\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if ((req.status >= 200 && req.status < 300) ||\n (url.substr(0, 7) === 'file://' && req.responseText)) {\n resolve(req.responseText);\n } else {\n reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));\n }\n }\n };\n req.send();\n });\n\n }\n\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== 'undefined' && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error('You must supply a polyfill for window.atob in this environment');\n }\n }\n\n function _parseJson(string) {\n if (typeof JSON !== 'undefined' && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error('You must supply a polyfill for JSON.parse in this environment');\n }\n }\n\n function _findFunctionName(source, lineNumber/*, columnNumber*/) {\n var syntaxes = [\n // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/,\n // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/,\n // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/,\n // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/,\n // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/\n ];\n var lines = source.split('\\n');\n\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = '';\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf('//');\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {\n throw new Error('Unable to consume source maps in older browsers');\n }\n }\n\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== 'object') {\n throw new TypeError('Given StackFrame is not an object');\n } else if (typeof stackframe.fileName !== 'string') {\n throw new TypeError('Given file name is not a String');\n } else if (typeof stackframe.lineNumber !== 'number' ||\n stackframe.lineNumber % 1 !== 0 ||\n stackframe.lineNumber < 1) {\n throw new TypeError('Given line number must be a positive integer');\n } else if (typeof stackframe.columnNumber !== 'number' ||\n stackframe.columnNumber % 1 !== 0 ||\n stackframe.columnNumber < 0) {\n throw new TypeError('Given column number must be a non-negative integer');\n }\n return true;\n }\n\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/mg;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n // eslint-disable-next-line no-cond-assign\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error('sourceMappingURL not found');\n }\n }\n\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function(resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n\n resolve(\n // given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error('Could not get original source for given stackframe and source map'));\n }\n });\n }\n\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n\n this.ajax = opts.ajax || _xdr;\n\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function(resolve, reject) {\n var isDataUrl = location.substr(0, 5) === 'data:';\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error('Cannot make network requests in offline mode'));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp =\n /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error('The encoding of the inline sourcemap is not supported'));\n }\n } else {\n var xhrPromise = this.ajax(location, {method: 'get'});\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function(resolve) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function(resolve, reject) {\n return this._get(sourceMappingURL).then(function(sourceMapSource) {\n if (typeof sourceMapSource === 'string') {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, ''));\n }\n if (typeof sourceMapSource.sourceRoot === 'undefined') {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function(resolve, reject) {\n this.getMappedLocation(stackframe).then(function(mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n\n this.findFunctionName(mappedStackFrame)\n .then(resolve, resolveMappedStackFrame)\n // eslint-disable-next-line no-unexpected-multiline\n ['catch'](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)['catch'](reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function(source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);\n\n if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\\/\\/|^\\/\\//i).test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)\n .then(function(sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)\n .then(resolve)['catch'](function() {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)['catch'](reject);\n }.bind(this));\n };\n };\n}));\n\n},{\"source-map/lib/source-map-consumer\":11,\"stackframe\":15}],17:[function(require,module,exports){\n// Polyfill for old browsers\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\nif (!Array.isArray) {\n Array.isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n };\n}\n\nif (typeof Promise === 'undefined') {\n ES6Promise.polyfill();\n}\n\n// ES5 Polyfills\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1);\n var fToBind = this;\n var NoOp = function() {\n };\n var fBound = function() {\n return fToBind.apply(this instanceof NoOp && oThis ? this : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n\n NoOp.prototype = this.prototype;\n fBound.prototype = new NoOp();\n\n return fBound;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\nif (!Array.prototype.map) {\n Array.prototype.map = function(callback, thisArg) {\n if (this === void 0 || this === null) {\n throw new TypeError('this is null or not defined');\n }\n var O = Object(this);\n var len = O.length >>> 0;\n var T;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n if (arguments.length > 1) {\n T = thisArg;\n }\n\n var A = new Array(len);\n var k = 0;\n\n while (k < len) {\n var kValue;\n var mappedValue;\n if (k in O) {\n kValue = O[k];\n mappedValue = callback.call(T, kValue, k, O);\n A[k] = mappedValue;\n }\n k++;\n }\n\n return A;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\nif (!Array.prototype.filter) {\n Array.prototype.filter = function(callback/*, thisArg*/) {\n if (this === void 0 || this === null) {\n throw new TypeError('this is null or not defined');\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n\n var res = [];\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in t) {\n var val = t[i];\n if (callback.call(thisArg, val, i, t)) {\n res.push(val);\n }\n }\n }\n\n return res;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\nif (!Array.prototype.forEach) {\n Array.prototype.forEach = function(callback, thisArg) {\n var T;\n var k;\n if (this === null || this === undefined) {\n throw new TypeError(' this is null or not defined');\n }\n\n var O = Object(this);\n var len = O.length >>> 0;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n\n if (arguments.length > 1) {\n T = thisArg;\n }\n k = 0;\n while (k < len) {\n var kValue;\n if (k in O) {\n kValue = O[k];\n callback.call(T, kValue, k, O);\n }\n k++;\n }\n };\n}\n\n},{}],18:[function(require,module,exports){\n(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace', ['error-stack-parser', 'stack-generator', 'stacktrace-gps'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('error-stack-parser'), require('stack-generator'), require('stacktrace-gps'));\n } else {\n root.StackTrace = factory(root.ErrorStackParser, root.StackGenerator, root.StackTraceGPS);\n }\n}(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {\n var _options = {\n filter: function(stackframe) {\n // Filter out stackframes for this library by default\n return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&\n (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;\n },\n sourceCache: {}\n };\n\n var _generateError = function StackTrace$$GenerateError() {\n try {\n // Error must be thrown to get stack in IE\n throw new Error();\n } catch (err) {\n return err;\n }\n };\n\n /**\n * Merge 2 given Objects. If a conflict occurs the second object wins.\n * Does not do deep merges.\n *\n * @param {Object} first base object\n * @param {Object} second overrides\n * @returns {Object} merged first and second\n * @private\n */\n function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }\n\n function _isShapedLikeParsableError(err) {\n return err.stack || err['opera#sourceloc'];\n }\n\n function _filtered(stackframes, filter) {\n if (typeof filter === 'function') {\n return stackframes.filter(filter);\n }\n return stackframes;\n }\n\n return {\n /**\n * Get a backtrace from invocation point.\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n get: function StackTrace$$get(opts) {\n var err = _generateError();\n return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);\n },\n\n /**\n * Get a backtrace from invocation point.\n * IMPORTANT: Does not handle source maps or guess function names!\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n getSync: function StackTrace$$getSync(opts) {\n opts = _merge(_options, opts);\n var err = _generateError();\n var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);\n return _filtered(stack, opts.filter);\n },\n\n /**\n * Given an error object, parse it.\n *\n * @param {Error} error object\n * @param {Object} opts\n * @returns {Promise} for Array[StackFrame}\n */\n fromError: function StackTrace$$fromError(error, opts) {\n opts = _merge(_options, opts);\n var gps = new StackTraceGPS(opts);\n return new Promise(function(resolve) {\n var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n }.bind(this));\n },\n\n /**\n * Use StackGenerator to generate a backtrace.\n *\n * @param {Object} opts\n * @returns {Promise} of Array[StackFrame]\n */\n generateArtificially: function StackTrace$$generateArtificially(opts) {\n opts = _merge(_options, opts);\n var stackFrames = StackGenerator.backtrace(opts);\n if (typeof opts.filter === 'function') {\n stackFrames = stackFrames.filter(opts.filter);\n }\n return Promise.resolve(stackFrames);\n },\n\n /**\n * Given a function, wrap it such that invocations trigger a callback that\n * is called with a stack trace.\n *\n * @param {Function} fn to be instrumented\n * @param {Function} callback function to call with a stack trace on invocation\n * @param {Function} errback optional function to call with error if unable to get stack trace.\n * @param {Object} thisArg optional context object (e.g. window)\n */\n instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n // Already instrumented, return given Function\n return fn;\n }\n\n var instrumented = function StackTrace$$instrumented() {\n try {\n this.get().then(callback, errback)['catch'](errback);\n return fn.apply(thisArg || this, arguments);\n } catch (e) {\n if (_isShapedLikeParsableError(e)) {\n this.fromError(e).then(callback, errback)['catch'](errback);\n }\n throw e;\n }\n }.bind(this);\n instrumented.__stacktraceOriginalFn = fn;\n\n return instrumented;\n },\n\n /**\n * Given a function that has been instrumented,\n * revert the function to it's original (non-instrumented) state.\n *\n * @param {Function} fn to de-instrument\n */\n deinstrument: function StackTrace$$deinstrument(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot de-instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n return fn.__stacktraceOriginalFn;\n } else {\n // Function not instrumented, return original\n return fn;\n }\n },\n\n /**\n * Given an error message and Array of StackFrames, serialize and POST to given URL.\n *\n * @param {Array} stackframes\n * @param {String} url\n * @param {String} errorMsg\n * @param {Object} requestOptions\n */\n report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error('POST to ' + url + ' failed with status: ' + req.status));\n }\n }\n };\n req.open('post', url);\n\n // Set request headers\n req.setRequestHeader('Content-Type', 'application/json');\n if (requestOptions && typeof requestOptions.headers === 'object') {\n var headers = requestOptions.headers;\n for (var header in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, header)) {\n req.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n var reportPayload = {stack: stackframes};\n if (errorMsg !== undefined && errorMsg !== null) {\n reportPayload.message = errorMsg;\n }\n\n req.send(JSON.stringify(reportPayload));\n });\n }\n };\n}));\n\n},{\"error-stack-parser\":1,\"stack-generator\":14,\"stacktrace-gps\":16}]},{},[3,4,17,18])(18)\n});\n\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 3.3.1\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n return function () {\n vertxNext(flush);\n };\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\npolyfill();\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n//# sourceMappingURL=es6-promise.map","/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal[\"global\"] === freeGlobal || freeGlobal[\"window\"] === freeGlobal || freeGlobal[\"self\"] === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root[\"Object\"]());\n exports || (exports = root[\"Object\"]());\n\n // Native constructor aliases.\n var Number = context[\"Number\"] || root[\"Number\"],\n String = context[\"String\"] || root[\"String\"],\n Object = context[\"Object\"] || root[\"Object\"],\n Date = context[\"Date\"] || root[\"Date\"],\n SyntaxError = context[\"SyntaxError\"] || root[\"SyntaxError\"],\n TypeError = context[\"TypeError\"] || root[\"TypeError\"],\n Math = context[\"Math\"] || root[\"Math\"],\n nativeJSON = context[\"JSON\"] || root[\"JSON\"];\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty, forEach, undef;\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n try {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n // Safari < 2.0.2 stores the internal millisecond time value correctly,\n // but clips the values returned by the date methods to the range of\n // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n } catch (exception) {}\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] !== undef) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"json-parse\");\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n try {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undef &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undef) === undef &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undef &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undef]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n } catch (exception) {\n stringifySupported = false;\n }\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse;\n if (typeof parse == \"function\") {\n try {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n try {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n } catch (exception) {}\n if (parseSupported) {\n try {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n } catch (exception) {}\n }\n if (parseSupported) {\n try {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n } catch (exception) {}\n }\n }\n }\n } catch (exception) {\n parseSupported = false;\n }\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n }\n\n // Internal: Determines if a property is a direct property of the given\n // object. Delegates to the native `Object#hasOwnProperty` method.\n if (!(isProperty = objectProto.hasOwnProperty)) {\n isProperty = function (property) {\n var members = {}, constructor;\n if ((members.__proto__ = null, members.__proto__ = {\n // The *proto* property cannot be set multiple times in recent\n // versions of Firefox and SeaMonkey.\n \"toString\": 1\n }, members).toString != getClass) {\n // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but\n // supports the mutable *proto* property.\n isProperty = function (property) {\n // Capture and break the object's prototype chain (see section 8.6.2\n // of the ES 5.1 spec). The parenthesized expression prevents an\n // unsafe transformation by the Closure Compiler.\n var original = this.__proto__, result = property in (this.__proto__ = null, this);\n // Restore the original prototype chain.\n this.__proto__ = original;\n return result;\n };\n } else {\n // Capture a reference to the top-level `Object` constructor.\n constructor = members.constructor;\n // Use the `constructor` property to simulate `Object#hasOwnProperty` in\n // other environments.\n isProperty = function (property) {\n var parent = (this.constructor || constructor).prototype;\n return property in this && !(property in parent && this[property] === parent[property]);\n };\n }\n members = null;\n return isProperty.call(this, property);\n };\n }\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n forEach = function (object, callback) {\n var size = 0, Properties, members, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n members = new Properties();\n for (property in members) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(members, property)) {\n size++;\n }\n }\n Properties = members = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n members = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));\n };\n } else if (size == 2) {\n // Safari <= 2.0.4 enumerates shadowed properties twice.\n forEach = function (object, callback) {\n // Create a set of iterated properties.\n var members = {}, isFunction = getClass.call(object) == functionClass, property;\n for (property in object) {\n // Store each property name to prevent double enumeration. The\n // `prototype` property of functions is not enumerated due to cross-\n // environment inconsistencies.\n if (!(isFunction && property == \"prototype\") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forEach = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forEach(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var quote = function (value) {\n var result = '\"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;\n var symbols = useCharIndex && (charIndexBuggy ? value.split(\"\") : value);\n for (; index < length; index++) {\n var charCode = value.charCodeAt(index);\n // If the character is a control character, append its Unicode or\n // shorthand escape sequence; otherwise, append the character as-is.\n switch (charCode) {\n case 8: case 9: case 10: case 12: case 13: case 34: case 92:\n result += Escapes[charCode];\n break;\n default:\n if (charCode < 32) {\n result += unicodePrefix + toPaddedString(2, charCode.toString(16));\n break;\n }\n result += useCharIndex ? symbols[index] : value.charAt(index);\n }\n }\n return result + '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;\n try {\n // Necessary for host object support.\n value = object[property];\n } catch (exception) {}\n if (typeof value == \"object\" && value) {\n className = getClass.call(value);\n if (className == dateClass && !isProperty.call(value, \"toJSON\")) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n if (getDay) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n } else {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n }\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n } else {\n value = null;\n }\n } else if (typeof value.toJSON == \"function\" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, \"toJSON\"))) {\n // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the\n // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3\n // ignores all `toJSON` methods on these objects unless they are\n // defined directly on an instance.\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n if (value === null) {\n return \"null\";\n }\n className = getClass.call(value);\n if (className == booleanClass) {\n // Booleans are represented literally.\n return \"\" + value;\n } else if (className == numberClass) {\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n } else if (className == stringClass) {\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undef ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forEach(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undef) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n if ((className = getClass.call(filter)) == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));\n }\n }\n if (width) {\n if ((className = getClass.call(width)) == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n for (whitespace = \"\", width > 10 && (width = 10); whitespace.length < width; whitespace += \" \");\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n if (source.slice(Index, Index + 4) == \"true\") {\n Index += 4;\n return true;\n } else if (source.slice(Index, Index + 5) == \"false\") {\n Index += 5;\n return false;\n } else if (source.slice(Index, Index + 4) == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;; hasMembers || (hasMembers = true)) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undef) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forEach` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(value, length, callback);\n }\n } else {\n forEach(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports[\"runInContext\"] = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root[\"JSON3\"],\n isRestored = false;\n\n var JSON3 = runInContext(root, (root[\"JSON3\"] = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root[\"JSON3\"] = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = util.toSetString(aStr);\n var isDuplicate = has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n this._set[sStr] = idx;\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap)\n : new BasicSourceMapConsumer(sourceMap);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n if (source != null && sourceRoot != null) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: Optional. the column number in the original source.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n if (this.sourceRoot != null) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n if (!this._sources.has(needle.source)) {\n return [];\n }\n needle.source = this._sources.indexOf(needle.source);\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n if (this.sourceRoot != null) {\n source = util.join(this.sourceRoot, source);\n }\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot != null) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n if (this.sourceRoot != null) {\n source = util.relative(this.sourceRoot, source);\n }\n if (!this._sources.has(source)) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n source = this._sources.indexOf(source);\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The only parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'))\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n if (section.consumer.sourceRoot !== null) {\n source = util.join(section.consumer.sourceRoot, source);\n }\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = mappingA.source - mappingB.source;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return mappingA.name - mappingB.name;\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace-gps', ['source-map', 'stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('source-map/lib/source-map-consumer'), require('stackframe'));\n } else {\n root.StackTraceGPS = factory(root.SourceMap || root.sourceMap, root.StackFrame);\n }\n}(this, function(SourceMap, StackFrame) {\n 'use strict';\n\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param {String} url\n * @returns {Promise} with response text if fulfilled\n */\n function _xdr(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('get', url);\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if ((req.status >= 200 && req.status < 300) ||\n (url.substr(0, 7) === 'file://' && req.responseText)) {\n resolve(req.responseText);\n } else {\n reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));\n }\n }\n };\n req.send();\n });\n\n }\n\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== 'undefined' && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error('You must supply a polyfill for window.atob in this environment');\n }\n }\n\n function _parseJson(string) {\n if (typeof JSON !== 'undefined' && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error('You must supply a polyfill for JSON.parse in this environment');\n }\n }\n\n function _findFunctionName(source, lineNumber/*, columnNumber*/) {\n var syntaxes = [\n // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/,\n // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/,\n // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/,\n // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/,\n // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/\n ];\n var lines = source.split('\\n');\n\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = '';\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf('//');\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {\n throw new Error('Unable to consume source maps in older browsers');\n }\n }\n\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== 'object') {\n throw new TypeError('Given StackFrame is not an object');\n } else if (typeof stackframe.fileName !== 'string') {\n throw new TypeError('Given file name is not a String');\n } else if (typeof stackframe.lineNumber !== 'number' ||\n stackframe.lineNumber % 1 !== 0 ||\n stackframe.lineNumber < 1) {\n throw new TypeError('Given line number must be a positive integer');\n } else if (typeof stackframe.columnNumber !== 'number' ||\n stackframe.columnNumber % 1 !== 0 ||\n stackframe.columnNumber < 0) {\n throw new TypeError('Given column number must be a non-negative integer');\n }\n return true;\n }\n\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/mg;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n // eslint-disable-next-line no-cond-assign\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error('sourceMappingURL not found');\n }\n }\n\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function(resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n\n resolve(\n // given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error('Could not get original source for given stackframe and source map'));\n }\n });\n }\n\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n\n this.ajax = opts.ajax || _xdr;\n\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function(resolve, reject) {\n var isDataUrl = location.substr(0, 5) === 'data:';\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error('Cannot make network requests in offline mode'));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp =\n /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error('The encoding of the inline sourcemap is not supported'));\n }\n } else {\n var xhrPromise = this.ajax(location, {method: 'get'});\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function(resolve) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function(resolve, reject) {\n return this._get(sourceMappingURL).then(function(sourceMapSource) {\n if (typeof sourceMapSource === 'string') {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, ''));\n }\n if (typeof sourceMapSource.sourceRoot === 'undefined') {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function(resolve, reject) {\n this.getMappedLocation(stackframe).then(function(mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n\n this.findFunctionName(mappedStackFrame)\n .then(resolve, resolveMappedStackFrame)\n // eslint-disable-next-line no-unexpected-multiline\n ['catch'](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)['catch'](reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function(source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);\n\n if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\\/\\/|^\\/\\//i).test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)\n .then(function(sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)\n .then(resolve)['catch'](function() {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)['catch'](reject);\n }.bind(this));\n };\n };\n}));\n","// Polyfill for old browsers\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\nif (!Array.isArray) {\n Array.isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n };\n}\n\nif (typeof Promise === 'undefined') {\n ES6Promise.polyfill();\n}\n\n// ES5 Polyfills\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind\nif (!Function.prototype.bind) {\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1);\n var fToBind = this;\n var NoOp = function() {\n };\n var fBound = function() {\n return fToBind.apply(this instanceof NoOp && oThis ? this : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n\n NoOp.prototype = this.prototype;\n fBound.prototype = new NoOp();\n\n return fBound;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\nif (!Array.prototype.map) {\n Array.prototype.map = function(callback, thisArg) {\n if (this === void 0 || this === null) {\n throw new TypeError('this is null or not defined');\n }\n var O = Object(this);\n var len = O.length >>> 0;\n var T;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n if (arguments.length > 1) {\n T = thisArg;\n }\n\n var A = new Array(len);\n var k = 0;\n\n while (k < len) {\n var kValue;\n var mappedValue;\n if (k in O) {\n kValue = O[k];\n mappedValue = callback.call(T, kValue, k, O);\n A[k] = mappedValue;\n }\n k++;\n }\n\n return A;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\nif (!Array.prototype.filter) {\n Array.prototype.filter = function(callback/*, thisArg*/) {\n if (this === void 0 || this === null) {\n throw new TypeError('this is null or not defined');\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n\n var res = [];\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in t) {\n var val = t[i];\n if (callback.call(thisArg, val, i, t)) {\n res.push(val);\n }\n }\n }\n\n return res;\n };\n}\n\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\nif (!Array.prototype.forEach) {\n Array.prototype.forEach = function(callback, thisArg) {\n var T;\n var k;\n if (this === null || this === undefined) {\n throw new TypeError(' this is null or not defined');\n }\n\n var O = Object(this);\n var len = O.length >>> 0;\n if (typeof callback !== 'function') {\n throw new TypeError(callback + ' is not a function');\n }\n\n if (arguments.length > 1) {\n T = thisArg;\n }\n k = 0;\n while (k < len) {\n var kValue;\n if (k in O) {\n kValue = O[k];\n callback.call(T, kValue, k, O);\n }\n k++;\n }\n };\n}\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stacktrace', ['error-stack-parser', 'stack-generator', 'stacktrace-gps'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('error-stack-parser'), require('stack-generator'), require('stacktrace-gps'));\n } else {\n root.StackTrace = factory(root.ErrorStackParser, root.StackGenerator, root.StackTraceGPS);\n }\n}(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {\n var _options = {\n filter: function(stackframe) {\n // Filter out stackframes for this library by default\n return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&\n (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;\n },\n sourceCache: {}\n };\n\n var _generateError = function StackTrace$$GenerateError() {\n try {\n // Error must be thrown to get stack in IE\n throw new Error();\n } catch (err) {\n return err;\n }\n };\n\n /**\n * Merge 2 given Objects. If a conflict occurs the second object wins.\n * Does not do deep merges.\n *\n * @param {Object} first base object\n * @param {Object} second overrides\n * @returns {Object} merged first and second\n * @private\n */\n function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }\n\n function _isShapedLikeParsableError(err) {\n return err.stack || err['opera#sourceloc'];\n }\n\n function _filtered(stackframes, filter) {\n if (typeof filter === 'function') {\n return stackframes.filter(filter);\n }\n return stackframes;\n }\n\n return {\n /**\n * Get a backtrace from invocation point.\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n get: function StackTrace$$get(opts) {\n var err = _generateError();\n return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);\n },\n\n /**\n * Get a backtrace from invocation point.\n * IMPORTANT: Does not handle source maps or guess function names!\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n getSync: function StackTrace$$getSync(opts) {\n opts = _merge(_options, opts);\n var err = _generateError();\n var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);\n return _filtered(stack, opts.filter);\n },\n\n /**\n * Given an error object, parse it.\n *\n * @param {Error} error object\n * @param {Object} opts\n * @returns {Promise} for Array[StackFrame}\n */\n fromError: function StackTrace$$fromError(error, opts) {\n opts = _merge(_options, opts);\n var gps = new StackTraceGPS(opts);\n return new Promise(function(resolve) {\n var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n }.bind(this));\n },\n\n /**\n * Use StackGenerator to generate a backtrace.\n *\n * @param {Object} opts\n * @returns {Promise} of Array[StackFrame]\n */\n generateArtificially: function StackTrace$$generateArtificially(opts) {\n opts = _merge(_options, opts);\n var stackFrames = StackGenerator.backtrace(opts);\n if (typeof opts.filter === 'function') {\n stackFrames = stackFrames.filter(opts.filter);\n }\n return Promise.resolve(stackFrames);\n },\n\n /**\n * Given a function, wrap it such that invocations trigger a callback that\n * is called with a stack trace.\n *\n * @param {Function} fn to be instrumented\n * @param {Function} callback function to call with a stack trace on invocation\n * @param {Function} errback optional function to call with error if unable to get stack trace.\n * @param {Object} thisArg optional context object (e.g. window)\n */\n instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n // Already instrumented, return given Function\n return fn;\n }\n\n var instrumented = function StackTrace$$instrumented() {\n try {\n this.get().then(callback, errback)['catch'](errback);\n return fn.apply(thisArg || this, arguments);\n } catch (e) {\n if (_isShapedLikeParsableError(e)) {\n this.fromError(e).then(callback, errback)['catch'](errback);\n }\n throw e;\n }\n }.bind(this);\n instrumented.__stacktraceOriginalFn = fn;\n\n return instrumented;\n },\n\n /**\n * Given a function that has been instrumented,\n * revert the function to it's original (non-instrumented) state.\n *\n * @param {Function} fn to de-instrument\n */\n deinstrument: function StackTrace$$deinstrument(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot de-instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n return fn.__stacktraceOriginalFn;\n } else {\n // Function not instrumented, return original\n return fn;\n }\n },\n\n /**\n * Given an error message and Array of StackFrames, serialize and POST to given URL.\n *\n * @param {Array} stackframes\n * @param {String} url\n * @param {String} errorMsg\n * @param {Object} requestOptions\n */\n report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error('POST to ' + url + ' failed with status: ' + req.status));\n }\n }\n };\n req.open('post', url);\n\n // Set request headers\n req.setRequestHeader('Content-Type', 'application/json');\n if (requestOptions && typeof requestOptions.headers === 'object') {\n var headers = requestOptions.headers;\n for (var header in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, header)) {\n req.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n var reportPayload = {stack: stackframes};\n if (errorMsg !== undefined && errorMsg !== null) {\n reportPayload.message = errorMsg;\n }\n\n req.send(JSON.stringify(reportPayload));\n });\n }\n };\n}));\n"]}
@@ -0,0 +1,3025 @@
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.StackTrace = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
+ (function(root, factory) {
3
+ 'use strict';
4
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
5
+
6
+ /* istanbul ignore next */
7
+ if (typeof define === 'function' && define.amd) {
8
+ define('error-stack-parser', ['stackframe'], factory);
9
+ } else if (typeof exports === 'object') {
10
+ module.exports = factory(require('stackframe'));
11
+ } else {
12
+ root.ErrorStackParser = factory(root.StackFrame);
13
+ }
14
+ }(this, function ErrorStackParser(StackFrame) {
15
+ 'use strict';
16
+
17
+ var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
18
+ var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
19
+ var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
20
+
21
+ return {
22
+ /**
23
+ * Given an Error object, extract the most information from it.
24
+ *
25
+ * @param {Error} error object
26
+ * @return {Array} of StackFrames
27
+ */
28
+ parse: function ErrorStackParser$$parse(error) {
29
+ if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {
30
+ return this.parseOpera(error);
31
+ } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {
32
+ return this.parseV8OrIE(error);
33
+ } else if (error.stack) {
34
+ return this.parseFFOrSafari(error);
35
+ } else {
36
+ throw new Error('Cannot parse given Error object');
37
+ }
38
+ },
39
+
40
+ // Separate line and column numbers from a string of the form: (URI:Line:Column)
41
+ extractLocation: function ErrorStackParser$$extractLocation(urlLike) {
42
+ // Fail-fast but return locations like "(native)"
43
+ if (urlLike.indexOf(':') === -1) {
44
+ return [urlLike];
45
+ }
46
+
47
+ var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
48
+ var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
49
+ return [parts[1], parts[2] || undefined, parts[3] || undefined];
50
+ },
51
+
52
+ parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {
53
+ var filtered = error.stack.split('\n').filter(function(line) {
54
+ return !!line.match(CHROME_IE_STACK_REGEXP);
55
+ }, this);
56
+
57
+ return filtered.map(function(line) {
58
+ if (line.indexOf('(eval ') > -1) {
59
+ // Throw away eval information until we implement stacktrace.js/stackframe#8
60
+ line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
61
+ }
62
+ var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
63
+
64
+ // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
65
+ // case it has spaces in it, as the string is split on \s+ later on
66
+ var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
67
+
68
+ // remove the parenthesized location from the line, if it was matched
69
+ sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
70
+
71
+ var tokens = sanitizedLine.split(/\s+/).slice(1);
72
+ // if a location was matched, pass it to extractLocation() otherwise pop the last token
73
+ var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
74
+ var functionName = tokens.join(' ') || undefined;
75
+ var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
76
+
77
+ return new StackFrame({
78
+ functionName: functionName,
79
+ fileName: fileName,
80
+ lineNumber: locationParts[1],
81
+ columnNumber: locationParts[2],
82
+ source: line
83
+ });
84
+ }, this);
85
+ },
86
+
87
+ parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {
88
+ var filtered = error.stack.split('\n').filter(function(line) {
89
+ return !line.match(SAFARI_NATIVE_CODE_REGEXP);
90
+ }, this);
91
+
92
+ return filtered.map(function(line) {
93
+ // Throw away eval information until we implement stacktrace.js/stackframe#8
94
+ if (line.indexOf(' > eval') > -1) {
95
+ line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
96
+ }
97
+
98
+ if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
99
+ // Safari eval frames only have function names and nothing else
100
+ return new StackFrame({
101
+ functionName: line
102
+ });
103
+ } else {
104
+ var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
105
+ var matches = line.match(functionNameRegex);
106
+ var functionName = matches && matches[1] ? matches[1] : undefined;
107
+ var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));
108
+
109
+ return new StackFrame({
110
+ functionName: functionName,
111
+ fileName: locationParts[0],
112
+ lineNumber: locationParts[1],
113
+ columnNumber: locationParts[2],
114
+ source: line
115
+ });
116
+ }
117
+ }, this);
118
+ },
119
+
120
+ parseOpera: function ErrorStackParser$$parseOpera(e) {
121
+ if (!e.stacktrace || (e.message.indexOf('\n') > -1 &&
122
+ e.message.split('\n').length > e.stacktrace.split('\n').length)) {
123
+ return this.parseOpera9(e);
124
+ } else if (!e.stack) {
125
+ return this.parseOpera10(e);
126
+ } else {
127
+ return this.parseOpera11(e);
128
+ }
129
+ },
130
+
131
+ parseOpera9: function ErrorStackParser$$parseOpera9(e) {
132
+ var lineRE = /Line (\d+).*script (?:in )?(\S+)/i;
133
+ var lines = e.message.split('\n');
134
+ var result = [];
135
+
136
+ for (var i = 2, len = lines.length; i < len; i += 2) {
137
+ var match = lineRE.exec(lines[i]);
138
+ if (match) {
139
+ result.push(new StackFrame({
140
+ fileName: match[2],
141
+ lineNumber: match[1],
142
+ source: lines[i]
143
+ }));
144
+ }
145
+ }
146
+
147
+ return result;
148
+ },
149
+
150
+ parseOpera10: function ErrorStackParser$$parseOpera10(e) {
151
+ var lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
152
+ var lines = e.stacktrace.split('\n');
153
+ var result = [];
154
+
155
+ for (var i = 0, len = lines.length; i < len; i += 2) {
156
+ var match = lineRE.exec(lines[i]);
157
+ if (match) {
158
+ result.push(
159
+ new StackFrame({
160
+ functionName: match[3] || undefined,
161
+ fileName: match[2],
162
+ lineNumber: match[1],
163
+ source: lines[i]
164
+ })
165
+ );
166
+ }
167
+ }
168
+
169
+ return result;
170
+ },
171
+
172
+ // Opera 10.65+ Error.stack very similar to FF/Safari
173
+ parseOpera11: function ErrorStackParser$$parseOpera11(error) {
174
+ var filtered = error.stack.split('\n').filter(function(line) {
175
+ return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);
176
+ }, this);
177
+
178
+ return filtered.map(function(line) {
179
+ var tokens = line.split('@');
180
+ var locationParts = this.extractLocation(tokens.pop());
181
+ var functionCall = (tokens.shift() || '');
182
+ var functionName = functionCall
183
+ .replace(/<anonymous function(: (\w+))?>/, '$2')
184
+ .replace(/\([^)]*\)/g, '') || undefined;
185
+ var argsRaw;
186
+ if (functionCall.match(/\(([^)]*)\)/)) {
187
+ argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
188
+ }
189
+ var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
190
+ undefined : argsRaw.split(',');
191
+
192
+ return new StackFrame({
193
+ functionName: functionName,
194
+ args: args,
195
+ fileName: locationParts[0],
196
+ lineNumber: locationParts[1],
197
+ columnNumber: locationParts[2],
198
+ source: line
199
+ });
200
+ }, this);
201
+ }
202
+ };
203
+ }));
204
+
205
+ },{"stackframe":2}],2:[function(require,module,exports){
206
+ (function(root, factory) {
207
+ 'use strict';
208
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
209
+
210
+ /* istanbul ignore next */
211
+ if (typeof define === 'function' && define.amd) {
212
+ define('stackframe', [], factory);
213
+ } else if (typeof exports === 'object') {
214
+ module.exports = factory();
215
+ } else {
216
+ root.StackFrame = factory();
217
+ }
218
+ }(this, function() {
219
+ 'use strict';
220
+ function _isNumber(n) {
221
+ return !isNaN(parseFloat(n)) && isFinite(n);
222
+ }
223
+
224
+ function _capitalize(str) {
225
+ return str.charAt(0).toUpperCase() + str.substring(1);
226
+ }
227
+
228
+ function _getter(p) {
229
+ return function() {
230
+ return this[p];
231
+ };
232
+ }
233
+
234
+ var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];
235
+ var numericProps = ['columnNumber', 'lineNumber'];
236
+ var stringProps = ['fileName', 'functionName', 'source'];
237
+ var arrayProps = ['args'];
238
+
239
+ var props = booleanProps.concat(numericProps, stringProps, arrayProps);
240
+
241
+ function StackFrame(obj) {
242
+ if (!obj) return;
243
+ for (var i = 0; i < props.length; i++) {
244
+ if (obj[props[i]] !== undefined) {
245
+ this['set' + _capitalize(props[i])](obj[props[i]]);
246
+ }
247
+ }
248
+ }
249
+
250
+ StackFrame.prototype = {
251
+ getArgs: function() {
252
+ return this.args;
253
+ },
254
+ setArgs: function(v) {
255
+ if (Object.prototype.toString.call(v) !== '[object Array]') {
256
+ throw new TypeError('Args must be an Array');
257
+ }
258
+ this.args = v;
259
+ },
260
+
261
+ getEvalOrigin: function() {
262
+ return this.evalOrigin;
263
+ },
264
+ setEvalOrigin: function(v) {
265
+ if (v instanceof StackFrame) {
266
+ this.evalOrigin = v;
267
+ } else if (v instanceof Object) {
268
+ this.evalOrigin = new StackFrame(v);
269
+ } else {
270
+ throw new TypeError('Eval Origin must be an Object or StackFrame');
271
+ }
272
+ },
273
+
274
+ toString: function() {
275
+ var fileName = this.getFileName() || '';
276
+ var lineNumber = this.getLineNumber() || '';
277
+ var columnNumber = this.getColumnNumber() || '';
278
+ var functionName = this.getFunctionName() || '';
279
+ if (this.getIsEval()) {
280
+ if (fileName) {
281
+ return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
282
+ }
283
+ return '[eval]:' + lineNumber + ':' + columnNumber;
284
+ }
285
+ if (functionName) {
286
+ return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';
287
+ }
288
+ return fileName + ':' + lineNumber + ':' + columnNumber;
289
+ }
290
+ };
291
+
292
+ StackFrame.fromString = function StackFrame$$fromString(str) {
293
+ var argsStartIndex = str.indexOf('(');
294
+ var argsEndIndex = str.lastIndexOf(')');
295
+
296
+ var functionName = str.substring(0, argsStartIndex);
297
+ var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');
298
+ var locationString = str.substring(argsEndIndex + 1);
299
+
300
+ if (locationString.indexOf('@') === 0) {
301
+ var parts = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(locationString, '');
302
+ var fileName = parts[1];
303
+ var lineNumber = parts[2];
304
+ var columnNumber = parts[3];
305
+ }
306
+
307
+ return new StackFrame({
308
+ functionName: functionName,
309
+ args: args || undefined,
310
+ fileName: fileName,
311
+ lineNumber: lineNumber || undefined,
312
+ columnNumber: columnNumber || undefined
313
+ });
314
+ };
315
+
316
+ for (var i = 0; i < booleanProps.length; i++) {
317
+ StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);
318
+ StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {
319
+ return function(v) {
320
+ this[p] = Boolean(v);
321
+ };
322
+ })(booleanProps[i]);
323
+ }
324
+
325
+ for (var j = 0; j < numericProps.length; j++) {
326
+ StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);
327
+ StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {
328
+ return function(v) {
329
+ if (!_isNumber(v)) {
330
+ throw new TypeError(p + ' must be a Number');
331
+ }
332
+ this[p] = Number(v);
333
+ };
334
+ })(numericProps[j]);
335
+ }
336
+
337
+ for (var k = 0; k < stringProps.length; k++) {
338
+ StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);
339
+ StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {
340
+ return function(v) {
341
+ this[p] = String(v);
342
+ };
343
+ })(stringProps[k]);
344
+ }
345
+
346
+ return StackFrame;
347
+ }));
348
+
349
+ },{}],3:[function(require,module,exports){
350
+ /* -*- Mode: js; js-indent-level: 2; -*- */
351
+ /*
352
+ * Copyright 2011 Mozilla Foundation and contributors
353
+ * Licensed under the New BSD license. See LICENSE or:
354
+ * http://opensource.org/licenses/BSD-3-Clause
355
+ */
356
+
357
+ var util = require('./util');
358
+ var has = Object.prototype.hasOwnProperty;
359
+
360
+ /**
361
+ * A data structure which is a combination of an array and a set. Adding a new
362
+ * member is O(1), testing for membership is O(1), and finding the index of an
363
+ * element is O(1). Removing elements from the set is not supported. Only
364
+ * strings are supported for membership.
365
+ */
366
+ function ArraySet() {
367
+ this._array = [];
368
+ this._set = Object.create(null);
369
+ }
370
+
371
+ /**
372
+ * Static method for creating ArraySet instances from an existing array.
373
+ */
374
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
375
+ var set = new ArraySet();
376
+ for (var i = 0, len = aArray.length; i < len; i++) {
377
+ set.add(aArray[i], aAllowDuplicates);
378
+ }
379
+ return set;
380
+ };
381
+
382
+ /**
383
+ * Return how many unique items are in this ArraySet. If duplicates have been
384
+ * added, than those do not count towards the size.
385
+ *
386
+ * @returns Number
387
+ */
388
+ ArraySet.prototype.size = function ArraySet_size() {
389
+ return Object.getOwnPropertyNames(this._set).length;
390
+ };
391
+
392
+ /**
393
+ * Add the given string to this set.
394
+ *
395
+ * @param String aStr
396
+ */
397
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
398
+ var sStr = util.toSetString(aStr);
399
+ var isDuplicate = has.call(this._set, sStr);
400
+ var idx = this._array.length;
401
+ if (!isDuplicate || aAllowDuplicates) {
402
+ this._array.push(aStr);
403
+ }
404
+ if (!isDuplicate) {
405
+ this._set[sStr] = idx;
406
+ }
407
+ };
408
+
409
+ /**
410
+ * Is the given string a member of this set?
411
+ *
412
+ * @param String aStr
413
+ */
414
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
415
+ var sStr = util.toSetString(aStr);
416
+ return has.call(this._set, sStr);
417
+ };
418
+
419
+ /**
420
+ * What is the index of the given string in the array?
421
+ *
422
+ * @param String aStr
423
+ */
424
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
425
+ var sStr = util.toSetString(aStr);
426
+ if (has.call(this._set, sStr)) {
427
+ return this._set[sStr];
428
+ }
429
+ throw new Error('"' + aStr + '" is not in the set.');
430
+ };
431
+
432
+ /**
433
+ * What is the element at the given index?
434
+ *
435
+ * @param Number aIdx
436
+ */
437
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
438
+ if (aIdx >= 0 && aIdx < this._array.length) {
439
+ return this._array[aIdx];
440
+ }
441
+ throw new Error('No element indexed by ' + aIdx);
442
+ };
443
+
444
+ /**
445
+ * Returns the array representation of this set (which has the proper indices
446
+ * indicated by indexOf). Note that this is a copy of the internal array used
447
+ * for storing the members so that no one can mess with internal state.
448
+ */
449
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
450
+ return this._array.slice();
451
+ };
452
+
453
+ exports.ArraySet = ArraySet;
454
+
455
+ },{"./util":9}],4:[function(require,module,exports){
456
+ /* -*- Mode: js; js-indent-level: 2; -*- */
457
+ /*
458
+ * Copyright 2011 Mozilla Foundation and contributors
459
+ * Licensed under the New BSD license. See LICENSE or:
460
+ * http://opensource.org/licenses/BSD-3-Clause
461
+ *
462
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
463
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
464
+ *
465
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
466
+ * Redistribution and use in source and binary forms, with or without
467
+ * modification, are permitted provided that the following conditions are
468
+ * met:
469
+ *
470
+ * * Redistributions of source code must retain the above copyright
471
+ * notice, this list of conditions and the following disclaimer.
472
+ * * Redistributions in binary form must reproduce the above
473
+ * copyright notice, this list of conditions and the following
474
+ * disclaimer in the documentation and/or other materials provided
475
+ * with the distribution.
476
+ * * Neither the name of Google Inc. nor the names of its
477
+ * contributors may be used to endorse or promote products derived
478
+ * from this software without specific prior written permission.
479
+ *
480
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
481
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
482
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
483
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
484
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
485
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
486
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
487
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
488
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
489
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
490
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
491
+ */
492
+
493
+ var base64 = require('./base64');
494
+
495
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
496
+ // length quantities we use in the source map spec, the first bit is the sign,
497
+ // the next four bits are the actual value, and the 6th bit is the
498
+ // continuation bit. The continuation bit tells us whether there are more
499
+ // digits in this value following this digit.
500
+ //
501
+ // Continuation
502
+ // | Sign
503
+ // | |
504
+ // V V
505
+ // 101011
506
+
507
+ var VLQ_BASE_SHIFT = 5;
508
+
509
+ // binary: 100000
510
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
511
+
512
+ // binary: 011111
513
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
514
+
515
+ // binary: 100000
516
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
517
+
518
+ /**
519
+ * Converts from a two-complement value to a value where the sign bit is
520
+ * placed in the least significant bit. For example, as decimals:
521
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
522
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
523
+ */
524
+ function toVLQSigned(aValue) {
525
+ return aValue < 0
526
+ ? ((-aValue) << 1) + 1
527
+ : (aValue << 1) + 0;
528
+ }
529
+
530
+ /**
531
+ * Converts to a two-complement value from a value where the sign bit is
532
+ * placed in the least significant bit. For example, as decimals:
533
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
534
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
535
+ */
536
+ function fromVLQSigned(aValue) {
537
+ var isNegative = (aValue & 1) === 1;
538
+ var shifted = aValue >> 1;
539
+ return isNegative
540
+ ? -shifted
541
+ : shifted;
542
+ }
543
+
544
+ /**
545
+ * Returns the base 64 VLQ encoded value.
546
+ */
547
+ exports.encode = function base64VLQ_encode(aValue) {
548
+ var encoded = "";
549
+ var digit;
550
+
551
+ var vlq = toVLQSigned(aValue);
552
+
553
+ do {
554
+ digit = vlq & VLQ_BASE_MASK;
555
+ vlq >>>= VLQ_BASE_SHIFT;
556
+ if (vlq > 0) {
557
+ // There are still more digits in this value, so we must make sure the
558
+ // continuation bit is marked.
559
+ digit |= VLQ_CONTINUATION_BIT;
560
+ }
561
+ encoded += base64.encode(digit);
562
+ } while (vlq > 0);
563
+
564
+ return encoded;
565
+ };
566
+
567
+ /**
568
+ * Decodes the next base 64 VLQ value from the given string and returns the
569
+ * value and the rest of the string via the out parameter.
570
+ */
571
+ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
572
+ var strLen = aStr.length;
573
+ var result = 0;
574
+ var shift = 0;
575
+ var continuation, digit;
576
+
577
+ do {
578
+ if (aIndex >= strLen) {
579
+ throw new Error("Expected more digits in base 64 VLQ value.");
580
+ }
581
+
582
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
583
+ if (digit === -1) {
584
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
585
+ }
586
+
587
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
588
+ digit &= VLQ_BASE_MASK;
589
+ result = result + (digit << shift);
590
+ shift += VLQ_BASE_SHIFT;
591
+ } while (continuation);
592
+
593
+ aOutParam.value = fromVLQSigned(result);
594
+ aOutParam.rest = aIndex;
595
+ };
596
+
597
+ },{"./base64":5}],5:[function(require,module,exports){
598
+ /* -*- Mode: js; js-indent-level: 2; -*- */
599
+ /*
600
+ * Copyright 2011 Mozilla Foundation and contributors
601
+ * Licensed under the New BSD license. See LICENSE or:
602
+ * http://opensource.org/licenses/BSD-3-Clause
603
+ */
604
+
605
+ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
606
+
607
+ /**
608
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
609
+ */
610
+ exports.encode = function (number) {
611
+ if (0 <= number && number < intToCharMap.length) {
612
+ return intToCharMap[number];
613
+ }
614
+ throw new TypeError("Must be between 0 and 63: " + number);
615
+ };
616
+
617
+ /**
618
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
619
+ * failure.
620
+ */
621
+ exports.decode = function (charCode) {
622
+ var bigA = 65; // 'A'
623
+ var bigZ = 90; // 'Z'
624
+
625
+ var littleA = 97; // 'a'
626
+ var littleZ = 122; // 'z'
627
+
628
+ var zero = 48; // '0'
629
+ var nine = 57; // '9'
630
+
631
+ var plus = 43; // '+'
632
+ var slash = 47; // '/'
633
+
634
+ var littleOffset = 26;
635
+ var numberOffset = 52;
636
+
637
+ // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
638
+ if (bigA <= charCode && charCode <= bigZ) {
639
+ return (charCode - bigA);
640
+ }
641
+
642
+ // 26 - 51: abcdefghijklmnopqrstuvwxyz
643
+ if (littleA <= charCode && charCode <= littleZ) {
644
+ return (charCode - littleA + littleOffset);
645
+ }
646
+
647
+ // 52 - 61: 0123456789
648
+ if (zero <= charCode && charCode <= nine) {
649
+ return (charCode - zero + numberOffset);
650
+ }
651
+
652
+ // 62: +
653
+ if (charCode == plus) {
654
+ return 62;
655
+ }
656
+
657
+ // 63: /
658
+ if (charCode == slash) {
659
+ return 63;
660
+ }
661
+
662
+ // Invalid base64 digit.
663
+ return -1;
664
+ };
665
+
666
+ },{}],6:[function(require,module,exports){
667
+ /* -*- Mode: js; js-indent-level: 2; -*- */
668
+ /*
669
+ * Copyright 2011 Mozilla Foundation and contributors
670
+ * Licensed under the New BSD license. See LICENSE or:
671
+ * http://opensource.org/licenses/BSD-3-Clause
672
+ */
673
+
674
+ exports.GREATEST_LOWER_BOUND = 1;
675
+ exports.LEAST_UPPER_BOUND = 2;
676
+
677
+ /**
678
+ * Recursive implementation of binary search.
679
+ *
680
+ * @param aLow Indices here and lower do not contain the needle.
681
+ * @param aHigh Indices here and higher do not contain the needle.
682
+ * @param aNeedle The element being searched for.
683
+ * @param aHaystack The non-empty array being searched.
684
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
685
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
686
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
687
+ * closest element that is smaller than or greater than the one we are
688
+ * searching for, respectively, if the exact element cannot be found.
689
+ */
690
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
691
+ // This function terminates when one of the following is true:
692
+ //
693
+ // 1. We find the exact element we are looking for.
694
+ //
695
+ // 2. We did not find the exact element, but we can return the index of
696
+ // the next-closest element.
697
+ //
698
+ // 3. We did not find the exact element, and there is no next-closest
699
+ // element than the one we are searching for, so we return -1.
700
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
701
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
702
+ if (cmp === 0) {
703
+ // Found the element we are looking for.
704
+ return mid;
705
+ }
706
+ else if (cmp > 0) {
707
+ // Our needle is greater than aHaystack[mid].
708
+ if (aHigh - mid > 1) {
709
+ // The element is in the upper half.
710
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
711
+ }
712
+
713
+ // The exact needle element was not found in this haystack. Determine if
714
+ // we are in termination case (3) or (2) and return the appropriate thing.
715
+ if (aBias == exports.LEAST_UPPER_BOUND) {
716
+ return aHigh < aHaystack.length ? aHigh : -1;
717
+ } else {
718
+ return mid;
719
+ }
720
+ }
721
+ else {
722
+ // Our needle is less than aHaystack[mid].
723
+ if (mid - aLow > 1) {
724
+ // The element is in the lower half.
725
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
726
+ }
727
+
728
+ // we are in termination case (3) or (2) and return the appropriate thing.
729
+ if (aBias == exports.LEAST_UPPER_BOUND) {
730
+ return mid;
731
+ } else {
732
+ return aLow < 0 ? -1 : aLow;
733
+ }
734
+ }
735
+ }
736
+
737
+ /**
738
+ * This is an implementation of binary search which will always try and return
739
+ * the index of the closest element if there is no exact hit. This is because
740
+ * mappings between original and generated line/col pairs are single points,
741
+ * and there is an implicit region between each of them, so a miss just means
742
+ * that you aren't on the very start of a region.
743
+ *
744
+ * @param aNeedle The element you are looking for.
745
+ * @param aHaystack The array that is being searched.
746
+ * @param aCompare A function which takes the needle and an element in the
747
+ * array and returns -1, 0, or 1 depending on whether the needle is less
748
+ * than, equal to, or greater than the element, respectively.
749
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
750
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
751
+ * closest element that is smaller than or greater than the one we are
752
+ * searching for, respectively, if the exact element cannot be found.
753
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
754
+ */
755
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
756
+ if (aHaystack.length === 0) {
757
+ return -1;
758
+ }
759
+
760
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
761
+ aCompare, aBias || exports.GREATEST_LOWER_BOUND);
762
+ if (index < 0) {
763
+ return -1;
764
+ }
765
+
766
+ // We have found either the exact element, or the next-closest element than
767
+ // the one we are searching for. However, there may be more than one such
768
+ // element. Make sure we always return the smallest of these.
769
+ while (index - 1 >= 0) {
770
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
771
+ break;
772
+ }
773
+ --index;
774
+ }
775
+
776
+ return index;
777
+ };
778
+
779
+ },{}],7:[function(require,module,exports){
780
+ /* -*- Mode: js; js-indent-level: 2; -*- */
781
+ /*
782
+ * Copyright 2011 Mozilla Foundation and contributors
783
+ * Licensed under the New BSD license. See LICENSE or:
784
+ * http://opensource.org/licenses/BSD-3-Clause
785
+ */
786
+
787
+ // It turns out that some (most?) JavaScript engines don't self-host
788
+ // `Array.prototype.sort`. This makes sense because C++ will likely remain
789
+ // faster than JS when doing raw CPU-intensive sorting. However, when using a
790
+ // custom comparator function, calling back and forth between the VM's C++ and
791
+ // JIT'd JS is rather slow *and* loses JIT type information, resulting in
792
+ // worse generated code for the comparator function than would be optimal. In
793
+ // fact, when sorting with a comparator, these costs outweigh the benefits of
794
+ // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
795
+ // a ~3500ms mean speed-up in `bench/bench.html`.
796
+
797
+ /**
798
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
799
+ *
800
+ * @param {Array} ary
801
+ * The array.
802
+ * @param {Number} x
803
+ * The index of the first item.
804
+ * @param {Number} y
805
+ * The index of the second item.
806
+ */
807
+ function swap(ary, x, y) {
808
+ var temp = ary[x];
809
+ ary[x] = ary[y];
810
+ ary[y] = temp;
811
+ }
812
+
813
+ /**
814
+ * Returns a random integer within the range `low .. high` inclusive.
815
+ *
816
+ * @param {Number} low
817
+ * The lower bound on the range.
818
+ * @param {Number} high
819
+ * The upper bound on the range.
820
+ */
821
+ function randomIntInRange(low, high) {
822
+ return Math.round(low + (Math.random() * (high - low)));
823
+ }
824
+
825
+ /**
826
+ * The Quick Sort algorithm.
827
+ *
828
+ * @param {Array} ary
829
+ * An array to sort.
830
+ * @param {function} comparator
831
+ * Function to use to compare two items.
832
+ * @param {Number} p
833
+ * Start index of the array
834
+ * @param {Number} r
835
+ * End index of the array
836
+ */
837
+ function doQuickSort(ary, comparator, p, r) {
838
+ // If our lower bound is less than our upper bound, we (1) partition the
839
+ // array into two pieces and (2) recurse on each half. If it is not, this is
840
+ // the empty array and our base case.
841
+
842
+ if (p < r) {
843
+ // (1) Partitioning.
844
+ //
845
+ // The partitioning chooses a pivot between `p` and `r` and moves all
846
+ // elements that are less than or equal to the pivot to the before it, and
847
+ // all the elements that are greater than it after it. The effect is that
848
+ // once partition is done, the pivot is in the exact place it will be when
849
+ // the array is put in sorted order, and it will not need to be moved
850
+ // again. This runs in O(n) time.
851
+
852
+ // Always choose a random pivot so that an input array which is reverse
853
+ // sorted does not cause O(n^2) running time.
854
+ var pivotIndex = randomIntInRange(p, r);
855
+ var i = p - 1;
856
+
857
+ swap(ary, pivotIndex, r);
858
+ var pivot = ary[r];
859
+
860
+ // Immediately after `j` is incremented in this loop, the following hold
861
+ // true:
862
+ //
863
+ // * Every element in `ary[p .. i]` is less than or equal to the pivot.
864
+ //
865
+ // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
866
+ for (var j = p; j < r; j++) {
867
+ if (comparator(ary[j], pivot) <= 0) {
868
+ i += 1;
869
+ swap(ary, i, j);
870
+ }
871
+ }
872
+
873
+ swap(ary, i + 1, j);
874
+ var q = i + 1;
875
+
876
+ // (2) Recurse on each half.
877
+
878
+ doQuickSort(ary, comparator, p, q - 1);
879
+ doQuickSort(ary, comparator, q + 1, r);
880
+ }
881
+ }
882
+
883
+ /**
884
+ * Sort the given array in-place with the given comparator function.
885
+ *
886
+ * @param {Array} ary
887
+ * An array to sort.
888
+ * @param {function} comparator
889
+ * Function to use to compare two items.
890
+ */
891
+ exports.quickSort = function (ary, comparator) {
892
+ doQuickSort(ary, comparator, 0, ary.length - 1);
893
+ };
894
+
895
+ },{}],8:[function(require,module,exports){
896
+ /* -*- Mode: js; js-indent-level: 2; -*- */
897
+ /*
898
+ * Copyright 2011 Mozilla Foundation and contributors
899
+ * Licensed under the New BSD license. See LICENSE or:
900
+ * http://opensource.org/licenses/BSD-3-Clause
901
+ */
902
+
903
+ var util = require('./util');
904
+ var binarySearch = require('./binary-search');
905
+ var ArraySet = require('./array-set').ArraySet;
906
+ var base64VLQ = require('./base64-vlq');
907
+ var quickSort = require('./quick-sort').quickSort;
908
+
909
+ function SourceMapConsumer(aSourceMap) {
910
+ var sourceMap = aSourceMap;
911
+ if (typeof aSourceMap === 'string') {
912
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
913
+ }
914
+
915
+ return sourceMap.sections != null
916
+ ? new IndexedSourceMapConsumer(sourceMap)
917
+ : new BasicSourceMapConsumer(sourceMap);
918
+ }
919
+
920
+ SourceMapConsumer.fromSourceMap = function(aSourceMap) {
921
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
922
+ }
923
+
924
+ /**
925
+ * The version of the source mapping spec that we are consuming.
926
+ */
927
+ SourceMapConsumer.prototype._version = 3;
928
+
929
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
930
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
931
+ // are lazily instantiated, accessed via the `_generatedMappings` and
932
+ // `_originalMappings` getters respectively, and we only parse the mappings
933
+ // and create these arrays once queried for a source location. We jump through
934
+ // these hoops because there can be many thousands of mappings, and parsing
935
+ // them is expensive, so we only want to do it if we must.
936
+ //
937
+ // Each object in the arrays is of the form:
938
+ //
939
+ // {
940
+ // generatedLine: The line number in the generated code,
941
+ // generatedColumn: The column number in the generated code,
942
+ // source: The path to the original source file that generated this
943
+ // chunk of code,
944
+ // originalLine: The line number in the original source that
945
+ // corresponds to this chunk of generated code,
946
+ // originalColumn: The column number in the original source that
947
+ // corresponds to this chunk of generated code,
948
+ // name: The name of the original symbol which generated this chunk of
949
+ // code.
950
+ // }
951
+ //
952
+ // All properties except for `generatedLine` and `generatedColumn` can be
953
+ // `null`.
954
+ //
955
+ // `_generatedMappings` is ordered by the generated positions.
956
+ //
957
+ // `_originalMappings` is ordered by the original positions.
958
+
959
+ SourceMapConsumer.prototype.__generatedMappings = null;
960
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
961
+ get: function () {
962
+ if (!this.__generatedMappings) {
963
+ this._parseMappings(this._mappings, this.sourceRoot);
964
+ }
965
+
966
+ return this.__generatedMappings;
967
+ }
968
+ });
969
+
970
+ SourceMapConsumer.prototype.__originalMappings = null;
971
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
972
+ get: function () {
973
+ if (!this.__originalMappings) {
974
+ this._parseMappings(this._mappings, this.sourceRoot);
975
+ }
976
+
977
+ return this.__originalMappings;
978
+ }
979
+ });
980
+
981
+ SourceMapConsumer.prototype._charIsMappingSeparator =
982
+ function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
983
+ var c = aStr.charAt(index);
984
+ return c === ";" || c === ",";
985
+ };
986
+
987
+ /**
988
+ * Parse the mappings in a string in to a data structure which we can easily
989
+ * query (the ordered arrays in the `this.__generatedMappings` and
990
+ * `this.__originalMappings` properties).
991
+ */
992
+ SourceMapConsumer.prototype._parseMappings =
993
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
994
+ throw new Error("Subclasses must implement _parseMappings");
995
+ };
996
+
997
+ SourceMapConsumer.GENERATED_ORDER = 1;
998
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
999
+
1000
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
1001
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
1002
+
1003
+ /**
1004
+ * Iterate over each mapping between an original source/line/column and a
1005
+ * generated line/column in this source map.
1006
+ *
1007
+ * @param Function aCallback
1008
+ * The function that is called with each mapping.
1009
+ * @param Object aContext
1010
+ * Optional. If specified, this object will be the value of `this` every
1011
+ * time that `aCallback` is called.
1012
+ * @param aOrder
1013
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
1014
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
1015
+ * iterate over the mappings sorted by the generated file's line/column
1016
+ * order or the original's source/line/column order, respectively. Defaults to
1017
+ * `SourceMapConsumer.GENERATED_ORDER`.
1018
+ */
1019
+ SourceMapConsumer.prototype.eachMapping =
1020
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
1021
+ var context = aContext || null;
1022
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
1023
+
1024
+ var mappings;
1025
+ switch (order) {
1026
+ case SourceMapConsumer.GENERATED_ORDER:
1027
+ mappings = this._generatedMappings;
1028
+ break;
1029
+ case SourceMapConsumer.ORIGINAL_ORDER:
1030
+ mappings = this._originalMappings;
1031
+ break;
1032
+ default:
1033
+ throw new Error("Unknown order of iteration.");
1034
+ }
1035
+
1036
+ var sourceRoot = this.sourceRoot;
1037
+ mappings.map(function (mapping) {
1038
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
1039
+ if (source != null && sourceRoot != null) {
1040
+ source = util.join(sourceRoot, source);
1041
+ }
1042
+ return {
1043
+ source: source,
1044
+ generatedLine: mapping.generatedLine,
1045
+ generatedColumn: mapping.generatedColumn,
1046
+ originalLine: mapping.originalLine,
1047
+ originalColumn: mapping.originalColumn,
1048
+ name: mapping.name === null ? null : this._names.at(mapping.name)
1049
+ };
1050
+ }, this).forEach(aCallback, context);
1051
+ };
1052
+
1053
+ /**
1054
+ * Returns all generated line and column information for the original source,
1055
+ * line, and column provided. If no column is provided, returns all mappings
1056
+ * corresponding to a either the line we are searching for or the next
1057
+ * closest line that has any mappings. Otherwise, returns all mappings
1058
+ * corresponding to the given line and either the column we are searching for
1059
+ * or the next closest column that has any offsets.
1060
+ *
1061
+ * The only argument is an object with the following properties:
1062
+ *
1063
+ * - source: The filename of the original source.
1064
+ * - line: The line number in the original source.
1065
+ * - column: Optional. the column number in the original source.
1066
+ *
1067
+ * and an array of objects is returned, each with the following properties:
1068
+ *
1069
+ * - line: The line number in the generated source, or null.
1070
+ * - column: The column number in the generated source, or null.
1071
+ */
1072
+ SourceMapConsumer.prototype.allGeneratedPositionsFor =
1073
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
1074
+ var line = util.getArg(aArgs, 'line');
1075
+
1076
+ // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
1077
+ // returns the index of the closest mapping less than the needle. By
1078
+ // setting needle.originalColumn to 0, we thus find the last mapping for
1079
+ // the given line, provided such a mapping exists.
1080
+ var needle = {
1081
+ source: util.getArg(aArgs, 'source'),
1082
+ originalLine: line,
1083
+ originalColumn: util.getArg(aArgs, 'column', 0)
1084
+ };
1085
+
1086
+ if (this.sourceRoot != null) {
1087
+ needle.source = util.relative(this.sourceRoot, needle.source);
1088
+ }
1089
+ if (!this._sources.has(needle.source)) {
1090
+ return [];
1091
+ }
1092
+ needle.source = this._sources.indexOf(needle.source);
1093
+
1094
+ var mappings = [];
1095
+
1096
+ var index = this._findMapping(needle,
1097
+ this._originalMappings,
1098
+ "originalLine",
1099
+ "originalColumn",
1100
+ util.compareByOriginalPositions,
1101
+ binarySearch.LEAST_UPPER_BOUND);
1102
+ if (index >= 0) {
1103
+ var mapping = this._originalMappings[index];
1104
+
1105
+ if (aArgs.column === undefined) {
1106
+ var originalLine = mapping.originalLine;
1107
+
1108
+ // Iterate until either we run out of mappings, or we run into
1109
+ // a mapping for a different line than the one we found. Since
1110
+ // mappings are sorted, this is guaranteed to find all mappings for
1111
+ // the line we found.
1112
+ while (mapping && mapping.originalLine === originalLine) {
1113
+ mappings.push({
1114
+ line: util.getArg(mapping, 'generatedLine', null),
1115
+ column: util.getArg(mapping, 'generatedColumn', null),
1116
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
1117
+ });
1118
+
1119
+ mapping = this._originalMappings[++index];
1120
+ }
1121
+ } else {
1122
+ var originalColumn = mapping.originalColumn;
1123
+
1124
+ // Iterate until either we run out of mappings, or we run into
1125
+ // a mapping for a different line than the one we were searching for.
1126
+ // Since mappings are sorted, this is guaranteed to find all mappings for
1127
+ // the line we are searching for.
1128
+ while (mapping &&
1129
+ mapping.originalLine === line &&
1130
+ mapping.originalColumn == originalColumn) {
1131
+ mappings.push({
1132
+ line: util.getArg(mapping, 'generatedLine', null),
1133
+ column: util.getArg(mapping, 'generatedColumn', null),
1134
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
1135
+ });
1136
+
1137
+ mapping = this._originalMappings[++index];
1138
+ }
1139
+ }
1140
+ }
1141
+
1142
+ return mappings;
1143
+ };
1144
+
1145
+ exports.SourceMapConsumer = SourceMapConsumer;
1146
+
1147
+ /**
1148
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
1149
+ * query for information about the original file positions by giving it a file
1150
+ * position in the generated source.
1151
+ *
1152
+ * The only parameter is the raw source map (either as a JSON string, or
1153
+ * already parsed to an object). According to the spec, source maps have the
1154
+ * following attributes:
1155
+ *
1156
+ * - version: Which version of the source map spec this map is following.
1157
+ * - sources: An array of URLs to the original source files.
1158
+ * - names: An array of identifiers which can be referrenced by individual mappings.
1159
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
1160
+ * - sourcesContent: Optional. An array of contents of the original source files.
1161
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
1162
+ * - file: Optional. The generated file this source map is associated with.
1163
+ *
1164
+ * Here is an example source map, taken from the source map spec[0]:
1165
+ *
1166
+ * {
1167
+ * version : 3,
1168
+ * file: "out.js",
1169
+ * sourceRoot : "",
1170
+ * sources: ["foo.js", "bar.js"],
1171
+ * names: ["src", "maps", "are", "fun"],
1172
+ * mappings: "AA,AB;;ABCDE;"
1173
+ * }
1174
+ *
1175
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
1176
+ */
1177
+ function BasicSourceMapConsumer(aSourceMap) {
1178
+ var sourceMap = aSourceMap;
1179
+ if (typeof aSourceMap === 'string') {
1180
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
1181
+ }
1182
+
1183
+ var version = util.getArg(sourceMap, 'version');
1184
+ var sources = util.getArg(sourceMap, 'sources');
1185
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
1186
+ // requires the array) to play nice here.
1187
+ var names = util.getArg(sourceMap, 'names', []);
1188
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
1189
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
1190
+ var mappings = util.getArg(sourceMap, 'mappings');
1191
+ var file = util.getArg(sourceMap, 'file', null);
1192
+
1193
+ // Once again, Sass deviates from the spec and supplies the version as a
1194
+ // string rather than a number, so we use loose equality checking here.
1195
+ if (version != this._version) {
1196
+ throw new Error('Unsupported version: ' + version);
1197
+ }
1198
+
1199
+ sources = sources
1200
+ .map(String)
1201
+ // Some source maps produce relative source paths like "./foo.js" instead of
1202
+ // "foo.js". Normalize these first so that future comparisons will succeed.
1203
+ // See bugzil.la/1090768.
1204
+ .map(util.normalize)
1205
+ // Always ensure that absolute sources are internally stored relative to
1206
+ // the source root, if the source root is absolute. Not doing this would
1207
+ // be particularly problematic when the source root is a prefix of the
1208
+ // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
1209
+ .map(function (source) {
1210
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
1211
+ ? util.relative(sourceRoot, source)
1212
+ : source;
1213
+ });
1214
+
1215
+ // Pass `true` below to allow duplicate names and sources. While source maps
1216
+ // are intended to be compressed and deduplicated, the TypeScript compiler
1217
+ // sometimes generates source maps with duplicates in them. See Github issue
1218
+ // #72 and bugzil.la/889492.
1219
+ this._names = ArraySet.fromArray(names.map(String), true);
1220
+ this._sources = ArraySet.fromArray(sources, true);
1221
+
1222
+ this.sourceRoot = sourceRoot;
1223
+ this.sourcesContent = sourcesContent;
1224
+ this._mappings = mappings;
1225
+ this.file = file;
1226
+ }
1227
+
1228
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1229
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
1230
+
1231
+ /**
1232
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
1233
+ *
1234
+ * @param SourceMapGenerator aSourceMap
1235
+ * The source map that will be consumed.
1236
+ * @returns BasicSourceMapConsumer
1237
+ */
1238
+ BasicSourceMapConsumer.fromSourceMap =
1239
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
1240
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
1241
+
1242
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
1243
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
1244
+ smc.sourceRoot = aSourceMap._sourceRoot;
1245
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
1246
+ smc.sourceRoot);
1247
+ smc.file = aSourceMap._file;
1248
+
1249
+ // Because we are modifying the entries (by converting string sources and
1250
+ // names to indices into the sources and names ArraySets), we have to make
1251
+ // a copy of the entry or else bad things happen. Shared mutable state
1252
+ // strikes again! See github issue #191.
1253
+
1254
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
1255
+ var destGeneratedMappings = smc.__generatedMappings = [];
1256
+ var destOriginalMappings = smc.__originalMappings = [];
1257
+
1258
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
1259
+ var srcMapping = generatedMappings[i];
1260
+ var destMapping = new Mapping;
1261
+ destMapping.generatedLine = srcMapping.generatedLine;
1262
+ destMapping.generatedColumn = srcMapping.generatedColumn;
1263
+
1264
+ if (srcMapping.source) {
1265
+ destMapping.source = sources.indexOf(srcMapping.source);
1266
+ destMapping.originalLine = srcMapping.originalLine;
1267
+ destMapping.originalColumn = srcMapping.originalColumn;
1268
+
1269
+ if (srcMapping.name) {
1270
+ destMapping.name = names.indexOf(srcMapping.name);
1271
+ }
1272
+
1273
+ destOriginalMappings.push(destMapping);
1274
+ }
1275
+
1276
+ destGeneratedMappings.push(destMapping);
1277
+ }
1278
+
1279
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
1280
+
1281
+ return smc;
1282
+ };
1283
+
1284
+ /**
1285
+ * The version of the source mapping spec that we are consuming.
1286
+ */
1287
+ BasicSourceMapConsumer.prototype._version = 3;
1288
+
1289
+ /**
1290
+ * The list of original sources.
1291
+ */
1292
+ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
1293
+ get: function () {
1294
+ return this._sources.toArray().map(function (s) {
1295
+ return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
1296
+ }, this);
1297
+ }
1298
+ });
1299
+
1300
+ /**
1301
+ * Provide the JIT with a nice shape / hidden class.
1302
+ */
1303
+ function Mapping() {
1304
+ this.generatedLine = 0;
1305
+ this.generatedColumn = 0;
1306
+ this.source = null;
1307
+ this.originalLine = null;
1308
+ this.originalColumn = null;
1309
+ this.name = null;
1310
+ }
1311
+
1312
+ /**
1313
+ * Parse the mappings in a string in to a data structure which we can easily
1314
+ * query (the ordered arrays in the `this.__generatedMappings` and
1315
+ * `this.__originalMappings` properties).
1316
+ */
1317
+ BasicSourceMapConsumer.prototype._parseMappings =
1318
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1319
+ var generatedLine = 1;
1320
+ var previousGeneratedColumn = 0;
1321
+ var previousOriginalLine = 0;
1322
+ var previousOriginalColumn = 0;
1323
+ var previousSource = 0;
1324
+ var previousName = 0;
1325
+ var length = aStr.length;
1326
+ var index = 0;
1327
+ var cachedSegments = {};
1328
+ var temp = {};
1329
+ var originalMappings = [];
1330
+ var generatedMappings = [];
1331
+ var mapping, str, segment, end, value;
1332
+
1333
+ while (index < length) {
1334
+ if (aStr.charAt(index) === ';') {
1335
+ generatedLine++;
1336
+ index++;
1337
+ previousGeneratedColumn = 0;
1338
+ }
1339
+ else if (aStr.charAt(index) === ',') {
1340
+ index++;
1341
+ }
1342
+ else {
1343
+ mapping = new Mapping();
1344
+ mapping.generatedLine = generatedLine;
1345
+
1346
+ // Because each offset is encoded relative to the previous one,
1347
+ // many segments often have the same encoding. We can exploit this
1348
+ // fact by caching the parsed variable length fields of each segment,
1349
+ // allowing us to avoid a second parse if we encounter the same
1350
+ // segment again.
1351
+ for (end = index; end < length; end++) {
1352
+ if (this._charIsMappingSeparator(aStr, end)) {
1353
+ break;
1354
+ }
1355
+ }
1356
+ str = aStr.slice(index, end);
1357
+
1358
+ segment = cachedSegments[str];
1359
+ if (segment) {
1360
+ index += str.length;
1361
+ } else {
1362
+ segment = [];
1363
+ while (index < end) {
1364
+ base64VLQ.decode(aStr, index, temp);
1365
+ value = temp.value;
1366
+ index = temp.rest;
1367
+ segment.push(value);
1368
+ }
1369
+
1370
+ if (segment.length === 2) {
1371
+ throw new Error('Found a source, but no line and column');
1372
+ }
1373
+
1374
+ if (segment.length === 3) {
1375
+ throw new Error('Found a source and line, but no column');
1376
+ }
1377
+
1378
+ cachedSegments[str] = segment;
1379
+ }
1380
+
1381
+ // Generated column.
1382
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
1383
+ previousGeneratedColumn = mapping.generatedColumn;
1384
+
1385
+ if (segment.length > 1) {
1386
+ // Original source.
1387
+ mapping.source = previousSource + segment[1];
1388
+ previousSource += segment[1];
1389
+
1390
+ // Original line.
1391
+ mapping.originalLine = previousOriginalLine + segment[2];
1392
+ previousOriginalLine = mapping.originalLine;
1393
+ // Lines are stored 0-based
1394
+ mapping.originalLine += 1;
1395
+
1396
+ // Original column.
1397
+ mapping.originalColumn = previousOriginalColumn + segment[3];
1398
+ previousOriginalColumn = mapping.originalColumn;
1399
+
1400
+ if (segment.length > 4) {
1401
+ // Original name.
1402
+ mapping.name = previousName + segment[4];
1403
+ previousName += segment[4];
1404
+ }
1405
+ }
1406
+
1407
+ generatedMappings.push(mapping);
1408
+ if (typeof mapping.originalLine === 'number') {
1409
+ originalMappings.push(mapping);
1410
+ }
1411
+ }
1412
+ }
1413
+
1414
+ quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
1415
+ this.__generatedMappings = generatedMappings;
1416
+
1417
+ quickSort(originalMappings, util.compareByOriginalPositions);
1418
+ this.__originalMappings = originalMappings;
1419
+ };
1420
+
1421
+ /**
1422
+ * Find the mapping that best matches the hypothetical "needle" mapping that
1423
+ * we are searching for in the given "haystack" of mappings.
1424
+ */
1425
+ BasicSourceMapConsumer.prototype._findMapping =
1426
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
1427
+ aColumnName, aComparator, aBias) {
1428
+ // To return the position we are searching for, we must first find the
1429
+ // mapping for the given position and then return the opposite position it
1430
+ // points to. Because the mappings are sorted, we can use binary search to
1431
+ // find the best mapping.
1432
+
1433
+ if (aNeedle[aLineName] <= 0) {
1434
+ throw new TypeError('Line must be greater than or equal to 1, got '
1435
+ + aNeedle[aLineName]);
1436
+ }
1437
+ if (aNeedle[aColumnName] < 0) {
1438
+ throw new TypeError('Column must be greater than or equal to 0, got '
1439
+ + aNeedle[aColumnName]);
1440
+ }
1441
+
1442
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1443
+ };
1444
+
1445
+ /**
1446
+ * Compute the last column for each generated mapping. The last column is
1447
+ * inclusive.
1448
+ */
1449
+ BasicSourceMapConsumer.prototype.computeColumnSpans =
1450
+ function SourceMapConsumer_computeColumnSpans() {
1451
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
1452
+ var mapping = this._generatedMappings[index];
1453
+
1454
+ // Mappings do not contain a field for the last generated columnt. We
1455
+ // can come up with an optimistic estimate, however, by assuming that
1456
+ // mappings are contiguous (i.e. given two consecutive mappings, the
1457
+ // first mapping ends where the second one starts).
1458
+ if (index + 1 < this._generatedMappings.length) {
1459
+ var nextMapping = this._generatedMappings[index + 1];
1460
+
1461
+ if (mapping.generatedLine === nextMapping.generatedLine) {
1462
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1463
+ continue;
1464
+ }
1465
+ }
1466
+
1467
+ // The last mapping for each line spans the entire line.
1468
+ mapping.lastGeneratedColumn = Infinity;
1469
+ }
1470
+ };
1471
+
1472
+ /**
1473
+ * Returns the original source, line, and column information for the generated
1474
+ * source's line and column positions provided. The only argument is an object
1475
+ * with the following properties:
1476
+ *
1477
+ * - line: The line number in the generated source.
1478
+ * - column: The column number in the generated source.
1479
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
1480
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
1481
+ * closest element that is smaller than or greater than the one we are
1482
+ * searching for, respectively, if the exact element cannot be found.
1483
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
1484
+ *
1485
+ * and an object is returned with the following properties:
1486
+ *
1487
+ * - source: The original source file, or null.
1488
+ * - line: The line number in the original source, or null.
1489
+ * - column: The column number in the original source, or null.
1490
+ * - name: The original identifier, or null.
1491
+ */
1492
+ BasicSourceMapConsumer.prototype.originalPositionFor =
1493
+ function SourceMapConsumer_originalPositionFor(aArgs) {
1494
+ var needle = {
1495
+ generatedLine: util.getArg(aArgs, 'line'),
1496
+ generatedColumn: util.getArg(aArgs, 'column')
1497
+ };
1498
+
1499
+ var index = this._findMapping(
1500
+ needle,
1501
+ this._generatedMappings,
1502
+ "generatedLine",
1503
+ "generatedColumn",
1504
+ util.compareByGeneratedPositionsDeflated,
1505
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
1506
+ );
1507
+
1508
+ if (index >= 0) {
1509
+ var mapping = this._generatedMappings[index];
1510
+
1511
+ if (mapping.generatedLine === needle.generatedLine) {
1512
+ var source = util.getArg(mapping, 'source', null);
1513
+ if (source !== null) {
1514
+ source = this._sources.at(source);
1515
+ if (this.sourceRoot != null) {
1516
+ source = util.join(this.sourceRoot, source);
1517
+ }
1518
+ }
1519
+ var name = util.getArg(mapping, 'name', null);
1520
+ if (name !== null) {
1521
+ name = this._names.at(name);
1522
+ }
1523
+ return {
1524
+ source: source,
1525
+ line: util.getArg(mapping, 'originalLine', null),
1526
+ column: util.getArg(mapping, 'originalColumn', null),
1527
+ name: name
1528
+ };
1529
+ }
1530
+ }
1531
+
1532
+ return {
1533
+ source: null,
1534
+ line: null,
1535
+ column: null,
1536
+ name: null
1537
+ };
1538
+ };
1539
+
1540
+ /**
1541
+ * Return true if we have the source content for every source in the source
1542
+ * map, false otherwise.
1543
+ */
1544
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
1545
+ function BasicSourceMapConsumer_hasContentsOfAllSources() {
1546
+ if (!this.sourcesContent) {
1547
+ return false;
1548
+ }
1549
+ return this.sourcesContent.length >= this._sources.size() &&
1550
+ !this.sourcesContent.some(function (sc) { return sc == null; });
1551
+ };
1552
+
1553
+ /**
1554
+ * Returns the original source content. The only argument is the url of the
1555
+ * original source file. Returns null if no original source content is
1556
+ * available.
1557
+ */
1558
+ BasicSourceMapConsumer.prototype.sourceContentFor =
1559
+ function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1560
+ if (!this.sourcesContent) {
1561
+ return null;
1562
+ }
1563
+
1564
+ if (this.sourceRoot != null) {
1565
+ aSource = util.relative(this.sourceRoot, aSource);
1566
+ }
1567
+
1568
+ if (this._sources.has(aSource)) {
1569
+ return this.sourcesContent[this._sources.indexOf(aSource)];
1570
+ }
1571
+
1572
+ var url;
1573
+ if (this.sourceRoot != null
1574
+ && (url = util.urlParse(this.sourceRoot))) {
1575
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
1576
+ // many users. We can help them out when they expect file:// URIs to
1577
+ // behave like it would if they were running a local HTTP server. See
1578
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
1579
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
1580
+ if (url.scheme == "file"
1581
+ && this._sources.has(fileUriAbsPath)) {
1582
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
1583
+ }
1584
+
1585
+ if ((!url.path || url.path == "/")
1586
+ && this._sources.has("/" + aSource)) {
1587
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
1588
+ }
1589
+ }
1590
+
1591
+ // This function is used recursively from
1592
+ // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
1593
+ // don't want to throw if we can't find the source - we just want to
1594
+ // return null, so we provide a flag to exit gracefully.
1595
+ if (nullOnMissing) {
1596
+ return null;
1597
+ }
1598
+ else {
1599
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
1600
+ }
1601
+ };
1602
+
1603
+ /**
1604
+ * Returns the generated line and column information for the original source,
1605
+ * line, and column positions provided. The only argument is an object with
1606
+ * the following properties:
1607
+ *
1608
+ * - source: The filename of the original source.
1609
+ * - line: The line number in the original source.
1610
+ * - column: The column number in the original source.
1611
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
1612
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
1613
+ * closest element that is smaller than or greater than the one we are
1614
+ * searching for, respectively, if the exact element cannot be found.
1615
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
1616
+ *
1617
+ * and an object is returned with the following properties:
1618
+ *
1619
+ * - line: The line number in the generated source, or null.
1620
+ * - column: The column number in the generated source, or null.
1621
+ */
1622
+ BasicSourceMapConsumer.prototype.generatedPositionFor =
1623
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
1624
+ var source = util.getArg(aArgs, 'source');
1625
+ if (this.sourceRoot != null) {
1626
+ source = util.relative(this.sourceRoot, source);
1627
+ }
1628
+ if (!this._sources.has(source)) {
1629
+ return {
1630
+ line: null,
1631
+ column: null,
1632
+ lastColumn: null
1633
+ };
1634
+ }
1635
+ source = this._sources.indexOf(source);
1636
+
1637
+ var needle = {
1638
+ source: source,
1639
+ originalLine: util.getArg(aArgs, 'line'),
1640
+ originalColumn: util.getArg(aArgs, 'column')
1641
+ };
1642
+
1643
+ var index = this._findMapping(
1644
+ needle,
1645
+ this._originalMappings,
1646
+ "originalLine",
1647
+ "originalColumn",
1648
+ util.compareByOriginalPositions,
1649
+ util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
1650
+ );
1651
+
1652
+ if (index >= 0) {
1653
+ var mapping = this._originalMappings[index];
1654
+
1655
+ if (mapping.source === needle.source) {
1656
+ return {
1657
+ line: util.getArg(mapping, 'generatedLine', null),
1658
+ column: util.getArg(mapping, 'generatedColumn', null),
1659
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
1660
+ };
1661
+ }
1662
+ }
1663
+
1664
+ return {
1665
+ line: null,
1666
+ column: null,
1667
+ lastColumn: null
1668
+ };
1669
+ };
1670
+
1671
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1672
+
1673
+ /**
1674
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
1675
+ * we can query for information. It differs from BasicSourceMapConsumer in
1676
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
1677
+ * input.
1678
+ *
1679
+ * The only parameter is a raw source map (either as a JSON string, or already
1680
+ * parsed to an object). According to the spec for indexed source maps, they
1681
+ * have the following attributes:
1682
+ *
1683
+ * - version: Which version of the source map spec this map is following.
1684
+ * - file: Optional. The generated file this source map is associated with.
1685
+ * - sections: A list of section definitions.
1686
+ *
1687
+ * Each value under the "sections" field has two fields:
1688
+ * - offset: The offset into the original specified at which this section
1689
+ * begins to apply, defined as an object with a "line" and "column"
1690
+ * field.
1691
+ * - map: A source map definition. This source map could also be indexed,
1692
+ * but doesn't have to be.
1693
+ *
1694
+ * Instead of the "map" field, it's also possible to have a "url" field
1695
+ * specifying a URL to retrieve a source map from, but that's currently
1696
+ * unsupported.
1697
+ *
1698
+ * Here's an example source map, taken from the source map spec[0], but
1699
+ * modified to omit a section which uses the "url" field.
1700
+ *
1701
+ * {
1702
+ * version : 3,
1703
+ * file: "app.js",
1704
+ * sections: [{
1705
+ * offset: {line:100, column:10},
1706
+ * map: {
1707
+ * version : 3,
1708
+ * file: "section.js",
1709
+ * sources: ["foo.js", "bar.js"],
1710
+ * names: ["src", "maps", "are", "fun"],
1711
+ * mappings: "AAAA,E;;ABCDE;"
1712
+ * }
1713
+ * }],
1714
+ * }
1715
+ *
1716
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
1717
+ */
1718
+ function IndexedSourceMapConsumer(aSourceMap) {
1719
+ var sourceMap = aSourceMap;
1720
+ if (typeof aSourceMap === 'string') {
1721
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
1722
+ }
1723
+
1724
+ var version = util.getArg(sourceMap, 'version');
1725
+ var sections = util.getArg(sourceMap, 'sections');
1726
+
1727
+ if (version != this._version) {
1728
+ throw new Error('Unsupported version: ' + version);
1729
+ }
1730
+
1731
+ this._sources = new ArraySet();
1732
+ this._names = new ArraySet();
1733
+
1734
+ var lastOffset = {
1735
+ line: -1,
1736
+ column: 0
1737
+ };
1738
+ this._sections = sections.map(function (s) {
1739
+ if (s.url) {
1740
+ // The url field will require support for asynchronicity.
1741
+ // See https://github.com/mozilla/source-map/issues/16
1742
+ throw new Error('Support for url field in sections not implemented.');
1743
+ }
1744
+ var offset = util.getArg(s, 'offset');
1745
+ var offsetLine = util.getArg(offset, 'line');
1746
+ var offsetColumn = util.getArg(offset, 'column');
1747
+
1748
+ if (offsetLine < lastOffset.line ||
1749
+ (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
1750
+ throw new Error('Section offsets must be ordered and non-overlapping.');
1751
+ }
1752
+ lastOffset = offset;
1753
+
1754
+ return {
1755
+ generatedOffset: {
1756
+ // The offset fields are 0-based, but we use 1-based indices when
1757
+ // encoding/decoding from VLQ.
1758
+ generatedLine: offsetLine + 1,
1759
+ generatedColumn: offsetColumn + 1
1760
+ },
1761
+ consumer: new SourceMapConsumer(util.getArg(s, 'map'))
1762
+ }
1763
+ });
1764
+ }
1765
+
1766
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1767
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
1768
+
1769
+ /**
1770
+ * The version of the source mapping spec that we are consuming.
1771
+ */
1772
+ IndexedSourceMapConsumer.prototype._version = 3;
1773
+
1774
+ /**
1775
+ * The list of original sources.
1776
+ */
1777
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
1778
+ get: function () {
1779
+ var sources = [];
1780
+ for (var i = 0; i < this._sections.length; i++) {
1781
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
1782
+ sources.push(this._sections[i].consumer.sources[j]);
1783
+ }
1784
+ }
1785
+ return sources;
1786
+ }
1787
+ });
1788
+
1789
+ /**
1790
+ * Returns the original source, line, and column information for the generated
1791
+ * source's line and column positions provided. The only argument is an object
1792
+ * with the following properties:
1793
+ *
1794
+ * - line: The line number in the generated source.
1795
+ * - column: The column number in the generated source.
1796
+ *
1797
+ * and an object is returned with the following properties:
1798
+ *
1799
+ * - source: The original source file, or null.
1800
+ * - line: The line number in the original source, or null.
1801
+ * - column: The column number in the original source, or null.
1802
+ * - name: The original identifier, or null.
1803
+ */
1804
+ IndexedSourceMapConsumer.prototype.originalPositionFor =
1805
+ function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
1806
+ var needle = {
1807
+ generatedLine: util.getArg(aArgs, 'line'),
1808
+ generatedColumn: util.getArg(aArgs, 'column')
1809
+ };
1810
+
1811
+ // Find the section containing the generated position we're trying to map
1812
+ // to an original position.
1813
+ var sectionIndex = binarySearch.search(needle, this._sections,
1814
+ function(needle, section) {
1815
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
1816
+ if (cmp) {
1817
+ return cmp;
1818
+ }
1819
+
1820
+ return (needle.generatedColumn -
1821
+ section.generatedOffset.generatedColumn);
1822
+ });
1823
+ var section = this._sections[sectionIndex];
1824
+
1825
+ if (!section) {
1826
+ return {
1827
+ source: null,
1828
+ line: null,
1829
+ column: null,
1830
+ name: null
1831
+ };
1832
+ }
1833
+
1834
+ return section.consumer.originalPositionFor({
1835
+ line: needle.generatedLine -
1836
+ (section.generatedOffset.generatedLine - 1),
1837
+ column: needle.generatedColumn -
1838
+ (section.generatedOffset.generatedLine === needle.generatedLine
1839
+ ? section.generatedOffset.generatedColumn - 1
1840
+ : 0),
1841
+ bias: aArgs.bias
1842
+ });
1843
+ };
1844
+
1845
+ /**
1846
+ * Return true if we have the source content for every source in the source
1847
+ * map, false otherwise.
1848
+ */
1849
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
1850
+ function IndexedSourceMapConsumer_hasContentsOfAllSources() {
1851
+ return this._sections.every(function (s) {
1852
+ return s.consumer.hasContentsOfAllSources();
1853
+ });
1854
+ };
1855
+
1856
+ /**
1857
+ * Returns the original source content. The only argument is the url of the
1858
+ * original source file. Returns null if no original source content is
1859
+ * available.
1860
+ */
1861
+ IndexedSourceMapConsumer.prototype.sourceContentFor =
1862
+ function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1863
+ for (var i = 0; i < this._sections.length; i++) {
1864
+ var section = this._sections[i];
1865
+
1866
+ var content = section.consumer.sourceContentFor(aSource, true);
1867
+ if (content) {
1868
+ return content;
1869
+ }
1870
+ }
1871
+ if (nullOnMissing) {
1872
+ return null;
1873
+ }
1874
+ else {
1875
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
1876
+ }
1877
+ };
1878
+
1879
+ /**
1880
+ * Returns the generated line and column information for the original source,
1881
+ * line, and column positions provided. The only argument is an object with
1882
+ * the following properties:
1883
+ *
1884
+ * - source: The filename of the original source.
1885
+ * - line: The line number in the original source.
1886
+ * - column: The column number in the original source.
1887
+ *
1888
+ * and an object is returned with the following properties:
1889
+ *
1890
+ * - line: The line number in the generated source, or null.
1891
+ * - column: The column number in the generated source, or null.
1892
+ */
1893
+ IndexedSourceMapConsumer.prototype.generatedPositionFor =
1894
+ function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
1895
+ for (var i = 0; i < this._sections.length; i++) {
1896
+ var section = this._sections[i];
1897
+
1898
+ // Only consider this section if the requested source is in the list of
1899
+ // sources of the consumer.
1900
+ if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
1901
+ continue;
1902
+ }
1903
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1904
+ if (generatedPosition) {
1905
+ var ret = {
1906
+ line: generatedPosition.line +
1907
+ (section.generatedOffset.generatedLine - 1),
1908
+ column: generatedPosition.column +
1909
+ (section.generatedOffset.generatedLine === generatedPosition.line
1910
+ ? section.generatedOffset.generatedColumn - 1
1911
+ : 0)
1912
+ };
1913
+ return ret;
1914
+ }
1915
+ }
1916
+
1917
+ return {
1918
+ line: null,
1919
+ column: null
1920
+ };
1921
+ };
1922
+
1923
+ /**
1924
+ * Parse the mappings in a string in to a data structure which we can easily
1925
+ * query (the ordered arrays in the `this.__generatedMappings` and
1926
+ * `this.__originalMappings` properties).
1927
+ */
1928
+ IndexedSourceMapConsumer.prototype._parseMappings =
1929
+ function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1930
+ this.__generatedMappings = [];
1931
+ this.__originalMappings = [];
1932
+ for (var i = 0; i < this._sections.length; i++) {
1933
+ var section = this._sections[i];
1934
+ var sectionMappings = section.consumer._generatedMappings;
1935
+ for (var j = 0; j < sectionMappings.length; j++) {
1936
+ var mapping = sectionMappings[j];
1937
+
1938
+ var source = section.consumer._sources.at(mapping.source);
1939
+ if (section.consumer.sourceRoot !== null) {
1940
+ source = util.join(section.consumer.sourceRoot, source);
1941
+ }
1942
+ this._sources.add(source);
1943
+ source = this._sources.indexOf(source);
1944
+
1945
+ var name = section.consumer._names.at(mapping.name);
1946
+ this._names.add(name);
1947
+ name = this._names.indexOf(name);
1948
+
1949
+ // The mappings coming from the consumer for the section have
1950
+ // generated positions relative to the start of the section, so we
1951
+ // need to offset them to be relative to the start of the concatenated
1952
+ // generated file.
1953
+ var adjustedMapping = {
1954
+ source: source,
1955
+ generatedLine: mapping.generatedLine +
1956
+ (section.generatedOffset.generatedLine - 1),
1957
+ generatedColumn: mapping.generatedColumn +
1958
+ (section.generatedOffset.generatedLine === mapping.generatedLine
1959
+ ? section.generatedOffset.generatedColumn - 1
1960
+ : 0),
1961
+ originalLine: mapping.originalLine,
1962
+ originalColumn: mapping.originalColumn,
1963
+ name: name
1964
+ };
1965
+
1966
+ this.__generatedMappings.push(adjustedMapping);
1967
+ if (typeof adjustedMapping.originalLine === 'number') {
1968
+ this.__originalMappings.push(adjustedMapping);
1969
+ }
1970
+ }
1971
+ }
1972
+
1973
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
1974
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
1975
+ };
1976
+
1977
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1978
+
1979
+ },{"./array-set":3,"./base64-vlq":4,"./binary-search":6,"./quick-sort":7,"./util":9}],9:[function(require,module,exports){
1980
+ /* -*- Mode: js; js-indent-level: 2; -*- */
1981
+ /*
1982
+ * Copyright 2011 Mozilla Foundation and contributors
1983
+ * Licensed under the New BSD license. See LICENSE or:
1984
+ * http://opensource.org/licenses/BSD-3-Clause
1985
+ */
1986
+
1987
+ /**
1988
+ * This is a helper function for getting values from parameter/options
1989
+ * objects.
1990
+ *
1991
+ * @param args The object we are extracting values from
1992
+ * @param name The name of the property we are getting.
1993
+ * @param defaultValue An optional value to return if the property is missing
1994
+ * from the object. If this is not specified and the property is missing, an
1995
+ * error will be thrown.
1996
+ */
1997
+ function getArg(aArgs, aName, aDefaultValue) {
1998
+ if (aName in aArgs) {
1999
+ return aArgs[aName];
2000
+ } else if (arguments.length === 3) {
2001
+ return aDefaultValue;
2002
+ } else {
2003
+ throw new Error('"' + aName + '" is a required argument.');
2004
+ }
2005
+ }
2006
+ exports.getArg = getArg;
2007
+
2008
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
2009
+ var dataUrlRegexp = /^data:.+\,.+$/;
2010
+
2011
+ function urlParse(aUrl) {
2012
+ var match = aUrl.match(urlRegexp);
2013
+ if (!match) {
2014
+ return null;
2015
+ }
2016
+ return {
2017
+ scheme: match[1],
2018
+ auth: match[2],
2019
+ host: match[3],
2020
+ port: match[4],
2021
+ path: match[5]
2022
+ };
2023
+ }
2024
+ exports.urlParse = urlParse;
2025
+
2026
+ function urlGenerate(aParsedUrl) {
2027
+ var url = '';
2028
+ if (aParsedUrl.scheme) {
2029
+ url += aParsedUrl.scheme + ':';
2030
+ }
2031
+ url += '//';
2032
+ if (aParsedUrl.auth) {
2033
+ url += aParsedUrl.auth + '@';
2034
+ }
2035
+ if (aParsedUrl.host) {
2036
+ url += aParsedUrl.host;
2037
+ }
2038
+ if (aParsedUrl.port) {
2039
+ url += ":" + aParsedUrl.port
2040
+ }
2041
+ if (aParsedUrl.path) {
2042
+ url += aParsedUrl.path;
2043
+ }
2044
+ return url;
2045
+ }
2046
+ exports.urlGenerate = urlGenerate;
2047
+
2048
+ /**
2049
+ * Normalizes a path, or the path portion of a URL:
2050
+ *
2051
+ * - Replaces consecutive slashes with one slash.
2052
+ * - Removes unnecessary '.' parts.
2053
+ * - Removes unnecessary '<dir>/..' parts.
2054
+ *
2055
+ * Based on code in the Node.js 'path' core module.
2056
+ *
2057
+ * @param aPath The path or url to normalize.
2058
+ */
2059
+ function normalize(aPath) {
2060
+ var path = aPath;
2061
+ var url = urlParse(aPath);
2062
+ if (url) {
2063
+ if (!url.path) {
2064
+ return aPath;
2065
+ }
2066
+ path = url.path;
2067
+ }
2068
+ var isAbsolute = exports.isAbsolute(path);
2069
+
2070
+ var parts = path.split(/\/+/);
2071
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
2072
+ part = parts[i];
2073
+ if (part === '.') {
2074
+ parts.splice(i, 1);
2075
+ } else if (part === '..') {
2076
+ up++;
2077
+ } else if (up > 0) {
2078
+ if (part === '') {
2079
+ // The first part is blank if the path is absolute. Trying to go
2080
+ // above the root is a no-op. Therefore we can remove all '..' parts
2081
+ // directly after the root.
2082
+ parts.splice(i + 1, up);
2083
+ up = 0;
2084
+ } else {
2085
+ parts.splice(i, 2);
2086
+ up--;
2087
+ }
2088
+ }
2089
+ }
2090
+ path = parts.join('/');
2091
+
2092
+ if (path === '') {
2093
+ path = isAbsolute ? '/' : '.';
2094
+ }
2095
+
2096
+ if (url) {
2097
+ url.path = path;
2098
+ return urlGenerate(url);
2099
+ }
2100
+ return path;
2101
+ }
2102
+ exports.normalize = normalize;
2103
+
2104
+ /**
2105
+ * Joins two paths/URLs.
2106
+ *
2107
+ * @param aRoot The root path or URL.
2108
+ * @param aPath The path or URL to be joined with the root.
2109
+ *
2110
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
2111
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
2112
+ * first.
2113
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
2114
+ * is updated with the result and aRoot is returned. Otherwise the result
2115
+ * is returned.
2116
+ * - If aPath is absolute, the result is aPath.
2117
+ * - Otherwise the two paths are joined with a slash.
2118
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
2119
+ */
2120
+ function join(aRoot, aPath) {
2121
+ if (aRoot === "") {
2122
+ aRoot = ".";
2123
+ }
2124
+ if (aPath === "") {
2125
+ aPath = ".";
2126
+ }
2127
+ var aPathUrl = urlParse(aPath);
2128
+ var aRootUrl = urlParse(aRoot);
2129
+ if (aRootUrl) {
2130
+ aRoot = aRootUrl.path || '/';
2131
+ }
2132
+
2133
+ // `join(foo, '//www.example.org')`
2134
+ if (aPathUrl && !aPathUrl.scheme) {
2135
+ if (aRootUrl) {
2136
+ aPathUrl.scheme = aRootUrl.scheme;
2137
+ }
2138
+ return urlGenerate(aPathUrl);
2139
+ }
2140
+
2141
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
2142
+ return aPath;
2143
+ }
2144
+
2145
+ // `join('http://', 'www.example.com')`
2146
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
2147
+ aRootUrl.host = aPath;
2148
+ return urlGenerate(aRootUrl);
2149
+ }
2150
+
2151
+ var joined = aPath.charAt(0) === '/'
2152
+ ? aPath
2153
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
2154
+
2155
+ if (aRootUrl) {
2156
+ aRootUrl.path = joined;
2157
+ return urlGenerate(aRootUrl);
2158
+ }
2159
+ return joined;
2160
+ }
2161
+ exports.join = join;
2162
+
2163
+ exports.isAbsolute = function (aPath) {
2164
+ return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
2165
+ };
2166
+
2167
+ /**
2168
+ * Make a path relative to a URL or another path.
2169
+ *
2170
+ * @param aRoot The root path or URL.
2171
+ * @param aPath The path or URL to be made relative to aRoot.
2172
+ */
2173
+ function relative(aRoot, aPath) {
2174
+ if (aRoot === "") {
2175
+ aRoot = ".";
2176
+ }
2177
+
2178
+ aRoot = aRoot.replace(/\/$/, '');
2179
+
2180
+ // It is possible for the path to be above the root. In this case, simply
2181
+ // checking whether the root is a prefix of the path won't work. Instead, we
2182
+ // need to remove components from the root one by one, until either we find
2183
+ // a prefix that fits, or we run out of components to remove.
2184
+ var level = 0;
2185
+ while (aPath.indexOf(aRoot + '/') !== 0) {
2186
+ var index = aRoot.lastIndexOf("/");
2187
+ if (index < 0) {
2188
+ return aPath;
2189
+ }
2190
+
2191
+ // If the only part of the root that is left is the scheme (i.e. http://,
2192
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
2193
+ // have exhausted all components, so the path is not relative to the root.
2194
+ aRoot = aRoot.slice(0, index);
2195
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
2196
+ return aPath;
2197
+ }
2198
+
2199
+ ++level;
2200
+ }
2201
+
2202
+ // Make sure we add a "../" for each component we removed from the root.
2203
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
2204
+ }
2205
+ exports.relative = relative;
2206
+
2207
+ var supportsNullProto = (function () {
2208
+ var obj = Object.create(null);
2209
+ return !('__proto__' in obj);
2210
+ }());
2211
+
2212
+ function identity (s) {
2213
+ return s;
2214
+ }
2215
+
2216
+ /**
2217
+ * Because behavior goes wacky when you set `__proto__` on objects, we
2218
+ * have to prefix all the strings in our set with an arbitrary character.
2219
+ *
2220
+ * See https://github.com/mozilla/source-map/pull/31 and
2221
+ * https://github.com/mozilla/source-map/issues/30
2222
+ *
2223
+ * @param String aStr
2224
+ */
2225
+ function toSetString(aStr) {
2226
+ if (isProtoString(aStr)) {
2227
+ return '$' + aStr;
2228
+ }
2229
+
2230
+ return aStr;
2231
+ }
2232
+ exports.toSetString = supportsNullProto ? identity : toSetString;
2233
+
2234
+ function fromSetString(aStr) {
2235
+ if (isProtoString(aStr)) {
2236
+ return aStr.slice(1);
2237
+ }
2238
+
2239
+ return aStr;
2240
+ }
2241
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
2242
+
2243
+ function isProtoString(s) {
2244
+ if (!s) {
2245
+ return false;
2246
+ }
2247
+
2248
+ var length = s.length;
2249
+
2250
+ if (length < 9 /* "__proto__".length */) {
2251
+ return false;
2252
+ }
2253
+
2254
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
2255
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
2256
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
2257
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
2258
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
2259
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
2260
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
2261
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
2262
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
2263
+ return false;
2264
+ }
2265
+
2266
+ for (var i = length - 10; i >= 0; i--) {
2267
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
2268
+ return false;
2269
+ }
2270
+ }
2271
+
2272
+ return true;
2273
+ }
2274
+
2275
+ /**
2276
+ * Comparator between two mappings where the original positions are compared.
2277
+ *
2278
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
2279
+ * mappings with the same original source/line/column, but different generated
2280
+ * line and column the same. Useful when searching for a mapping with a
2281
+ * stubbed out mapping.
2282
+ */
2283
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
2284
+ var cmp = mappingA.source - mappingB.source;
2285
+ if (cmp !== 0) {
2286
+ return cmp;
2287
+ }
2288
+
2289
+ cmp = mappingA.originalLine - mappingB.originalLine;
2290
+ if (cmp !== 0) {
2291
+ return cmp;
2292
+ }
2293
+
2294
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
2295
+ if (cmp !== 0 || onlyCompareOriginal) {
2296
+ return cmp;
2297
+ }
2298
+
2299
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
2300
+ if (cmp !== 0) {
2301
+ return cmp;
2302
+ }
2303
+
2304
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
2305
+ if (cmp !== 0) {
2306
+ return cmp;
2307
+ }
2308
+
2309
+ return mappingA.name - mappingB.name;
2310
+ }
2311
+ exports.compareByOriginalPositions = compareByOriginalPositions;
2312
+
2313
+ /**
2314
+ * Comparator between two mappings with deflated source and name indices where
2315
+ * the generated positions are compared.
2316
+ *
2317
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
2318
+ * mappings with the same generated line and column, but different
2319
+ * source/name/original line and column the same. Useful when searching for a
2320
+ * mapping with a stubbed out mapping.
2321
+ */
2322
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
2323
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
2324
+ if (cmp !== 0) {
2325
+ return cmp;
2326
+ }
2327
+
2328
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
2329
+ if (cmp !== 0 || onlyCompareGenerated) {
2330
+ return cmp;
2331
+ }
2332
+
2333
+ cmp = mappingA.source - mappingB.source;
2334
+ if (cmp !== 0) {
2335
+ return cmp;
2336
+ }
2337
+
2338
+ cmp = mappingA.originalLine - mappingB.originalLine;
2339
+ if (cmp !== 0) {
2340
+ return cmp;
2341
+ }
2342
+
2343
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
2344
+ if (cmp !== 0) {
2345
+ return cmp;
2346
+ }
2347
+
2348
+ return mappingA.name - mappingB.name;
2349
+ }
2350
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
2351
+
2352
+ function strcmp(aStr1, aStr2) {
2353
+ if (aStr1 === aStr2) {
2354
+ return 0;
2355
+ }
2356
+
2357
+ if (aStr1 > aStr2) {
2358
+ return 1;
2359
+ }
2360
+
2361
+ return -1;
2362
+ }
2363
+
2364
+ /**
2365
+ * Comparator between two mappings with inflated source and name strings where
2366
+ * the generated positions are compared.
2367
+ */
2368
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
2369
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
2370
+ if (cmp !== 0) {
2371
+ return cmp;
2372
+ }
2373
+
2374
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
2375
+ if (cmp !== 0) {
2376
+ return cmp;
2377
+ }
2378
+
2379
+ cmp = strcmp(mappingA.source, mappingB.source);
2380
+ if (cmp !== 0) {
2381
+ return cmp;
2382
+ }
2383
+
2384
+ cmp = mappingA.originalLine - mappingB.originalLine;
2385
+ if (cmp !== 0) {
2386
+ return cmp;
2387
+ }
2388
+
2389
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
2390
+ if (cmp !== 0) {
2391
+ return cmp;
2392
+ }
2393
+
2394
+ return strcmp(mappingA.name, mappingB.name);
2395
+ }
2396
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
2397
+
2398
+ },{}],10:[function(require,module,exports){
2399
+ arguments[4][2][0].apply(exports,arguments)
2400
+ },{"dup":2}],11:[function(require,module,exports){
2401
+ (function(root, factory) {
2402
+ 'use strict';
2403
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
2404
+
2405
+ /* istanbul ignore next */
2406
+ if (typeof define === 'function' && define.amd) {
2407
+ define('stack-generator', ['stackframe'], factory);
2408
+ } else if (typeof exports === 'object') {
2409
+ module.exports = factory(require('stackframe'));
2410
+ } else {
2411
+ root.StackGenerator = factory(root.StackFrame);
2412
+ }
2413
+ }(this, function(StackFrame) {
2414
+ return {
2415
+ backtrace: function StackGenerator$$backtrace(opts) {
2416
+ var stack = [];
2417
+ var maxStackSize = 10;
2418
+
2419
+ if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {
2420
+ maxStackSize = opts.maxStackSize;
2421
+ }
2422
+
2423
+ var curr = arguments.callee;
2424
+ while (curr && stack.length < maxStackSize && curr['arguments']) {
2425
+ // Allow V8 optimizations
2426
+ var args = new Array(curr['arguments'].length);
2427
+ for (var i = 0; i < args.length; ++i) {
2428
+ args[i] = curr['arguments'][i];
2429
+ }
2430
+ if (/function(?:\s+([\w$]+))+\s*\(/.test(curr.toString())) {
2431
+ stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));
2432
+ } else {
2433
+ stack.push(new StackFrame({args: args}));
2434
+ }
2435
+
2436
+ try {
2437
+ curr = curr.caller;
2438
+ } catch (e) {
2439
+ break;
2440
+ }
2441
+ }
2442
+ return stack;
2443
+ }
2444
+ };
2445
+ }));
2446
+
2447
+ },{"stackframe":10}],12:[function(require,module,exports){
2448
+ arguments[4][2][0].apply(exports,arguments)
2449
+ },{"dup":2}],13:[function(require,module,exports){
2450
+ (function(root, factory) {
2451
+ 'use strict';
2452
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
2453
+
2454
+ /* istanbul ignore next */
2455
+ if (typeof define === 'function' && define.amd) {
2456
+ define('stacktrace-gps', ['source-map', 'stackframe'], factory);
2457
+ } else if (typeof exports === 'object') {
2458
+ module.exports = factory(require('source-map/lib/source-map-consumer'), require('stackframe'));
2459
+ } else {
2460
+ root.StackTraceGPS = factory(root.SourceMap || root.sourceMap, root.StackFrame);
2461
+ }
2462
+ }(this, function(SourceMap, StackFrame) {
2463
+ 'use strict';
2464
+
2465
+ /**
2466
+ * Make a X-Domain request to url and callback.
2467
+ *
2468
+ * @param {String} url
2469
+ * @returns {Promise} with response text if fulfilled
2470
+ */
2471
+ function _xdr(url) {
2472
+ return new Promise(function(resolve, reject) {
2473
+ var req = new XMLHttpRequest();
2474
+ req.open('get', url);
2475
+ req.onerror = reject;
2476
+ req.onreadystatechange = function onreadystatechange() {
2477
+ if (req.readyState === 4) {
2478
+ if ((req.status >= 200 && req.status < 300) ||
2479
+ (url.substr(0, 7) === 'file://' && req.responseText)) {
2480
+ resolve(req.responseText);
2481
+ } else {
2482
+ reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));
2483
+ }
2484
+ }
2485
+ };
2486
+ req.send();
2487
+ });
2488
+
2489
+ }
2490
+
2491
+ /**
2492
+ * Convert a Base64-encoded string into its original representation.
2493
+ * Used for inline sourcemaps.
2494
+ *
2495
+ * @param {String} b64str Base-64 encoded string
2496
+ * @returns {String} original representation of the base64-encoded string.
2497
+ */
2498
+ function _atob(b64str) {
2499
+ if (typeof window !== 'undefined' && window.atob) {
2500
+ return window.atob(b64str);
2501
+ } else {
2502
+ throw new Error('You must supply a polyfill for window.atob in this environment');
2503
+ }
2504
+ }
2505
+
2506
+ function _parseJson(string) {
2507
+ if (typeof JSON !== 'undefined' && JSON.parse) {
2508
+ return JSON.parse(string);
2509
+ } else {
2510
+ throw new Error('You must supply a polyfill for JSON.parse in this environment');
2511
+ }
2512
+ }
2513
+
2514
+ function _findFunctionName(source, lineNumber/*, columnNumber*/) {
2515
+ var syntaxes = [
2516
+ // {name} = function ({args}) TODO args capture
2517
+ /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,
2518
+ // function {name}({args}) m[1]=name m[2]=args
2519
+ /function\s+([^('"`]*?)\s*\(([^)]*)\)/,
2520
+ // {name} = eval()
2521
+ /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,
2522
+ // fn_name() {
2523
+ /\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,
2524
+ // {name} = () => {
2525
+ /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/
2526
+ ];
2527
+ var lines = source.split('\n');
2528
+
2529
+ // Walk backwards in the source lines until we find the line which matches one of the patterns above
2530
+ var code = '';
2531
+ var maxLines = Math.min(lineNumber, 20);
2532
+ for (var i = 0; i < maxLines; ++i) {
2533
+ // lineNo is 1-based, source[] is 0-based
2534
+ var line = lines[lineNumber - i - 1];
2535
+ var commentPos = line.indexOf('//');
2536
+ if (commentPos >= 0) {
2537
+ line = line.substr(0, commentPos);
2538
+ }
2539
+
2540
+ if (line) {
2541
+ code = line + code;
2542
+ var len = syntaxes.length;
2543
+ for (var index = 0; index < len; index++) {
2544
+ var m = syntaxes[index].exec(code);
2545
+ if (m && m[1]) {
2546
+ return m[1];
2547
+ }
2548
+ }
2549
+ }
2550
+ }
2551
+ return undefined;
2552
+ }
2553
+
2554
+ function _ensureSupportedEnvironment() {
2555
+ if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {
2556
+ throw new Error('Unable to consume source maps in older browsers');
2557
+ }
2558
+ }
2559
+
2560
+ function _ensureStackFrameIsLegit(stackframe) {
2561
+ if (typeof stackframe !== 'object') {
2562
+ throw new TypeError('Given StackFrame is not an object');
2563
+ } else if (typeof stackframe.fileName !== 'string') {
2564
+ throw new TypeError('Given file name is not a String');
2565
+ } else if (typeof stackframe.lineNumber !== 'number' ||
2566
+ stackframe.lineNumber % 1 !== 0 ||
2567
+ stackframe.lineNumber < 1) {
2568
+ throw new TypeError('Given line number must be a positive integer');
2569
+ } else if (typeof stackframe.columnNumber !== 'number' ||
2570
+ stackframe.columnNumber % 1 !== 0 ||
2571
+ stackframe.columnNumber < 0) {
2572
+ throw new TypeError('Given column number must be a non-negative integer');
2573
+ }
2574
+ return true;
2575
+ }
2576
+
2577
+ function _findSourceMappingURL(source) {
2578
+ var sourceMappingUrlRegExp = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg;
2579
+ var lastSourceMappingUrl;
2580
+ var matchSourceMappingUrl;
2581
+ // eslint-disable-next-line no-cond-assign
2582
+ while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {
2583
+ lastSourceMappingUrl = matchSourceMappingUrl[1];
2584
+ }
2585
+ if (lastSourceMappingUrl) {
2586
+ return lastSourceMappingUrl;
2587
+ } else {
2588
+ throw new Error('sourceMappingURL not found');
2589
+ }
2590
+ }
2591
+
2592
+ function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {
2593
+ return new Promise(function(resolve, reject) {
2594
+ var loc = sourceMapConsumer.originalPositionFor({
2595
+ line: stackframe.lineNumber,
2596
+ column: stackframe.columnNumber
2597
+ });
2598
+
2599
+ if (loc.source) {
2600
+ // cache mapped sources
2601
+ var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);
2602
+ if (mappedSource) {
2603
+ sourceCache[loc.source] = mappedSource;
2604
+ }
2605
+
2606
+ resolve(
2607
+ // given stackframe and source location, update stackframe
2608
+ new StackFrame({
2609
+ functionName: loc.name || stackframe.functionName,
2610
+ args: stackframe.args,
2611
+ fileName: loc.source,
2612
+ lineNumber: loc.line,
2613
+ columnNumber: loc.column
2614
+ }));
2615
+ } else {
2616
+ reject(new Error('Could not get original source for given stackframe and source map'));
2617
+ }
2618
+ });
2619
+ }
2620
+
2621
+ /**
2622
+ * @constructor
2623
+ * @param {Object} opts
2624
+ * opts.sourceCache = {url: "Source String"} => preload source cache
2625
+ * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}
2626
+ * opts.offline = True to prevent network requests.
2627
+ * Best effort without sources or source maps.
2628
+ * opts.ajax = Promise returning function to make X-Domain requests
2629
+ */
2630
+ return function StackTraceGPS(opts) {
2631
+ if (!(this instanceof StackTraceGPS)) {
2632
+ return new StackTraceGPS(opts);
2633
+ }
2634
+ opts = opts || {};
2635
+
2636
+ this.sourceCache = opts.sourceCache || {};
2637
+ this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};
2638
+
2639
+ this.ajax = opts.ajax || _xdr;
2640
+
2641
+ this._atob = opts.atob || _atob;
2642
+
2643
+ this._get = function _get(location) {
2644
+ return new Promise(function(resolve, reject) {
2645
+ var isDataUrl = location.substr(0, 5) === 'data:';
2646
+ if (this.sourceCache[location]) {
2647
+ resolve(this.sourceCache[location]);
2648
+ } else if (opts.offline && !isDataUrl) {
2649
+ reject(new Error('Cannot make network requests in offline mode'));
2650
+ } else {
2651
+ if (isDataUrl) {
2652
+ // data URLs can have parameters.
2653
+ // see http://tools.ietf.org/html/rfc2397
2654
+ var supportedEncodingRegexp =
2655
+ /^data:application\/json;([\w=:"-]+;)*base64,/;
2656
+ var match = location.match(supportedEncodingRegexp);
2657
+ if (match) {
2658
+ var sourceMapStart = match[0].length;
2659
+ var encodedSource = location.substr(sourceMapStart);
2660
+ var source = this._atob(encodedSource);
2661
+ this.sourceCache[location] = source;
2662
+ resolve(source);
2663
+ } else {
2664
+ reject(new Error('The encoding of the inline sourcemap is not supported'));
2665
+ }
2666
+ } else {
2667
+ var xhrPromise = this.ajax(location, {method: 'get'});
2668
+ // Cache the Promise to prevent duplicate in-flight requests
2669
+ this.sourceCache[location] = xhrPromise;
2670
+ xhrPromise.then(resolve, reject);
2671
+ }
2672
+ }
2673
+ }.bind(this));
2674
+ };
2675
+
2676
+ /**
2677
+ * Creating SourceMapConsumers is expensive, so this wraps the creation of a
2678
+ * SourceMapConsumer in a per-instance cache.
2679
+ *
2680
+ * @param {String} sourceMappingURL = URL to fetch source map from
2681
+ * @param {String} defaultSourceRoot = Default source root for source map if undefined
2682
+ * @returns {Promise} that resolves a SourceMapConsumer
2683
+ */
2684
+ this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {
2685
+ return new Promise(function(resolve) {
2686
+ if (this.sourceMapConsumerCache[sourceMappingURL]) {
2687
+ resolve(this.sourceMapConsumerCache[sourceMappingURL]);
2688
+ } else {
2689
+ var sourceMapConsumerPromise = new Promise(function(resolve, reject) {
2690
+ return this._get(sourceMappingURL).then(function(sourceMapSource) {
2691
+ if (typeof sourceMapSource === 'string') {
2692
+ sourceMapSource = _parseJson(sourceMapSource.replace(/^\)\]\}'/, ''));
2693
+ }
2694
+ if (typeof sourceMapSource.sourceRoot === 'undefined') {
2695
+ sourceMapSource.sourceRoot = defaultSourceRoot;
2696
+ }
2697
+
2698
+ resolve(new SourceMap.SourceMapConsumer(sourceMapSource));
2699
+ }, reject);
2700
+ }.bind(this));
2701
+ this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;
2702
+ resolve(sourceMapConsumerPromise);
2703
+ }
2704
+ }.bind(this));
2705
+ };
2706
+
2707
+ /**
2708
+ * Given a StackFrame, enhance function name and use source maps for a
2709
+ * better StackFrame.
2710
+ *
2711
+ * @param {StackFrame} stackframe object
2712
+ * @returns {Promise} that resolves with with source-mapped StackFrame
2713
+ */
2714
+ this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {
2715
+ return new Promise(function(resolve, reject) {
2716
+ this.getMappedLocation(stackframe).then(function(mappedStackFrame) {
2717
+ function resolveMappedStackFrame() {
2718
+ resolve(mappedStackFrame);
2719
+ }
2720
+
2721
+ this.findFunctionName(mappedStackFrame)
2722
+ .then(resolve, resolveMappedStackFrame)
2723
+ // eslint-disable-next-line no-unexpected-multiline
2724
+ ['catch'](resolveMappedStackFrame);
2725
+ }.bind(this), reject);
2726
+ }.bind(this));
2727
+ };
2728
+
2729
+ /**
2730
+ * Given a StackFrame, guess function name from location information.
2731
+ *
2732
+ * @param {StackFrame} stackframe
2733
+ * @returns {Promise} that resolves with enhanced StackFrame.
2734
+ */
2735
+ this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {
2736
+ return new Promise(function(resolve, reject) {
2737
+ _ensureStackFrameIsLegit(stackframe);
2738
+ this._get(stackframe.fileName).then(function getSourceCallback(source) {
2739
+ var lineNumber = stackframe.lineNumber;
2740
+ var columnNumber = stackframe.columnNumber;
2741
+ var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);
2742
+ // Only replace functionName if we found something
2743
+ if (guessedFunctionName) {
2744
+ resolve(new StackFrame({
2745
+ functionName: guessedFunctionName,
2746
+ args: stackframe.args,
2747
+ fileName: stackframe.fileName,
2748
+ lineNumber: lineNumber,
2749
+ columnNumber: columnNumber
2750
+ }));
2751
+ } else {
2752
+ resolve(stackframe);
2753
+ }
2754
+ }, reject)['catch'](reject);
2755
+ }.bind(this));
2756
+ };
2757
+
2758
+ /**
2759
+ * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.
2760
+ *
2761
+ * @param {StackFrame} stackframe
2762
+ * @returns {Promise} that resolves with enhanced StackFrame.
2763
+ */
2764
+ this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {
2765
+ return new Promise(function(resolve, reject) {
2766
+ _ensureSupportedEnvironment();
2767
+ _ensureStackFrameIsLegit(stackframe);
2768
+
2769
+ var sourceCache = this.sourceCache;
2770
+ var fileName = stackframe.fileName;
2771
+ this._get(fileName).then(function(source) {
2772
+ var sourceMappingURL = _findSourceMappingURL(source);
2773
+ var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';
2774
+ var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);
2775
+
2776
+ if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\/\/|^\/\//i).test(sourceMappingURL)) {
2777
+ sourceMappingURL = defaultSourceRoot + sourceMappingURL;
2778
+ }
2779
+
2780
+ return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)
2781
+ .then(function(sourceMapConsumer) {
2782
+ return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)
2783
+ .then(resolve)['catch'](function() {
2784
+ resolve(stackframe);
2785
+ });
2786
+ });
2787
+ }.bind(this), reject)['catch'](reject);
2788
+ }.bind(this));
2789
+ };
2790
+ };
2791
+ }));
2792
+
2793
+ },{"source-map/lib/source-map-consumer":8,"stackframe":12}],14:[function(require,module,exports){
2794
+ (function(root, factory) {
2795
+ 'use strict';
2796
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.
2797
+
2798
+ /* istanbul ignore next */
2799
+ if (typeof define === 'function' && define.amd) {
2800
+ define('stacktrace', ['error-stack-parser', 'stack-generator', 'stacktrace-gps'], factory);
2801
+ } else if (typeof exports === 'object') {
2802
+ module.exports = factory(require('error-stack-parser'), require('stack-generator'), require('stacktrace-gps'));
2803
+ } else {
2804
+ root.StackTrace = factory(root.ErrorStackParser, root.StackGenerator, root.StackTraceGPS);
2805
+ }
2806
+ }(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {
2807
+ var _options = {
2808
+ filter: function(stackframe) {
2809
+ // Filter out stackframes for this library by default
2810
+ return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&
2811
+ (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&
2812
+ (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&
2813
+ (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;
2814
+ },
2815
+ sourceCache: {}
2816
+ };
2817
+
2818
+ var _generateError = function StackTrace$$GenerateError() {
2819
+ try {
2820
+ // Error must be thrown to get stack in IE
2821
+ throw new Error();
2822
+ } catch (err) {
2823
+ return err;
2824
+ }
2825
+ };
2826
+
2827
+ /**
2828
+ * Merge 2 given Objects. If a conflict occurs the second object wins.
2829
+ * Does not do deep merges.
2830
+ *
2831
+ * @param {Object} first base object
2832
+ * @param {Object} second overrides
2833
+ * @returns {Object} merged first and second
2834
+ * @private
2835
+ */
2836
+ function _merge(first, second) {
2837
+ var target = {};
2838
+
2839
+ [first, second].forEach(function(obj) {
2840
+ for (var prop in obj) {
2841
+ if (Object.prototype.hasOwnProperty.call(obj, prop)) {
2842
+ target[prop] = obj[prop];
2843
+ }
2844
+ }
2845
+ return target;
2846
+ });
2847
+
2848
+ return target;
2849
+ }
2850
+
2851
+ function _isShapedLikeParsableError(err) {
2852
+ return err.stack || err['opera#sourceloc'];
2853
+ }
2854
+
2855
+ function _filtered(stackframes, filter) {
2856
+ if (typeof filter === 'function') {
2857
+ return stackframes.filter(filter);
2858
+ }
2859
+ return stackframes;
2860
+ }
2861
+
2862
+ return {
2863
+ /**
2864
+ * Get a backtrace from invocation point.
2865
+ *
2866
+ * @param {Object} opts
2867
+ * @returns {Array} of StackFrame
2868
+ */
2869
+ get: function StackTrace$$get(opts) {
2870
+ var err = _generateError();
2871
+ return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);
2872
+ },
2873
+
2874
+ /**
2875
+ * Get a backtrace from invocation point.
2876
+ * IMPORTANT: Does not handle source maps or guess function names!
2877
+ *
2878
+ * @param {Object} opts
2879
+ * @returns {Array} of StackFrame
2880
+ */
2881
+ getSync: function StackTrace$$getSync(opts) {
2882
+ opts = _merge(_options, opts);
2883
+ var err = _generateError();
2884
+ var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);
2885
+ return _filtered(stack, opts.filter);
2886
+ },
2887
+
2888
+ /**
2889
+ * Given an error object, parse it.
2890
+ *
2891
+ * @param {Error} error object
2892
+ * @param {Object} opts
2893
+ * @returns {Promise} for Array[StackFrame}
2894
+ */
2895
+ fromError: function StackTrace$$fromError(error, opts) {
2896
+ opts = _merge(_options, opts);
2897
+ var gps = new StackTraceGPS(opts);
2898
+ return new Promise(function(resolve) {
2899
+ var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);
2900
+ resolve(Promise.all(stackframes.map(function(sf) {
2901
+ return new Promise(function(resolve) {
2902
+ function resolveOriginal() {
2903
+ resolve(sf);
2904
+ }
2905
+
2906
+ gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);
2907
+ });
2908
+ })));
2909
+ }.bind(this));
2910
+ },
2911
+
2912
+ /**
2913
+ * Use StackGenerator to generate a backtrace.
2914
+ *
2915
+ * @param {Object} opts
2916
+ * @returns {Promise} of Array[StackFrame]
2917
+ */
2918
+ generateArtificially: function StackTrace$$generateArtificially(opts) {
2919
+ opts = _merge(_options, opts);
2920
+ var stackFrames = StackGenerator.backtrace(opts);
2921
+ if (typeof opts.filter === 'function') {
2922
+ stackFrames = stackFrames.filter(opts.filter);
2923
+ }
2924
+ return Promise.resolve(stackFrames);
2925
+ },
2926
+
2927
+ /**
2928
+ * Given a function, wrap it such that invocations trigger a callback that
2929
+ * is called with a stack trace.
2930
+ *
2931
+ * @param {Function} fn to be instrumented
2932
+ * @param {Function} callback function to call with a stack trace on invocation
2933
+ * @param {Function} errback optional function to call with error if unable to get stack trace.
2934
+ * @param {Object} thisArg optional context object (e.g. window)
2935
+ */
2936
+ instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {
2937
+ if (typeof fn !== 'function') {
2938
+ throw new Error('Cannot instrument non-function object');
2939
+ } else if (typeof fn.__stacktraceOriginalFn === 'function') {
2940
+ // Already instrumented, return given Function
2941
+ return fn;
2942
+ }
2943
+
2944
+ var instrumented = function StackTrace$$instrumented() {
2945
+ try {
2946
+ this.get().then(callback, errback)['catch'](errback);
2947
+ return fn.apply(thisArg || this, arguments);
2948
+ } catch (e) {
2949
+ if (_isShapedLikeParsableError(e)) {
2950
+ this.fromError(e).then(callback, errback)['catch'](errback);
2951
+ }
2952
+ throw e;
2953
+ }
2954
+ }.bind(this);
2955
+ instrumented.__stacktraceOriginalFn = fn;
2956
+
2957
+ return instrumented;
2958
+ },
2959
+
2960
+ /**
2961
+ * Given a function that has been instrumented,
2962
+ * revert the function to it's original (non-instrumented) state.
2963
+ *
2964
+ * @param {Function} fn to de-instrument
2965
+ */
2966
+ deinstrument: function StackTrace$$deinstrument(fn) {
2967
+ if (typeof fn !== 'function') {
2968
+ throw new Error('Cannot de-instrument non-function object');
2969
+ } else if (typeof fn.__stacktraceOriginalFn === 'function') {
2970
+ return fn.__stacktraceOriginalFn;
2971
+ } else {
2972
+ // Function not instrumented, return original
2973
+ return fn;
2974
+ }
2975
+ },
2976
+
2977
+ /**
2978
+ * Given an error message and Array of StackFrames, serialize and POST to given URL.
2979
+ *
2980
+ * @param {Array} stackframes
2981
+ * @param {String} url
2982
+ * @param {String} errorMsg
2983
+ * @param {Object} requestOptions
2984
+ */
2985
+ report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {
2986
+ return new Promise(function(resolve, reject) {
2987
+ var req = new XMLHttpRequest();
2988
+ req.onerror = reject;
2989
+ req.onreadystatechange = function onreadystatechange() {
2990
+ if (req.readyState === 4) {
2991
+ if (req.status >= 200 && req.status < 400) {
2992
+ resolve(req.responseText);
2993
+ } else {
2994
+ reject(new Error('POST to ' + url + ' failed with status: ' + req.status));
2995
+ }
2996
+ }
2997
+ };
2998
+ req.open('post', url);
2999
+
3000
+ // Set request headers
3001
+ req.setRequestHeader('Content-Type', 'application/json');
3002
+ if (requestOptions && typeof requestOptions.headers === 'object') {
3003
+ var headers = requestOptions.headers;
3004
+ for (var header in headers) {
3005
+ if (Object.prototype.hasOwnProperty.call(headers, header)) {
3006
+ req.setRequestHeader(header, headers[header]);
3007
+ }
3008
+ }
3009
+ }
3010
+
3011
+ var reportPayload = {stack: stackframes};
3012
+ if (errorMsg !== undefined && errorMsg !== null) {
3013
+ reportPayload.message = errorMsg;
3014
+ }
3015
+
3016
+ req.send(JSON.stringify(reportPayload));
3017
+ });
3018
+ }
3019
+ };
3020
+ }));
3021
+
3022
+ },{"error-stack-parser":1,"stack-generator":11,"stacktrace-gps":13}]},{},[14])(14)
3023
+ });
3024
+
3025
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvZXJyb3Itc3RhY2stcGFyc2VyL2Vycm9yLXN0YWNrLXBhcnNlci5qcyIsIm5vZGVfbW9kdWxlcy9lcnJvci1zdGFjay1wYXJzZXIvbm9kZV9tb2R1bGVzL3N0YWNrZnJhbWUvc3RhY2tmcmFtZS5qcyIsIm5vZGVfbW9kdWxlcy9zb3VyY2UtbWFwL2xpYi9hcnJheS1zZXQuanMiLCJub2RlX21vZHVsZXMvc291cmNlLW1hcC9saWIvYmFzZTY0LXZscS5qcyIsIm5vZGVfb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xuICAgICAgICAgICAgdmFyIHBhcnRzID0gcmVnRXhwLmV4ZWModXJsTGlrZS5yZXBsYWNlKC9bKCldL2csICcnKSk7XG4gICAgICAgICAgICByZXR1cm4gW3BhcnRzWzFdLCBwYXJ0c1syXSB8fCB1bmRlZmluZWQsIHBhcnRzWzNdIHx8IHVuZGVmaW5lZF07XG4gICAgICAgIH0sXG5cbiAgICAgICAgcGFyc2VWOE9ySUU6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlVjhPcklFKGVycm9yKSB7XG4gICAgICAgICAgICB2YXIgZmlsdGVyZWQgPSBlcnJvci5zdGFjay5zcGxpdCgnXFxuJykuZmlsdGVyKGZ1bmN0aW9uKGxpbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gISFsaW5lLm1hdGNoKENIUk9NRV9JRV9TVEFDS19SRUdFWFApO1xuICAgICAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgICAgIHJldHVybiBmaWx0ZXJlZC5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIGlmIChsaW5lLmluZGV4T2YoJyhldmFsICcpID4gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhyb3cgYXdheSBldmFsIGluZm9ybWF0aW9uIHVudGlsIHdlIGltcGxlbWVudCBzdGFja3RyYWNlLmpzL3N0YWNrZnJhbWUjOFxuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5yZXBsYWNlKC9ldmFsIGNvZGUvZywgJ2V2YWwnKS5yZXBsYWNlKC8oXFwoZXZhbCBhdCBbXigpXSopfChcXCksLiokKS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBzYW5pdGl6ZWRMaW5lID0gbGluZS5yZXBsYWNlKC9eXFxzKy8sICcnKS5yZXBsYWNlKC9cXChldmFsIGNvZGUvZywgJygnKTtcblxuICAgICAgICAgICAgICAgIC8vIGNhcHR1cmUgYW5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vblBhcnRzWzBdKSA+IC0xID8gdW5kZWZpbmVkIDogbG9jYXRpb25QYXJ0c1swXTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uTmFtZTogZnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogZmlsZU5hbWUsXG4gICAgICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxvY2F0aW9uUGFydHNbMV0sXG4gICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogbG9jYXRpb25QYXJ0c1syXSxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlOiBsaW5lXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZUZGT3JTYWZhcmk6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlRkZPclNhZmFyaShlcnJvcikge1xuICAgICAgICAgICAgdmFyIGZpbHRlcmVkID0gZXJyb3Iuc3RhY2suc3BsaXQoJ1xcbicpLmZpbHRlcihmdW5jdGlvbihsaW5lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICFsaW5lLm1hdGNoKFNBRkFSSV9OQVRJVkVfQ09ERV9SRUdFWFApO1xuICAgICAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgICAgIHJldHVybiBmaWx0ZXJlZC5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIC8vIFRocm93IGF3YXkgZXZhbCBpbmZvcm1hdGlvbiB1bnRpbCB3ZSBpbXBsZW1lbnQgc3RhY2t0cmFjZS5qcy9zdGFja2ZyYW1lIzhcbiAgICAgICAgICAgICAgICBpZiAobGluZS5pbmRleE9mKCcgPiBldmFsJykgPiAtMSkge1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5yZXBsYWNlKC8gbGluZSAoXFxkKykoPzogPiBldmFsIGxpbmUgXFxkKykqID4gZXZhbDpcXGQrOlxcZCsvZywgJzokMScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChsaW5lLmluZGV4T2YoJ0AnKSA9PT0gLTEgJiYgbGluZS5pbmRleE9mKCc6JykgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNhZmFyaSBldmFsIGZyYW1lcyBvbmx5IGhhdmUgZnVuY3Rpb24gbmFtZXMgYW5kIG5vdGhpbmcgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0YWNrRnJhbWUoe1xuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb25OYW1lOiBsaW5lXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmdW5jdGlvbk5hbWVSZWdleCA9IC8oKC4qXCIuK1wiW15AXSopP1teQF0qKSg/OkApLztcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1hdGNoZXMgPSBsaW5lLm1hdGNoKGZ1bmN0aW9uTmFtZVJlZ2V4KTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZ1bmN0aW9uTmFtZSA9IG1hdGNoZXMgJiYgbWF0Y2hlc1sxXSA/IG1hdGNoZXNbMV0gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb2NhdGlvblBhcnRzID0gdGhpcy5leHRyYWN0TG9jYXRpb24obGluZS5yZXBsYWNlKGZ1bmN0aW9uTmFtZVJlZ2V4LCAnJykpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lOiBsb2NhdGlvblBhcnRzWzBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZU51bWJlcjogbG9jYXRpb25QYXJ0c1sxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogbG9jYXRpb25QYXJ0c1syXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogbGluZVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZU9wZXJhOiBmdW5jdGlvbiBFcnJvclN0YWNrUGFyc2VyJCRwYXJzZU9wZXJhKGUpIHtcbiAgICAgICAgICAgIGlmICghZS5zdGFja3RyYWNlIHx8IChlLm1lc3NhZ2UuaW5kZXhPZignXFxuJykgPiAtMSAmJlxuICAgICAgICAgICAgICAgIGUubWVzc2FnZS5zcGxpdCgnXFxuJykubGVuZ3RoID4gZS5zdGFja3RyYWNlLnNwbGl0KCdcXG4nKS5sZW5ndGgpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcGVyYTkoZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFlLnN0YWNrKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcGVyYTEwKGUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9wZXJhMTEoZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgcGFyc2VPcGVyYTk6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlT3BlcmE5KGUpIHtcbiAgICAgICAgICAgIHZhciBsaW5lUkUgPSAvTGluZSAoXFxkKykuKnNjcmlwdCAoPzppbiApPyhcXFMrKS9pO1xuICAgICAgICAgICAgdmFyIGxpbmVzID0gZS5tZXNzYWdlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDIsIGxlbiA9IGxpbmVzLmxlbmd0aDsgaSA8IGxlbjsgaSArPSAyKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gbGluZVJFLmV4ZWMobGluZXNbaV0pO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbWF0Y2hbMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBtYXRjaFsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogbGluZXNbaV1cbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZU9wZXJhMTA6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlT3BlcmExMChlKSB7XG4gICAgICAgICAgICB2YXIgbGluZVJFID0gL0xpbmUgKFxcZCspLipzY3JpcHQgKD86aW4gKT8oXFxTKykoPzo6IEluIGZ1bmN0aW9uIChcXFMrKSk/JC9pO1xuICAgICAgICAgICAgdmFyIGxpbmVzID0gZS5zdGFja3RyYWNlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbiA9IGxpbmVzLmxlbmd0aDsgaSA8IGxlbjsgaSArPSAyKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gbGluZVJFLmV4ZWMobGluZXNbaV0pO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdGFja0ZyYW1lKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IG1hdGNoWzNdIHx8IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbWF0Y2hbMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZU51bWJlcjogbWF0Y2hbMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiBsaW5lc1tpXVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLy8gT3BlcmEgMTAuNjUrIEVycm9yLnN0YWNrIHZlcnkgc2ltaWxhciB0byBGRi9TYWZhcmlcbiAgICAgICAgcGFyc2VPcGVyYTExOiBmdW5jdGlvbiBFcnJvclN0YWNrUGFyc2VyJCRwYXJzZU9wZXJhMTEoZXJyb3IpIHtcbiAgICAgICAgICAgIHZhciBmaWx0ZXJlZCA9IGVycm9yLnN0YWNrLnNwbGl0KCdcXG4nKS5maWx0ZXIoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAhIWxpbmUubWF0Y2goRklSRUZPWF9TQUZBUklfU1RBQ0tfUkVHRVhQKSAmJiAhbGluZS5tYXRjaCgvXkVycm9yIGNyZWF0ZWQgYXQvKTtcbiAgICAgICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgICAgICByZXR1cm4gZmlsdGVyZWQubWFwKGZ1bmN0aW9uKGxpbmUpIHtcbiAgICAgICAgICAgICAgICB2YXIgdG9rZW5zID0gbGluZS5zcGxpdCgnQCcpO1xuICAgICAgICAgICAgICAgIHZhciBsb2NhdGlvblBhcnRzID0gdGhpcy5leHRyYWN0TG9jYXRpb24odG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgICAgICB2YXIgZnVuY3Rpb25DYWxsID0gKHRva2Vucy5zaGlmdCgpIHx8ICcnKTtcbiAgICAgICAgICAgICAgICB2YXIgZnVuY3Rpb25OYW1lID0gZnVuY3Rpb25DYWxsXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88YW5vbnltb3VzIGZ1bmN0aW9uKDogKFxcdyspKT8+LywgJyQyJylcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcKFteKV0qXFwpL2csICcnKSB8fCB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgdmFyIGFyZ3NSYXc7XG4gICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uQ2FsbC5tYXRjaCgvXFwoKFteKV0qKVxcKS8pKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyZ3NSYXcgPSBmdW5jdGlvbkNhbGwucmVwbGFjZSgvXlteKF0rXFwoKFteKV0qKVxcKSQvLCAnJDEnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdmFyIGFyZ3MgPSAoYXJnc1JhdyA9PT0gdW5kZWZpbmVkIHx8IGFyZ3NSYXcgPT09ICdbYXJndW1lbnRzIG5vdCBhdmFpbGFibGVdJykgP1xuICAgICAgICAgICAgICAgICAgICB1bmRlZmluZWQgOiBhcmdzUmF3LnNwbGl0KCcsJyk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0YWNrRnJhbWUoe1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgYXJnczogYXJncyxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWU6IGxvY2F0aW9uUGFydHNbMF0sXG4gICAgICAgICAgICAgICAgICA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AgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKHYpICE9PSAnW29iamVjdCBBcnJheV0nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQXJncyBtdXN0IGJlIGFuIEFycmF5Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmFyZ3MgPSB2O1xuICAgICAgICB9LFxuXG4gICAgICAgIGdldEV2YWxPcmlnaW46IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXZhbE9yaWdpbjtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0RXZhbE9yaWdpbjogZnVuY3Rpb24odikge1xuICAgICAgICAgICAgaWYgKHYgaW5zdGFuY2VvZiBTdGFja0ZyYW1lKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5ldmFsT3JpZ2luID0gdjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodiBpbnN0YW5jZW9mIE9iamVjdCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZXZhbE9yaWdpbiA9IG5ldyBTdGFja0ZyYW1lKHYpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFdmFsIE9yaWdpbiBtdXN0IGJlIGFuIE9iamVjdCBvciBTdGFja0ZyYW1lJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgdG9TdHJpbmc6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGZpbGVOYW1lID0gdGhpcy5nZXRGaWxlTmFtZSgpIHx8ICcnO1xuICAgICAgICAgICAgdmFyIGxpbmVOdW1iZXIgPSB0aGlzLmdldExpbmVOdW1iZXIoKSB8fCAnJztcbiAgICAgICAgICAgIHZhciBjb2x1bW5OdW1iZXIgPSB0aGlzLmdldENvbHVtbk51bWJlcigpIHx8ICcnO1xuICAgICAgICAgICAgdmFyIGZ1bmN0aW9uTmFtZSA9IHRoaXMuZ2V0RnVuY3Rpb25OYW1lKCkgfHwgJyc7XG4gICAgICAgICAgICBpZiAodGhpcy5nZXRJc0V2YWwoKSkge1xuICAgICAgICAgICAgICAgIGlmIChmaWxlTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tldmFsXSAoJyArIGZpbGVOYW1lICsgJzonICsgbGluZU51bWJlciArICc6JyArIGNvbHVtbk51bWJlciArICcpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbZXZhbF06JyArIGxpbmVOdW1iZXIgKyAnOicgKyBjb2x1bW5OdW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZnVuY3Rpb25OYW1lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uTmFtZSArICcgKCcgKyBmaWxlTmFtZSArICc6JyArIGxpbmVOdW1iZXIgKyAnOicgKyBjb2x1bW5OdW1iZXIgKyAnKSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmlsZU5hbWUgKyAnOicgKyBsaW5lTnVtYmVyICsgJzonICsgY29sdW1uTnVtYmVyO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIFN0YWNrRnJhbWUuZnJvbVN0cmluZyA9IGZ1bmN0aW9uIFN0YWNrRnJhbWUkJGZyb21TdHJpbmcoc3RyKSB7XG4gICAgICAgIHZhciBhcmdzU3RhcnRJbmRleCA9IHN0ci5pbmRleE9mKCcoJyk7XG4gICAgICAgIHZhciBhcmdzRW5kSW5kZXggPSBzdHIubGFzdEluZGV4T2YoJyknKTtcblxuICAgICAgICB2YXIgZnVuY3Rpb25OYW1lID0gc3RyLnN1YnN0cmluZygwLCBhcmdzU3RhcnRJbmRleCk7XG4gICAgICAgIHZhciBhcmdzID0gc3RyLnN1YnN0cmluZyhhcmdzU3RhcnRJbmRleCArIDEsIGFyZ3NFbmRJbmRleCkuc3BsaXQoJywnKTtcbiAgICAgICAgdmFyIGxvY2F0aW9uU3RyaW5nID0gc3RyLnN1YnN0cmluZyhhcmdzRW5kSW5kZXggKyAxKTtcblxuICAgICAgICBpZiAobG9jYXRpb25TdHJpbmcuaW5kZXhPZignQCcpID09PSAwKSB7XG4gICAgICAgICAgICB2YXIgcGFydHMgPSAvQCguKz8pKD86OihcXGQrKSk/KD86OihcXGQrKSk/JC8uZXhlYyhsb2NhdGlvblN0cmluZywgJycpO1xuICAgICAgICAgICAgdmFyIGZpbGVOYW1lID0gcGFydHNbMV07XG4gICAgICAgICAgICB2YXIgbGluZU51bWJlciA9IHBhcnRzWzJdO1xuICAgICAgICAgICAgdmFyIGNvbHVtbk51bWJlciA9IHBhcnRzWzNdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG5ldyBTdGFja0ZyYW1lKHtcbiAgICAgICAgICAgIGZ1bmN0aW9uTmFtZTogZnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgYXJnczogYXJncyB8fCB1bmRlZmluZWQsXG4gICAgICAgICAgICBmaWxlTmFtZTogZmlsZU5hbWUsXG4gICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyIHx8IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGNvbHVtbk51bWJlcjogY29sdW1uTnVtYmVyIHx8IHVuZGVmaW5lZFxuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBib29sZWFuUHJvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgU3RhY2tGcmFtZS5wcm90b3R5cGVbJ2dldCcgKyBfY2FwaXRhbGl6ZShib29sZWFuUHJvcHNbaV0pXSA9IF9nZXR0ZXIoYm9vbGVhblByb3BzW2ldKTtcbiAgICAgICAgU3RhY2tGcmFtZS5wcm90b3R5cGVbJ3NldCcgKyBfY2FwaXRhbGl6ZShib29sZWFuUHJvcHNbaV0pXSA9IChmdW5jdGlvbihwKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odikge1xuICAgICAgICAgICAgICAgIHRoaXNbcF0gPSBCb29sZWFuKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSkoYm9vbGVhblByb3BzW2ldKTtcbiAgICB9XG5cbiAgICBmb3IgKHZhciBqID0gMDsgaiA8IG51bWVyaWNQcm9wcy5sZW5ndGg7IGorKykge1xuICAgICAgICBTdGFja0ZyYW1lLnByb3RvdHlwZVsnZ2V0JyArIF9jYXBpdGFsaXplKG51bWVyaWNQcm9wc1tqXSldID0gX2dldHRlcihudW1lcmljUHJvcHNbal0pO1xuICAgICAgICBTdGFja0ZyYW1lLnByb3RvdHlwZVsnc2V0JyArIF9jYXBpdGFsaXplKG51bWVyaWNQcm9wc1tqXSldID0gKGZ1bmN0aW9uKHApIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih2KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFfaXNOdW1iZXIodikpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihwICsgJyBtdXN0IGJlIGEgTnVtYmVyJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXNbcF0gPSBOdW1iZXIodik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9KShudW1lcmljUHJvcHNbal0pO1xuICAgIH1cblxuICAgIGZvciAodmFyIGsgPSAwOyBrIDwgc3RyaW5nUHJvcHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgU3RhY2tGcmFtZS5wcm90b3R5cGVbJ2dldCcgKyBfY2FwaXRhbGl6ZShzdHJpbmdQcm9wc1trXSldID0gX2dldHRlcihzdHJpbmdQcm9wc1trXSk7XG4gICAgICAgIFN0YWNrRnJhbWUucHJvdG90eXBlWydzZXQnICsgX2NhcGl0YWxpemUoc3RyaW5nUHJvcHNba10pXSA9IChmdW5jdGlvbihwKSB7XG4gICAgICA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AgcmV0dXJuIFtdO1xuICAgIH1cbiAgICBuZWVkbGUuc291cmNlID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG5lZWRsZS5zb3VyY2UpO1xuXG4gICAgdmFyIG1hcHBpbmdzID0gW107XG5cbiAgICB2YXIgaW5kZXggPSB0aGlzLl9maW5kTWFwcGluZyhuZWVkbGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb3JpZ2luYWxNYXBwaW5ncyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9yaWdpbmFsTGluZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwib3JpZ2luYWxDb2x1bW5cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1dGlsLmNvbXBhcmVCeU9yaWdpbmFsUG9zaXRpb25zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpbmFyeVNlYXJjaC5MRUFTVF9VUFBFUl9CT1VORCk7XG4gICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgIHZhciBtYXBwaW5nID0gdGhpcy5fb3JpZ2luYWxNYXBwaW5nc1tpbmRleF07XG5cbiAgICAgIGlmIChhQXJncy5jb2x1bW4gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICB2YXIgb3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG5cbiAgICAgICAgLy8gSXRlcmF0ZSB1bnRpbCBlaXRoZXIgd2UgcnVuIG91dCBvZiBtYXBwaW5ncywgb3Igd2UgcnVuIGludG9cbiAgICAgICAgLy8gYSBtYXBwaW5nIGZvciBhIGRpZmZlcmVudCBsaW5lIHRoYW4gdGhlIG9uZSB3ZSBmb3VuZC4gU2luY2VcbiAgICAgICAgLy8gbWFwcGluZ3MgYXJlIHNvcnRlZCwgdGhpcyBpcyBndWFyYW50ZWVkIHRvIGZpbmQgYWxsIG1hcHBpbmdzIGZvclxuICAgICAgIC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JyYXkoY3VyclsnYXJndW1lbnRzJ10ubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyZ3MubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJnc1tpXSA9IGN1cnJbJ2FyZ3VtZW50cyddW2ldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoL2Z1bmN0aW9uKD86XFxzKyhbXFx3JF0rKSkrXFxzKlxcKC8udGVzdChjdXJyLnRvU3RyaW5nKCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YWNrLnB1c2gobmV3IFN0YWNrRnJhbWUoe2Z1bmN0aW9uTmFtZTogUmVnRXhwLiQxIHx8IHVuZGVmaW5lZCwgYXJnczogYXJnc30pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGFjay5wdXNoKG5ldyBTdGFja0ZyYW1lKHthcmdzOiBhcmdzfSkpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnIgPSBjdXJyLmNhbGxlcjtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBzdGFjaztcbiAgICAgICAgfVxuICAgIH07XG59KSk7XG4iLCIoZnVuY3Rpb24ocm9vdCwgZmFjdG9yeSkge1xuICAgICd1c2Ugc3RyaWN0JztcbiAgICAvLyBVbml2ZXJzYWwgTW9kdWxlIERlZmluaXRpb24gKFVNRCkgdG8gc3VwcG9ydCBBTUQsIENvbW1vbkpTL05vZGUuanMsIFJoaW5vLCBhbmQgYnJvd3NlcnMuXG5cbiAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgIGl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ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uIG9ucmVhZHlzdGF0ZWNoYW5nZSgpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVxLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChyZXEuc3RhdHVzID49IDIwMCAmJiByZXEuc3RhdHVzIDwgMzAwKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgKHVybC5zdWJzdHIoMCwgNykgPT09ICdmaWxlOi8vJyAmJiByZXEucmVzcG9uc2VUZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXEucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoJ0hUVFAgc3RhdHVzOiAnICsgcmVxLnN0YXR1cyArICcgcmV0cmlldmluZyAnICsgdXJsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVxLnNlbmQoKTtcbiAgICAgICAgfSk7XG5cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb252ZXJ0IGEgQmFzZTY0LWVuY29kZWQgc3RyaW5nIGludG8gaXRzIG9yaWdpbmFsIHJlcHJlc2VudGF0aW9uLlxuICAgICAqIFVzZWQgZm9yIGlubGluZSBzb3VyY2VtYXBzLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IGI2NHN0ciBCYXNlLTY0IGVuY29kZWQgc3RyaW5nXG4gICAgICogQHJldHVybnMge1N0cmluZ30gb3JpZ2luYWwgcmVwcmVzZW50YXRpb24gb2YgdGhlIGJhc2U2NC1lbmNvZGVkIHN0cmluZy5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBfYXRvYihiNjRzdHIpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB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Ckge1xuICAgICAgICAgICAgICAgIGxpbmUgPSBsaW5lLnN1YnN0cigwLCBjb21tZW50UG9zKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGxpbmUpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gbGluZSArIGNvZGU7XG4gICAgICAgICAgICAgICAgdmFyIGxlbiA9IHN5bnRheGVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpbmRleCA9IDA7IGluZGV4IDwgbGVuOyBpbmRleCsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtID0gc3ludGF4ZXNbaW5kZXhdLmV4ZWMoY29kZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtICYmIG1bMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2Vuc3VyZVN1cHBvcnRlZEVudmlyb25tZW50KCkge1xuICAgICAgICBpZiAodHlwZW9mIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSAhPT0gJ2Z1bmN0aW9uJyB8fCB0eXBlb2YgT2JqZWN0LmNyZWF0ZSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmFibGUgdG8gY29uc3VtZSBzb3VyY2UgbWFwcyBpbiBvbGRlciBicm93c2VycycpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2Vuc3VyZVN0YWNrRnJhbWVJc0xlZ2l0KHN0YWNrZnJhbWUpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBzdGFja2ZyYW1lICE9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcign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KVxccyokL21nO1xuICAgICAgICB2YXIgbGFzdFNvdXJjZU1hcHBpbmdVcmw7XG4gICAgICAgIHZhciBtYXRjaFNvdXJjZU1hcHBpbmdVcmw7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25kLWFzc2lnblxuICAgICAgICB3aGlsZSAobWF0Y2hTb3VyY2VNYXBwaW5nVXJsID0gc291cmNlTWFwcGluZ1VybFJlZ0V4cC5leGVjKHNvdXJjZSkpIHtcbiAgICAgICAgICAgIGxhc3RTb3VyY2VNYXBwaW5nVXJsID0gbWF0Y2hTb3VyY2VNYXBwaW5nVXJsWzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsYXN0U291cmNlTWFwcGluZ1VybCkge1xuICAgICAgICAgICAgcmV0dXJuIGxhc3RTb3VyY2VNYXBwaW5nVXJsO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdzb3VyY2VNYXBwaW5nVVJMIG5vdCBmb3VuZCcpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2V4dHJhY3RMb2NhdGlvbkluZm9Gcm9tU291cmNlTWFwU291cmNlKHN0YWNrZnJhbWUsIHNvdXJjZU1hcENvbnN1bWVyLCBzb3VyY2VDYWNoZSkge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgbG9jID0gc291cmNlTWFwQ29uc3VtZXIub3JpZ2luYWxQb3NpdGlvbkZvcih7XG4gICAgICAgICAgICAgICAgbGluZTogc3RhY2tmcmFtZS5saW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogc3RhY2tmcmFtZS5jb2x1bW5OdW1iZXJcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAobG9jLnNvdXJjZSkge1xuICAgICAgICAgICAgICAgIC8vIGNhY2hlIG1hcHBlZCBzb3VyY2VzXG4gICAgICAgICAgICAgICAgdmFyIG1hcHBlZFNvdXJjZSA9IHNvdXJjZU1hcENvbnN1bWVyLnNvdXJjZUNvbnRlbnRGb3IobG9jLnNvdXJjZSk7XG4gICAgICAgICAgICAgICAgaWYgKG1hcHBlZFNvdXJjZSkge1xuICAgICAgICAgICAgICAgICAgICBzb3VyY2VDYWNoZVtsb2Muc291cmNlXSA9IG1hcHBlZFNvdXJjZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXNvbHZlKFxuICAgICAgICAgICAgICAgICAgICAvLyBnaXZlbiBzdGFja2ZyYW1lIGFuZCBzb3VyY2UgbG9jYXRpb24sIHVwZGF0ZSBzdGFja2ZyYW1lXG4gICAgICAgICAgICAgICAgICAgIG5ldyBTdGFja0ZyYW1lKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uTmFtZTogbG9jLm5hbWUgfHwgc3RhY2tmcmFtZS5mdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmdzOiBzdGFja2ZyYW1lLmFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbG9jLnNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxvYy5saW5lLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uTnVtYmVyOiBsb2MuY29sdW1uXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignQ291bGQgbm90IGdldCBvcmlnaW5hbCBzb3VyY2UgZm9yIGdpdmVuIHN0YWNrZnJhbWUgYW5kIHNvdXJjZSBtYXAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEBjb25zdHJ1Y3R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jdGlvbiBfZ2V0KGxvY2F0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgdmFyIGlzRGF0YVVybCA9IGxvY2F0aW9uLnN1YnN0cigwLCA1KSA9PT0gJ2RhdGE6JztcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zb3VyY2VDYWNoZVtsb2NhdGlvbl0pIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnNvdXJjZUNhY2hlW2xvY2F0aW9uXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRzLm9mZmxpbmUgJiYgIWlzRGF0YVVybCkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKCdDYW5ub3QgbWFrZSBuZXR3b3JrIHJlcXVlc3RzIGluIG9mZmxpbmUgbW9kZScpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNEYXRhVXJsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBkYXRhIFVSTHMgY2FuIGhhdmUgcGFyYW1ldGVycy5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlZSBodHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9yZmMyMzk3XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VwcG9ydGVkRW5jb2RpbmdSZWdleHAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9eZGF0YTphcHBsaWNhdGlvblxcL2pzb247KFtcXHc9OlwiLV0rOykqYmFzZTY0LC87XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF0Y2ggPSBsb2NhdGlvbi5tYXRjaChzdXBwb3J0ZWRFbmNvZGluZ1JlZ2V4cCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc291cmNlTWFwU3RhcnQgPSBtYXRjaFswXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuY29kZWRTb3VyY2UgPSBsb2NhdGlvbi5zdWJzdHIoc291cmNlTWFwU3RhcnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzb3VyY2UgPSB0aGlzLl9hdG9iKGVuY29kZWRTb3VyY2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc291cmNlQ2FjaGVbbG9jYXRpb25dID0gc291cmNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignVGhlIGVuY29kaW5nIG9mIHRoZSBpbmxpbmUgc291cmNlbWFwIGlzIG5vdCBzdXBwb3J0ZWQnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgeGhyUHJvbWlzZSA9IHRoaXMuYWpheChsb2NhdGlvbiwge21ldGhvZDogJ2dldCd9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENhY2hlIHRoZSBQcm9taXNlIHRvIHByZXZlbnQgZHVwbGljYXRlIGluLWZsaWdodCByZXF1ZXN0c1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zb3VyY2VDYWNoZVtsb2NhdGlvbl0gPSB4aHJQcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgeGhyUHJvbWlzZS50aGVuKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAg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29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2dldChzb3VyY2VNYXBwaW5nVVJMKS50aGVuKGZ1bmN0aW9uKHNvdXJjZU1hcFNvdXJjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc291cmNlTWFwU291cmNlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VNYXBTb3VyY2UgPSBfcGFyc2VKc29uKHNvdXJjZU1hcFNvdXJjZS5yZXBsYWNlKC9eXFwpXFxdXFx9Jy8sICcnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc291cmNlTWFwU291cmNlLnNvdXJjZVJvb3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZU1hcFNvdXJjZS5zb3VyY2VSb290ID0gZGVmYXVsdFNvdXJjZVJvb3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgU291cmNlTWFwLlNvdXJjZU1hcENvbnN1bWVyKHNvdXJjZU1hcFNvdXJjZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgfS5iaW5kKHRoaXMpKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zb3VyY2VNYXBDb25zdW1lckNhY2hlW3NvdXJjZU1hcHBpbmdVUkxdID0gc291cmNlTWFwQ29uc3VtZXJQcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHNvdXJjZU1hcENvbnN1bWVyUHJvbWlzZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfS5iaW5kKHRoaXMp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uY3Rpb25OYW1lID0gX2ZpbmRGdW5jdGlvbk5hbWUoc291cmNlLCBsaW5lTnVtYmVyLCBjb2x1bW5OdW1iZXIpO1xuICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHJlcGxhY2UgZnVuY3Rpb25OYW1lIGlmIHdlIGZvdW5kIHNvbWV0aGluZ1xuICAgICAgICAgICAgICAgICAgICBpZiAoZ3Vlc3NlZEZ1bmN0aW9uTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb25OYW1lOiBndWVzc2VkRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IHN0YWNrZnJhbWUuYXJncyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogc3RhY2tmcmFtZS5maWxlTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogY29sdW1uTnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHN0YWNrZnJhbWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgcmVqZWN0KVsnY2F0Y2gnXShyZWplY3QpO1xuICAgICAgICAgICAgfS5iaW5kKHRoaXMpKTtcbiAgICAgICAgfTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogR2l2ZW4gYSBTdGFja0ZyYW1lLCBzZWVrIHNvdXJjZS1tYXBwZWQgbG9jYXRpb24gYW5kIHJldHVybiBuZXcgZW5oYW5jZWQgU3RhY2tGcmFtZS5cbiAgICAgICAgICpcbiAgICAgIC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VVJMWzBdICE9PSAnLycgJiYgIWlzRGF0YVVybCAmJiAhKC9eaHR0cHM/OlxcL1xcL3xeXFwvXFwvL2kpLnRlc3Qoc291cmNlTWFwcGluZ1VSTCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZU1hcHBpbmdVUkwgPSBkZWZhdWx0U291cmNlUm9vdCArIHNvdXJjZU1hcHBpbmdVUkw7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fZ2V0U291cmNlTWFwQ29uc3VtZXIoc291cmNlTWFwcGluZ1VSTCwgZGVmYXVsdFNvdXJjZVJvb3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbihzb3VyY2VNYXBDb25zdW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfZXh0cmFjdExvY2F0aW9uSW5mb0Zyb21Tb3VyY2VNYXBTb3VyY2Uoc3RhY2tmcmFtZSwgc291cmNlTWFwQ29uc3VtZXIsIHNvdXJjZUNhY2hlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihyZXNvbHZlKVsnY2F0Y2gnXShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc3RhY2tmcmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfS5iaW5kKHRoaXMpLCByZWplY3QpWydjYXRjaCddKHJlamVjdCk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICB9O1xuICAgIH07XG59KSk7XG4iLCIoZnVuY3Rpb24ocm9vdCwgZmFjdG9yeSkge1xuICAgICd1c2Ugc3RyaWN0JztcbiAgICAvLyBVbml2ZXJzYWwgTW9kdWxlIERlZmluaXRpb24gKFVNRCkgdG8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AgICovXG4gICAgZnVuY3Rpb24gX21lcmdlKGZpcnN0LCBzZWNvbmQpIHtcbiAgICAgICAgdmFyIHRhcmdldCA9IHt9O1xuXG4gICAgICAgIFtmaXJzdCwgc2Vjb25kXS5mb3JFYWNoKGZ1bmN0aW9uKG9iaikge1xuICAgICAgICAgICAgZm9yICh2YXIgcHJvcCBpbiBvYmopIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0W3Byb3BdID0gb2JqW3Byb3BdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2lzU2hhcGVkTGlrZVBhcnNhYmxlRXJyb3IoZXJyKSB7XG4gICAgICAgIHJldHVybiBlcnIuc3RhY2sgfHwgZXJyWydvcGVyYSNzb3VyY2Vsb2MnXTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBfZmlsdGVyZWQoc3RhY2tmcmFtZXMsIGZpbHRlcikge1xuICAgICAgICBpZiAodHlwZW9mIGZpbHRlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgcmV0dXJuIHN0YWNrZnJhbWVzLmZpbHRlcihmaWx0ZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGFja2ZyYW1lcztcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgICAvKipcbiAgICAgICAgICogR2V0IGEgYmFja3RyYWNlIGZyb20gaW52b2NhdGlvbiBwb2ludC5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG9wdHNcbiAgICAgICAgICogQHJldHVybnMge0FycmF5fSBvZiBTdGFja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Vycm9yIG9iamVjdCwgcGFyc2UgaXQuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7RXJyb3J9IGVycm9yIG9iamVjdFxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0c1xuICAgICAgICAgKiBAcmV0dXJucyB7UHJvbWlzZX0gZm9yIEFycmF5W1N0YWNrRnJhbWV9XG4gICAgICAgICAqL1xuICAgICAgICBmcm9tRXJyb3I6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGZyb21FcnJvcihlcnJvciwgb3B0cykge1xuICAgICAgICAgICAgb3B0cyA9IF9tZXJnZShfb3B0aW9ucywgb3B0cyk7XG4gICAgICAgICAgICB2YXIgZ3BzID0gbmV3IFN0YWNrVHJhY2VHUFMob3B0cyk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgIHZhciBzdGFja2ZyYW1lcyA9IF9maWx0ZXJlZChFcnJvclN0YWNrUGFyc2VyLnBhcnNlKGVycm9yKSwgb3B0cy5maWx0ZXIpO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoUHJvbWlzZS5hbGwoc3RhY2tmcmFtZXMubWFwKGZ1bmN0aW9uKHNmKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiByZXNvbHZlT3JpZ2luYWwoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShzZik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGdwcy5waW5wb2ludChzZikudGhlbihyZXNvbHZlLCByZXNvbHZlT3JpZ2luYWwpWydjYXRjaCddKHJlc29sdmVPcmlnaW5hbCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAg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nJiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KHRoaXNBcmcgfHwgdGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChfaXNTaGFwZWRMaWtlUGFyc2FibGVFcnJvcihlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mcm9tRXJyb3IoZSkudGhlbihjYWxsYmFjaywgZXJyYmFjaylbJ2NhdGNoJ10oZXJyYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LmJpbmQodGhpcyk7XG4gICAgICAgICAgICBpbnN0cnVtZW50ZWQuX19zdGFja3RyYWNlT3JpZ2luYWxGbiA9IGZuO1xuXG4gICAgICAgICAgICByZXR1cm4gaW5zdHJ1bWVudGVkO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBHaXZlbiBhIGZ1bmN0aW9uIHRoYXQgaGFzIGJlZW4gaW5zdHJ1bWVudGVkLFxuICAgICAgICAgKiByZXZlcnQgdGhlIGZ1bmN0aW9uIHRvIGl0J3Mgb3JpZ2luYWwgKG5vbi1pbnN0cnVtZW50ZWQpIHN0YXRlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBmbiB0byBkZS1pbnN0cnVtZW50XG4gICAgICAgICAqL1xuICAgICAgICBkZWluc3RydW1lbnQ6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGRlaW5zdHJ1bWVudChmbikge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmbiAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQ2Fubm90IGRlLWluc3RydW1lbnQgbm9uLWZ1bmN0aW9uIG9iamVjdCcpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZm4uX19zdGFja3RyYWNlT3JpZ2luYWxGbiA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmbi5fX3N0YWNrdHJhY2VPcmlnaW5hbEZuO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBGdW5jdGlvbiBub3QgaW5zdHJ1bWVudGVkLCByZXR1cm4gb3JpZ2luYWxcbiAgICAgICAgICAgICAgICByZXR1cm4gZm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEdpdmVuIGFuIGVycm9yIG1lc3NhZ2UgYW5kIEFycmF5IG9mIFN0YWNrRnJhbWVzLCBzZXJpYWxpemUgYW5kIFBPU1QgdG8gZ2l2ZW4gVVJMLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge0FycmF5fSBzdGFja2ZyYW1lc1xuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gdXJsXG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBlcnJvck1zZ1xuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcmVxdWVzdE9wdGlvbnNcbiAgICAgICAgICovXG4gICAgICAgIHJlcG9ydDogZnVuY3Rpb24gU3RhY2tUcmFjZSQkcmVwb3J0KHN0YWNrZnJhbWVzLCB1cmwsIGVycm9yTXNnLCByZXF1ZXN0T3B0aW9ucykge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgIHZhciByZXEgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IHJlamVjdDtcbiAgICAgICAgICAgICAgICByZXEub25yZWFkeXN0YXRlY2hhbmdlID0gZnVuY3Rpb24gb25yZWFkeXN0YXRlY2hhbmdlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVxLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXEuc3RhdHVzID49IDIwMCAmJiByZXEuc3RhdHVzIDwgNDAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXEucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignUE9TVCB0byAnICsgdXJsICsgJyBmYWlsZWQgd2l0aCBzdGF0dXM6ICcgKyByZXEuc3RhdHVzKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJlcS5vcGVuKCdwb3N0JywgdXJsKTtcblxuICAgICAgICAgICAgICAgIC8vIFNldCByZXF1ZXN0IGhlYWRlcnNcbiAgICAgICAgICAgICAgICByZXEuc2V0UmVxdWVzdEhlYWRlcignQ29udGVudC1UeXBlJywgJ2FwcGxpY2F0aW9uL2pzb24nKTtcbiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdE9wdGlvbnMgJiYgdHlwZW9mIHJlcXVlc3RPcHRpb25zLmhlYWRlcnMgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBoZWFkZXJzID0gcmVxdWVzdE9wdGlvbnMuaGVhZGVycztcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaGVhZGVyIGluIGhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoaGVhZGVycywgaGVhZGVyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcS5zZXRSZXF1ZXN0SGVhZGVyKGhlYWRlciwgaGVhZGVyc1toZWFkZXJdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciByZXBvcnRQYXlsb2FkID0ge3N0YWNrOiBzdGFja2ZyYW1lc307XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yTXNnICE9PSB1bmRlZmluZWQgJiYgZXJyb3JNc2cgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0UGF5bG9hZC5tZXNzYWdlID0gZXJyb3JNc2c7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmVxLnNlbmQoSlNPTi5zdHJpbmdpZnkocmVwb3J0UGF5bG9hZCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xufSkpO1xuIl19